[v6.1] possible deadlock in nci_close_device (2)

4 views
Skip to first unread message

syzbot

unread,
Sep 17, 2026, 7:39:30 AMSep 17
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 1a8763b93150 Linux 6.1.188
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=12327925580000
kernel config: https://syzkaller.appspot.com/x/.config?x=7e5b41322189806a
dashboard link: https://syzkaller.appspot.com/bug?extid=ddad7434ea7bad960d8d
compiler: Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8
userspace arch: arm64

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/79d582e9ec4f/disk-1a8763b9.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/70e43b512b19/vmlinux-1a8763b9.xz
kernel image: https://storage.googleapis.com/syzbot-assets/7107d5b60093/Image-1a8763b9.gz.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+ddad74...@syzkaller.appspotmail.com

======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.2.66/4611 is trying to acquire lock:
ffff0000dfba2938 ((wq_completion)nfc2_nci_tx_wq){+.+.}-{0:0}, at: __flush_workqueue+0x108/0x1060 kernel/workqueue.c:2809

but task is already holding lock:
ffff0000def62350 (&ndev->req_lock){+.+.}-{3:3}, at: nci_close_device+0xe8/0x57c net/nfc/nci/core.c:560

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #5 (&ndev->req_lock){+.+.}-{3:3}:
__mutex_lock_common+0x1a0/0x1f3c kernel/locking/mutex.c:603
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799
nci_request net/nfc/nci/core.c:148 [inline]
nci_set_local_general_bytes net/nfc/nci/core.c:776 [inline]
nci_start_poll+0x424/0xaa0 net/nfc/nci/core.c:840
nfc_start_poll+0x124/0x284 net/nfc/core.c:225
nfc_genl_start_poll+0x1b0/0x2f4 net/nfc/netlink.c:828
genl_family_rcv_msg_doit+0x210/0x308 net/netlink/genetlink.c:756
genl_family_rcv_msg net/netlink/genetlink.c:833 [inline]
genl_rcv_msg+0x424/0x600 net/netlink/genetlink.c:850
netlink_rcv_skb+0x220/0x3ec net/netlink/af_netlink.c:2516
genl_rcv+0x38/0x50 net/netlink/genetlink.c:861
netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
netlink_unicast+0x5fc/0x80c net/netlink/af_netlink.c:1344
netlink_sendmsg+0x6f0/0x9d8 net/netlink/af_netlink.c:1877
sock_sendmsg_nosec net/socket.c:718 [inline]
__sock_sendmsg net/socket.c:730 [inline]
____sys_sendmsg+0x588/0x90c net/socket.c:2519
___sys_sendmsg net/socket.c:2573 [inline]
__sys_sendmsg+0x288/0x374 net/socket.c:2602
__do_sys_sendmsg net/socket.c:2611 [inline]
__se_sys_sendmsg net/socket.c:2609 [inline]
__arm64_sys_sendmsg+0x80/0x94 net/socket.c:2609
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x290 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x13c/0x258 arch/arm64/kernel/syscall.c:140
do_el0_svc+0x5c/0x134 arch/arm64/kernel/syscall.c:204
el0_svc+0x58/0x128 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

-> #4 (&genl_data->genl_data_mutex){+.+.}-{3:3}:
__mutex_lock_common+0x1a0/0x1f3c kernel/locking/mutex.c:603
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799
nfc_urelease_event_work+0x108/0x2b8 net/nfc/netlink.c:1849
process_one_work+0x7e4/0x13bc kernel/workqueue.c:2292
worker_thread+0x8cc/0xfe8 kernel/workqueue.c:2439
kthread+0x254/0x2e0 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850

