[v6.1] possible deadlock in sock_close

4 views
Skip to first unread message

syzbot

unread,
Oct 8, 2026, 8:02:31 PM (13 days ago) Oct 8
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: a500ba24937a Linux 6.1.189
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=134980a5580000
kernel config: https://syzkaller.appspot.com/x/.config?x=ad298832474de60c
dashboard link: https://syzkaller.appspot.com/bug?extid=175ab246871db9ff9256
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/e278ec6c88b0/disk-a500ba24.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/e95551d48fd4/vmlinux-a500ba24.xz
kernel image: https://storage.googleapis.com/syzbot-assets/64269add15d8/Image-a500ba24.gz.xz

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

======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.4.227/4957 is trying to acquire lock:
ffff0000e076a610 (&sb->s_type->i_mutex_key#12){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:764 [inline]
ffff0000e076a610 (&sb->s_type->i_mutex_key#12){+.+.}-{3:3}, at: __sock_release net/socket.c:653 [inline]
ffff0000e076a610 (&sb->s_type->i_mutex_key#12){+.+.}-{3:3}, at: sock_close+0x74/0x1ec net/socket.c:1400

but task is already holding lock:
ffff0000d18f8d40 (&wdev->mtx){+.+.}-{3:3}, at: wdev_lock net/wireless/core.h:231 [inline]
ffff0000d18f8d40 (&wdev->mtx){+.+.}-{3:3}, at: cfg80211_wext_siwgenie+0xc8/0x370 net/wireless/wext-sme.c:340

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&wdev->mtx){+.+.}-{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
wdev_lock net/wireless/core.h:231 [inline]
cfg80211_wext_siwgenie+0xc8/0x370 net/wireless/wext-sme.c:340
__cfg80211_wext_siwgenie+0x3c/0x50 net/wireless/wext-compat.c:1620
ioctl_standard_iw_point+0x7b4/0xcf8 net/wireless/wext-core.c:848
ioctl_standard_call+0xb8/0x24c net/wireless/wext-core.c:1033
wireless_process_ioctl net/wireless/wext-core.c:-1 [inline]
wext_ioctl_dispatch+0x168/0x3d0 net/wireless/wext-core.c:997
wext_handle_ioctl+0x1ac/0x370 net/wireless/wext-core.c:1058
sock_ioctl+0x138/0x828 net/socket.c:1253
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl fs/ioctl.c:856 [inline]
__arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:856
__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/0x12c 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

-> #1 (rtnl_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
rtnl_lock+0x20/0x2c net/core/rtnetlink.c:74
raw_release+0x190/0x7e4 net/can/raw.c:402
__sock_release net/socket.c:654 [inline]
sock_close+0xac/0x1ec net/socket.c:1400
__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+0x9c/0x12c 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

-> #0 (&sb->s_type->i_mutex_key#12){+.+.}-{3:3}:
check_prev_add kernel/locking/lockdep.c:3162 [inline]
check_prevs_add kernel/locking/lockdep.c:3281 [inline]
validate_chain kernel/locking/lockdep.c:3897 [inline]
__lock_acquire+0x3504/0x7280 kernel/locking/lockdep.c:5171
lock_acquire+0x210/0x63c kernel/locking/lockdep.c:5790
down_write+0x5c/0x88 kernel/locking/rwsem.c:1573
inode_lock include/linux/fs.h:764 [inline]
__sock_release net/socket.c:653 [inline]
sock_close+0x74/0x1ec net/socket.c:1400
__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
get_signal+0x1140/0x133c kernel/signal.c:2661
do_signal arch/arm64/kernel/signal.c:1095 [inline]
do_notify_resume+0x364/0x2c84 arch/arm64/kernel/signal.c:1148
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+0x9c/0x12c 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:
&sb->s_type->i_mutex_key#12 --> 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#12);

*** DEADLOCK ***

1 lock held by syz.4.227/4957:
#0: ffff0000d18f8d40 (&wdev->mtx){+.+.}-{3:3}, at: wdev_lock net/wireless/core.h:231 [inline]
#0: ffff0000d18f8d40 (&wdev->mtx){+.+.}-{3:3}, at: cfg80211_wext_siwgenie+0xc8/0x370 net/wireless/wext-sme.c:340

stack backtrace:
CPU: 0 PID: 4957 Comm: syz.4.227 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/14/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:2088
check_noncircular+0x290/0x370 kernel/locking/lockdep.c:2215
check_prev_add kernel/locking/lockdep.c:3162 [inline]
check_prevs_add kernel/locking/lockdep.c:3281 [inline]
validate_chain kernel/locking/lockdep.c:3897 [inline]
__lock_acquire+0x3504/0x7280 kernel/locking/lockdep.c:5171
lock_acquire+0x210/0x63c kernel/locking/lockdep.c:5790
down_write+0x5c/0x88 kernel/locking/rwsem.c:1573
inode_lock include/linux/fs.h:764 [inline]
__sock_release net/socket.c:653 [inline]
sock_close+0x74/0x1ec net/socket.c:1400
__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
get_signal+0x1140/0x133c kernel/signal.c:2661
do_signal arch/arm64/kernel/signal.c:1095 [inline]
do_notify_resume+0x364/0x2c84 arch/arm64/kernel/signal.c:1148
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+0x9c/0x12c 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


---
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,
Oct 9, 2026, 6:25:59 AM (13 days ago) Oct 9
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: a051a4bf909f Linux 5.15.222
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=121ea49c580000
kernel config: https://syzkaller.appspot.com/x/.config?x=da6191fcbb94efef
dashboard link: https://syzkaller.appspot.com/bug?extid=b9be576dd49a884409f5
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/3e5e3b715c39/disk-a051a4bf.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/bb2c203626fc/vmlinux-a051a4bf.xz
kernel image: https://storage.googleapis.com/syzbot-assets/18735b3f1c27/bzImage-a051a4bf.xz

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

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