- if ( current->personality == PER_SVR4 )
- {
- /* Why this, you ask??? Well SVr4 maps page 0 as read-only,
- and some applications "depend" upon this behavior.
- Since we do not have the power to recompile these, we
- emulate the SVr4 behavior. Sigh. */
- /* N.B. Shouldn't the size here be PAGE_SIZE?? */
- error = do_mmap(NULL, 0, 4096, PROT_READ | PROT_EXEC,
- MAP_FIXED | MAP_PRIVATE, 0);
- }
+ /* Why this, you ask??? Well SVr4/UW7 maps page 0 as read-only,
+ and some applications "depend" upon this behavior.
+ Since we do not have the power to recompile these, we
+ emulate the SVr4/UW7 behavior. */
+
+ if (current->personality & MAP_PAGE_ZERO)
+ error = do_mmap(NULL, 0, PAGE_SIZE,
+ PROT_READ | PROT_EXEC, MAP_FIXED | MAP_PRIVATE, 0);
+
#ifdef ELF_PLAT_INIT
/*
diff -urN linux/include/linux/personality.h linux-2.3.18-zeropage/include/linux/personality.h
--- linux/include/linux/personality.h Sat Sep 4 21:06:08 1999
+++ linux-2.3.18-zeropage/include/linux/personality.h Fri Oct 1 17:03:44 1999
@@ -8,6 +8,7 @@
/* Flags for bug emulation. These occupy the top three bytes. */
#define STICKY_TIMEOUTS 0x4000000
#define WHOLE_SECONDS 0x2000000
+#define MAP_PAGE_ZERO 0x100000
#define ADDR_LIMIT_32BIT 0x0800000
/* Personality types. These go in the low byte. Avoid using the top bit,
@@ -16,7 +17,7 @@
#define PER_MASK (0x00ff)
#define PER_LINUX (0x0000)
#define PER_LINUX_32BIT (0x0000 | ADDR_LIMIT_32BIT)
-#define PER_SVR4 (0x0001 | STICKY_TIMEOUTS)
+#define PER_SVR4 (0x0001 | STICKY_TIMEOUTS | MAP_PAGE_ZERO)
#define PER_SVR3 (0x0002 | STICKY_TIMEOUTS)
#define PER_SCOSVR3 (0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS)
#define PER_WYSEV386 (0x0004 | STICKY_TIMEOUTS)