lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7f840a23ab8865d7f205caec56817c660e237d64.camel@xry111.site>
Date: Fri, 23 May 2025 16:02:45 +0800
From: Xi Ruoyao <xry111@...111.site>
To: Alexandre Ghiti <alex@...ti.fr>, Thomas Weißschuh
	 <thomas.weissschuh@...utronix.de>, Nathan Chancellor <nathan@...nel.org>
Cc: "Jason A. Donenfeld" <Jason@...c4.com>, Paul Walmsley
	 <paul.walmsley@...ive.com>, Palmer Dabbelt <palmer@...belt.com>, Guo Ren
	 <guoren@...nel.org>, linux-riscv@...ts.infradead.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] RISC-V: vDSO: Wire up getrandom() vDSO implementation

On Fri, 2025-05-23 at 10:01 +0200, Alexandre Ghiti wrote:
> Hi Xi,
> 
> On 4/11/25 10:04, Thomas Weißschuh wrote:
> > On Fri, Apr 11, 2025 at 10:46:00AM +0800, Xi Ruoyao wrote:
> > > Hook up the generic vDSO implementation to the generic vDSO
> > > getrandom
> > > implementation by providing the required
> > > __arch_chacha20_blocks_nostack
> > > and getrandom_syscall implementations. Also wire up the selftests.
> > > 
> > > The benchmark result:
> > > 
> > > 	vdso: 25000000 times in 2.466341333 seconds
> > > 	libc: 25000000 times in 41.447720005 seconds
> > > 	syscall: 25000000 times in 41.043926672 seconds
> > > 
> > > 	vdso: 25000000 x 256 times in 162.286219353 seconds
> > > 	libc: 25000000 x 256 times in 2953.855018685 seconds
> > > 	syscall: 25000000 x 256 times in 2796.268546000 seconds
> > > 
> > > Signed-off-by: Xi Ruoyao <xry111@...111.site>
> > > ---
> > > 
> > > [v1]->v2:
> > > - Fix the commit message.
> > > - Only build the vDSO getrandom code if CONFIG_VDSO_GETRANDOM, to
> > >    unbreak RV32 build.
> > > - Likewise, only enable the selftest if __riscv_xlen == 64.
> > > 
> > > [v1]:
> > > https://lore.kernel.org/all/20250224122541.65045-1-xry111@xry111.site/
> > > 
> > >   arch/riscv/Kconfig                            |   1 +
> > >   arch/riscv/include/asm/vdso/getrandom.h       |  30 +++
> > >   arch/riscv/kernel/vdso/Makefile               |  12 +
> > >   arch/riscv/kernel/vdso/getrandom.c            |  10 +
> > >   arch/riscv/kernel/vdso/vdso.lds.S             |   1 +
> > >   arch/riscv/kernel/vdso/vgetrandom-chacha.S    | 244
> > > ++++++++++++++++++
> > >   .../selftests/vDSO/vgetrandom-chacha.S        |   2 +
> > >   7 files changed, 300 insertions(+)
> > >   create mode 100644 arch/riscv/include/asm/vdso/getrandom.h
> > >   create mode 100644 arch/riscv/kernel/vdso/getrandom.c
> > >   create mode 100644 arch/riscv/kernel/vdso/vgetrandom-chacha.S
> > <snip>
> > 
> > > diff --git a/arch/riscv/kernel/vdso/vdso.lds.S
> > > b/arch/riscv/kernel/vdso/vdso.lds.S
> > > index 8e86965a8aae..abc69cda0445 100644
> > > --- a/arch/riscv/kernel/vdso/vdso.lds.S
> > > +++ b/arch/riscv/kernel/vdso/vdso.lds.S
> > > @@ -80,6 +80,7 @@ VERSION
> > >   #ifndef COMPAT_VDSO
> > >   		__vdso_riscv_hwprobe;
> > >   #endif
> > > +		__vdso_getrandom;
> > For consistency this could be gated behind CONFIG_VDSO_GETRANDOM.
> 
> 
> Nathan sent a fix for this here:
> 
> https://lore.kernel.org/all/20250423-riscv-fix-compat_vdso-lld-v2-1-b7bbbc244501@kernel.org/

I've given it an R-b.  Do you prefer me to squash the patches and keep
the SoB of both I and Nathan?

-- 
Xi Ruoyao <xry111@...111.site>
School of Aerospace Science and Technology, Xidian University

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