[v5.15] possible deadlock in nci_start_poll (2)

0 views
Skip to first unread message

syzbot

unread,
Aug 8, 2026, 11:31:30 PM (4 days ago) Aug 8
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: aabd761612db Linux 5.15.215
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=11b6e132580000
kernel config: https://syzkaller.appspot.com/x/.config?x=f161cbc9aef65db0
dashboard link: https://syzkaller.appspot.com/bug?extid=23333916d415d68f8611
compiler: Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17569fb9580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12107fb9580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/f636f56d3662/disk-aabd7616.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/f1a46620f40c/vmlinux-aabd7616.xz
kernel image: https://storage.googleapis.com/syzbot-assets/9b78bb48b022/bzImage-aabd7616.xz

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

======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.3.22/4366 is trying to acquire lock:
ffff88807a557350 (&ndev->req_lock){+.+.}-{3:3}, at: nci_request net/nfc/nci/core.c:148 [inline]
ffff88807a557350 (&ndev->req_lock){+.+.}-{3:3}, at: nci_start_poll+0x8c8/0xcc0 net/nfc/nci/core.c:855

but task is already holding lock:
ffff88807b1d85d8 (&genl_data->genl_data_mutex){+.+.}-{3:3}, at: nfc_genl_start_poll+0x1c9/0x340 net/nfc/netlink.c:826

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #3 (&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

-> #2 (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:3616 [inline]
path_openat+0x2718/0x2fb0 fs/namei.c:3750
do_filp_open+0x1df/0x400 fs/namei.c:3777
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

-> #1 (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_close+0x13/0x40 drivers/nfc/virtual_ncidev.c:44
nci_open_device net/nfc/nci/core.c:544 [inline]
nci_dev_up+0x976/0xd90 net/nfc/nci/core.c:633
nfc_dev_up+0x15d/0x310 net/nfc/core.c:118
nfc_genl_dev_up+0x85/0xd0 net/nfc/netlink.c:770
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

-> #0 (&ndev->req_lock){+.+.}-{3:3}:
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:5623
__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_start_poll+0x8c8/0xcc0 net/nfc/nci/core.c:855
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

other info that might help us debug this:

Chain exists of:
&ndev->req_lock --> nfc_devlist_mutex --> &genl_data->genl_data_mutex

Possible unsafe locking scenario:

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

*** DEADLOCK ***

4 locks held by syz.3.22/4366:
#0: ffffffff8d4aa0b0 (cb_lock){++++}-{3:3}, at: genl_rcv+0x15/0x40 net/netlink/genetlink.c:802
#1: ffffffff8d4a9f08 (genl_mutex){+.+.}-{3:3}, at: genl_lock net/netlink/genetlink.c:33 [inline]
#1: ffffffff8d4a9f08 (genl_mutex){+.+.}-{3:3}, at: genl_rcv_msg+0x161/0xfa0 net/netlink/genetlink.c:790
#2: ffff88807b1d85d8 (&genl_data->genl_data_mutex){+.+.}-{3:3}, at: nfc_genl_start_poll+0x1c9/0x340 net/nfc/netlink.c:826
#3: ffff88807b1d8190 (&dev->mutex){....}-{3:3}, at: device_lock include/linux/device.h:809 [inline]
#3: ffff88807b1d8190 (&dev->mutex){....}-{3:3}, at: nfc_start_poll+0x4f/0x2c0 net/nfc/core.c:208

stack backtrace:
CPU: 0 PID: 4366 Comm: syz.3.22 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:5623
__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_start_poll+0x8c8/0xcc0 net/nfc/nci/core.c:855
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
RIP: 0033:0x7fb13925b0d9
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:00007fb13889a028 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007fb1394e3090 RCX: 00007fb13925b0d9
RDX: 0000000000000000 RSI: 0000200000000180 RDI: 0000000000000005
RBP: 00007fb1392f2024 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fb1394e3128 R14: 00007fb1394e3090 R15: 00007fffb430b908
</TASK>
nci: __nci_request: wait_for_completion_interruptible_timeout failed -512


---
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 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.

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
Reply all
Reply to author
Forward
0 new messages