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

Josh Boyer jwboyer at redhat.com
Mon Apr 30 16:47:50 UTC 2012


On Sun, Apr 29, 2012 at 02:40:01AM -0400, Jon Masters wrote:
> 
> 
> -------- Original Message --------
> Subject: [PATCH] ARM: Fix restoration of IP scratch register when
> auditing syscalls
> Date: Sun, 29 Apr 2012 02:38:24 -0400
> From: Jon Masters <jcm at jonmasters.org>
> To: Linux ARM Kernel <linux-arm-kernel at lists.infradead.org>
> CC: Jon Masters <jcm at redhat.com>, Al Viro <viro at zeniv.linux.org.uk>,
>     Eric Paris <eparis at redhat.com>, Jon Masters <jcm at jonmasters.org>
> 
> The audit subsystem builds upon ptrace to record system calls. This is done
> in a couple of places (on return from fork into a new task, on exit from
> the SWI vector), using calls to syscall_trace. The latter function abuses
> the userspace intra-procedure scratch register (regs->ARM_ip, aka r12),
> and intends to restore it prior to return to userspace. Unfortunately,
> there are cases where we will return to userspace without restoring.
> 
> If we are in fact not ptracing but are merely auditing calls, we will
> happily trash the content of ip but will exit to userspace without
> restoring the value. It just so happens that GLIBC uses ip as a
> storage for the TLS thread pointer info, and bad things result.
> 
> The fix is simply to have an additional out when not ptracing.
> 
> Signed-off-by: Jon Masters <jcm at jonmasters.org>
> ---

Going to assume you forwarded this here because you want it applied to
the Fedora kernel.  Likely F17/rawhide?

I'm guessing we probably want to follow
http://lists.infradead.org/pipermail/linux-arm-kernel/2012-April/096951.html
for a bit to see if there are any more iterations of this?

Since it's CC'd to stable, it should get picked up rather quickly if RMK
applies it.

josh


More information about the kernel mailing list