Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Bill Roberts <bill.roberts@foss.arm.com>
To: Mark Brown <broonie@kernel.org>,
	"Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
Cc: Jesse Huang <jesse.huang@sifive.com>,
	"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: Wed, 9 Sep 2026 15:01:10 -0500	[thread overview]
Message-ID: <c5367968-0e0d-4583-8ac9-efb3bb5b2983@foss.arm.com> (raw)
In-Reply-To: <522bcf96-499c-491b-aaf0-34e6bbd42929@sirena.org.uk>

>>>> unsigned long locked = 0x2; // Kernel Task State -> LOCK WRITE
>>>> unsigned long cur_val = 0x3; // Kernel Task State -> WRITE and SHADOWSTACK
>>>> ENABLED
>>>> unsigned long new_val = 0x0; // Userspace Feature Change via syscall ->
>>>> DISABLE
>>>> | x86-64 | risc-v | arm64 |
>>>> | ---------- | -------- | --------- |
>>>> | Works  | Fails  | Fails     |
>>> I would not have expected that combination to work at all with the
>>> prctl() (as opposed to arch_prctl()) interface TBH, if you've locked
>>> write on you shouldn't be able to disable it.  The reason that works on
>>> x86 at the minute is that for x86 you can only change one bit at a time
>>> so the new value when disabling is effectively 0x2, not 0x0.
>> Yes, this is exactly what I am pointing out. Implementation aside, is that
>> the behavior we want?
> It seems more helpful to support changing more than one bit at once.
+ Rick in "to", I want him to weigh in as well.

I think we're still miscommunicating.  The issue is, that in the current
interface for x86 via arch_prctl, which is one bit at a time, the explicit
locking of write can be undone via turning off the shadow stack. Should
that succeed, or should that fail since it implicitly turns off write? 
Should
we preserve that as we port to prctl? Should we change that in x86
arch_prctl, was that intended?



  reply	other threads:[~2026-09-09 20:01 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 [this message]
2026-09-10 14:19       ` Bill Roberts

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=c5367968-0e0d-4583-8ac9-efb3bb5b2983@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