Re: [PATCH v2] random: vDSO: Avoid call to memset() when zeroing reserved in __cvdso_getrandom_data()
From: Nathan Chancellor
Date: Tue Sep 29 2026 - 13:00:07 EST
On Sun, Sep 27, 2026 at 08:02:25AM +0100, David Laight wrote:
> On Sat, 26 Sep 2026 14:32:49 +0200
> "Jason A. Donenfeld" <Jason@xxxxxxxxx> wrote:
> > Do we even need to return a value at all? Might as well just make the
> > function two lines:
> >
> > + for (char *d = dst; size--;)
> > + *d++ = value;
>
> Wouldn't it be better to add a barrier() or similar in there to
> stop the compiler playing unwanted games>
Wouldn't that just result in the same code generation issue that Jason
pointed out on my v1?
https://lore.kernel.org/aquyVkdYceiWdckX@xxxxxxxxx/
Maybe that doesn't matter because modern compilers have better options?
--
Cheers,
Nathan