Skip to content

Commit 2932b76

Browse files
torvaldsroxanan1996
authored andcommitted
Revert "mm: mmap: allow for the maximum number of bits for randomizing mmap_base by default"
BugLink: https://bugs.launchpad.net/bugs/2075154 commit 14d7c92 upstream. This reverts commit 3afb76a. This was a wrongheaded workaround for an issue that had already been fixed much better by commit 4ef9ad1 ("mm: huge_memory: don't force huge page alignment on 32 bit"). Asking users questions at kernel compile time that they can't make sense of is not a viable strategy. And the fact that even the kernel VM maintainers apparently didn't catch that this "fix" is not a fix any more pretty much proves the point that people can't be expected to understand the implications of the question. It may well be the case that we could improve things further, and that __thp_get_unmapped_area() should take the mapping randomization into account even for 64-bit kernels. Maybe we should not be so eager to use THP mappings. But in no case should this be a kernel config option. Cc: Rafael Aquini <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Jiri Slaby <[email protected]> Cc: Suren Baghdasaryan <[email protected]> Cc: Matthew Wilcox (Oracle) <[email protected]> Signed-off-by: Linus Torvalds <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Manuel Diewald <[email protected]> Signed-off-by: Stefan Bader <[email protected]>
1 parent 0f877a9 commit 2932b76

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

arch/Kconfig

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,21 +1029,10 @@ config ARCH_MMAP_RND_BITS_MAX
10291029
config ARCH_MMAP_RND_BITS_DEFAULT
10301030
int
10311031

1032-
config FORCE_MAX_MMAP_RND_BITS
1033-
bool "Force maximum number of bits to use for ASLR of mmap base address"
1034-
default y if !64BIT
1035-
help
1036-
ARCH_MMAP_RND_BITS and ARCH_MMAP_RND_COMPAT_BITS represent the number
1037-
of bits to use for ASLR and if no custom value is assigned (EXPERT)
1038-
then the architecture's lower bound (minimum) value is assumed.
1039-
This toggle changes that default assumption to assume the arch upper
1040-
bound (maximum) value instead.
1041-
10421032
config ARCH_MMAP_RND_BITS
10431033
int "Number of bits to use for ASLR of mmap base address" if EXPERT
10441034
range ARCH_MMAP_RND_BITS_MIN ARCH_MMAP_RND_BITS_MAX
10451035
default ARCH_MMAP_RND_BITS_DEFAULT if ARCH_MMAP_RND_BITS_DEFAULT
1046-
default ARCH_MMAP_RND_BITS_MAX if FORCE_MAX_MMAP_RND_BITS
10471036
default ARCH_MMAP_RND_BITS_MIN
10481037
depends on HAVE_ARCH_MMAP_RND_BITS
10491038
help
@@ -1078,7 +1067,6 @@ config ARCH_MMAP_RND_COMPAT_BITS
10781067
int "Number of bits to use for ASLR of mmap base address for compatible applications" if EXPERT
10791068
range ARCH_MMAP_RND_COMPAT_BITS_MIN ARCH_MMAP_RND_COMPAT_BITS_MAX
10801069
default ARCH_MMAP_RND_COMPAT_BITS_DEFAULT if ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
1081-
default ARCH_MMAP_RND_COMPAT_BITS_MAX if FORCE_MAX_MMAP_RND_BITS
10821070
default ARCH_MMAP_RND_COMPAT_BITS_MIN
10831071
depends on HAVE_ARCH_MMAP_RND_COMPAT_BITS
10841072
help

0 commit comments

Comments
 (0)