Re: [PATCH v3] x86: Use `get_random_u8' for kernel stack offset randomization

From: Thomas Gleixner
Date: Mon Feb 13 2023 - 14:04:30 EST


On Mon, Jan 30 2023 at 21:30, Maciej W. Rozycki wrote:
>
> Therefore switch to our generic entropy source and use `get_random_u8'
> instead, which according to Jason A. Donenfeld is supposed to be fast
> enough:
>
> "Generally it's very very fast, as most cases wind up being only a
> memcpy -- in this case, a single byte copy. So by and large it should
> be suitable. It's fast enough now that most networking things are able
> to use it. And lots of other places where you'd want really high
> performance. So I'd expect it's okay to use here too. And if it is too
> slow, we should figure out how to make it faster. But I don't suspect
> it'll be too slow."

Please provide numbers on contemporary hardware.

Up to that point, it's easy enough to just disable that randomization on
32bit.

Thanks,

tglx