-> #3 (nfc_devlist_mutex){+.+.}-{3:3}:
__mutex_lock_common+0x1a0/0x1f3c kernel/locking/mutex.c:603
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799
nfc_register_device+0x48/0x300 net/nfc/core.c:1116
nci_register_device+0x6b8/0x7e4 net/nfc/nci/core.c:1272
virtual_ncidev_open+0x6c/0xd8 drivers/nfc/virtual_ncidev.c:146
misc_open+0x310/0x388 drivers/char/misc.c:145
chrdev_open+0x3d0/0x51c fs/char_dev.c:414
do_dentry_open+0x738/0xf8c fs/open.c:882
vfs_open+0x7c/0x90 fs/open.c:1015
do_open fs/namei.c:3677 [inline]
path_openat+0x1fc0/0x27a0 fs/namei.c:3834
do_filp_open+0x198/0x38c fs/namei.c:3861
do_sys_openat2+0x134/0x3fc fs/open.c:1320
do_sys_open fs/open.c:1336 [inline]
__do_sys_openat fs/open.c:1352 [inline]
__se_sys_openat fs/open.c:1347 [inline]
__arm64_sys_openat+0x11c/0x150 fs/open.c:1347
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x290 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x13c/0x258 arch/arm64/kernel/syscall.c:140
do_el0_svc+0x5c/0x134 arch/arm64/kernel/syscall.c:204
el0_svc+0x58/0x128 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

-> #2 (nci_mutex){+.+.}-{3:3}:
__mutex_lock_common+0x1a0/0x1f3c kernel/locking/mutex.c:603
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799
virtual_nci_send+0x28/0xe4 drivers/nfc/virtual_ncidev.c:54
nci_send_frame net/nfc/nci/core.c:1364 [inline]
nci_tx_work+0x288/0x500 net/nfc/nci/core.c:1527
process_one_work+0x7e4/0x13bc kernel/workqueue.c:2292
worker_thread+0x8cc/0xfe8 kernel/workqueue.c:2439
kthread+0x254/0x2e0 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850

-> #1 ((work_completion)(&ndev->tx_work)){+.+.}-{0:0}:
process_one_work+0x710/0x13bc kernel/workqueue.c:2268
worker_thread+0x8cc/0xfe8 kernel/workqueue.c:2439
kthread+0x254/0x2e0 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850

-> #0 ((wq_completion)nfc2_nci_tx_wq){+.+.}-{0:0}:
check_prev_add kernel/locking/lockdep.c:3095 [inline]
check_prevs_add kernel/locking/lockdep.c:3214 [inline]
validate_chain kernel/locking/lockdep.c:3830 [inline]
__lock_acquire+0x2808/0x6634 kernel/locking/lockdep.c:5063
lock_acquire+0x20c/0x638 kernel/locking/lockdep.c:5678
__flush_workqueue+0x134/0x1060 kernel/workqueue.c:2812
nci_close_device+0x188/0x57c net/nfc/nci/core.c:578
nci_unregister_device+0x78/0x258 net/nfc/nci/core.c:1309
virtual_ncidev_close+0x70/0xb0 drivers/nfc/virtual_ncidev.c:166
__fput+0x1b4/0x7b0 fs/file_table.c:320
____fput+0x20/0x30 fs/file_table.c:348
task_work_run+0x1f4/0x280 kernel/task_work.c:203
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
do_notify_resume+0x20f8/0x2c84 arch/arm64/kernel/signal.c:1151
prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline]
exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline]
el0_svc+0x98/0x128 arch/arm64/kernel/entry-common.c:638
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

other info that might help us debug this:

Chain exists of:
(wq_completion)nfc2_nci_tx_wq --> &genl_data->genl_data_mutex --> &ndev->req_lock

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
lock(&ndev->req_lock);
lock(&genl_data->genl_data_mutex);
lock(&ndev->req_lock);
lock((wq_completion)nfc2_nci_tx_wq);

*** DEADLOCK ***

1 lock held by syz.2.66/4611:
#0: ffff0000def62350 (&ndev->req_lock){+.+.}-{3:3}, at: nci_close_device+0xe8/0x57c net/nfc/nci/core.c:560

