Skip to content
Commit a9788960 authored by He Zhe's avatar He Zhe Committed by Bruce Ashfield
Browse files

arm64: signal: Delay calling signals in atomic

Debugging with breakpoints on arm64 and RT would trigger the following
call trace. When CONFIG_PREEMPT_RT is enabled, spin_locks become mutexes,
and one of these is the spin lock used in signal handling.

BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:969
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 17192, name: multi-timer
INFO: lockdep is turned off.
Preemption disabled at:
[<ffffffc01003bbf0>] debug_exception_enter+0x20/0x70
CPU: 1 PID: 17192 Comm: multi-timer Not tainted 5.10.63-rt47-yocto-preempt-rt #1
Hardware name: Freescale S32G274 (DT)
Call trace:
 dump_backtrace+0x0/0x1d4
 show_stack+0x24/0x30
 dump_stack+0xf0/0x13c
 ___might_sleep+0x17c/0x1f0
 rt_spin_lock+0x6c/0x104
 force_sig_info_to_task+0x30/0x12c
 force_sig_fault+0x58/0x80
 arm64_force_sig_fault+0x4c/0x7c
 send_user_sigtrap+0x50/0x84
 brk_handler+0x40/0x70
 do_debug_exception+0x78/0x194
 el0_dbg+0x34/0x54
 el0_sync_handler+0x110/0x1b0
 el0_sync+0x180/0x1c0

Fix potential sleep while atomic in the similar way of
2dbbc3a07009 ("signal/x86: Delay calling signals in atomic")

Define ARCH_RT_DELAYS_SIGNAL_SEND to enable delaying action in
force_sig_info_to_task. Add actual sending action to arm64 specific path.

Link: https://lore.kernel.org/all/20211015170325.li5rugf6u4rghkrd@linutronix.de/


Back ported for 5.10
Signed-off-by: default avatarHe Zhe <zhe.he@windriver.com>
Signed-off-by: default avatarBruce Ashfield <bruce.ashfield@gmail.com>
parent 8048444f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment