WARNING in nfc_rfkill_set_block
Subsystems (4)
syzbot
syzbotHello,
syzbot found the following issue on:
HEAD commit: 8f5ae30d69d7 Linux 6.17-rc1 git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=16c80af0580000 kernel config: https://syzkaller.appspot.com/x/.config?x=13f39c6a0380a209 dashboard link: https://syzkaller.appspot.com/bug?extid=535bbe83dfc3ae8d4be3 compiler: Debian clang version 20.1.7 (++20250616065708+6146a88f6049-1~exp1~20250616065826.132), Debian LLD 20.1.7
Unfortunately, I don't have any reproducer for this issue yet.
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/46150b6d2447/disk-8f5ae30d.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/1c604b2b2258/vmlinux-8f5ae30d.xz
kernel image: https://storage.googleapis.com/syzbot-assets/9c542f0972de/bzImage-8f5ae30d.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
------------[ cut here ]------------
rtmutex deadlock detected
WARNING: CPU: 1 PID: 9725 at kernel/locking/rtmutex.c:1674 rt_mutex_handle_deadlock+0x28/0xb0 kernel/locking/rtmutex.c:1674
Modules linked in:
CPU: 1 UID: 0 PID: 9725 Comm: syz.8.874 Tainted: G W 6.17.0-rc1-syzkaller #0 PREEMPT_{RT,(full)}
Tainted: [W]=WARN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
RIP: 0010:rt_mutex_handle_deadlock+0x28/0xb0 kernel/locking/rtmutex.c:1674
Code: 90 90 41 57 41 56 41 55 41 54 53 83 ff dd 0f 85 8c 00 00 00 48 89 f7 e8 c6 2c 01 00 90 48 c7 c7 a0 08 0b 8b e8 79 08 8b f6 90 <0f> 0b 90 90 4c 8d 3d 00 00 00 00 65 48 8b 1c 25 08 b0 f5 91 4c 8d
RSP: 0018:ffffc900043a7950 EFLAGS: 00010246
RAX: 89021558f1df5a00 RBX: ffffc900043a79e0 RCX: ffff888025bb3b80
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc900043a7b00 R08: 0000000000000000 R09: 0000000000000000
R10: dffffc0000000000 R11: ffffed1017124863 R12: 1ffff92000874f38
R13: ffffffff8af82119 R14: ffff888036e55098 R15: dffffc0000000000
FS: 00007fec70d5e6c0(0000) GS:ffff8881269c5000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fce013b0000 CR3: 000000003ebbc000 CR4: 00000000003526f0
Call Trace:
<TASK>
__rt_mutex_slowlock kernel/locking/rtmutex.c:1734 [inline]
__rt_mutex_slowlock_locked kernel/locking/rtmutex.c:1760 [inline]
rt_mutex_slowlock+0x692/0x6e0 kernel/locking/rtmutex.c:1800
__rt_mutex_lock kernel/locking/rtmutex.c:1815 [inline]
__mutex_lock_common kernel/locking/rtmutex_api.c:536 [inline]
mutex_lock_nested+0x16a/0x1d0 kernel/locking/rtmutex_api.c:547
device_lock include/linux/device.h:911 [inline]
nfc_dev_down net/nfc/core.c:143 [inline]
nfc_rfkill_set_block+0x50/0x2e0 net/nfc/core.c:179
rfkill_set_block+0x1e5/0x450 net/rfkill/core.c:346
rfkill_fop_write+0x44e/0x580 net/rfkill/core.c:1301
vfs_write+0x287/0xb40 fs/read_write.c:684
ksys_write+0x14b/0x260 fs/read_write.c:738
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fec72afebe9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fec70d5e038 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fec72d25fa0 RCX: 00007fec72afebe9
RDX: 0000000000000008 RSI: 0000200000000080 RDI: 0000000000000003
RBP: 00007fec72b81e19 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fec72d26038 R14: 00007fec72d25fa0 R15: 00007ffe1f71d718
</TASK>---
This report is generated by a bot. It may contain errors. See https://goo.gl/tpsmEJ for more information about syzbot. syzbot engineers can be reached at [email protected].
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title
If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)
If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report
If you want to undo deduplication, reply with:
#syz undup
On Thu, 14 Aug 2025 16:05:30 -0700
Quoted 18 lines
Hello,
syzbot found the following issue on:
HEAD commit: 8f5ae30d69d7 Linux 6.17-rc1 git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=16c80af0580000 kernel config: https://syzkaller.appspot.com/x/.config?x=13f39c6a0380a209 dashboard link: https://syzkaller.appspot.com/bug?extid=535bbe83dfc3ae8d4be3 compiler: Debian clang version 20.1.7 (++20250616065708+6146a88f6049-1~exp1~20250616065826.132), Debian LLD 20.1.7Unfortunately, I don't have any reproducer for this issue yet.
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/46150b6d2447/disk-8f5ae30d.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/1c604b2b2258/vmlinux-8f5ae30d.xz
kernel image: https://storage.googleapis.com/syzbot-assets/9c542f0972de/bzImage-8f5ae30d.xz
Quoted 5 lines
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by [email protected]------------[ cut here ]------------ rtmutex deadlock detected
Even given the lockdep_set_novalidate_class() in device_initialize(), rtmutex can detect deadlock (the ABBA one [1]?), weird.
[1] Subject: [PATCH] net/nfc: Fix A-B/B-A deadlock between nfc_unregister_device and rfkill_fop_write
https://lore.kernel.org/lkml/[email protected]/
Quoted 66 lines
WARNING: CPU: 1 PID: 9725 at kernel/locking/rtmutex.c:1674 rt_mutex_handle_deadlock+0x28/0xb0 kernel/locking/rtmutex.c:1674 Modules linked in: CPU: 1 UID: 0 PID: 9725 Comm: syz.8.874 Tainted: G W 6.17.0-rc1-syzkaller #0 PREEMPT_{RT,(full)} Tainted: [W]=WARN Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 RIP: 0010:rt_mutex_handle_deadlock+0x28/0xb0 kernel/locking/rtmutex.c:1674 Code: 90 90 41 57 41 56 41 55 41 54 53 83 ff dd 0f 85 8c 00 00 00 48 89 f7 e8 c6 2c 01 00 90 48 c7 c7 a0 08 0b 8b e8 79 08 8b f6 90 <0f> 0b 90 90 4c 8d 3d 00 00 00 00 65 48 8b 1c 25 08 b0 f5 91 4c 8d RSP: 0018:ffffc900043a7950 EFLAGS: 00010246 RAX: 89021558f1df5a00 RBX: ffffc900043a79e0 RCX: ffff888025bb3b80 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc900043a7b00 R08: 0000000000000000 R09: 0000000000000000 R10: dffffc0000000000 R11: ffffed1017124863 R12: 1ffff92000874f38 R13: ffffffff8af82119 R14: ffff888036e55098 R15: dffffc0000000000 FS: 00007fec70d5e6c0(0000) GS:ffff8881269c5000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fce013b0000 CR3: 000000003ebbc000 CR4: 00000000003526f0 Call Trace: <TASK> __rt_mutex_slowlock kernel/locking/rtmutex.c:1734 [inline] __rt_mutex_slowlock_locked kernel/locking/rtmutex.c:1760 [inline] rt_mutex_slowlock+0x692/0x6e0 kernel/locking/rtmutex.c:1800 __rt_mutex_lock kernel/locking/rtmutex.c:1815 [inline] __mutex_lock_common kernel/locking/rtmutex_api.c:536 [inline] mutex_lock_nested+0x16a/0x1d0 kernel/locking/rtmutex_api.c:547 device_lock include/linux/device.h:911 [inline] nfc_dev_down net/nfc/core.c:143 [inline] nfc_rfkill_set_block+0x50/0x2e0 net/nfc/core.c:179 rfkill_set_block+0x1e5/0x450 net/rfkill/core.c:346 rfkill_fop_write+0x44e/0x580 net/rfkill/core.c:1301 vfs_write+0x287/0xb40 fs/read_write.c:684 ksys_write+0x14b/0x260 fs/read_write.c:738 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fec72afebe9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fec70d5e038 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fec72d25fa0 RCX: 00007fec72afebe9 RDX: 0000000000000008 RSI: 0000200000000080 RDI: 0000000000000003 RBP: 00007fec72b81e19 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fec72d26038 R14: 00007fec72d25fa0 R15: 00007ffe1f71d718 </TASK>---
This report is generated by a bot. It may contain errors. See https://goo.gl/tpsmEJ for more information about syzbot. syzbot engineers can be reached at [email protected].syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-titleIf you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-reportIf you want to undo deduplication, reply with:
#syz undup
syzbot
syzbotsyzbot has found a reproducer for the following issue on:
syzbot has found a reproducer for the following issue on:
HEAD commit: c8bc81a52d5a Merge tag 'arm64-fixes' of git://git.kernel.o.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=1508ce34580000 kernel config: https://syzkaller.appspot.com/x/.config?x=bd9738e00c1bbfb4 dashboard link: https://syzkaller.appspot.com/bug?extid=535bbe83dfc3ae8d4be3 compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8 syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11019a62580000 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1308ce34580000
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/e617000fa273/disk-c8bc81a5.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/7ae3a3f4924d/vmlinux-c8bc81a5.xz
kernel image: https://storage.googleapis.com/syzbot-assets/d68d297e1f87/bzImage-c8bc81a5.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Bluetooth: hci0: Opcode 0x0c1a failed: -110
Bluetooth: hci0: Error when powering off device on rfkill (-110)
------------[ cut here ]------------
rtmutex deadlock detected
WARNING: CPU: 0 PID: 6084 at kernel/locking/rtmutex.c:1674 rt_mutex_handle_deadlock+0x28/0xb0 kernel/locking/rtmutex.c:1674
Modules linked in:
CPU: 0 UID: 0 PID: 6084 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT_{RT,(full)}
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
RIP: 0010:rt_mutex_handle_deadlock+0x28/0xb0 kernel/locking/rtmutex.c:1674
Code: 90 90 41 57 41 56 41 55 41 54 53 83 ff dd 0f 85 8c 00 00 00 48 89 f7 e8 c6 2c 01 00 90 48 c7 c7 80 08 0b 8b e8 79 78 8a f6 90 <0f> 0b 90 90 4c 8d 3d 00 00 00 00 65 48 8b 1c 25 08 e0 f5 91 4c 8d
RSP: 0018:ffffc90003a8f950 EFLAGS: 00010246
RAX: 4a17b3cdcfcd8c00 RBX: ffffc90003a8f9e0 RCX: ffff888034b23b80
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc90003a8fb00 R08: 0000000000000000 R09: 0000000000000000
R10: dffffc0000000000 R11: ffffed1017104863 R12: 1ffff92000751f38
R13: ffffffff8af8b119 R14: ffff88802b77f098 R15: dffffc0000000000
FS: 00007f918c68e6c0(0000) GS:ffff8881268c2000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000558db6b05168 CR3: 0000000040f42000 CR4: 00000000003526f0
Call Trace:
<TASK>
__rt_mutex_slowlock kernel/locking/rtmutex.c:1734 [inline]
__rt_mutex_slowlock_locked kernel/locking/rtmutex.c:1760 [inline]
rt_mutex_slowlock+0x692/0x6e0 kernel/locking/rtmutex.c:1800
__rt_mutex_lock kernel/locking/rtmutex.c:1815 [inline]
__mutex_lock_common kernel/locking/rtmutex_api.c:536 [inline]
mutex_lock_nested+0x16a/0x1d0 kernel/locking/rtmutex_api.c:547
device_lock include/linux/device.h:911 [inline]
nfc_dev_down net/nfc/core.c:143 [inline]
nfc_rfkill_set_block+0x50/0x2e0 net/nfc/core.c:179
rfkill_set_block+0x1e5/0x450 net/rfkill/core.c:346
rfkill_fop_write+0x44e/0x580 net/rfkill/core.c:1301
vfs_write+0x284/0xb40 fs/read_write.c:684
ksys_write+0x14b/0x260 fs/read_write.c:738
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f918d01ebe9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f918c68e038 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f918d255fa0 RCX: 00007f918d01ebe9
RDX: 0000000000000008 RSI: 0000200000000080 RDI: 0000000000000004
RBP: 00007f918d0a1e19 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f918d256038 R14: 00007f918d255fa0 R15: 00007ffcb32fa318
</TASK>---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
Quoted 11 lines
Date: Sun, 31 Aug 2025 00:02:33 -0700
syzbot has found a reproducer for the following issue on:HEAD commit: c8bc81a52d5a Merge tag 'arm64-fixes' of git://git.kernel.o.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=1508ce34580000 kernel config: https://syzkaller.appspot.com/x/.config?x=bd9738e00c1bbfb4 dashboard link: https://syzkaller.appspot.com/bug?extid=535bbe83dfc3ae8d4be3 compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8 syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11019a62580000 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1308ce34580000
Test Kim's patch.
#syz test
net/nfc/core.c +8 -3
@@ -1154,6 +1154,7 @@ EXPORT_SYMBOL(nfc_register_device);void nfc_unregister_device (struct nfc_dev *dev) {int rc; +struct rfkill *rfk =NULL ;pr_debug ("dev_name=%s\n" ,dev_name (&dev->dev));
@@ -1163,14 +1164,18 @@ void nfc_unregister_device(struct nfc_dev *dev) "was removed\n", dev_name(&dev->dev));device_lock (&dev->dev); + dev->shutting_down = true;if (dev->rfkill) { -rfkill_unregister (dev->rfkill); -rfkill_destroy (dev->rfkill); + rfk = dev->rfkill; dev->rfkill =NULL ; } - dev->shutting_down = true;device_unlock (&dev->dev); +if (rfk) { +rfkill_unregister (rfk); +rfkill_destroy (rfk); + } +if (dev->ops->check_presence) {timer_delete_sync (&dev->check_pres_timer);cancel_work_sync (&dev->check_pres_work);
--
syzbot
syzbotsyzbot has tested the proposed patch but the reproducer is still triggering an issue: WARNING in call_timer_fn
Hello,
syzbot has tested the proposed patch but the reproducer is still triggering an issue:
WARNING in call_timer_fn
------------[ cut here ]------------
workqueue: cannot queue hci_cmd_timeout on wq hci0
WARNING: CPU: 1 PID: 29 at kernel/workqueue.c:2256 __queue_work+0x2e5/0x1010 kernel/workqueue.c:2254
Modules linked in:
CPU: 1 UID: 0 PID: 29 Comm: ktimers/1 Not tainted syzkaller #0 PREEMPT_{RT,(full)}
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
RIP: 0010:__queue_work+0x2e5/0x1010 kernel/workqueue.c:2254
Code: 42 80 3c 28 00 74 08 48 89 ef e8 16 a1 93 00 48 8b 75 00 49 81 c6 68 01 00 00 48 c7 c7 60 ed 09 8b 4c 89 f2 e8 ac 3c f9 ff 90 <0f> 0b 90 90 e9 f2 fe ff ff e8 0d 6a 34 00 eb 2e e8 06 6a 34 00 e9
RSP: 0018:ffffc90000a3f828 EFLAGS: 00010046
RAX: d228e4afda57de00 RBX: 0000000000000000 RCX: ffff88801ca99dc0
RDX: 0000000000000100 RSI: 0000000000000000 RDI: 0000000000000100
RBP: ffff888028754998 R08: 0000000000000000 R09: 0000000000000100
R10: dffffc0000000000 R11: ffffed1017124863 R12: dffffc0000000000
R13: dffffc0000000000 R14: ffff88803d644168 R15: ffff88801ca9a8cc
FS: 0000000000000000(0000) GS:ffff8881269c2000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b31e63fff CR3: 00000000281de000 CR4: 00000000003526f0
Call Trace:
<TASK>
call_timer_fn+0x17b/0x5f0 kernel/time/timer.c:1747
expire_timers kernel/time/timer.c:1793 [inline]
__run_timers kernel/time/timer.c:2372 [inline]
__run_timer_base+0x709/0x970 kernel/time/timer.c:2384
run_timer_base kernel/time/timer.c:2393 [inline]
run_timer_softirq+0xb7/0x180 kernel/time/timer.c:2403
handle_softirqs+0x22c/0x710 kernel/softirq.c:579
__do_softirq kernel/softirq.c:613 [inline]
run_ktimerd+0xcf/0x190 kernel/softirq.c:1043
smpboot_thread_fn+0x542/0xa60 kernel/smpboot.c:160
kthread+0x711/0x8a0 kernel/kthread.c:463
ret_from_fork+0x3f9/0x770 arch/x86/kernel/process.c:148
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
</TASK>Tested on:
commit: c8bc81a5 Merge tag 'arm64-fixes' of git://git.kernel.o.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=16ccc1f0580000 kernel config: https://syzkaller.appspot.com/x/.config?x=bd9738e00c1bbfb4 dashboard link: https://syzkaller.appspot.com/bug?extid=535bbe83dfc3ae8d4be3 compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8 patch: https://syzkaller.appspot.com/x/patch.diff?x=17122242580000
Quoted 11 lines
Date: Sun, 31 Aug 2025 00:02:33 -0700
syzbot has found a reproducer for the following issue on:HEAD commit: c8bc81a52d5a Merge tag 'arm64-fixes' of git://git.kernel.o.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=1508ce34580000 kernel config: https://syzkaller.appspot.com/x/.config?x=bd9738e00c1bbfb4 dashboard link: https://syzkaller.appspot.com/bug?extid=535bbe83dfc3ae8d4be3 compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8 syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11019a62580000 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1308ce34580000
Test Kim's patch.
#syz test
net/nfc/core.c +8 -3
@@ -1154,6 +1154,7 @@ EXPORT_SYMBOL(nfc_register_device);void nfc_unregister_device (struct nfc_dev *dev) {int rc; +struct rfkill *rfk =NULL ;pr_debug ("dev_name=%s\n" ,dev_name (&dev->dev));
@@ -1163,14 +1164,18 @@ void nfc_unregister_device(struct nfc_dev *dev) "was removed\n", dev_name(&dev->dev));device_lock (&dev->dev); + dev->shutting_down = true;if (dev->rfkill) { -rfkill_unregister (dev->rfkill); -rfkill_destroy (dev->rfkill); + rfk = dev->rfkill; dev->rfkill =NULL ; } - dev->shutting_down = true;device_unlock (&dev->dev); +if (rfk) { +rfkill_unregister (rfk); +rfkill_destroy (rfk); + } +if (dev->ops->check_presence) {timer_delete_sync (&dev->check_pres_timer);cancel_work_sync (&dev->check_pres_work);
net/bluetooth/hci_core.c +6 -0
@@ -1476,8 +1476,14 @@ static void hci_cmd_timeout(struct work_if (hdev->reset) hdev->reset (hdev); +rcu_read_lock (); +if (hci_dev_test_flag (hdev,HCI_CMD_DRAIN_WORKQUEUE )) { +rcu_read_unlock (); +return ; + }atomic_set (&hdev->cmd_cnt,1 );queue_work (hdev->workqueue, &hdev->cmd_work); +rcu_read_unlock (); }/* HCI ncmd timer function */
--
syzbot
syzbotsyzbot has tested the proposed patch but the reproducer is still triggering an issue:
Hello,
syzbot has tested the proposed patch but the reproducer is still triggering an issue:
BUG: MAX_LOCKDEP_KEYS too low!
BUG: MAX_LOCKDEP_KEYS too low!
turning off the locking correctness validator.
CPU: 0 UID: 0 PID: 25225 Comm: syz.0.3616 Not tainted syzkaller #0 PREEMPT_{RT,(full)}
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
Call Trace:
<TASK>
dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
register_lock_class+0x2e8/0x320 kernel/locking/lockdep.c:1332
__lock_acquire+0x99/0xd20 kernel/locking/lockdep.c:5112
lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5868
touch_wq_lockdep_map+0xcb/0x180 kernel/workqueue.c:3907
__flush_workqueue+0x121/0x14b0 kernel/workqueue.c:3949
drain_workqueue+0xd3/0x390 kernel/workqueue.c:4113
destroy_workqueue+0xbb/0xc70 kernel/workqueue.c:5869
nci_unregister_device+0xb1/0x240 net/nfc/nci/core.c:1316
virtual_ncidev_close+0x59/0x90 drivers/nfc/virtual_ncidev.c:172
__fput+0x45b/0xa80 fs/file_table.c:468
task_work_run+0x1d4/0x260 kernel/task_work.c:227
resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
exit_to_user_mode_loop+0xec/0x110 kernel/entry/common.c:43
exit_to_user_mode_prepare include/linux/irq-entry-common.h:225 [inline]
syscall_exit_to_user_mode_work include/linux/entry-common.h:175 [inline]
syscall_exit_to_user_mode include/linux/entry-common.h:210 [inline]
do_syscall_64+0x2bd/0x3b0 arch/x86/entry/syscall_64.c:100
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f9bb98aebe9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fffc624e4c8 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4
RAX: 0000000000000000 RBX: 0000000000063d39 RCX: 00007f9bb98aebe9
RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003
RBP: 00007f9bb9ae7da0 R08: 0000000000000001 R09: 00000003c624e7bf
R10: 0000001b2c520000 R11: 0000000000000246 R12: 00007f9bb9ae5fac
R13: 00007f9bb9ae5fa0 R14: ffffffffffffffff R15: 00007fffc624e5e0
</TASK>Tested on:
commit: c8bc81a5 Merge tag 'arm64-fixes' of git://git.kernel.o.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=1226c1f0580000 kernel config: https://syzkaller.appspot.com/x/.config?x=bd9738e00c1bbfb4 dashboard link: https://syzkaller.appspot.com/bug?extid=535bbe83dfc3ae8d4be3 compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8 patch: https://syzkaller.appspot.com/x/patch.diff?x=12dac1f0580000
Oh, thank you Hillf, for your help!
Quoted 56 lines · Hillf Danton
Quoted 11 lines
Date: Sun, 31 Aug 2025 00:02:33 -0700
syzbot has found a reproducer for the following issue on:HEAD commit: c8bc81a52d5a Merge tag 'arm64-fixes' of git://git.kernel.o.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=1508ce34580000 kernel config: https://syzkaller.appspot.com/x/.config?x=bd9738e00c1bbfb4 dashboard link: https://syzkaller.appspot.com/bug?extid=535bbe83dfc3ae8d4be3 compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8 syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11019a62580000 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1308ce34580000Test Kim's patch.
#syz test
net/nfc/core.c +8
-3@@ -1154,6 +1154,7 @@ EXPORT_SYMBOL(nfc_register_device);void nfc_unregister_device (struct nfc_dev *dev) {int rc; +struct rfkill *rfk =NULL ;pr_debug ("dev_name=%s\n" ,dev_name (&dev->dev));@@ -1163,14 +1164,18 @@ void nfc_unregister_device(struct nfc_dev *dev) "was removed\n", dev_name(&dev->dev));device_lock (&dev->dev); + dev->shutting_down = true;if (dev->rfkill) { -rfkill_unregister (dev->rfkill); -rfkill_destroy (dev->rfkill); + rfk = dev->rfkill; dev->rfkill =NULL ; } - dev->shutting_down = true;device_unlock (&dev->dev); +if (rfk) { +rfkill_unregister (rfk); +rfkill_destroy (rfk); + } +if (dev->ops->check_presence) {timer_delete_sync (&dev->check_pres_timer);cancel_work_sync (&dev->check_pres_work);net/bluetooth/hci_core.c +2
-0@@ -1476,8 +1476,14 @@ static void hci_cmd_timeout(struct work_if (hdev->reset) hdev->reset (hdev); +rcu_read_lock (); +if (hci_dev_test_flag (hdev,HCI_CMD_DRAIN_WORKQUEUE )) {
net/bluetooth/hci_core.c static void hci_cmd_timeout(struct work_
Quoted 10 lines
net/bluetooth/hci_core.c +4
-1+rcu_read_unlock (); +return ; + }atomic_set (&hdev->cmd_cnt,1 );queue_work (hdev->workqueue, &hdev->cmd_work); +rcu_read_unlock (); }/* HCI ncmd timer function */ --
Last time, as Krzysztof guided, I wanted to try fixing the bugs reported by syzbot, but since it was my first time following this process, I needed to look up the steps. Including the bug I’m seeing now, is there anything else I should do to address these issues?
My plan was to look up the procedure and then revise the patch description before submitting a v2 patch.
Thank you!
Best regards,
Yunseong Kim (金潤成)