stack backtrace:
CPU: 0 PID: 4611 Comm: syz.2.66 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/07/2026
Call trace:
dump_backtrace+0x1c4/0x1f0 arch/arm64/kernel/stacktrace.c:158
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
__dump_stack+0x30/0x40 lib/dump_stack.c:88
dump_stack_lvl+0xf4/0x15c lib/dump_stack.c:106
dump_stack+0x1c/0x5c lib/dump_stack.c:113
print_circular_bug+0x148/0x1b0 kernel/locking/lockdep.c:2048
check_noncircular+0x264/0x2f8 kernel/locking/lockdep.c:2170
check_prev_add kernel/locking/lockdep.c:3095 [inline]
check_prevs_add kernel/locking/lockdep.c:3214 [inline]
validate_chain kernel/locking/lockdep.c:3830 [inline]
__lock_acquire+0x2808/0x6634 kernel/locking/lockdep.c:5063
lock_acquire+0x20c/0x638 kernel/locking/lockdep.c:5678
__flush_workqueue+0x134/0x1060 kernel/workqueue.c:2812
nci_close_device+0x188/0x57c net/nfc/nci/core.c:578
nci_unregister_device+0x78/0x258 net/nfc/nci/core.c:1309
virtual_ncidev_close+0x70/0xb0 drivers/nfc/virtual_ncidev.c:166
__fput+0x1b4/0x7b0 fs/file_table.c:320
____fput+0x20/0x30 fs/file_table.c:348
task_work_run+0x1f4/0x280 kernel/task_work.c:203
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
do_notify_resume+0x20f8/0x2c84 arch/arm64/kernel/signal.c:1151
prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline]
exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline]
el0_svc+0x98/0x128 arch/arm64/kernel/entry-common.c:638
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585
nci: __nci_request: wait_for_completion_interruptible_timeout failed -512
------------[ cut here ]------------
ODEBUG: free active (active state 0) object type: timer_list hint: atomic_set include/linux/atomic/atomic-instrumented.h:-1 [inline]
ODEBUG: free active (active state 0) object type: timer_list hint: nci_data_timer+0x0/0x94 net/nfc/nci/core.c:616
WARNING: CPU: 0 PID: 4611 at lib/debugobjects.c:518 debug_print_object lib/debugobjects.c:515 [inline]
WARNING: CPU: 0 PID: 4611 at lib/debugobjects.c:518 __debug_check_no_obj_freed lib/debugobjects.c:1045 [inline]
WARNING: CPU: 0 PID: 4611 at lib/debugobjects.c:518 debug_check_no_obj_freed+0x2d4/0x454 lib/debugobjects.c:1075
Modules linked in:
CPU: 0 PID: 4611 Comm: syz.2.66 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/07/2026
pstate: 62400005 (nZCv daif +PAN -UAO +TCO -DIT -SSBS BTYPE=--)
pc : debug_print_object lib/debugobjects.c:515 [inline]
pc : __debug_check_no_obj_freed lib/debugobjects.c:1045 [inline]
pc : debug_check_no_obj_freed+0x2d4/0x454 lib/debugobjects.c:1075
lr : debug_print_object lib/debugobjects.c:515 [inline]
lr : __debug_check_no_obj_freed lib/debugobjects.c:1045 [inline]
lr : debug_check_no_obj_freed+0x2d4/0x454 lib/debugobjects.c:1075
sp : ffff800022017890
x29: ffff8000220178c0 x28: ffff0000f54be598 x27: 0000000000000000
x26: ffff800011d3b280 x25: ffff0000def620a0 x24: ffff8000118cd0a4
x23: 1ffff00003914086 x22: ffff0000def62800 x21: dfff800000000000
x20: ffff800011d3b288 x19: ffff0000def62000 x18: 1fffe00033e6997e
x17: ffff8000153bd000 x16: ffff800008043b30 x15: 0000000040000000
x14: 0000000000000001 x13: 1fffe00033e6c070 x12: 0000000000000000
x11: ff00800008048e14 x10: 0000000040000000 x9 : ab8e1ef0a0475d00
x8 : ab8e1ef0a0475d00 x7 : ffff800011d1c160 x6 : ffff80000825ab20
x5 : 0000000000000000 x4 : 0000000000000001 x3 : 0000000000000000
x2 : ffff800022017440 x1 : 0000000000000000 x0 : ffff80000825abb4
Call trace:
debug_print_object lib/debugobjects.c:515 [inline]
__debug_check_no_obj_freed lib/debugobjects.c:1045 [inline]
debug_check_no_obj_freed+0x2d4/0x454 lib/debugobjects.c:1075
slab_free_hook mm/slub.c:1704 [inline]
slab_free_freelist_hook+0x104/0x1e8 mm/slub.c:1755
slab_free mm/slub.c:3687 [inline]
__kmem_cache_free+0xbc/0x21c mm/slub.c:3700
kfree+0xd0/0x1a8 mm/slab_common.c:988
nci_free_device+0x8c/0xa0 net/nfc/nci/core.c:1221
virtual_ncidev_close+0x78/0xb0 drivers/nfc/virtual_ncidev.c:167
__fput+0x1b4/0x7b0 fs/file_table.c:320
____fput+0x20/0x30 fs/file_table.c:348
task_work_run+0x1f4/0x280 kernel/task_work.c:203
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
do_notify_resume+0x20f8/0x2c84 arch/arm64/kernel/signal.c:1151
prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline]
exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline]
el0_svc+0x98/0x128 arch/arm64/kernel/entry-common.c:638
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585
irq event stamp: 6437
hardirqs last enabled at (6437): [<ffff800011c9da4c>] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:151 [inline]
hardirqs last enabled at (6437): [<ffff800011c9da4c>] _raw_spin_unlock_irqrestore+0x48/0xac kernel/locking/spinlock.c:194
hardirqs last disabled at (6436): [<ffff800011c9d870>] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline]
hardirqs last disabled at (6436): [<ffff800011c9d870>] _raw_spin_lock_irqsave+0xa4/0xb0 kernel/locking/spinlock.c:162
softirqs last enabled at (6174): [<ffff80000d55fd90>] spin_unlock_bh include/linux/spinlock.h:396 [inline]
softirqs last enabled at (6174): [<ffff80000d55fd90>] remove_user_radios drivers/net/wireless/mac80211_hwsim.c:5391 [inline]
softirqs last enabled at (6174): [<ffff80000d55fd90>] mac80211_hwsim_netlink_notify+0x31c/0x750 drivers/net/wireless/mac80211_hwsim.c:5409
softirqs last disabled at (6172): [<ffff80000d55fb78>] spin_lock_bh include/linux/spinlock.h:356 [inline]
softirqs last disabled at (6172): [<ffff80000d55fb78>] remove_user_radios drivers/net/wireless/mac80211_hwsim.c:5382 [inline]
softirqs last disabled at (6172): [<ffff80000d55fb78>] mac80211_hwsim_netlink_notify+0x104/0x750 drivers/net/wireless/mac80211_hwsim.c:5409
---[ end trace 0000000000000000 ]---


