[PATCH] ARM: Fix restoration of IP scratch register when auditing syscalls

Russell King - ARM Linux linux at arm.linux.org.uk
Mon Apr 30 15:00:15 EDT 2012


On Mon, Apr 30, 2012 at 11:07:46AM +0100, Will Deacon wrote:
> diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
> index 80abafb..bfcadc0 100644
> --- a/arch/arm/kernel/ptrace.c
> +++ b/arch/arm/kernel/ptrace.c
> @@ -916,14 +916,7 @@ asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno)
>  {
>         unsigned long ip;
>  
> -       /*
> -        * Save IP.  IP is used to denote syscall entry/exit:
> -        *  IP = 0 -> entry, = 1 -> exit
> -        */
> -       ip = regs->ARM_ip;
> -       regs->ARM_ip = why;
> -
> -       if (!ip)
> +       if (why)

Umm yes, that original code is complete crap, because the old IP value
has no meaning what so ever.  The replacement looks much better here.



More information about the linux-arm-kernel mailing list