[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z74giMre3SJo-3Zw@gmail.com>
Date: Tue, 25 Feb 2025 20:56:56 +0100
From: Ingo Molnar <mingo@...nel.org>
To: Michael Jeanson <mjeanson@...icios.com>
Cc: Peter Zijlstra <peterz@...radead.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
"Paul E. McKenney" <paulmck@...nel.org>,
Boqun Feng <boqun.feng@...il.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] rseq: update kernel fields in lockstep with
CONFIG_DEBUG_RSEQ
* Michael Jeanson <mjeanson@...icios.com> wrote:
> With CONFIG_DEBUG_RSEQ=y, an in-kernel copy of the read-only fields is
> kept synchronized with the user-space fields. Ensure the updates are
> done in lockstep in case we error out on a write to user-space.
>
> Fixes: 7d5265ffcd8b ("rseq: Validate read-only fields under DEBUG_RSEQ config")
> Signed-off-by: Michael Jeanson <mjeanson@...icios.com>
> Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
> ---
> kernel/rseq.c | 85 +++++++++++++++++++++++++++------------------------
> 1 file changed, 45 insertions(+), 40 deletions(-)
>
> diff --git a/kernel/rseq.c b/kernel/rseq.c
> index 2cb16091ec0a..88aa780f8cf4 100644
> --- a/kernel/rseq.c
> +++ b/kernel/rseq.c
> @@ -26,6 +26,11 @@
> RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL | \
> RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE)
>
> +static struct rseq __user *rseq_user_fields(struct task_struct *t)
> +{
> + return (struct rseq __user *) t->rseq;
Why is this wrapper needed?
task_struct::rseq is already of that exact type AFAICS:
struct rseq __user *rseq;
Thanks,
Ingo
Powered by blists - more mailing lists