---
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 syzk...@googlegroups.com.

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

syzbot

unread,
Sep 22, 2026, 12:02:31 PMSep 22
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 0248c33e835e Linux 5.15.221
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=109fc515580000
kernel config: https://syzkaller.appspot.com/x/.config?x=21845b39f8fc6be8
dashboard link: https://syzkaller.appspot.com/bug?extid=5d174ffc03bdcd60d7de
compiler: Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/cdcbd8738a16/disk-0248c33e.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/864175e96c3d/vmlinux-0248c33e.xz
kernel image: https://storage.googleapis.com/syzbot-assets/cb031d3f4011/bzImage-0248c33e.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+5d174f...@syzkaller.appspotmail.com

======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.3.18/4312 is trying to acquire lock:
ffff88807d34c138 ((wq_completion)nfc2_nci_tx_wq){+.+.}-{0:0}, at: flush_workqueue+0x14e/0x1390 kernel/workqueue.c:2830

but task is already holding lock:
ffff88805e9b2350 (&ndev->req_lock){+.+.}-{3:3}, at: nci_close_device+0x102/0x600 net/nfc/nci/core.c:560

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #5 (&ndev->req_lock){+.+.}-{3:3}:
__mutex_lock_common+0x1e5/0x2400 kernel/locking/mutex.c:596
__mutex_lock kernel/locking/mutex.c:729 [inline]
mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
nci_request net/nfc/nci/core.c:148 [inline]
nci_set_local_general_bytes net/nfc/nci/core.c:776 [inline]
nci_start_poll+0x529/0xcc0 net/nfc/nci/core.c:840
nfc_start_poll+0x141/0x2c0 net/nfc/core.c:225
nfc_genl_start_poll+0x1d7/0x340 net/nfc/netlink.c:828
genl_family_rcv_msg_doit net/netlink/genetlink.c:731 [inline]
genl_family_rcv_msg net/netlink/genetlink.c:775 [inline]
genl_rcv_msg+0xd0b/0xfa0 net/netlink/genetlink.c:792
netlink_rcv_skb+0x1e9/0x430 net/netlink/af_netlink.c:2519
genl_rcv+0x24/0x40 net/netlink/genetlink.c:803
netlink_unicast_kernel net/netlink/af_netlink.c:1314 [inline]
netlink_unicast+0x78f/0x940 net/netlink/af_netlink.c:1340
netlink_sendmsg+0x8ba/0xbe0 net/netlink/af_netlink.c:1919
sock_sendmsg_nosec net/socket.c:706 [inline]
__sock_sendmsg net/socket.c:718 [inline]
____sys_sendmsg+0x5be/0x8f0 net/socket.c:2446
___sys_sendmsg+0x236/0x2e0 net/socket.c:2500
__sys_sendmsg net/socket.c:2529 [inline]
__do_sys_sendmsg net/socket.c:2538 [inline]
__se_sys_sendmsg+0x1b7/0x2a0 net/socket.c:2536
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #4 (&genl_data->genl_data_mutex){+.+.}-{3:3}:
__mutex_lock_common+0x1e5/0x2400 kernel/locking/mutex.c:596
__mutex_lock kernel/locking/mutex.c:729 [inline]
mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
nfc_urelease_event_work+0x120/0x310 net/nfc/netlink.c:1833
process_one_work+0x867/0xff0 kernel/workqueue.c:2310
worker_thread+0xad7/0x12a0 kernel/workqueue.c:2457
kthread+0x42e/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

