From: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
To: "jeffxu@google.com" <jeffxu@google.com>,
"jeffxu@chromium.org" <jeffxu@chromium.org>
Cc: "dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
"x86@kernel.org" <x86@kernel.org>,
"jannh@google.com" <jannh@google.com>,
"andrew.brownsword@oracle.com" <andrew.brownsword@oracle.com>,
"matthias.neugschwandtner@oracle.com"
<matthias.neugschwandtner@oracle.com>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"aruna.ramakrishna@oracle.com" <aruna.ramakrishna@oracle.com>,
"sroettger@google.com" <sroettger@google.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"keescook@chromium.org" <keescook@chromium.org>
Subject: Re: [RFC PATCH v2 1/1] x86/pkeys: update PKRU to enable pkey 0 before XSAVE
Date: Fri, 26 Apr 2024 16:33:31 +0000 [thread overview]
Message-ID: <d0162c76c25bc8e1c876aebe8e243ff2e6862359.camel@intel.com> (raw)
In-Reply-To: <CABi2SkVvGWa0=Q9AEkTGAr6f_hZ54Ekrxw5CdgvrRKWtNPNkng@mail.gmail.com>
On Fri, 2024-04-26 at 09:13 -0700, Jeff Xu wrote:
> > > I’m wary about reordering anything here. Also, this code is not aware of
> > > the altstack permissions. I’m wondering if wrpkru(0) is needed here too.
> > >
> > We can't change PKRU after restore_sigcontext, the calling thread
> > would have PKRU 0, not the original PKRU from before handling the
> > signal.
>
> probably putting restore_altstack ahead of restore_sigcontext would be
> good enough.
> restore_altstack doesn't seem to need to be after restore_sigcontex,
> it reads data
> from the sigframe and calls do_sigaltstack to update the current struct.
Just was CCed, and haven't reviewed the whole thread.
But I hit an issue with the ordering in setting up a signal frame. I noted that
the ordering in sigreturn was potentially wrong in the same way:
https://lore.kernel.org/lkml/20231107182251.91276-1-rick.p.edgecombe@intel.com/
It might be useful analysis.
next prev parent reply other threads:[~2024-04-26 16:33 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-21 21:56 [RFC PATCH v2 0/1] x86/pkeys: update PKRU to enable pkey 0 Aruna Ramakrishna
2024-03-21 21:56 ` [RFC PATCH v2 1/1] x86/pkeys: update PKRU to enable pkey 0 before XSAVE Aruna Ramakrishna
2024-03-22 9:46 ` Ingo Molnar
2024-03-22 18:30 ` Aruna Ramakrishna
2024-04-25 22:03 ` jeffxu
2024-03-22 15:40 ` Dave Hansen
2024-03-22 18:28 ` Aruna Ramakrishna
2024-04-25 21:05 ` jeffxu
2024-04-25 22:49 ` Aruna Ramakrishna
2024-04-26 0:12 ` Jeff Xu
2024-04-26 16:13 ` Jeff Xu
2024-04-26 16:33 ` Edgecombe, Rick P [this message]
2024-04-26 17:13 ` Jeff Xu
2024-04-25 21:58 ` jeffxu
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=d0162c76c25bc8e1c876aebe8e243ff2e6862359.camel@intel.com \
--to=rick.p.edgecombe@intel.com \
--cc=andrew.brownsword@oracle.com \
--cc=aruna.ramakrishna@oracle.com \
--cc=dave.hansen@linux.intel.com \
--cc=jannh@google.com \
--cc=jeffxu@chromium.org \
--cc=jeffxu@google.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matthias.neugschwandtner@oracle.com \
--cc=sroettger@google.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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