diff options
author | Rafael Aquini <aquini@redhat.com> | 2024-06-06 14:06:22 -0400 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2024-06-15 10:43:06 -0700 |
commit | 3afb76a66b5559a7b595155803ce23801558a7a9 (patch) | |
tree | a9ad68a96db16bf98cbafb486d001a83b55c0cf9 /scripts | |
parent | c1558bc57b8e5b4da5d821537cd30e2e660861d8 (diff) | |
download | linux-stable-3afb76a66b5559a7b595155803ce23801558a7a9.tar.gz linux-stable-3afb76a66b5559a7b595155803ce23801558a7a9.tar.bz2 linux-stable-3afb76a66b5559a7b595155803ce23801558a7a9.zip |
mm: mmap: allow for the maximum number of bits for randomizing mmap_base by default
An ASLR regression was noticed [1] and tracked down to file-mapped areas
being backed by THP in recent kernels. The 21-bit alignment constraint
for such mappings reduces the entropy for randomizing the placement of
64-bit library mappings and breaks ASLR completely for 32-bit libraries.
The reported issue is easily addressed by increasing vm.mmap_rnd_bits and
vm.mmap_rnd_compat_bits. This patch just provides a simple way to set
ARCH_MMAP_RND_BITS and ARCH_MMAP_RND_COMPAT_BITS to their maximum values
allowed by the architecture at build time.
[1] https://zolutal.github.io/aslrnt/
[akpm@linux-foundation.org: default to `y' if 32-bit, per Rafael]
Link: https://lkml.kernel.org/r/20240606180622.102099-1-aquini@redhat.com
Fixes: 1854bc6e2420 ("mm/readahead: Align file mappings for non-DAX")
Signed-off-by: Rafael Aquini <aquini@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Mike Rapoport (IBM) <rppt@kernel.org>
Cc: Paul E. McKenney <paulmck@kernel.org>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Samuel Holland <samuel.holland@sifive.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions