mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] LoongArch: Increase default mmap randomization bits
@ 2026-03-28 22:59 Bingwu Zhang
  2026-03-29  3:48 ` Huacai Chen
  0 siblings, 1 reply; 11+ messages in thread
From: Bingwu Zhang @ 2026-03-28 22:59 UTC (permalink / raw)
  To: Huacai Chen, WANG Xuerui, Guo Ren, Jiaxun Yang
  Cc: loongarch, linux-kernel, Bingwu Zhang

From: Bingwu Zhang <xtex@astrafall.org>

Increase default mmap randomization bits from 12 to 18 on 64-bit
platforms for better strength.

The original default, 12, means that ASLR offset has only (1 << 12) =
4096 possibilities. On average, it can be brute-forced in 2048 attempts.
If a service is configured to restart automatically or can be started
easily (e.g. execve a suid program), then trying for 4k times can be
done in one day even when each attempt takes 20s.
Increasing it to 18 makes brute-force much more difficult and leaves
more time for operators to find out attacks.

On 64-bit platforms, virtual address space is cheap, so the
randomization bits can be increased safely without disturbing userland
much and security comes first instead of availability.

Fixes: fa96b57c1490 ("LoongArch: Add build infrastructure")
Signed-off-by: Bingwu Zhang <xtex@astrafall.org>
---
 arch/loongarch/Kconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig
index 92068ff38685..b47c4e4ecbb7 100644
--- a/arch/loongarch/Kconfig
+++ b/arch/loongarch/Kconfig
@@ -740,9 +740,11 @@ config MMU
 	default y
 
 config ARCH_MMAP_RND_BITS_MIN
+	default 18 if 64BIT
 	default 12
 
 config ARCH_MMAP_RND_BITS_MAX
+	default 32 if 64BIT
 	default 18
 
 config ARCH_SUPPORTS_UPROBES

base-commit: be762d8b6dd7efacb61937d20f8475db8f207655
-- 
2.52.0


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-04-13  2:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-28 22:59 [PATCH] LoongArch: Increase default mmap randomization bits Bingwu Zhang
2026-03-29  3:48 ` Huacai Chen
2026-04-12  3:49   ` Bingwu Zhang
2026-04-12 12:24     ` Huacai Chen
2026-04-12 12:32       ` Xi Ruoyao
2026-04-12 12:36         ` Huacai Chen
2026-04-12 12:37         ` Xi Ruoyao
2026-04-12 12:42           ` Huacai Chen
2026-04-13  2:05           ` xtex
2026-04-13  2:05           ` xtex
2026-04-13  2:38             ` Huacai Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®