Skip to contentSkip to conversation

Bump vm.mmap_min_addr on 64-bit

PATCH In review Alexey Dobriyan 2 participants 3 messages Apr 1, 2019 – Apr 2, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bump vm.mmap_min_addr on 64-bit

No self respecting 64-bit program should ever touch that lowly 32-bit part of address space.

---

 mm/Kconfig       |    3 ++-
 security/Kconfig |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
mm/Kconfig +2 -1
@@ -306,7 +306,8 @@ config KSM
 config DEFAULT_MMAP_MIN_ADDR
         int "Low address space to protect from user allocation"
 	depends on MMU
-        default 4096
+	default 4096 if !64BIT
+	default 4294967296 if 64BIT
         help
 	  This is the portion of low virtual memory which should be protected
 	  from userspace allocation.  Keeping a user from writing to low pages
security/Kconfig +2 -1
@@ -129,7 +129,8 @@ config LSM_MMAP_MIN_ADDR
 	int "Low address space for LSM to protect from user allocation"
 	depends on SECURITY && SECURITY_SELINUX
 	default 32768 if ARM || (ARM64 && COMPAT)
-	default 65536
+	default 65536 if !64BIT
+	default 4294967296 if 64BIT
 	help
 	  This is the portion of low virtual memory which should be protected
 	  from userspace allocation.  Keeping a user from writing to low pages
maintainer
#1 lore raw
Quoted 20 lines · On Mon, 1 Apr 2019 08:06:13 +0300 Alexey Dobriyan <[email protected]> wrote:

No self respecting 64-bit program should ever touch that lowly 32-bit part of address space.

...

mm/Kconfig +2 -1
@@ -306,7 +306,8 @@ config KSM
 config DEFAULT_MMAP_MIN_ADDR
         int "Low address space to protect from user allocation"
 	depends on MMU
-        default 4096
+	default 4096 if !64BIT
+	default 4294967296 if 64BIT
         help
 	  This is the portion of low virtual memory which should be protected
 	  from userspace allocation.  Keeping a user from writing to low pages

security/Kconfig config LSM_MMAP_MIN_ADDR · line 136

Quoted 9 lines
security/Kconfig +2 -1
@@ -129,7 +129,8 @@ config LSM_MMAP_MIN_ADDR
 	int "Low address space for LSM to protect from user allocation"
 	depends on SECURITY && SECURITY_SELINUX
 	default 32768 if ARM || (ARM64 && COMPAT)
-	default 65536
+	default 65536 if !64BIT
+	default 4294967296 if 64BIT
 	help
 	  This is the portion of low virtual memory which should be protected
 	  from userspace allocation.  Keeping a user from writing to low pages

Gee. Do we have any idea what effect this will have upon all userspace programs, some of which do inexplicably weird things?

What's the benefit?

#2 lore raw
Quoted 9 lines · Andrew Morton
Quoted 2 lines · On Mon, 1 Apr 2019 08:06:13 +0300 Alexey Dobriyan <[email protected]> wrote:

No self respecting 64-bit program should ever touch that lowly 32-bit part of address space.

Gee. Do we have any idea what effect this will have upon all userspace programs, some of which do inexplicably weird things?

What's the benefit?

Note the date :^)