[PATCH 2/5] ARM: mm: fault: Enable interrupts before invoking __do_user_fault()
Sebastian Andrzej Siewior
bigeasy at linutronix.de
Wed Oct 29 08:59:15 PDT 2025
From: "Yadi.hu" <yadi.hu at windriver.com>
In the !LPAE case __do_user_fault() is invoked from do_bad_area(). If a
user pointer cause the page fault then a signal is sent.
Sending a signal requires to acquire sighand_struct::siglock which is a
spinlock_t. On PREEMPT_RT spinlock_t becomes a sleeping spin lock which
requires interrupts to be enabled. Since the calling context is user
land, interrupts must have been enabled so it is fine to enable them in
this case.
Enable interrupts in do_bad_area() before invoking __do_user_fault().
[bigeasy: Initial patch/ report by Yadi. Maintained the patch and redid
the patch description since]
Signed-off-by: Yadi.hu <yadi.hu at windriver.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
---
arch/arm/mm/fault.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index 5d28c28e877c1..ad58c1e22a5f9 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -218,6 +218,7 @@ void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
if (user_mode(regs)) {
if (addr >= TASK_SIZE)
harden_branch_predictor();
+ local_irq_enable();
__do_user_fault(addr, fsr, SIGSEGV, SEGV_MAPERR, regs);
} else {
__do_kernel_fault(mm, addr, fsr, regs);
--
2.51.0
More information about the linux-arm-kernel
mailing list