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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <71f093d5-4823-4bc6-b9ee-23433bd8c60c@ghiti.fr>
Date: Fri, 23 May 2025 12:06:38 +0200
From: Alexandre Ghiti <alex@...ti.fr>
To: Xi Ruoyao <xry111@...111.site>,
 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 5/23/25 10:02, Xi Ruoyao wrote:
> 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?

Hmm I was about to send a new PR today after the CI passes, I mentioned 
Nathan's patch in the squash so he keeps credit for the fix. Unless you 
can send something today, I'll keep my squashed patch.

Thanks,

Alex


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