-> #3 (nfc_devlist_mutex){+.+.}-{3:3}:
__mutex_lock_common+0x1e5/0x2400 kernel/locking/mutex.c:596
__mutex_lock kernel/locking/mutex.c:729 [inline]
mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
nfc_register_device+0x38/0x300 net/nfc/core.c:1116
nci_register_device+0x89f/0x9f0 net/nfc/nci/core.c:1276
virtual_ncidev_open+0x55/0xc0 drivers/nfc/virtual_ncidev.c:146
misc_open+0x31f/0x390 drivers/char/misc.c:143
chrdev_open+0x585/0x5f0 fs/char_dev.c:414
do_dentry_open+0x7f7/0xf90 fs/open.c:826
do_open fs/namei.c:3659 [inline]
path_openat+0x2718/0x2fb0 fs/namei.c:3793
do_filp_open+0x1df/0x400 fs/namei.c:3820
do_sys_openat2+0x14b/0x500 fs/open.c:1255
do_sys_open fs/open.c:1271 [inline]
__do_sys_openat fs/open.c:1287 [inline]
__se_sys_openat fs/open.c:1282 [inline]
__x64_sys_openat+0x135/0x160 fs/open.c:1282
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #2 (nci_mutex){+.+.}-{3:3}:
__mutex_lock_common+0x1e5/0x2400 kernel/locking/mutex.c:596
__mutex_lock kernel/locking/mutex.c:729 [inline]
mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
virtual_nci_send+0x1d/0xd0 drivers/nfc/virtual_ncidev.c:54
nci_tx_work+0x19f/0x3a0 net/nfc/nci/core.c:1531
process_one_work+0x867/0xff0 kernel/workqueue.c:2310
worker_thread+0xad7/0x12a0 kernel/workqueue.c:2457
kthread+0x42e/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

