Thread (3 messages) 3 messages, 2 authors, 3d ago

Re: [PATCH] powerpc: Restore kuap regs during syscall restart exit

From: Mukesh Kumar Chaurasiya <hidden>
Date: 2026-06-16 05:08:45
Also in: lkml

On Mon, Jun 15, 2026 at 10:51:43AM +0530, Shrikanth Hegde wrote:
Hi Mukesh.

On 6/13/26 6:08 PM, Mukesh Kumar Chaurasiya (IBM) wrote:
quoted
During syscall restart, we block the kuap as we need to replay
interrupts. Which are not restored when we exit to the user, hence we
get a fault which ends up with `bad_access_pkey` and hence crashing the
kernel.

We have already stored the kuap values during the entry, just restore
them when we exit.

Applies on linux-next (next-20260610).
Please re-write the changelog in imperative mood.
i.e Avoid we/you/I.

https://www.kernel.org/doc/html/v4.17/process/submitting-patches.html#describe-your-changes

quoted
Fixes: bee25f97ad24 ("powerpc: Enable GENERIC_ENTRY feature")
Reported-by: Sayali Patil <redacted>
Signed-off-by: Mukesh Kumar Chaurasiya (IBM) <redacted>
---
  arch/powerpc/kernel/interrupt.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/interrupt.c b/arch/powerpc/kernel/interrupt.c
index 89a999be1352..159901d6ba8c 100644
--- a/arch/powerpc/kernel/interrupt.c
+++ b/arch/powerpc/kernel/interrupt.c
@@ -165,7 +165,7 @@ notrace unsigned long syscall_exit_restart(unsigned long r3, struct pt_regs *reg
  		local_irq_disable();
  		goto again;
  	}
-
+	kuap_user_restore(regs);
Please describe where was kuap save was done in the stack.
quoted
  	regs->exit_result |= regs->exit_flags;
  	return regs->exit_result;
Sent out V2 with the requested changes.

Regards,
Mukesh
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help