Re: [PATCH] randomize_kstack: Improve entropy diffusion

2024-05-22 Thread Arnd Bergmann
On Wed, May 22, 2024, at 08:35, Nicolai Stange wrote: > Kees Cook writes: >> >> diff --git a/include/linux/randomize_kstack.h >> b/include/linux/randomize_kstack.h >> index 5d868505a94e..6d92b68efbf6 100644 >> --- a/include/linux/randomize_kstack.h >> +++ b/include/linux/randomize_kstack.h >> @@

Re: [PATCH] randomize_kstack: Improve entropy diffusion

2024-05-22 Thread Nicolai Stange
Kees Cook writes: > > diff --git a/include/linux/randomize_kstack.h > b/include/linux/randomize_kstack.h > index 5d868505a94e..6d92b68efbf6 100644 > --- a/include/linux/randomize_kstack.h > +++ b/include/linux/randomize_kstack.h > @@ -80,7 +80,7 @@ DECLARE_PER_CPU(u32, kstack_offset); > if

Re: [PATCH] randomize_kstack: Improve entropy diffusion

2024-04-03 Thread Kees Cook
On Sat, 09 Mar 2024 12:24:48 -0800, Kees Cook wrote: > The kstack_offset variable was really only ever using the low bits for > kernel stack offset entropy. Add a ror32() to increase bit diffusion. > > Applied to for-next/hardening: [1/1] randomize_kstack: Improve entropy diffusion https:

[PATCH] randomize_kstack: Improve entropy diffusion

2024-03-09 Thread Kees Cook
The kstack_offset variable was really only ever using the low bits for kernel stack offset entropy. Add a ror32() to increase bit diffusion. Suggested-by: Arnd Bergmann Fixes: 39218ff4c625 ("stack: Optionally randomize kernel stack offset each syscall") Signed-off-by: Kees Cook --- Cc: Jeremy L