[PATCH] ARM: pass syscall return value to sys_exit tracepoint

Will Deacon will.deacon at arm.com
Fri Dec 7 11:01:42 EST 2012


On Fri, Dec 07, 2012 at 10:45:40AM +0000, Mark Rutland wrote:
> On Tue, Dec 04, 2012 at 11:55:26AM +0000, Will Deacon wrote:
> > +asmlinkage void syscall_trace_exit(struct pt_regs *regs)
> >  {
> > -	current_thread_info()->syscall = scno;
> > -
> > -	if (test_thread_flag(TIF_SYSCALL_TRACE))
> > -		scno = tracehook_report_syscall(regs, PTRACE_SYSCALL_EXIT);
> 
> I see here we used to test TIF_SYSCALL_TRACE...
> 
> > +	/*
> > +	 * Audit the syscall before anything else, as a debugger may
> > +	 * come in and change the current registers.
> > +	 */
> > +	audit_syscall_exit(regs);
> >  
> > +	/*
> > +	 * Note that we haven't updated the ->syscall field for the
> > +	 * current thread. This isn't a problem because it will have
> > +	 * been set on syscall entry and there hasn't been an opportunity
> > +	 * for a PTRACE_SET_SYSCALL since then.
> > +	 */
> >  	if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
> > -		trace_sys_exit(regs, scno);
> > +		trace_sys_exit(regs, regs_return_value(regs));
> >  
> > -	audit_syscall_exit(regs);
> > -
> > -	return scno;
> > +	tracehook_report_syscall(regs, PTRACE_SYSCALL_EXIT);
> 
> And here we don't. Restoring the test makes boot complete, and audit and
> tracing seem to be happy afterwards.
> 
> With the test restored,
> Tested-by: Mark Rutland <mark.rutland at arm.com>

Cheers Mark, I'll fix this oversight and stick it in the patch system with
your tag.

Will



More information about the linux-arm-kernel mailing list