runtime: check for updated arena_end overflow
runtime: check for updated arena_end overflow

Currently, if an allocation is large enough that arena_end + size
overflows (which is not hard to do on 32-bit), we go ahead and call
sysReserve with the impossible base and length and depend on this to
either directly fail because the kernel can't possibly fulfill the
requested mapping (causing mheap.sysAlloc to return nil) or to succeed
with a mapping at some other address which will then be rejected as
outside the arena.

In order to make this less subtle, less dependent on the kernel
getting all of this right, and to eliminate the hopeless system call,
add an explicit overflow check.

Updates #13143. This real issue has been fixed by 0de59c2, but this is
a belt-and-suspenders improvement on top of that. It was uncovered by
my symbolic modeling of that bug.

Change-Id: I85fa868a33286fdcc23cdd7cdf86b19abf1cb2d1
Reviewed-on: https://go-review.googlesource.com/16961
Run-TryBot: Austin Clements <7ea35d812706d9213868749011af1ed4fa2f6aa0@google.com>
TryBot-Result: Gobot Gobot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>
Reviewed-by: Ian Lance Taylor <87e9c6d529889242b7e184afb632328636553ab4@golang.org>

odeke-em/go,kim-racktop/go,Jordanzuo/go,goodlang/good,CAFxX/go,deft-code/go,nawawi/go,goodlang/good,cloudflare/go,miolini/go,miolini/go,Samurais/go,vanloswang/go,codestation/go,miolini/go,Jordanzuo/go,sndnvaps/go,cloudflare/go,nawawi/go,CAFxX/go,linux-on-ibm-z/go,polyverse-security/go,Samurais/go,codestation/go,derekmarcotte/go,derekmarcotte/go,codestation/go,ganboing/go-esx,suncycheng/go,nawawi/go,kim-racktop/go,kim-racktop/go,suncycheng/go,linux-on-ibm-z/go,4ad/go,akutz/go,vanloswang/go,suncycheng/go,binarycrusader/go,linux-on-ibm-z/go,ganboing/go-esx,josharian/go,cloudflare/go,cloudflare/go,cyberroadie/go,fjballest/golang,codestation/go,4ad/go,miolini/go,odeke-em/go,josharian/go,roth1002/go,miolini/go,Endika/go,sndnvaps/go,4ad/go,mwhudson/go,polyverse-security/go,Jordanzuo/go,Samurais/go,nawawi/go,sndnvaps/go,mwhudson/go,vsekhar/elastic-go,linux-on-ibm-z/go,ImJasonH/go,theif519/go,polyverse-security/go,odeke-em/go,miolini/go,polyverse-security/go,vsekhar/elastic-go,mwhudson/go,mwhudson/go,cyberroadie/go,codestation/go,Cofyc/go,derekmarcotte/go,binarycrusader/go,nawawi/go,derekmarcotte/go,vsekhar/elastic-go,nawawi/go,cloudflare/go,theif519/go,miolini/go,codestation/go,kim-racktop/go,polyverse-security/go,roth1002/go,Samurais/go,fjballest/golang,Endika/go,Endika/go,Samurais/go,CAFxX/go,polyverse-security/go,golang/go,theif519/go,vsekhar/elastic-go,Cofyc/go,Endika/go,cloudflare/go,deft-code/go,deft-code/go,polyverse-security/go,odeke-em/go,josharian/go,vsekhar/elastic-go,cyberroadie/go,momchil-velikov/go,Jordanzuo/go,codestation/go,fjballest/golang,momchil-velikov/go,Cofyc/go,Jordanzuo/go,4ad/go,akutz/go,sndnvaps/go,akutz/go,akutz/go,ganboing/go-esx,odeke-em/go,sndnvaps/go,vsekhar/elastic-go,christopher-henderson/Go,CAFxX/go,cloudflare/go,cyberroadie/go,momchil-velikov/go,roth1002/go,roth1002/go,sndnvaps/go,4ad/go,goodlang/good,sndnvaps/go,deft-code/go,golang/go,Jordanzuo/go,suncycheng/go,Jordanzuo/go,mwhudson/go,ganboing/go-esx,sndnvaps/go,josharian/go,kim-racktop/go,derekmarcotte/go,CAFxX/go,fjballest/golang,fjballest/golang,akutz/go,deft-code/go,momchil-velikov/go,binarycrusader/go,4ad/go,goodlang/good,suncycheng/go,ImJasonH/go,momchil-velikov/go,binarycrusader/go,goodlang/good,suncycheng/go,golang/go,binarycrusader/go,ganboing/go-esx,suncycheng/go,momchil-velikov/go,odeke-em/go,theif519/go,roth1002/go,Cofyc/go,cyberroadie/go,cyberroadie/go,kim-racktop/go,vsekhar/elastic-go,kim-racktop/go,akutz/go,akutz/go,Endika/go,linux-on-ibm-z/go,Samurais/go,theif519/go,Endika/go,goodlang/good,momchil-velikov/go,josharian/go,odeke-em/go,miolini/go,roth1002/go,fjballest/golang,4ad/go,ganboing/go-esx,akutz/go,linux-on-ibm-z/go,Endika/go,suncycheng/go,ImJasonH/go,goodlang/good,ImJasonH/go,binarycrusader/go,vanloswang/go,cloudflare/go,cyberroadie/go,linux-on-ibm-z/go,derekmarcotte/go,Cofyc/go,Cofyc/go,codestation/go,momchil-velikov/go,ImJasonH/go,josharian/go,derekmarcotte/go,deft-code/go,roth1002/go,linux-on-ibm-z/go,goodlang/good,fjballest/golang,golang/go,nawawi/go,mwhudson/go,roth1002/go,Cofyc/go,fjballest/golang,ganboing/go-esx,theif519/go,vanloswang/go,golang/go,odeke-em/go,Endika/go,vanloswang/go,vsekhar/elastic-go,CAFxX/go,mwhudson/go,4ad/go,Jordanzuo/go,theif519/go,binarycrusader/go,deft-code/go,binarycrusader/go,ImJasonH/go,mwhudson/go,theif519/go,Samurais/go,CAFxX/go,kim-racktop/go,josharian/go,ImJasonH/go,ganboing/go-esx,golang/go,Samurais/go,ImJasonH/go,vanloswang/go,Cofyc/go,vanloswang/go,josharian/go,derekmarcotte/go,cyberroadie/go,polyverse-security/go,golang/go,deft-code/go,nawawi/go,vanloswang/go,golang/go,CAFxX/go