Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Revert "mm: mmap: allow for the maximum number of bits for randomizing mmap_base by default"

This reverts commit 3afb76a66b5559a7b595155803ce23801558a7a9.

This was a wrongheaded workaround for an issue that had already been
fixed much better by commit 4ef9ad19e176 ("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 <aquini@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Slaby <jirislaby@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

-12
-12
arch/Kconfig
··· 1046 1046 config ARCH_MMAP_RND_BITS_DEFAULT 1047 1047 int 1048 1048 1049 - config FORCE_MAX_MMAP_RND_BITS 1050 - bool "Force maximum number of bits to use for ASLR of mmap base address" 1051 - default y if !64BIT 1052 - help 1053 - ARCH_MMAP_RND_BITS and ARCH_MMAP_RND_COMPAT_BITS represent the number 1054 - of bits to use for ASLR and if no custom value is assigned (EXPERT) 1055 - then the architecture's lower bound (minimum) value is assumed. 1056 - This toggle changes that default assumption to assume the arch upper 1057 - bound (maximum) value instead. 1058 - 1059 1049 config ARCH_MMAP_RND_BITS 1060 1050 int "Number of bits to use for ASLR of mmap base address" if EXPERT 1061 1051 range ARCH_MMAP_RND_BITS_MIN ARCH_MMAP_RND_BITS_MAX 1062 1052 default ARCH_MMAP_RND_BITS_DEFAULT if ARCH_MMAP_RND_BITS_DEFAULT 1063 - default ARCH_MMAP_RND_BITS_MAX if FORCE_MAX_MMAP_RND_BITS 1064 1053 default ARCH_MMAP_RND_BITS_MIN 1065 1054 depends on HAVE_ARCH_MMAP_RND_BITS 1066 1055 help ··· 1084 1095 int "Number of bits to use for ASLR of mmap base address for compatible applications" if EXPERT 1085 1096 range ARCH_MMAP_RND_COMPAT_BITS_MIN ARCH_MMAP_RND_COMPAT_BITS_MAX 1086 1097 default ARCH_MMAP_RND_COMPAT_BITS_DEFAULT if ARCH_MMAP_RND_COMPAT_BITS_DEFAULT 1087 - default ARCH_MMAP_RND_COMPAT_BITS_MAX if FORCE_MAX_MMAP_RND_BITS 1088 1098 default ARCH_MMAP_RND_COMPAT_BITS_MIN 1089 1099 depends on HAVE_ARCH_MMAP_RND_COMPAT_BITS 1090 1100 help