Re: Re [PATCH v5 4/5] x86/pkeys: Restore altstack before sigcontext
From: Jeff Xu
Date: Tue Jun 11 2024 - 18:17:12 EST
On Tue, Jun 11, 2024 at 7:08 AM Aruna Ramakrishna
<aruna.ramakrishna@xxxxxxxxxx> wrote:
>
>
>
> > On Jun 10, 2024, at 2:44 PM, jeffxu@xxxxxxxxxxxx wrote:
> >
> > Can we we move this patch to the first of the series? this can be an
> > independent patch, the problem not only affect PKRU, but also other
> > scenarios, as Rick pointed out in [1]
> >
> > [1] https://lore.kernel.org/lkml/d0162c76c25bc8e1c876aebe8e243ff2e6862359.camel@xxxxxxxxx/
> >
> > -Jeff
>
> For this patch set, the issue with rt_sigreturn() is only exposed after patch 3/5 - i.e., when
> copy_fpregs_to_sigframe() calls update_pkru_in_sigframe() to update the PKRU value to
> user-specified PKRU that might disable pkey 0 access, thus breaking restore_altstack().
> So it seemed logical to me to have this fix as patch 4/5 of this series. I’m not strongly
> opposed to moving this to patch 1/5, but this ordering is easier to understand (I think).
> But if this patch needs to be broken out of this patchset and submitted independently
> (for the other scenarios you mentioned) - I can do that.
>
My main thought is that Rick mentioned this can be a cross-arch changes [1]
and we can start with x86/64 and other arches might follow.
[1] https://lore.kernel.org/lkml/20231107182251.91276-1-rick.p.edgecombe@xxxxxxxxx/
Thanks
-Jeff
> Thanks,
> Aruna