[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <C1AC58DD-70DC-49C3-A590-2A0198AE974D@oracle.com>
Date: Thu, 30 Oct 2025 21:52:25 +0000
From: Prakash Sangappa <prakash.sangappa@...cle.com>
To: Thomas Gleixner <tglx@...utronix.de>
CC: LKML <linux-kernel@...r.kernel.org>,
        Michael Jeanson
	<mjeanson@...icios.com>, Jens Axboe <axboe@...nel.dk>,
        Mathieu Desnoyers
	<mathieu.desnoyers@...icios.com>,
        Peter Zijlstra <peterz@...radead.org>,
        "Paul E. McKenney" <paulmck@...nel.org>,
        "x86@...nel.org" <x86@...nel.org>,
        Sean Christopherson <seanjc@...gle.com>, Wei Liu <wei.liu@...nel.org>
Subject: Re: [patch V6 20/31] rseq: Replace the original debug implementation
> On Oct 27, 2025, at 1:45 AM, Thomas Gleixner <tglx@...utronix.de> wrote:
> 
> Just utilize the new infrastructure and put the original one to rest.
> 
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
[…]
> 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;
-Prakash
> + if (likely(!csaddr))
> return;
> - if (rseq_get_rseq_cs(t, &rseq_cs) || in_rseq_cs(ip, &rseq_cs))
> - force_sig(SIGSEGV);
> + if (unlikely(csaddr >= TASK_SIZE))
> + goto fail;
> + if (rseq_debug_update_user_cs(t, regs, csaddr))
> + return;
> +fail:
> + force_sig(SIGSEGV);
> }
> -
> #endif
> 
> /*
> 
> 
Powered by blists - more mailing lists
 
