Re: [PATCH 1/1] arm64: syscall: Direct PRNG kstack randomization

2024-03-23 Thread Arnd Bergmann
On Sat, Mar 23, 2024, at 00:40, Jeremy Linton wrote: > On 3/8/24 14:29, Arnd Bergmann wrote: >> On Fri, Mar 8, 2024, at 17:49, Jeremy Linton wrote: >>> On 3/7/24 05:10, Arnd Bergmann wrote: I'm not sure I understand the logic. Do you mean that accessing CNTVCT itself is slow, or that

Re: [PATCH 1/1] arm64: syscall: Direct PRNG kstack randomization

2024-03-22 Thread Jeremy Linton
Hi, Sorry about the delay here, PTO and I actually wanted to verify my assumptions. On 3/8/24 14:29, Arnd Bergmann wrote: On Fri, Mar 8, 2024, at 17:49, Jeremy Linton wrote: On 3/7/24 05:10, Arnd Bergmann wrote: I'm not sure I understand the logic. Do you mean that accessing CNTVCT itself

Re: [PATCH 1/1] arm64: syscall: Direct PRNG kstack randomization

2024-03-08 Thread Arnd Bergmann
On Fri, Mar 8, 2024, at 17:49, Jeremy Linton wrote: > On 3/7/24 05:10, Arnd Bergmann wrote: >> >> I'm not sure I understand the logic. Do you mean that accessing >> CNTVCT itself is slow, or that reseeding based on CNTVCT is slow >> because of the overhead of reseeding? > > Slow, as in, its running

Re: [PATCH 1/1] arm64: syscall: Direct PRNG kstack randomization

2024-03-08 Thread Jeremy Linton
Hi, On 3/7/24 05:10, Arnd Bergmann wrote: On Wed, Mar 6, 2024, at 22:54, Jeremy Linton wrote: On 3/6/24 14:46, Arnd Bergmann wrote: On Wed, Mar 6, 2024, at 00:33, Kees Cook wrote: On Tue, Mar 05, 2024 at 04:18:24PM -0600, Jeremy Linton wrote: The existing arm64 stack randomization uses the k

Re: [PATCH 1/1] arm64: syscall: Direct PRNG kstack randomization

2024-03-07 Thread Arnd Bergmann
On Thu, Mar 7, 2024, at 20:15, Kees Cook wrote: > On Thu, Mar 07, 2024 at 12:10:34PM +0100, Arnd Bergmann wrote: >> There is not even any attempt to use the most random bits of >> the cycle counter, as both the high 22 to 24 bits get masked >> out (to keep the wasted stack space small) and the low

Re: [PATCH 1/1] arm64: syscall: Direct PRNG kstack randomization

2024-03-07 Thread Arnd Bergmann
On Thu, Mar 7, 2024, at 20:10, Kees Cook wrote: > On Thu, Mar 07, 2024 at 12:10:34PM +0100, Arnd Bergmann wrote: >> For the strength, we have at least four options: >> >> - strong rng, most expensive >> - your new prng, less strong but somewhat cheaper and/or more >> predictable overhead >> - cy

Re: [PATCH 1/1] arm64: syscall: Direct PRNG kstack randomization

2024-03-07 Thread Kees Cook
On Thu, Mar 07, 2024 at 12:10:34PM +0100, Arnd Bergmann wrote: > There is not even any attempt to use the most random bits of > the cycle counter, as both the high 22 to 24 bits get masked > out (to keep the wasted stack space small) and the low 3 or 4 > bits get ignored because of stack alignment.

Re: [PATCH 1/1] arm64: syscall: Direct PRNG kstack randomization

2024-03-07 Thread Kees Cook
On Thu, Mar 07, 2024 at 12:10:34PM +0100, Arnd Bergmann wrote: > For the strength, we have at least four options: > > - strong rng, most expensive > - your new prng, less strong but somewhat cheaper and/or more > predictable overhead > - cycle counter, cheap but probably even less strong, > ne

Re: [PATCH 1/1] arm64: syscall: Direct PRNG kstack randomization

2024-03-07 Thread kernel test robot
Hi Jeremy, kernel test robot noticed the following build warnings: [auto build test WARNING on arm64/for-next/core] [also build test WARNING on arm/for-next arm/fixes kvmarm/next soc/for-next linus/master v6.8-rc7 next-20240307] [If your patch is applied to the wrong git tree, kindly drop us a n

Re: [PATCH 1/1] arm64: syscall: Direct PRNG kstack randomization

2024-03-07 Thread Arnd Bergmann
On Wed, Mar 6, 2024, at 22:54, Jeremy Linton wrote: > On 3/6/24 14:46, Arnd Bergmann wrote: >> On Wed, Mar 6, 2024, at 00:33, Kees Cook wrote: >>> On Tue, Mar 05, 2024 at 04:18:24PM -0600, Jeremy Linton wrote: The existing arm64 stack randomization uses the kernel rng to acquire 5 bits of

Re: [PATCH 1/1] arm64: syscall: Direct PRNG kstack randomization

2024-03-06 Thread Jeremy Linton
Hi, On 3/6/24 14:46, Arnd Bergmann wrote: On Wed, Mar 6, 2024, at 00:33, Kees Cook wrote: On Tue, Mar 05, 2024 at 04:18:24PM -0600, Jeremy Linton wrote: The existing arm64 stack randomization uses the kernel rng to acquire 5 bits of address space randomization. This is problematic because it c

Re: [PATCH 1/1] arm64: syscall: Direct PRNG kstack randomization

2024-03-06 Thread Arnd Bergmann
On Wed, Mar 6, 2024, at 00:33, Kees Cook wrote: > On Tue, Mar 05, 2024 at 04:18:24PM -0600, Jeremy Linton wrote: >> The existing arm64 stack randomization uses the kernel rng to acquire >> 5 bits of address space randomization. This is problematic because it >> creates non determinism in the syscal

Re: [PATCH 1/1] arm64: syscall: Direct PRNG kstack randomization

2024-03-05 Thread Kees Cook
On Tue, Mar 05, 2024 at 04:18:24PM -0600, Jeremy Linton wrote: > The existing arm64 stack randomization uses the kernel rng to acquire > 5 bits of address space randomization. This is problematic because it > creates non determinism in the syscall path when the rng needs to be > generated or reseed