summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/lib
diff options
context:
space:
mode:
authorKamalesh Babulal2017-09-20 12:19:51 +0200
committerMichael Ellerman2017-10-10 06:27:42 +0200
commite36a82ee4c514a2f4f8fa30c780ad059282f5d64 (patch)
tree7648167660b5bfba12cfca281966af9d6404b19e /arch/powerpc/lib
parentpowerpc/powernv: Increase memory block size to 1GB on radix (diff)
downloadkernel-qcow2-linux-e36a82ee4c514a2f4f8fa30c780ad059282f5d64.tar.gz
kernel-qcow2-linux-e36a82ee4c514a2f4f8fa30c780ad059282f5d64.tar.xz
kernel-qcow2-linux-e36a82ee4c514a2f4f8fa30c780ad059282f5d64.zip
powerpc/livepatch: Fix livepatch stack access
While running stress test with livepatch module loaded, kernel bug was triggered. cpu 0x5: Vector: 400 (Instruction Access) at [c0000000eb9d3b60] 5:mon> t [c0000000eb9d3de0] c0000000eb9d3e30 (unreliable) [c0000000eb9d3e30] c000000000008ab4 hardware_interrupt_common+0x114/0x120 --- Exception: 501 (Hardware Interrupt) at c000000000053040 livepatch_handler+0x4c/0x74 [c0000000eb9d4120] 0000000057ac6e9d (unreliable) [d0000000089d9f78] 2e0965747962382e SP (965747962342e09) is in userspace When an interrupt occurs during the livepatch_handler execution, it's possible for the livepatch_stack and/or thread_info to be corrupted. eg: Task A Interrupt Handler ========= ================= livepatch_handler: mr r0, r1 ld r1, TI_livepatch_sp(r12) hardware_interrupt_common: do_IRQ+0x8: mflr r0 <- saved stack pointer is overwritten bl _mcount ... std r27,-40(r1) <- overwrite of thread_info() lis r2, STACK_END_MAGIC@h ori r2, r2, STACK_END_MAGIC@l ld r12, -8(r1) Fix the corruption by using r11 register for livepatch stack manipulation, instead of shuffling task stack and livepatch stack into r1 register. Using r11 register also avoids disabling/enabling irq's while setting up the livepatch stack. Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> Reviewed-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> Reviewed-by: Balbir Singh <bsingharora@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/lib')
0 files changed, 0 insertions, 0 deletions