[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d61a3723-919d-40a7-a5ee-89f55bf8c445@efficios.com>
Date: Tue, 25 Feb 2025 15:04:24 -0500
From: Michael Jeanson <mjeanson@...icios.com>
To: Ingo Molnar <mingo@...nel.org>
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
On 2025-02-25 14:56, Ingo Molnar wrote:
>
> * 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;
It's not needed, I can remove it and resend.
Thanks,
Michael
Powered by blists - more mailing lists