From: Bill Roberts <bill.roberts@foss.arm.com>
To: Mark Brown <broonie@kernel.org>, Jesse Huang <jesse.huang@sifive.com>
Cc: "linux-riscv@lists.infradead.org"
<linux-riscv@lists.infradead.org>,
linux-arm-kernel@lists.infradead.org,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
linux-hardening@vger.kernel.org, linux-api@vger.kernel.org,
dave.hansen@linux.intel.com, rick.p.edgecombe@intel.com,
debug@rivosinc.com, andrew@sifive.com, kito.cheng@sifive.com
Subject: Re: Shadow Stack Locking Semantics between arch's
Date: Thu, 10 Sep 2026 09:19:23 -0500 [thread overview]
Message-ID: <615d5d1a-5266-4b83-bff2-21c8f3840040@foss.arm.com> (raw)
In-Reply-To: <0ef9f4ab-4c9f-4089-bed3-f7726ec97804@foss.arm.com>
On 9/9/26 12:57 PM, Bill Roberts wrote:
>>
>>> 2. riscv should check that the low bit is set in locking not just
>>> that its
>>> 0, it should be 1
>> I think for ABI compatibility RISC-V will have to continue accepting 0
>> as being equivalent to locking PR_SHADOW_STACK_ENABLE (or everything,
>> but it only supports that one bit right now).
>
> TL;DR - No users, lets fix it before risc-v lands the userspace side IIUC
>
> I can't find any libc's that support this for risc-v. It appears the
> glibc
> patches were not merged and I commented on those patches just now
> that the interface is wrong:
> -
> https://inbox.sourceware.org/libc-alpha/8a5e21d0-0628-4910-9ad8-165c829e9680@foss.arm.com/
>
> Additionally, stress-ng does it "generically", and it would be broken
> on a riscv system:
> -
> https://sources.debian.org/src/stress-ng/0.22.00-2/stress-prctl.c?hl=1144#L1144
>
> This is a bug and never followed the convention to begin with. So
> risc-v is
> non-compliant to the spec and this effectively prevents the a true
> unification
> of a generic prctl interface. The behavior on riscv doesn't adhere to
> there own docs:
>
> -
> https://cdn.kernel.org/doc/html/latest/arch/riscv/zicfiss.html#prctl-enabling
Sorry I confused two interfaces here, anyway,
arch_set_shadow_stack_status is fine,
it's the locking interface arch_lock_shadow_stack_status, code snippet
below:
/* If shtstk not supported or not enabled on task, nothing to lock here */
if (!is_user_shstk_enabled() ||
!is_shstk_enabled(task) || arg != 0)
return -EINVAL;
So even the glibc patches will be fine. But definitely something we want
to fix.
I am going to float a patch over to the risc-v folks.
prev parent reply other threads:[~2026-09-10 14:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-27 17:15 Shadow Stack Locking Semantics between arch's Bill Roberts
2026-08-27 17:52 ` Bill Roberts
2026-08-27 18:14 ` Mark Brown
2026-08-27 21:27 ` Edgecombe, Rick P
2026-08-27 21:41 ` Mark Brown
2026-08-27 22:37 ` Edgecombe, Rick P
2026-08-28 13:27 ` Mark Brown
2026-08-28 16:48 ` Edgecombe, Rick P
2026-08-28 17:11 ` Mark Brown
2026-09-09 17:57 ` Bill Roberts
2026-09-09 18:06 ` Mark Brown
2026-09-09 20:01 ` Bill Roberts
2026-09-10 14:19 ` Bill Roberts [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=615d5d1a-5266-4b83-bff2-21c8f3840040@foss.arm.com \
--to=bill.roberts@foss.arm.com \
--cc=andrew@sifive.com \
--cc=broonie@kernel.org \
--cc=dave.hansen@linux.intel.com \
--cc=debug@rivosinc.com \
--cc=jesse.huang@sifive.com \
--cc=kito.cheng@sifive.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=rick.p.edgecombe@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox