]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: remove paranoid mapping at 0
authorRuss Cox <rsc@golang.org>
Mon, 13 Dec 2010 21:57:35 +0000 (16:57 -0500)
committerRuss Cox <rsc@golang.org>
Mon, 13 Dec 2010 21:57:35 +0000 (16:57 -0500)
Too many programs complain that we even try.
This was a bit of security paranoia and not worth
the bother.

Fixes #1340.

R=r, r2
CC=golang-dev
https://golang.org/cl/3579042

src/pkg/runtime/darwin/mem.c
src/pkg/runtime/freebsd/mem.c
src/pkg/runtime/linux/mem.c

index fc963d719bc6652743c45331e8331a68b049ff97..7fb2c2807867b2db95ddc36755255775cc385c23 100644 (file)
@@ -36,11 +36,4 @@ runtime·SysFree(void *v, uintptr n)
 void
 runtime·SysMemInit(void)
 {
-       // Code generators assume that references to addresses
-       // on the first page will fault.  Map the page explicitly with
-       // no permissions, to head off possible bugs like the system
-       // allocating that page as the virtual address space fills.
-       // Ignore any error, since other systems might be smart
-       // enough to never allow anything there.
-//     mmap(nil, 4096, PROT_NONE, MAP_FIXED|MAP_ANON|MAP_PRIVATE, -1, 0);
 }
index 90201784a480e99c41b8eee80c8d88a333df3828..7fb2c2807867b2db95ddc36755255775cc385c23 100644 (file)
@@ -36,11 +36,4 @@ runtime·SysFree(void *v, uintptr n)
 void
 runtime·SysMemInit(void)
 {
-       // Code generators assume that references to addresses
-       // on the first page will fault.  Map the page explicitly with
-       // no permissions, to head off possible bugs like the system
-       // allocating that page as the virtual address space fills.
-       // Ignore any error, since other systems might be smart
-       // enough to never allow anything there.
-       runtime·mmap(nil, 4096, PROT_NONE, MAP_FIXED|MAP_ANON|MAP_PRIVATE, -1, 0);
 }
index 9bf054a21062e9c5d08e93eeb36af108fded1f64..e750f97ea2387d969d1e04e1aec9380f14b2fb17 100644 (file)
@@ -40,11 +40,4 @@ runtime·SysFree(void *v, uintptr n)
 void
 runtime·SysMemInit(void)
 {
-       // Code generators assume that references to addresses
-       // on the first page will fault.  Map the page explicitly with
-       // no permissions, to head off possible bugs like the system
-       // allocating that page as the virtual address space fills.
-       // Ignore any error, since other systems might be smart
-       // enough to never allow anything there.
-       runtime·mmap(nil, 4096, PROT_NONE, MAP_FIXED|MAP_ANON|MAP_PRIVATE, -1, 0);
 }