Re: [PATCH v6 3/4] rseq: Make rseq work with protection keys

From: Ingo Molnar
Date: Mon Mar 10 2025 - 14:51:49 EST



* Dmitry Vyukov <dvyukov@xxxxxxxxxx> wrote:

> > >> If an application registers rseq, and ever switches to another
> > >> pkey protection (such that the rseq becomes inaccessible), then
> > >> any context switch will cause failure in
> > >> __rseq_handle_notify_resume() attempting to read/write struct
> > >> rseq and/or rseq_cs. Since context switches are asynchronous and
> > >> are outside of the application control (not part of the
> > >> restricted code scope), temporarily switch to pkey value that
> > >> allows access to the 0 (default) PKEY.
> > >>
> > >> Signed-off-by: Dmitry Vyukov <dvyukov@xxxxxxxxxx>
> > >> Cc: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx>
> > >> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> > >> Cc: "Paul E. McKenney" <paulmck@xxxxxxxxxx>
> > >> Cc: Boqun Feng <boqun.feng@xxxxxxxxx>
> > >> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> > >> Cc: Ingo Molnar <mingo@xxxxxxxxxx>
> > >> Cc: Borislav Petkov <bp@xxxxxxxxx>
> > >> Cc: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
> > >> Cc: "H. Peter Anvin" <hpa@xxxxxxxxx>
> > >> Cc: Aruna Ramakrishna <aruna.ramakrishna@xxxxxxxxxx>
> > >> Cc: x86@xxxxxxxxxx
> > >> Cc: linux-kernel@xxxxxxxxxxxxxxx
> > >> Fixes: d7822b1e24f2 ("rseq: Introduce restartable sequences system call")
> > >
> > > Any remaining concerns with this series?
> > >
> > > What tree should it go into?
> >
> > Usually the rseq bits go through the -tip tree.
>
> Thomas, Ingo, can you please take this to -tip tree? Or who would that be?

I was waiting whether Dave Hansen would have an opinion on this series.

Also, could you please add all the new Reviewed-by tags for the next
version, plus there was still a bit of a discussion on patch #4, has
that been resolved?

Thanks,

Ingo