-> #1 ((work_completion)(&ndev->tx_work)){+.+.}-{0:0}:
process_one_work+0x7ba/0xff0 kernel/workqueue.c:2286
worker_thread+0xad7/0x12a0 kernel/workqueue.c:2457
kthread+0x42e/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

-> #0 ((wq_completion)nfc2_nci_tx_wq){+.+.}-{0:0}:
check_prev_add kernel/locking/lockdep.c:3053 [inline]
check_prevs_add kernel/locking/lockdep.c:3172 [inline]
validate_chain kernel/locking/lockdep.c:3788 [inline]
__lock_acquire+0x2c66/0x7b50 kernel/locking/lockdep.c:5012
lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5625
flush_workqueue+0x16a/0x1390 kernel/workqueue.c:2830
nci_close_device+0x172/0x600 net/nfc/nci/core.c:578
nci_unregister_device+0x5e/0x250 net/nfc/nci/core.c:1313
virtual_ncidev_close+0x55/0x90 drivers/nfc/virtual_ncidev.c:166
__fput+0x212/0x8c0 fs/file_table.c:311
task_work_run+0x125/0x1a0 kernel/task_work.c:188
tracehook_notify_resume include/linux/tracehook.h:189 [inline]
exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:184
exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:217
__syscall_exit_to_user_mode_work kernel/entry/common.c:299 [inline]
syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:310
do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x66/0xd0

other info that might help us debug this:

Chain exists of:
(wq_completion)nfc2_nci_tx_wq --> &genl_data->genl_data_mutex --> &ndev->req_lock

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
lock(&ndev->req_lock);
lock(&genl_data->genl_data_mutex);
lock(&ndev->req_lock);
lock((wq_completion)nfc2_nci_tx_wq);

*** DEADLOCK ***

1 lock held by syz.3.18/4312:
#0: ffff88805e9b2350 (&ndev->req_lock){+.+.}-{3:3}, at: nci_close_device+0x102/0x600 net/nfc/nci/core.c:560

stack backtrace:
CPU: 0 PID: 4312 Comm: syz.3.18 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Call Trace:
<TASK>
dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106
check_noncircular+0x296/0x330 kernel/locking/lockdep.c:2133
check_prev_add kernel/locking/lockdep.c:3053 [inline]
check_prevs_add kernel/locking/lockdep.c:3172 [inline]
validate_chain kernel/locking/lockdep.c:3788 [inline]
__lock_acquire+0x2c66/0x7b50 kernel/locking/lockdep.c:5012
lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5625
flush_workqueue+0x16a/0x1390 kernel/workqueue.c:2830
nci_close_device+0x172/0x600 net/nfc/nci/core.c:578
nci_unregister_device+0x5e/0x250 net/nfc/nci/core.c:1313
virtual_ncidev_close+0x55/0x90 drivers/nfc/virtual_ncidev.c:166
__fput+0x212/0x8c0 fs/file_table.c:311
task_work_run+0x125/0x1a0 kernel/task_work.c:188
tracehook_notify_resume include/linux/tracehook.h:189 [inline]
exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:184
exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:217
__syscall_exit_to_user_mode_work kernel/entry/common.c:299 [inline]
syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:310
do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f90e18dc159
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffcf4e62388 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4
RAX: 0000000000000000 RBX: 00007f90e1b65da0 RCX: 00007f90e18dc159
RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003
RBP: 00007f90e1b65da0 R08: 00007f90e1b64038 R09: 0000000000000000
R10: 00000000003ffb30 R11: 0000000000000246 R12: 0000000000010c58
R13: 00007f90e1b63fac R14: 00000000000109cd R15: 00007ffcf4e62490
</TASK>
Reply all
Reply to author
Forward
0 new messages