Thread (63 messages) 63 messages, 6 authors, 2012-12-06

Re: [ 09/56] x86-32: Fix invalid stack address while in softirq

From: Herton Ronaldo Krzesinski <hidden>
Date: 2012-12-04 13:56:55
Also in: lkml

On Fri, Nov 30, 2012 at 10:55:01AM -0800, Greg Kroah-Hartman wrote:
3.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Robert Richter <redacted>

commit 1022623842cb72ee4d0dbf02f6937f38c92c3f41 upstream.

In 32 bit the stack address provided by kernel_stack_pointer() may
point to an invalid range causing NULL pointer access or page faults
while in NMI (see trace below). This happens if called in softirq
context and if the stack is empty. The address at &regs->sp is then
out of range.

Fixing this by checking if regs and &regs->sp are in the same stack
context. Otherwise return the previous stack pointer stored in struct
thread_info. If that address is invalid too, return address of regs.
This also makes latest 3.4.y build fail with oprofile on i386, needs
also EXPORT_SYMBOL for kernel_stack_pointer (commit
cb57a2b4cff7edf2a4e32c0163200e9434807e0a)

-- 
[]'s
Herton
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help