riscv: mm: Update mmap_rnd_bits_max
authorSami Tolvanen <samitolvanen@google.com>
Fri, 29 Sep 2023 21:11:58 +0000 (21:11 +0000)
committerPalmer Dabbelt <palmer@rivosinc.com>
Wed, 24 Jan 2024 15:07:43 +0000 (07:07 -0800)
commit7df1ff5a5cd615815bc6fb4a3a981e9746935e59
tree3c3fa9c7d7bb51a8eeef4de5eeb1de471fed4802
parent71a5849aedaa9ea028fc51ee74576cad61954743
riscv: mm: Update mmap_rnd_bits_max

ARCH_MMAP_RND_BITS_MAX is based on Sv39, which leaves a few
potential bits of mmap randomness on the table if we end up enabling
4/5-level paging. Update mmap_rnd_bits_max to take the final address
space size into account. This increases mmap_rnd_bits_max from 24 to
33 with Sv48/57.

Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
Link: https://lore.kernel.org/r/20230929211155.3910949-6-samitolvanen@google.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/mm/init.c