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] [thread-next>] [day] [month] [year] [list]
Message-ID: <aH6qO3c39gmybwEc@x1>
Date: Mon, 21 Jul 2025 13:59:39 -0700
From: Drew Fustini <fustini@...nel.org>
To: Palmer Dabbelt <palmer@...belt.com>,
	Björn Töpel <bjorn@...osinc.com>,
	Alexandre Ghiti <alex@...ti.fr>,
	Paul Walmsley <paul.walmsley@...ive.com>,
	Samuel Holland <samuel.holland@...ive.com>,
	Drew Fustini <dfustini@...storrent.com>,
	Andy Chiu <andybnac@...il.com>,
	Conor Dooley <conor.dooley@...rochip.com>,
	linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] riscv: Add sysctl to control discard of vstate during
 syscall

On Mon, Jul 21, 2025 at 08:13:48AM -0400, Darius Rad wrote:
> On Fri, Jul 18, 2025 at 08:39:13PM -0700, Drew Fustini wrote:
> > From: Drew Fustini <dfustini@...storrent.com>
> > 
> > Clobbering the vector registers can significantly increase system call
> > latency for some implementations. To mitigate this performance impact, a
> > policy mechanism is provided to administrators, distro maintainers, and
> > developers to control vector state discard in the form of a sysctl knob:
> > 
> > /proc/sys/abi/riscv_v_vstate_discard
> > 
> > Valid values are:
> > 
> > 0: Do not discard vector state during syscall
> > 1: Discard vector state during syscall
> > 
> 
> Is the intention for this this mean "don't guarantee vector state is
> clobbered" or "preserve vector state"?  I suspect it is the former, but the
> wording seems unclear.  Additionally, if that's indeed the case, maybe the
> documentation should more clearly articulate the tradeoff (performance vs.
> security/robustness).

Thanks for your comment. I agree it could be worded better and the trade
off should be explained. I believe the motivation behind clobbering in
all syscalls was to make sure that userspace does not rely on the vector
being preserved through a syscall. The goal of this strictness was to
catch any programs that were misbehaving.

Thus, it might be better if I described it as:

0: Vector state is not strictly clobbered in all syscalls
1: Mandatory clobbering of vector state in all syscalls

Thanks,
Drew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