Re: [patch V6 20/31] rseq: Replace the original debug implementation
From: Thomas Gleixner
Date: Fri Oct 31 2025 - 10:27:26 EST
On Thu, Oct 30 2025 at 21:52, Prakash Sangappa wrote:
>> On Oct 27, 2025, at 1:45 AM, Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
>>
>> Just utilize the new infrastructure and put the original one to rest.
>>
>> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
>> Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx>
> […]
>> void rseq_syscall(struct pt_regs *regs)
>> {
>> - unsigned long ip = instruction_pointer(regs);
>> struct task_struct *t = current;
>> - struct rseq_cs rseq_cs;
>> + u64 csaddr;
>>
>> - if (!t->rseq.usrptr)
>> + if (!t->rseq.event.has_rseq)
>> + return;
>> + if (!get_user(csaddr, &t->rseq.usrptr->rseq_cs))
>> + goto fail;
>
> I believe get_user() would returns non zero(-EFAULT) on failure.
> Noticed test program dies with segv when command line parameter rseq_debug=1 is set.
>
> So, It should be
> if (get_user(csaddr, &t->rseq.usrptr->rseq_cs))
> goto fail;
Indeed