[RFC PATCH v2 2/2] ARM/mm/fault: Enable interrupts before sending signal
Xie Yuanbin
xieyuanbin1 at huawei.com
Thu Nov 27 06:01:09 PST 2025
From: xieyuanbin1 <xieyuanbin1 at huawei.com>
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.
Signed-off-by: xieyuanbin1 <xieyuanbin1 at huawei.com>
Cc: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
---
This patch depends on patch
Link: https://lore.kernel.org/20251029155918.503060-6-bigeasy@linutronix.de
The commit message is copy from:
Link: https://lore.kernel.org/20251029155918.503060-3-bigeasy@linutronix.de
Maybe I should add:
Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
Or something else? Thanks!
arch/arm/mm/fault.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index 5c58072d8235..f8ee1854c854 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -184,10 +184,13 @@ __do_user_fault(unsigned long addr, unsigned int fsr, unsigned int sig,
struct task_struct *tsk = current;
if (addr > TASK_SIZE)
harden_branch_predictor();
+ if (IS_ENABLED(CONFIG_PREEMPT_RT))
+ local_irq_enable();
+
#ifdef CONFIG_DEBUG_USER
if (((user_debug & UDBG_SEGV) && (sig == SIGSEGV)) ||
((user_debug & UDBG_BUS) && (sig == SIGBUS))) {
pr_err("8<--- cut here ---\n");
pr_err("%s: unhandled page fault (%d) at 0x%08lx, code 0x%03x\n",
--
2.51.0
More information about the linux-arm-kernel
mailing list