Re: [PATCH] net/nfc: Fix A-B/B-A deadlock between nfc_unregister_device and rfkill_fop_write
From: Krzysztof Kozlowski
Date: Fri Aug 15 2025 - 01:56:28 EST
On 14/08/2025 19:31, Yunseong Kim wrote:
> A potential deadlock due to A-B/B-A deadlock exists between the NFC core
> and the RFKill subsystem, involving the NFC device lock and the
> rfkill_global_mutex.
>
> This issue is particularly visible on PREEMPT_RT kernels, which can
> report the following warning:
Why are not you crediting syzbot and its report?
there is clear INSTRUCTION in that email from Syzbot.
>
> | rtmutex deadlock detected
> | WARNING: CPU: 0 PID: 22729 at kernel/locking/rtmutex.c:1674 rt_mutex_handle_deadlock+0x68/0xec kernel/locking/rtmutex.c:-1
> | Modules linked in:
> | CPU: 0 UID: 0 PID: 22729 Comm: syz.7.2187 Kdump: loaded Not tainted 6.17.0-rc1-00001-g1149a5db27c8-dirty #55 PREEMPT_RT
> | Hardware name: QEMU KVM Virtual Machine, BIOS 2025.02-8ubuntu1 06/11/2025
> | pstate: 63400005 (nZCv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--)
> | pc : rt_mutex_handle_deadlock+0x68/0xec kernel/locking/rtmutex.c:-1
> | lr : rt_mutex_handle_deadlock+0x40/0xec kernel/locking/rtmutex.c:1674
> | sp : ffff8000967c7720
> | x29: ffff8000967c7720 x28: 1fffe0001946d182 x27: dfff800000000000
> | x26: 0000000000000001 x25: 0000000000000003 x24: 1fffe0001946d00b
> | x23: 1fffe0001946d182 x22: ffff80008aec8940 x21: dfff800000000000
> | x20: ffff0000ca368058 x19: ffff0000ca368c10 x18: ffff80008af6b6e0
> | x17: 1fffe000590b8088 x16: ffff80008046cc08 x15: 0000000000000001
> | x14: 1fffe000590ba990 x13: 0000000000000000 x12: 0000000000000000
> | x11: ffff6000590ba991 x10: 0000000000000002 x9 : 0fe446e029bcfe00
> | x8 : 0000000000000000 x7 : 0000000000000000 x6 : 000000000000003f
> | x5 : 0000000000000001 x4 : 0000000000001000 x3 : ffff800080503efc
> | x2 : 0000000000000001 x1 : 0000000000000001 x0 : 0000000000000001
This all is irrelevant, really. Trim the log.
> | Call trace:
> | rt_mutex_handle_deadlock+0x68/0xec kernel/locking/rtmutex.c:-1 (P)
> | __rt_mutex_slowlock+0x1cc/0x480 kernel/locking/rtmutex.c:1734
> | __rt_mutex_slowlock_locked kernel/locking/rtmutex.c:1760 [inline]
> | rt_mutex_slowlock+0x140/0x21c kernel/locking/rtmutex.c:1800
Best regards,
Krzysztof