All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] sparc64: Randomize mmap base and PIE executables
@ 2026-10-17 10:04 Stian Halseth
  2026-10-17 10:04 ` [PATCH 1/2] sparc64: Start bottom-up mmap searches at mm->mmap_base Stian Halseth
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Stian Halseth @ 2026-10-17 10:04 UTC (permalink / raw)
  To: Andreas Larsson, David S . Miller
  Cc: Kees Cook, Michel Lespinasse, sparclinux, linux-mm, linux-kernel,
	Stian Halseth

On sparc64 a 64-bit process gets little address space randomization:
the stack moves, but shared libraries, anonymous mappings, PIE
executables and the brk heap land at the same address on every run.

Patch 1 makes arch_get_unmapped_area() start at the randomized
mm->mmap_base again, which it has ignored since v3.8. Patch 2 selects
ARCH_HAS_ELF_RANDOMIZE so that PIE executables and brk are randomized
as on other architectures.

Found while adding PIE support to the sparc64 Go port:
https://github.com/sparclinux/issues/issues/119

Tested on a T4-1 and a T7-1 (sun4v) and a V240 (sun4u), with 64-bit and
32-bit userland. With the series the program image, brk, shared
libraries and mmap base move between runs, and with
randomize_va_space=0 or setarch -R the layout is the same as before.
The exec and mm selftests, glibc's elf and nptl tests, the Python test
suite and a kernel build give the same results with and without the
series.

Stian Halseth (2):
  sparc64: Start bottom-up mmap searches at mm->mmap_base
  sparc64: Randomize the load address of PIE executables

 .../features/vm/ELF-ASLR/arch-support.txt      |  2 +-
 arch/sparc/Kconfig                             |  1 +
 arch/sparc/kernel/sys_sparc_64.c               | 18 ++++++++++++++----
 3 files changed, 16 insertions(+), 5 deletions(-)


base-commit: 24a19b953e2a3d0ea5a8c4951a0ab8f32720c907
-- 
2.43.0


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

end of thread, other threads:[~2026-10-18 12:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-17 10:04 [PATCH 0/2] sparc64: Randomize mmap base and PIE executables Stian Halseth
2026-10-17 10:04 ` [PATCH 1/2] sparc64: Start bottom-up mmap searches at mm->mmap_base Stian Halseth
2026-10-17 10:04 ` [PATCH 2/2] sparc64: Randomize the load address of PIE executables Stian Halseth
2026-10-18 10:05   ` sashiko-bot
2026-10-18 12:25     ` Stian Halseth
2026-10-17 14:40 ` [PATCH 0/2] sparc64: Randomize mmap base and " Jan Engelhardt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.