aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
authorLinus Torvalds <torvalds@linux-foundation.org>2026-04-13 17:52:29 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2026-04-13 17:52:29 -0700
commitd568788baab24875604c231f723dbb72387fb081 (patch)
tree0921e372d643541c59751e1af47b20fc1b702204 /init
parentcea4a90faf9e5d15aee1fd01883bc81ad7640260 (diff)
parentcf2f06f7152d5e38a87aa2e9b8b452714789f6ba (diff)
downloadlinux-next-history-d568788baab24875604c231f723dbb72387fb081.tar.gz
Merge tag 'hardening-v7.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
Pull hardening updates from Kees Cook: - randomize_kstack: Improve implementation across arches (Ryan Roberts) - lkdtm/fortify: Drop unneeded FORTIFY_STR_OBJECT test - refcount: Remove unused __signed_wrap function annotations * tag 'hardening-v7.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: lkdtm/fortify: Drop unneeded FORTIFY_STR_OBJECT test refcount: Remove unused __signed_wrap function annotations randomize_kstack: Unify random source across arches randomize_kstack: Maintain kstack_offset per task
Diffstat (limited to 'init')
-rw-r--r--init/main.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/init/main.c b/init/main.c
index 1cb395dd94e43..c9638a6946dca 100644
--- a/init/main.c
+++ b/init/main.c
@@ -833,7 +833,14 @@ static inline void initcall_debug_enable(void)
#ifdef CONFIG_RANDOMIZE_KSTACK_OFFSET
DEFINE_STATIC_KEY_MAYBE_RO(CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT,
randomize_kstack_offset);
-DEFINE_PER_CPU(u32, kstack_offset);
+DEFINE_PER_CPU(struct rnd_state, kstack_rnd_state);
+
+static int __init random_kstack_init(void)
+{
+ prandom_seed_full_state(&kstack_rnd_state);
+ return 0;
+}
+late_initcall(random_kstack_init);
static int __init early_randomize_kstack_offset(char *buf)
{