Hello,
syzbot found the following issue on:
HEAD commit: 42616e0f09fb Linux 6.1.15
git tree: linux-6.1.y
console output:
https://syzkaller.appspot.com/x/log.txt?x=1746602ac80000
kernel config:
https://syzkaller.appspot.com/x/.config?x=650737f7e9682672
dashboard link:
https://syzkaller.appspot.com/bug?extid=29ba00fca1f346f5a374
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64
syz repro:
https://syzkaller.appspot.com/x/repro.syz?x=11ad6688c80000
C reproducer:
https://syzkaller.appspot.com/x/repro.c?x=10938692c80000
Downloadable assets:
disk image:
https://storage.googleapis.com/syzbot-assets/f10713d1fd0f/disk-42616e0f.raw.xz
vmlinux:
https://storage.googleapis.com/syzbot-assets/5a1307bb774e/vmlinux-42616e0f.xz
kernel image:
https://storage.googleapis.com/syzbot-assets/388238a30fe4/Image-42616e0f.gz.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by:
syzbot+29ba00...@syzkaller.appspotmail.com
======================================================
WARNING: possible circular locking dependency detected
6.1.15-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor303/4382 is trying to acquire lock:
ffff0000d9d49350 (&ndev->req_lock){+.+.}-{3:3}, at: nci_request net/nfc/nci/core.c:148 [inline]
ffff0000d9d49350 (&ndev->req_lock){+.+.}-{3:3}, at: nci_set_local_general_bytes net/nfc/nci/core.c:774 [inline]
ffff0000d9d49350 (&ndev->req_lock){+.+.}-{3:3}, at: nci_start_poll+0x498/0x1204 net/nfc/nci/core.c:838
but task is already holding lock:
ffff0000d9d4a520 (&genl_data->genl_data_mutex){+.+.}-{3:3}, at: nfc_genl_start_poll+0x1a8/0x308 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+0x190/0x21a0 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+0xfc/0x2a8 net/nfc/netlink.c:1835
process_one_work+0x848/0x16b4 kernel/workqueue.c:2289
worker_thread+0x8e4/0xfec kernel/workqueue.c:2436
kthread+0x24c/0x2d4 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860
-> #2 (nfc_devlist_mutex){+.+.}-{3:3}:
__mutex_lock_common+0x190/0x21a0 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+0x4c/0x310 net/nfc/core.c:1116
nci_register_device+0x6ac/0x7c4 net/nfc/nci/core.c:1256
virtual_ncidev_open+0x6c/0xd8 drivers/nfc/virtual_ncidev.c:146
misc_open+0x2f0/0x368 drivers/char/misc.c:143
chrdev_open+0x3e8/0x4fc fs/char_dev.c:414
do_dentry_open+0x734/0xfa0 fs/open.c:882
vfs_open+0x7c/0x90 fs/open.c:1013
do_open fs/namei.c:3557 [inline]
path_openat+0x1e10/0x2540 fs/namei.c:3714
do_filp_open+0x1bc/0x3cc fs/namei.c:3741
do_sys_openat2+0x128/0x3d8 fs/open.c:1310
do_sys_open fs/open.c:1326 [inline]
__do_sys_openat fs/open.c:1342 [inline]
__se_sys_openat fs/open.c:1337 [inline]
__arm64_sys_openat+0x1f0/0x240 fs/open.c:1337
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
el0_svc+0x58/0x168 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:581
-> #1 (nci_mutex){+.+.}-{3:3}:
__mutex_lock_common+0x190/0x21a0 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_close+0x28/0x58 drivers/nfc/virtual_ncidev.c:44
nci_open_device net/nfc/nci/core.c:544 [inline]
nci_dev_up+0x754/0xb10 net/nfc/nci/core.c:631
nfc_dev_up+0x154/0x300 net/nfc/core.c:118
nfc_genl_dev_up+0x98/0xdc net/nfc/netlink.c:770
genl_family_rcv_msg_doit net/netlink/genetlink.c:756 [inline]
genl_family_rcv_msg net/netlink/genetlink.c:833 [inline]
genl_rcv_msg+0x948/0xc2c net/netlink/genetlink.c:850
netlink_rcv_skb+0x20c/0x3b8 net/netlink/af_netlink.c:2550
genl_rcv+0x38/0x50 net/netlink/genetlink.c:861
netlink_unicast_kernel net/netlink/af_netlink.c:1328 [inline]
netlink_unicast+0x660/0x8d4 net/netlink/af_netlink.c:1354
netlink_sendmsg+0x800/0xae0 net/netlink/af_netlink.c:1931
sock_sendmsg_nosec net/socket.c:714 [inline]
sock_sendmsg net/socket.c:734 [inline]
____sys_sendmsg+0x558/0x844 net/socket.c:2485
___sys_sendmsg net/socket.c:2539 [inline]
__sys_sendmsg+0x26c/0x33c net/socket.c:2568
__do_sys_sendmsg net/socket.c:2577 [inline]
__se_sys_sendmsg net/socket.c:2575 [inline]
__arm64_sys_sendmsg+0x80/0x94 net/socket.c:2575
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
el0_svc+0x58/0x168 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:581
-> #0 (&ndev->req_lock){+.+.}-{3:3}:
check_prev_add kernel/locking/lockdep.c:3097 [inline]
check_prevs_add kernel/locking/lockdep.c:3216 [inline]
validate_chain kernel/locking/lockdep.c:3831 [inline]
__lock_acquire+0x3338/0x764c kernel/locking/lockdep.c:5055
lock_acquire+0x2f8/0x8dc kernel/locking/lockdep.c:5668
__mutex_lock_common+0x190/0x21a0 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:774 [inline]
nci_start_poll+0x498/0x1204 net/nfc/nci/core.c:838
nfc_start_poll+0x164/0x2a4 net/nfc/core.c:225
nfc_genl_start_poll+0x1b8/0x308 net/nfc/netlink.c:828
genl_family_rcv_msg_doit net/netlink/genetlink.c:756 [inline]
genl_family_rcv_msg net/netlink/genetlink.c:833 [inline]
genl_rcv_msg+0x948/0xc2c net/netlink/genetlink.c:850
netlink_rcv_skb+0x20c/0x3b8 net/netlink/af_netlink.c:2550
genl_rcv+0x38/0x50 net/netlink/genetlink.c:861
netlink_unicast_kernel net/netlink/af_netlink.c:1328 [inline]
netlink_unicast+0x660/0x8d4 net/netlink/af_netlink.c:1354
netlink_sendmsg+0x800/0xae0 net/netlink/af_netlink.c:1931
sock_sendmsg_nosec net/socket.c:714 [inline]
sock_sendmsg net/socket.c:734 [inline]
____sys_sendmsg+0x558/0x844 net/socket.c:2485
___sys_sendmsg net/socket.c:2539 [inline]
__sys_sendmsg+0x26c/0x33c net/socket.c:2568
__do_sys_sendmsg net/socket.c:2577 [inline]
__se_sys_sendmsg net/socket.c:2575 [inline]
__arm64_sys_sendmsg+0x80/0x94 net/socket.c:2575
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
el0_svc+0x58/0x168 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:581
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-executor303/4382:
#0: ffff800017d78ed0 (cb_lock){++++}-{3:3}, at: genl_rcv+0x28/0x50 net/netlink/genetlink.c:860
#1: ffff800017d78d88 (genl_mutex){+.+.}-{3:3}, at: genl_lock net/netlink/genetlink.c:33 [inline]
#1: ffff800017d78d88 (genl_mutex){+.+.}-{3:3}, at: genl_rcv_msg+0x114/0xc2c net/netlink/genetlink.c:848
#2: ffff0000d9d4a520 (&genl_data->genl_data_mutex){+.+.}-{3:3}, at: nfc_genl_start_poll+0x1a8/0x308 net/nfc/netlink.c:826
#3: ffff0000d9d4a100 (&dev->mutex){....}-{3:3}, at: device_lock include/linux/device.h:835 [inline]
#3: ffff0000d9d4a100 (&dev->mutex){....}-{3:3}, at: nfc_start_poll+0x60/0x2a4 net/nfc/core.c:208
stack backtrace:
CPU: 0 PID: 4382 Comm: syz-executor303 Not tainted 6.1.15-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
Call trace:
dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
dump_stack+0x1c/0x58 lib/dump_stack.c:113
print_circular_bug+0x150/0x1b8 kernel/locking/lockdep.c:2055
check_noncircular+0x2cc/0x378 kernel/locking/lockdep.c:2177
check_prev_add kernel/locking/lockdep.c:3097 [inline]
check_prevs_add kernel/locking/lockdep.c:3216 [inline]
validate_chain kernel/locking/lockdep.c:3831 [inline]
__lock_acquire+0x3338/0x764c kernel/locking/lockdep.c:5055
lock_acquire+0x2f8/0x8dc kernel/locking/lockdep.c:5668
__mutex_lock_common+0x190/0x21a0 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:774 [inline]
nci_start_poll+0x498/0x1204 net/nfc/nci/core.c:838
nfc_start_poll+0x164/0x2a4 net/nfc/core.c:225
nfc_genl_start_poll+0x1b8/0x308 net/nfc/netlink.c:828
genl_family_rcv_msg_doit net/netlink/genetlink.c:756 [inline]
genl_family_rcv_msg net/netlink/genetlink.c:833 [inline]
genl_rcv_msg+0x948/0xc2c net/netlink/genetlink.c:850
netlink_rcv_skb+0x20c/0x3b8 net/netlink/af_netlink.c:2550
genl_rcv+0x38/0x50 net/netlink/genetlink.c:861
netlink_unicast_kernel net/netlink/af_netlink.c:1328 [inline]
netlink_unicast+0x660/0x8d4 net/netlink/af_netlink.c:1354
netlink_sendmsg+0x800/0xae0 net/netlink/af_netlink.c:1931
sock_sendmsg_nosec net/socket.c:714 [inline]
sock_sendmsg net/socket.c:734 [inline]
____sys_sendmsg+0x558/0x844 net/socket.c:2485
___sys_sendmsg net/socket.c:2539 [inline]
__sys_sendmsg+0x26c/0x33c net/socket.c:2568
__do_sys_sendmsg net/socket.c:2577 [inline]
__se_sys_sendmsg net/socket.c:2575 [inline]
__arm64_sys_sendmsg+0x80/0x94 net/socket.c:2575
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
el0_svc+0x58/0x168 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:581
nci: __nci_request: wait_for_completion_interruptible_timeout failed -512
nci: nci_start_poll: failed to set local general bytes
nci: __nci_request: wait_for_completion_interruptible_timeout failed 0
---
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.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches