Skip to content

Commit 5239650

Browse files
npigginmpe
authored andcommitted
powerpc/64s: Fix i-side SLB miss bad address handler saving nonvolatile GPRs
The SLB bad address handler's trap number fixup does not preserve the low bit that indicates nonvolatile GPRs have not been saved. This leads save_nvgprs to skip saving them, and subsequent functions and return from interrupt will think they are saved. This causes kernel branch-to-garbage debugging to not have correct registers, can also cause userspace to have its registers clobbered after a segfault. Fixes: f0f558b ("powerpc/mm: Preserve CFAR value on SLB miss caused by access to bogus address") Cc: [email protected] # v4.9+ Signed-off-by: Nicholas Piggin <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent a5d4b58 commit 5239650

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/powerpc/kernel/exceptions-64s.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ EXC_COMMON_BEGIN(bad_addr_slb)
706706
ld r3, PACA_EXSLB+EX_DAR(r13)
707707
std r3, _DAR(r1)
708708
beq cr6, 2f
709-
li r10, 0x480 /* fix trap number for I-SLB miss */
709+
li r10, 0x481 /* fix trap number for I-SLB miss */
710710
std r10, _TRAP(r1)
711711
2: bl save_nvgprs
712712
addi r3, r1, STACK_FRAME_OVERHEAD

0 commit comments

Comments
 (0)