diff options
author | Ravi Bangoria <[email protected]> | 2017-04-11 10:38:13 +0530 |
---|---|---|
committer | Michael Ellerman <[email protected]> | 2017-04-18 20:19:21 +1000 |
commit | 9e1ba4f27f018742a1aa95d11e35106feba08ec1 (patch) | |
tree | 83f0eb11eedc5dace781877ad176e6bfac8abac6 /net/core/netpoll.c | |
parent | 4749228f022893faf54a3dbc70796f78b7d4f342 (diff) |
powerpc/kprobe: Fix oops when kprobed on 'stdu' instruction
If we set a kprobe on a 'stdu' instruction on powerpc64, we see a kernel
OOPS:
Bad kernel stack pointer cd93c840 at c000000000009868
Oops: Bad kernel stack pointer, sig: 6 [#1]
...
GPR00: c000001fcd93cb30 00000000cd93c840 c0000000015c5e00 00000000cd93c840
...
NIP [c000000000009868] resume_kernel+0x2c/0x58
LR [c000000000006208] program_check_common+0x108/0x180
On a 64-bit system when the user probes on a 'stdu' instruction, the kernel does
not emulate actual store in emulate_step() because it may corrupt the exception
frame. So the kernel does the actual store operation in exception return code
i.e. resume_kernel().
resume_kernel() loads the saved stack pointer from memory using lwz, which only
loads the low 32-bits of the address, causing the kernel crash.
Fix this by loading the 64-bit value instead.
Fixes: be96f63375a1 ("powerpc: Split out instruction analysis part of emulate_step()")
Cc: [email protected] # v3.18+
Signed-off-by: Ravi Bangoria <[email protected]>
Reviewed-by: Naveen N. Rao <[email protected]>
Reviewed-by: Ananth N Mavinakayanahalli <[email protected]>
[mpe: Change log massage, add stable tag]
Signed-off-by: Michael Ellerman <[email protected]>
Diffstat (limited to 'net/core/netpoll.c')
0 files changed, 0 insertions, 0 deletions