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: <DALKK6MHWD7D.3ZFXSS6YNLHL@ventanamicro.com>
Date: Fri, 13 Jun 2025 19:08:17 +0200
From: Radim Krčmář <rkrcmar@...tanamicro.com>
To: "David Laight" <david.laight.linux@...il.com>
Cc: <linux-riscv@...ts.infradead.org>, <linux-kernel@...r.kernel.org>, "Paul
 Walmsley" <paul.walmsley@...ive.com>, "Palmer Dabbelt"
 <palmer@...belt.com>, "Albert Ou" <aou@...s.berkeley.edu>, "Alexandre
 Ghiti" <alex@...ti.fr>, "Atish Patra" <atishp@...osinc.com>, "Andrew Jones"
 <ajones@...tanamicro.com>, Clément Léger
 <cleger@...osinc.com>, "Anup Patel" <apatel@...tanamicro.com>
Subject: Re: [PATCH 2/2] RISC-V: make use of variadic sbi_ecall

2025-06-13T16:52:26+01:00, David Laight <david.laight.linux@...il.com>:
> On Fri, 13 Jun 2025 16:10:52 +0200
> Radim Krčmář <rkrcmar@...tanamicro.com> wrote:
>
> ...
>> The macro will result in the same arguments as before, and it is what
>> the sbi_ecall actually should do.
>
> Ugg...
> Are you using pre-processor 'magic' to add a pile of zeros and then
> select the first 'n' arguments?

Sadly, yes.  The zeros should have never been introduced in the code, so
I'm hiding them for the moment.
I planned to remove the useless zeros in future patches.

> That ought to be banned as error prone.

Sounds reasonable to me.  I will try to fix the insane tracepoint bloat,
and send a v2 that fills only the correct amount of registers for the
ecall instruction.

> I think the one for strncpy() removes the immediate compile error for:
> 	strncpy(dest, src, 1, 2);

I would have preferred if sbi.h had a wrapper function for each SBI
function, and we never allowed direct invocation of the ecall
instruction outside of the library.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