[PATCH 1/2] ARM: check stack pointer in get_wchan

Russell King - ARM Linux linux at arm.linux.org.uk
Thu Dec 5 06:33:48 EST 2013


On Thu, Dec 05, 2013 at 12:34:24PM +0400, Konstantin Khlebnikov wrote:
> get_wchan() is lockless. Task may wakeup at any time and change its own stack,
> thus each next stack frame may be overwritten and filled with random stuff.
> 
> /proc/$pid/stack interface had been disabled for non-current tasks, see [1]
> But 'wchan' still allows to trigger stack frame unwinding on volatile stack.
> 
> This patch fixes oops in unwind_frame() by adding stack pointer validation on
> each step (as x86 code do), unwind_frame() already checks frame pointer.
> 
> Also I've found another report of this oops on stackoverflow (irony).

Your two patches look fine to me.  Please put them in the patch system
and we'll get them merged - I think they should also be merged into stable
trees too - it looks like this goes all the way back to 2.6.30 kernels.

Thanks.



More information about the linux-arm-kernel mailing list