linux-stable/arch/arm64/kernel
Kees Cook b793177141 randomize_kstack: Remove non-functional per-arch entropy filtering
[ Upstream commit 6db1208bf9 ]

An unintended consequence of commit 9c573cd313 ("randomize_kstack:
Improve entropy diffusion") was that the per-architecture entropy size
filtering reduced how many bits were being added to the mix, rather than
how many bits were being used during the offsetting. All architectures
fell back to the existing default of 0x3FF (10 bits), which will consume
at most 1KiB of stack space. It seems that this is working just fine,
so let's avoid the confusion and update everything to use the default.

The prior intent of the per-architecture limits were:

  arm64: capped at 0x1FF (9 bits), 5 bits effective
  powerpc: uncapped (10 bits), 6 or 7 bits effective
  riscv: uncapped (10 bits), 6 bits effective
  x86: capped at 0xFF (8 bits), 5 (x86_64) or 6 (ia32) bits effective
  s390: capped at 0xFF (8 bits), undocumented effective entropy

Current discussion has led to just dropping the original per-architecture
filters. The additional entropy appears to be safe for arm64, x86,
and s390. Quoting Arnd, "There is no point pretending that 15.75KB is
somehow safe to use while 15.00KB is not."

Co-developed-by: Yuntao Liu <liuyuntao12@huawei.com>
Signed-off-by: Yuntao Liu <liuyuntao12@huawei.com>
Fixes: 9c573cd313 ("randomize_kstack: Improve entropy diffusion")
Link: https://lore.kernel.org/r/20240617133721.377540-1-liuyuntao12@huawei.com
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com> # s390
Link: https://lore.kernel.org/r/20240619214711.work.953-kees@kernel.org
Signed-off-by: Kees Cook <kees@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-07-05 09:31:51 +02:00
..
pi
probes arm64/kprobe: Optimize the performance of patching single-step slot 2022-09-30 09:17:15 +01:00
vdso arm64 updates for 6.1: 2022-10-06 11:51:49 -07:00
vdso32 kbuild: Drop -Wdeclaration-after-statement 2024-02-23 09:12:52 +01:00
.gitignore
acpi.c
acpi_numa.c
acpi_parking_protocol.c treewide: Drop function_nocfi 2022-09-26 10:13:14 -07:00
alternative.c arm64 updates for 6.1: 2022-10-06 11:51:49 -07:00
armv8_deprecated.c
asm-offsets.c
cacheinfo.c arm64: cacheinfo: Fix incorrect assignment of signed error value to unsigned fw_level 2022-08-23 11:10:24 +01:00
compat_alignment.c arm64: compat: Work around uninitialized variable warning 2023-04-13 16:55:24 +02:00
cpu-reset.S arm64: Add types to indirect called assembly functions 2022-09-26 10:13:13 -07:00
cpu_errata.c arm64: Subscribe Microsoft Azure Cobalt 100 to ARM Neoverse N2 errata 2024-02-23 09:12:52 +01:00
cpu_ops.c
cpufeature.c arm64: cpufeature: Fix CLRBHB and BC detection 2023-10-10 22:00:37 +02:00
cpuidle.c
cpuinfo.c arm64/sysreg: Add hwcap for SVE EBF16 2022-09-06 18:53:52 +01:00
crash_core.c
crash_dump.c
debug-monitors.c arm64: kgdb: Set PSTATE.SS to 1 to re-enable single-step 2023-05-11 23:03:16 +09:00
efi-entry.S
efi-header.S arm64: efi: Set NX compat flag in PE/COFF header 2023-04-06 12:10:37 +02:00
efi-rt-wrapper.S arm64: efi: Avoid workqueue to check whether EFI runtime is live 2023-02-01 08:34:34 +01:00
efi.c arm64: efi: Make efi_rt_lock a raw_spinlock 2023-03-11 13:55:43 +01:00
elfcore.c arm64: mte: Fix/clarify the PG_mte_tagged semantics 2023-03-11 13:55:44 +01:00
entry-common.c arm64: entry: avoid kprobe recursion 2022-11-01 17:43:31 +00:00
entry-fpsimd.S
entry-ftrace.S arm64: ftrace: Define ftrace_stub_graph only with FUNCTION_GRAPH_TRACER 2022-11-14 12:28:52 +00:00
entry.S arm64: Rename ARM64_WORKAROUND_2966298 2024-01-31 16:17:01 -08:00
fpsimd.c arm64/sme: Restore SME registers on exit from suspend 2024-03-01 13:26:37 +01:00
ftrace.c arm64 updates for 6.1: 2022-10-06 11:51:49 -07:00
head.S arm64: Always load shadow stack pointer directly from the task struct 2023-05-11 23:02:59 +09:00
hibernate-asm.S
hibernate.c arm64: mte: Fix/clarify the PG_mte_tagged semantics 2023-03-11 13:55:44 +01:00
hw_breakpoint.c hw_breakpoint: fix single-stepping when using bpf_overflow_handler 2023-09-23 11:11:00 +02:00
hyp-stub.S arm64/sysreg: Standardise naming for ID_AA64MMFR1_EL1 fields 2022-09-09 10:59:03 +01:00
idle.c
idreg-override.c arm64/sysreg: Standardise naming for ID_AA64MMFR1_EL1 fields 2022-09-09 10:59:03 +01:00
image-vars.h EFI updates for v6.1 2022-10-09 08:56:54 -07:00
image.h
io.c
irq.c arm64: irq: set the correct node for shadow call stack 2024-02-05 20:13:02 +00:00
jump_label.c
kaslr.c
kexec_image.c
kgdb.c arm64: kgdb: Set PSTATE.SS to 1 to re-enable single-step 2023-05-11 23:03:16 +09:00
kuser32.S
machine_kexec.c treewide: Drop function_nocfi 2022-09-26 10:13:14 -07:00
machine_kexec_file.c arm64/kexec: Fix missing extra range for crashkres_low. 2022-09-01 11:50:00 +01:00
Makefile Kbuild updates for v6.1 2022-10-10 12:00:45 -07:00
module-plts.c arm64: module: Use module_init_layout_section() to spot init sections 2023-09-02 09:16:19 +02:00
module.c arm64: module: move find_section to header 2022-09-09 12:27:25 +01:00
mte.c arm64: mte: Do not set PG_mte_tagged if tags were not initialized 2023-05-24 17:32:52 +01:00
paravirt.c
patching.c
pci.c
perf_callchain.c
perf_event.c drivers/perf: pmuv3: don't expose SW_INCR event in sysfs 2024-02-05 20:12:46 +00:00
perf_regs.c perf: arm64: Add SVE vector granule register to user regs 2022-09-22 15:06:02 +01:00
pointer_auth.c
process.c Random number generator fixes for Linux 6.1-rc1. 2022-10-16 15:27:07 -07:00
proton-pack.c arm64: Add AMPERE1 to the Spectre-BHB affected list 2022-10-12 17:36:06 +01:00
psci.c treewide: Drop function_nocfi 2022-09-26 10:13:14 -07:00
ptrace.c arm64/sve: Lower the maximum allocation for the SVE ptrace regset 2024-03-26 18:20:25 -04:00
reloc_test_core.c ARM64: reloc_test: add __init/__exit annotations to module init/exit funcs 2022-09-29 18:04:25 +01:00
reloc_test_syms.S
relocate_kernel.S
return_address.c
sdei.c arm64: sdei: abort running SDEI handlers during crash 2023-09-13 09:43:03 +02:00
setup.c
signal.c arm64/ptrace: Ensure that SME is set up for target when writing SSVE state 2023-08-23 17:52:41 +02:00
signal32.c
sigreturn32.S
sleep.S arm64: mm: fix resume for 52-bit enabled builds 2022-09-10 14:46:28 +01:00
smccc-call.S
smp.c arm64: sdei: abort running SDEI handlers during crash 2023-09-13 09:43:03 +02:00
smp_spin_table.c treewide: Drop function_nocfi 2022-09-26 10:13:14 -07:00
stacktrace.c arm64: efi: Account for the EFI runtime stack in stack unwinder 2023-02-01 08:34:35 +01:00
suspend.c arm64/sme: Restore SME registers on exit from suspend 2024-03-01 13:26:37 +01:00
sys.c
sys32.c
sys_compat.c
syscall.c randomize_kstack: Remove non-functional per-arch entropy filtering 2024-07-05 09:31:51 +02:00
time.c
topology.c RISC-V Patches for the 6.1 Merge Window, Part 1 2022-10-09 13:24:01 -07:00
trace-events-emulation.h
traps.c arm64 updates for 6.1: 2022-10-06 11:51:49 -07:00
vdso-wrap.S
vdso.c arm64: vdso: Pass (void *) to virt_to_page() 2023-06-09 10:34:14 +02:00
vdso32-wrap.S
vmlinux.lds.S