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: <a8f469b8-5750-dfec-2390-09bad4515f99@kernel.org>
Date: Fri, 31 Oct 2025 14:07:32 -0600 (MDT)
From: Paul Walmsley <pjw@...nel.org>
To: Deepak Gupta <debug@...osinc.com>, Andy Chiu <andybnac@...il.com>
cc: Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>, 
    Borislav Petkov <bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>, 
    x86@...nel.org, "H. Peter Anvin" <hpa@...or.com>, 
    Andrew Morton <akpm@...ux-foundation.org>, 
    "Liam R. Howlett" <Liam.Howlett@...cle.com>, 
    Vlastimil Babka <vbabka@...e.cz>, 
    Lorenzo Stoakes <lorenzo.stoakes@...cle.com>, 
    Paul Walmsley <paul.walmsley@...ive.com>, 
    Palmer Dabbelt <palmer@...belt.com>, Albert Ou <aou@...s.berkeley.edu>, 
    Conor Dooley <conor@...nel.org>, Rob Herring <robh@...nel.org>, 
    Krzysztof Kozlowski <krzk+dt@...nel.org>, Arnd Bergmann <arnd@...db.de>, 
    Christian Brauner <brauner@...nel.org>, 
    Peter Zijlstra <peterz@...radead.org>, Oleg Nesterov <oleg@...hat.com>, 
    Eric Biederman <ebiederm@...ssion.com>, Kees Cook <kees@...nel.org>, 
    Jonathan Corbet <corbet@....net>, Shuah Khan <shuah@...nel.org>, 
    Jann Horn <jannh@...gle.com>, Conor Dooley <conor+dt@...nel.org>, 
    Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>, 
    Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>, 
    Björn Roy Baron <bjorn3_gh@...tonmail.com>, 
    Andreas Hindborg <a.hindborg@...nel.org>, 
    Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>, 
    Benno Lossin <lossin@...nel.org>, linux-kernel@...r.kernel.org, 
    linux-fsdevel@...r.kernel.org, linux-mm@...ck.org, 
    linux-riscv@...ts.infradead.org, devicetree@...r.kernel.org, 
    linux-arch@...r.kernel.org, linux-doc@...r.kernel.org, 
    linux-kselftest@...r.kernel.org, alistair.francis@....com, 
    richard.henderson@...aro.org, jim.shu@...ive.com, 
    Andy Chiu <andybnac@...il.com>, kito.cheng@...ive.com, 
    charlie@...osinc.com, atishp@...osinc.com, evan@...osinc.com, 
    cleger@...osinc.com, alexghiti@...osinc.com, samitolvanen@...gle.com, 
    broonie@...nel.org, rick.p.edgecombe@...el.com, 
    rust-for-linux@...r.kernel.org
Subject: Re: [PATCH v22 17/28] riscv/signal: save and restore of shadow stack
 for signal

On Thu, 23 Oct 2025, Deepak Gupta via B4 Relay wrote:

> From: Deepak Gupta <debug@...osinc.com>
> 
> Save shadow stack pointer in sigcontext structure while delivering signal.
> Restore shadow stack pointer from sigcontext on sigreturn.
> 
> As part of save operation, kernel uses `ssamoswap` to save snapshot of
> current shadow stack on shadow stack itself (can be called as a save
> token). During restore on sigreturn, kernel retrieves token from top of
> shadow stack and validates it. This allows that user mode can't arbitrary
> pivot to any shadow stack address without having a token and thus provide
> strong security assurance between signaly delivery and sigreturn window.
> 
> Use ABI compatible way of saving/restoring shadow stack pointer into
> signal stack. This follows what Vector extension, where extra registers
> are placed in a form of extension header + extension body in the stack.
> The extension header indicates the size of the extra architectural
> states plus the size of header itself, and a magic identifier of the
> extension. Then, the extensions body contains the new architectural
> states in the form defined by uapi.
> 
> Signed-off-by: Andy Chiu <andy.chiu@...ive.com>
> Signed-off-by: Deepak Gupta <debug@...osinc.com>

This patch causes some 'checkpatch.pl --strict' messages:

CHECK: Comparison to NULL could be written "!saved_shstk_ptr"
#271: FILE: arch/riscv/kernel/usercfi.c:186:
+	if (saved_shstk_ptr == NULL)

CHECK: Lines should not end with a '('
#300: FILE: arch/riscv/kernel/usercfi.c:215:
+		pr_info_ratelimited(

I've fixed them up here in the event that v22 goes in, but please do the 
same on your side in case a new version is needed.


- Paul

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