]> git.baikalelectronics.ru Git - kernel.git/commit
x86/unwind: Fix last frame check for aligned function stacks
authorJosh Poimboeuf <jpoimboe@redhat.com>
Tue, 14 Mar 2017 04:27:47 +0000 (23:27 -0500)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 14 Mar 2017 20:51:57 +0000 (21:51 +0100)
commit3d46a3e6656083d202f5948818ee8245e227398a
tree560b56ad4a1fa1b0bb7749e419226b68f015db7d
parentbf6146e48f8c1e72886d108427fce024aa250cbe
x86/unwind: Fix last frame check for aligned function stacks

Pavel Machek reported the following warning on x86-32:

  WARNING: kernel stack frame pointer at f50cdf98 in swapper/2:0 has bad value   (null)

The warning is caused by the unwinder not realizing that it reached the
end of the stack, due to an unusual prologue which gcc sometimes
generates for aligned stacks.  The prologue is based on a gcc feature
called the Dynamic Realign Argument Pointer (DRAP).  It's almost always
enabled for aligned stacks when -maccumulate-outgoing-args isn't set.

This issue is similar to the one fixed by the following commit:

  5b586d6051df ("x86/unwind: Adjust last frame check for aligned function stacks")

... but that fix was specific to x86-64.

Make the fix more generic to cover x86-32 as well, and also ensure that
the return address referred to by the frame pointer is a copy of the
original return address.

Fixes: 0bbeca440d93 ("x86/unwind: Create stack frames for saved syscall registers")
Reported-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/50d4924db716c264b14f1633037385ec80bf89d2.1489465609.git.jpoimboe@redhat.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/kernel/unwind_frame.c