possible deadlock in sock_close

Status: upstream: reported on 2026/10/09 10:25
Reported-by: syzbot+b9be576dd49a884409f5@syzkaller.appspotmail.com
First crash: 10d, last: 10d
▶ ▼ Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 possible deadlock in sock_close 4 12 9h49m 11d 0/3 upstream: reported on 2026/10/09 00:02

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.7.1387/9815 is trying to acquire lock:
ffff888073609a10 (&sb->s_type->i_mutex_key#11){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:793 [inline]
ffff888073609a10 (&sb->s_type->i_mutex_key#11){+.+.}-{3:3}, at: __sock_release net/socket.c:650 [inline]
ffff888073609a10 (&sb->s_type->i_mutex_key#11){+.+.}-{3:3}, at: sock_close+0x82/0x210 net/socket.c:1346

but task is already holding lock:
ffff888023424d40 (&wdev->mtx){+.+.}-{3:3}, at: wdev_lock net/wireless/core.h:226 [inline]
ffff888023424d40 (&wdev->mtx){+.+.}-{3:3}, at: cfg80211_wext_siwgenie+0xd4/0x3f0 net/wireless/wext-sme.c:327

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&wdev->mtx){+.+.}-{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
       wdev_lock net/wireless/core.h:226 [inline]
       nl80211_send_iface+0x773/0xe00 net/wireless/nl80211.c:3633
       nl80211_dump_interface+0x39f/0x560 net/wireless/nl80211.c:3737
       netlink_dump+0x6d2/0xdd0 net/netlink/af_netlink.c:2291
       __netlink_dump_start+0x4e4/0x720 net/netlink/af_netlink.c:2398
       genl_family_rcv_msg_dumpit net/netlink/genetlink.c:689 [inline]
       genl_family_rcv_msg net/netlink/genetlink.c:772 [inline]
       genl_rcv_msg+0xbc7/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

-> #1 (rtnl_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
       ip6mr_sk_done+0xaa/0x2b0 net/ipv6/ip6mr.c:1584
       rawv6_close+0x62/0x90 net/ipv6/raw.c:1174
       inet_release+0x139/0x180 net/ipv4/af_inet.c:432
       __sock_release net/socket.c:651 [inline]
       sock_close+0xbf/0x210 net/socket.c:1346
       __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

-> #0 (&sb->s_type->i_mutex_key#11){+.+.}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3120 [inline]
       check_prevs_add kernel/locking/lockdep.c:3239 [inline]
       validate_chain kernel/locking/lockdep.c:3855 [inline]
       __lock_acquire+0x38f7/0x7d40 kernel/locking/lockdep.c:5120
       lock_acquire+0x19f/0x400 kernel/locking/lockdep.c:5737
       down_write+0x38/0x60 kernel/locking/rwsem.c:1551
       inode_lock include/linux/fs.h:793 [inline]
       __sock_release net/socket.c:650 [inline]
       sock_close+0x82/0x210 net/socket.c:1346
       __fput+0x212/0x8c0 fs/file_table.c:311
       task_work_run+0x125/0x1a0 kernel/task_work.c:188
       get_signal+0x123e/0x12e0 kernel/signal.c:2685
       arch_do_signal_or_restart+0xe6/0x12a0 arch/x86/kernel/signal.c:867
       handle_signal_work kernel/entry/common.c:157 [inline]
       exit_to_user_mode_loop+0x9e/0x130 kernel/entry/common.c:181
       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:
  &sb->s_type->i_mutex_key#11 --> rtnl_mutex --> &wdev->mtx

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&wdev->mtx);
                               lock(rtnl_mutex);
                               lock(&wdev->mtx);
  lock(&sb->s_type->i_mutex_key#11);

 *** DEADLOCK ***

1 lock held by syz.7.1387/9815:
 #0: ffff888023424d40 (&wdev->mtx){+.+.}-{3:3}, at: wdev_lock net/wireless/core.h:226 [inline]
 #0: ffff888023424d40 (&wdev->mtx){+.+.}-{3:3}, at: cfg80211_wext_siwgenie+0xd4/0x3f0 net/wireless/wext-sme.c:327

stack backtrace:
CPU: 0 PID: 9815 Comm: syz.7.1387 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+0x2f8/0x400 kernel/locking/lockdep.c:2178
 check_prev_add kernel/locking/lockdep.c:3120 [inline]
 check_prevs_add kernel/locking/lockdep.c:3239 [inline]
 validate_chain kernel/locking/lockdep.c:3855 [inline]
 __lock_acquire+0x38f7/0x7d40 kernel/locking/lockdep.c:5120
 lock_acquire+0x19f/0x400 kernel/locking/lockdep.c:5737
 down_write+0x38/0x60 kernel/locking/rwsem.c:1551
 inode_lock include/linux/fs.h:793 [inline]
 __sock_release net/socket.c:650 [inline]
 sock_close+0x82/0x210 net/socket.c:1346
 __fput+0x212/0x8c0 fs/file_table.c:311
 task_work_run+0x125/0x1a0 kernel/task_work.c:188
 get_signal+0x123e/0x12e0 kernel/signal.c:2685
 arch_do_signal_or_restart+0xe6/0x12a0 arch/x86/kernel/signal.c:867
 handle_signal_work kernel/entry/common.c:157 [inline]
 exit_to_user_mode_loop+0x9e/0x130 kernel/entry/common.c:181
 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:0x7fe8386051d9
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:00007fe83685d028 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffea RBX: 00007fe83888cfa0 RCX: 00007fe8386051d9
RDX: 0000200000000040 RSI: 0000000000008b30 RDI: 0000000000000004
RBP: 00007fe83869c888 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fe83888d038 R14: 00007fe83888cfa0 R15: 00007ffc3d886ff8
 </TASK>

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/10/09 10:25 linux-5.15.y a051a4bf909f b2734a59 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in sock_close
* Struck through repros no longer work on HEAD.