Re: [PATCH] random: vDSO: Avoid call to memset() when zeroing reserved in __cvdso_getrandom_data()

From: Nathan Chancellor

Date: Wed Sep 16 2026 - 18:57:25 EST


On Wed, Sep 16, 2026 at 03:08:38PM -0700, Nick Desaulniers wrote:
> Link: https://github.com/ClangBuiltLinux/linux/issues/2183

Whoops :/ thanks for including this

> Do we need to tag stable (I imagine this might be visible for older
> kernels with newer llvm)?

Yeah, we probably do, as I expect this error to happen with 6.16+ due to
commit ee0d03053e70 ("RISC-V: vDSO: Wire up getrandom() vDSO
implementation").

I will include those in v2 once the maintainers have had some time to
chime in to make sure this approach is okay.

> Any idea why we only see this for riscv? Would think loop idiom
> recognition would make this transform for any target.

I have not confirmed this but based on looking at the aarch64
disassembly when deciding how to tackle this, I suspect some backends
can expand certain calls to memset() to a set of instructions, as I saw
a set of stp calls with xzr as the source and offsets into params as the
dest.

> Reviewed-by: Nick Desaulniers <ndesaulniers@xxxxxxxxxx>

Thanks for taking a look!

--
Cheers,
Nathan