possible deadlock in __kernfs_remove (3)
Subsystems (4)
syzbot
syzbotHello,
syzbot found the following issue on:
HEAD commit: d4f687fbbce4 ovpn: tcp - fix packet extraction from stream git tree: net console output: https://syzkaller.appspot.com/x/log.txt?x=12dba44a580000 kernel config: https://syzkaller.appspot.com/x/.config?x=665cbf0979cda6c5 dashboard link: https://syzkaller.appspot.com/bug?extid=1075f6dc93f398c1857e compiler: Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8
Unfortunately, I don't have any reproducer for this issue yet.
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/ee42a61b2ee7/disk-d4f687fb.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/e5470ff18ff8/vmlinux-d4f687fb.xz
kernel image: https://storage.googleapis.com/syzbot-assets/d50957aaabf2/bzImage-d4f687fb.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.2.13134/20856 is trying to acquire lock:ffff888064e8e3c8 (kn->active#14){++++}-{0:0}, at: __kernfs_remove+0x3cf/0x660 fs/kernfs/dir.c:1513
but task is already holding lock:ffff888033048788 (&rdev->wiphy.mtx){+.+.}-{4:4}, at: class_wiphy_constructor include/net/cfg80211.h:6441 [inline] ffff888033048788 (&rdev->wiphy.mtx){+.+.}-{4:4}, at: ieee80211_remove_interfaces+0x132/0x6d0 net/mac80211/iface.c:2415
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #2 (&rdev->wiphy.mtx){+.+.}-{4:4}:
__mutex_lock_common kernel/locking/mutex.c:614 [inline]
__mutex_lock+0x19f/0x1300 kernel/locking/mutex.c:776
class_wiphy_constructor include/net/cfg80211.h:6441 [inline]
ieee80211_change_mac+0xb5/0x1410 net/mac80211/iface.c:324
netif_set_mac_address+0x317/0x4e0 net/core/dev.c:9989
do_setlink+0x9b1/0x4590 net/core/rtnetlink.c:3110
rtnl_changelink net/core/rtnetlink.c:3776 [inline]
__rtnl_newlink net/core/rtnetlink.c:3935 [inline]
rtnl_newlink+0x15a9/0x1be0 net/core/rtnetlink.c:4072
rtnetlink_rcv_msg+0x7d5/0xbe0 net/core/rtnetlink.c:6958
netlink_rcv_skb+0x232/0x4b0 net/netlink/af_netlink.c:2550
netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
netlink_unicast+0x80f/0x9b0 net/netlink/af_netlink.c:1344
netlink_sendmsg+0x813/0xb40 net/netlink/af_netlink.c:1894
sock_sendmsg_nosec net/socket.c:727 [inline]
__sock_sendmsg net/socket.c:742 [inline]
____sys_sendmsg+0xa68/0xad0 net/socket.c:2592
___sys_sendmsg+0x2a5/0x360 net/socket.c:2646
__sys_sendmsg net/socket.c:2678 [inline]
__do_sys_sendmsg net/socket.c:2683 [inline]
__se_sys_sendmsg net/socket.c:2681 [inline]
__x64_sys_sendmsg+0x1bd/0x2a0 net/socket.c:2681
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x14d/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f-> #1 (dev_addr_sem){++++}-{4:4}:
down_read+0x47/0x2e0 kernel/locking/rwsem.c:1537
address_show+0x25/0x250 net/core/net-sysfs.c:266
dev_attr_show+0x58/0xc0 drivers/base/core.c:2421
sysfs_kf_seq_show+0x310/0x490 fs/sysfs/file.c:65
seq_read_iter+0x4ef/0xe10 fs/seq_file.c:231
new_sync_read fs/read_write.c:493 [inline]
vfs_read+0x582/0xa70 fs/read_write.c:574
ksys_read+0x150/0x270 fs/read_write.c:717
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x14d/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f-> #0 (kn->active#14){++++}-{0:0}:
check_prev_add kernel/locking/lockdep.c:3165 [inline]
check_prevs_add kernel/locking/lockdep.c:3284 [inline]
validate_chain kernel/locking/lockdep.c:3908 [inline]
__lock_acquire+0x15a5/0x2cf0 kernel/locking/lockdep.c:5237
lock_acquire+0xf0/0x2e0 kernel/locking/lockdep.c:5868
kernfs_drain+0x284/0x600 fs/kernfs/dir.c:511
__kernfs_remove+0x3cf/0x660 fs/kernfs/dir.c:1513
kernfs_remove_by_name_ns+0xaf/0x130 fs/kernfs/dir.c:1722
kernfs_remove_by_name include/linux/kernfs.h:633 [inline]
remove_files fs/sysfs/group.c:28 [inline]
sysfs_remove_group+0xfc/0x2e0 fs/sysfs/group.c:328
sysfs_remove_groups+0x54/0xb0 fs/sysfs/group.c:352
device_remove_groups drivers/base/core.c:2843 [inline]
device_remove_attrs+0x229/0x280 drivers/base/core.c:2979
device_del+0x51f/0x8f0 drivers/base/core.c:3877
unregister_netdevice_many_notify+0x1e0e/0x2370 net/core/dev.c:12438
unregister_netdevice_many net/core/dev.c:12466 [inline]
unregister_netdevice_queue+0x31f/0x360 net/core/dev.c:12280
unregister_netdevice include/linux/netdevice.h:3408 [inline]
_cfg80211_unregister_wdev+0x155/0x570 net/wireless/core.c:1297
ieee80211_remove_interfaces+0x49c/0x6d0 net/mac80211/iface.c:2440
ieee80211_unregister_hw+0x5d/0x2c0 net/mac80211/main.c:1691
mac80211_hwsim_del_radio+0x28a/0x490 drivers/net/wireless/virtual/mac80211_hwsim.c:5916
remove_user_radios drivers/net/wireless/virtual/mac80211_hwsim.c:6727 [inline]
mac80211_hwsim_netlink_notify+0xfae/0x1310 drivers/net/wireless/virtual/mac80211_hwsim.c:6741
notifier_call_chain+0x1be/0x400 kernel/notifier.c:85
blocking_notifier_call_chain+0x6a/0x90 kernel/notifier.c:380
netlink_release+0x123b/0x1ad0 net/netlink/af_netlink.c:761
__sock_release net/socket.c:662 [inline]
sock_close+0xc3/0x240 net/socket.c:1455
__fput+0x44f/0xa70 fs/file_table.c:469
task_work_run+0x1d9/0x270 kernel/task_work.c:233
resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
__exit_to_user_mode_loop kernel/entry/common.c:67 [inline]
exit_to_user_mode_loop+0xed/0x480 kernel/entry/common.c:98
__exit_to_user_mode_prepare include/linux/irq-entry-common.h:226 [inline]
syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:256 [inline]
syscall_exit_to_user_mode include/linux/entry-common.h:325 [inline]
do_syscall_64+0x32d/0xf80 arch/x86/entry/syscall_64.c:100
entry_SYSCALL_64_after_hwframe+0x77/0x7fother info that might help us debug this:
Chain exists of: kn->active#14 --> dev_addr_sem --> &rdev->wiphy.mtx Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&rdev->wiphy.mtx);
lock(dev_addr_sem);
lock(&rdev->wiphy.mtx); lock(kn->active#14);
*** DEADLOCK ***
4 locks held by syz.2.13134/20856:
#0: ffff88809099c708 (&sb->s_type->i_mutex_key#14){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:1028 [inline] #0: ffff88809099c708 (&sb->s_type->i_mutex_key#14){+.+.}-{4:4}, at: __sock_release net/socket.c:661 [inline] #0: ffff88809099c708 (&sb->s_type->i_mutex_key#14){+.+.}-{4:4}, at: sock_close+0x9b/0x240 net/socket.c:1455 #1: ffffffff8fc374b0 ((netlink_chain).rwsem){++++}-{4:4}, at: blocking_notifier_call_chain+0x54/0x90 kernel/notifier.c:379 #2: ffffffff8fbcb808 (rtnl_mutex){+.+.}-{4:4}, at: ieee80211_unregister_hw+0x55/0x2c0 net/mac80211/main.c:1684 #3: ffff888033048788 (&rdev->wiphy.mtx){+.+.}-{4:4}, at: class_wiphy_constructor include/net/cfg80211.h:6441 [inline] #3: ffff888033048788 (&rdev->wiphy.mtx){+.+.}-{4:4}, at: ieee80211_remove_interfaces+0x132/0x6d0 net/mac80211/iface.c:2415
stack backtrace: CPU: 0 UID: 0 PID: 20856 Comm: syz.2.13134 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2026 Call Trace: <TASK> dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_circular_bug+0x2e1/0x300 kernel/locking/lockdep.c:2043 check_noncircular+0x12e/0x150 kernel/locking/lockdep.c:2175 check_prev_add kernel/locking/lockdep.c:3165 [inline] check_prevs_add kernel/locking/lockdep.c:3284 [inline] validate_chain kernel/locking/lockdep.c:3908 [inline] __lock_acquire+0x15a5/0x2cf0 kernel/locking/lockdep.c:5237 lock_acquire+0xf0/0x2e0 kernel/locking/lockdep.c:5868 kernfs_drain+0x284/0x600 fs/kernfs/dir.c:511 __kernfs_remove+0x3cf/0x660 fs/kernfs/dir.c:1513 kernfs_remove_by_name_ns+0xaf/0x130 fs/kernfs/dir.c:1722 kernfs_remove_by_name include/linux/kernfs.h:633 [inline] remove_files fs/sysfs/group.c:28 [inline] sysfs_remove_group+0xfc/0x2e0 fs/sysfs/group.c:328 sysfs_remove_groups+0x54/0xb0 fs/sysfs/group.c:352 device_remove_groups drivers/base/core.c:2843 [inline] device_remove_attrs+0x229/0x280 drivers/base/core.c:2979 device_del+0x51f/0x8f0 drivers/base/core.c:3877 unregister_netdevice_many_notify+0x1e0e/0x2370 net/core/dev.c:12438 unregister_netdevice_many net/core/dev.c:12466 [inline] unregister_netdevice_queue+0x31f/0x360 net/core/dev.c:12280 unregister_netdevice include/linux/netdevice.h:3408 [inline] _cfg80211_unregister_wdev+0x155/0x570 net/wireless/core.c:1297 ieee80211_remove_interfaces+0x49c/0x6d0 net/mac80211/iface.c:2440 ieee80211_unregister_hw+0x5d/0x2c0 net/mac80211/main.c:1691 mac80211_hwsim_del_radio+0x28a/0x490 drivers/net/wireless/virtual/mac80211_hwsim.c:5916 remove_user_radios drivers/net/wireless/virtual/mac80211_hwsim.c:6727 [inline] mac80211_hwsim_netlink_notify+0xfae/0x1310 drivers/net/wireless/virtual/mac80211_hwsim.c:6741 notifier_call_chain+0x1be/0x400 kernel/notifier.c:85 blocking_notifier_call_chain+0x6a/0x90 kernel/notifier.c:380 netlink_release+0x123b/0x1ad0 net/netlink/af_netlink.c:761 __sock_release net/socket.c:662 [inline] sock_close+0xc3/0x240 net/socket.c:1455 __fput+0x44f/0xa70 fs/file_table.c:469 task_work_run+0x1d9/0x270 kernel/task_work.c:233 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] __exit_to_user_mode_loop kernel/entry/common.c:67 [inline] exit_to_user_mode_loop+0xed/0x480 kernel/entry/common.c:98 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:226 [inline] syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:256 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:325 [inline] do_syscall_64+0x32d/0xf80 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f182d99c629 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:00007f182e8af028 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: 0000000000000018 RBX: 00007f182dc15fa0 RCX: 00007f182d99c629 RDX: 0000000000000300 RSI: 0000200000000040 RDI: 0000000000000004 RBP: 00007f182da32b39 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f182dc16038 R14: 00007f182dc15fa0 R15: 00007fff4353ce78 </TASK>
---
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 [email protected].
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
syzbotsyzbot has found a reproducer for the following issue on:
syzbot has found a reproducer for the following issue on:
HEAD commit: 66fb95a52111 Merge tag 'caps-pr-20260820' of git://git.ker.. git tree: upstream console+strace: https://syzkaller.appspot.com/x/log.txt?x=11ca4625580000 kernel config: https://syzkaller.appspot.com/x/.config?x=b0978f5ed2905b98 dashboard link: https://syzkaller.appspot.com/bug?extid=1075f6dc93f398c1857e compiler: gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44 syz repro: https://syzkaller.appspot.com/x/repro.syz?x=10815549580000
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/e7d9049723b0/disk-66fb95a5.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/a04d6efe59a0/vmlinux-66fb95a5.xz
kernel image: https://storage.googleapis.com/syzbot-assets/81e3f2b9c049/bzImage-66fb95a5.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.0.17/6104 is trying to acquire lock:ffff888035f1b008 (kn->active#59){++++}-{0:0}, at: __kernfs_remove+0x34c/0xb80 fs/kernfs/dir.c:1579
but task is already holding lock:ffffffff904d00c0 (serio_mutex){+.+.}-{4:4}, at: class_mutex_constructor include/linux/mutex.h:253 [inline] ffffffff904d00c0 (serio_mutex){+.+.}-{4:4}, at: serio_unregister_port+0x1b/0x40 drivers/input/serio/serio.c:677
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (serio_mutex){+.+.}-{4:4}:
lock_acquire kernel/locking/lockdep.c:5886 [inline]
lock_acquire+0x1b9/0x370 kernel/locking/lockdep.c:5843
__mutex_lock_common kernel/locking/mutex.c:646 [inline]
__mutex_lock+0x1a4/0x1bc0 kernel/locking/mutex.c:821
class_mutex_intr_constructor include/linux/mutex.h:255 [inline]
drvctl_store+0x3c/0x350 drivers/input/serio/serio.c:360
dev_attr_store+0x58/0x80 drivers/base/core.c:2509
sysfs_kf_write+0xf2/0x150 fs/sysfs/file.c:145
kernfs_fop_write_iter+0x3e0/0x5f0 fs/kernfs/file.c:345
new_sync_write fs/read_write.c:595 [inline]
vfs_write+0x6af/0x1050 fs/read_write.c:687
ksys_write+0x12a/0x250 fs/read_write.c:739
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f-> #0 (kn->active#59){++++}-{0:0}:
check_prev_add+0xeb/0xe60 kernel/locking/lockdep.c:3181
check_prevs_add kernel/locking/lockdep.c:3300 [inline]
validate_chain kernel/locking/lockdep.c:3924 [inline]
__lock_acquire+0x1492/0x1ec0 kernel/locking/lockdep.c:5253
lock_acquire kernel/locking/lockdep.c:5886 [inline]
lock_acquire+0x1b9/0x370 kernel/locking/lockdep.c:5843
kernfs_drain+0x4f0/0x600 fs/kernfs/dir.c:532
__kernfs_remove+0x34c/0xb80 fs/kernfs/dir.c:1579
kernfs_remove_by_name_ns+0x7c/0x120 fs/kernfs/dir.c:1797
kernfs_remove_by_name include/linux/kernfs.h:644 [inline]
remove_files+0x96/0x1c0 fs/sysfs/group.c:28
sysfs_remove_group+0x8b/0x1b0 fs/sysfs/group.c:328
sysfs_remove_groups fs/sysfs/group.c:352 [inline]
sysfs_remove_groups+0x60/0xb0 fs/sysfs/group.c:344
device_remove_groups drivers/base/core.c:2918 [inline]
device_remove_attrs+0x192/0x290 drivers/base/core.c:3048
device_del+0x36e/0x9b0 drivers/base/core.c:3964
serio_destroy_port+0x476/0x590 drivers/input/serio/serio.c:543
serio_unregister_port+0x2b/0x40 drivers/input/serio/serio.c:680
userio_char_release+0x91/0xe0 drivers/input/serio/userio.c:105
__fput+0x3ff/0xb50 fs/file_table.c:512
task_work_run+0x150/0x240 kernel/task_work.c:233
ptrace_notify+0xf3/0x120 kernel/signal.c:2531
ptrace_report_syscall include/linux/ptrace.h:416 [inline]
ptrace_report_syscall_exit include/linux/ptrace.h:477 [inline]
arch_ptrace_report_syscall_exit include/linux/entry-common.h:233 [inline]
syscall_exit_work include/linux/entry-common.h:266 [inline]
syscall_exit_to_user_mode_work include/linux/entry-common.h:297 [inline]
syscall_exit_to_user_mode include/linux/entry-common.h:334 [inline]
do_syscall_64+0x5e7/0x790 arch/x86/entry/syscall_64.c:89
entry_SYSCALL_64_after_hwframe+0x77/0x7fother info that might help us debug this:
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(serio_mutex);
lock(kn->active#59);
lock(serio_mutex); lock(kn->active#59);
*** DEADLOCK ***
locks held by syz.0.17/6104: 1, last CPU#1:
#0: ffffffff904d00c0 (serio_mutex){+.+.}-{4:4}, at: class_mutex_constructor include/linux/mutex.h:253 [inline] #0: ffffffff904d00c0 (serio_mutex){+.+.}-{4:4}, at: serio_unregister_port+0x1b/0x40 drivers/input/serio/serio.c:677
stack backtrace: CPU: 1 UID: 0 PID: 6104 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/16/2026 Call Trace: <TASK> __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_circular_bug.cold+0x178/0x1be kernel/locking/lockdep.c:2059 check_noncircular+0x146/0x160 kernel/locking/lockdep.c:2191 check_prev_add+0xeb/0xe60 kernel/locking/lockdep.c:3181 check_prevs_add kernel/locking/lockdep.c:3300 [inline] validate_chain kernel/locking/lockdep.c:3924 [inline] __lock_acquire+0x1492/0x1ec0 kernel/locking/lockdep.c:5253 lock_acquire kernel/locking/lockdep.c:5886 [inline] lock_acquire+0x1b9/0x370 kernel/locking/lockdep.c:5843 kernfs_drain+0x4f0/0x600 fs/kernfs/dir.c:532 __kernfs_remove+0x34c/0xb80 fs/kernfs/dir.c:1579 kernfs_remove_by_name_ns+0x7c/0x120 fs/kernfs/dir.c:1797 kernfs_remove_by_name include/linux/kernfs.h:644 [inline] remove_files+0x96/0x1c0 fs/sysfs/group.c:28 sysfs_remove_group+0x8b/0x1b0 fs/sysfs/group.c:328 sysfs_remove_groups fs/sysfs/group.c:352 [inline] sysfs_remove_groups+0x60/0xb0 fs/sysfs/group.c:344 device_remove_groups drivers/base/core.c:2918 [inline] device_remove_attrs+0x192/0x290 drivers/base/core.c:3048 device_del+0x36e/0x9b0 drivers/base/core.c:3964 serio_destroy_port+0x476/0x590 drivers/input/serio/serio.c:543 serio_unregister_port+0x2b/0x40 drivers/input/serio/serio.c:680 userio_char_release+0x91/0xe0 drivers/input/serio/userio.c:105 __fput+0x3ff/0xb50 fs/file_table.c:512 task_work_run+0x150/0x240 kernel/task_work.c:233 ptrace_notify+0xf3/0x120 kernel/signal.c:2531 ptrace_report_syscall include/linux/ptrace.h:416 [inline] ptrace_report_syscall_exit include/linux/ptrace.h:477 [inline] arch_ptrace_report_syscall_exit include/linux/entry-common.h:233 [inline] syscall_exit_work include/linux/entry-common.h:266 [inline] syscall_exit_to_user_mode_work include/linux/entry-common.h:297 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:334 [inline] do_syscall_64+0x5e7/0x790 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f094979e0d9 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:00007ffca1bdeb48 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4 RAX: 0000000000000000 RBX: 00007f0949a27da0 RCX: 00007f094979e0d9 RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003 RBP: 00007f0949a27da0 R08: 0000000000000006 R09: 0000000000000000 R10: 00007f0949a27cb0 R11: 0000000000000246 R12: 000000000001aa1e R13: 00007f0949a25fac R14: 000000000001a7d2 R15: 00007ffca1bdec50 </TASK>
---
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.
syzbot
syzbotsyzbot has found a reproducer for the following issue on:
syzbot has found a reproducer for the following issue on:
HEAD commit: cf72cbb39da8 Merge tag 'io_uring-7.3-20260828' of git://gi.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=14c09d79580000 kernel config: https://syzkaller.appspot.com/x/.config?x=85bc5cc2fc7394d9 dashboard link: https://syzkaller.appspot.com/bug?extid=1075f6dc93f398c1857e compiler: gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44 userspace arch: i386 syz repro: https://syzkaller.appspot.com/x/repro.syz?x=161fae25580000 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1084c379580000
Downloadable assets:
disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/d900f083ada3/non_bootable_disk-cf72cbb3.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/755d053ff703/vmlinux-cf72cbb3.xz
kernel image: https://storage.googleapis.com/syzbot-assets/0837738ba281/bzImage-cf72cbb3.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.0.17/6098 is trying to acquire lock:ffff88804e56bf08 (kn->active#66){++++}-{0:0}, at: __kernfs_remove+0x34c/0xb80 fs/kernfs/dir.c:1579
but task is already holding lock:ffffffff904e2360 (serio_mutex){+.+.}-{4:4}, at: class_mutex_constructor include/linux/mutex.h:253 [inline] ffffffff904e2360 (serio_mutex){+.+.}-{4:4}, at: serio_unregister_port+0x1b/0x40 drivers/input/serio/serio.c:677
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (serio_mutex){+.+.}-{4:4}:
lock_acquire kernel/locking/lockdep.c:5908 [inline]
lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5865
__mutex_lock_common kernel/locking/mutex.c:646 [inline]
__mutex_lock+0x1a4/0x1bc0 kernel/locking/mutex.c:821
class_mutex_intr_constructor include/linux/mutex.h:255 [inline]
drvctl_store+0x3c/0x350 drivers/input/serio/serio.c:360
dev_attr_store+0x58/0x80 drivers/base/core.c:2509
sysfs_kf_write+0xf2/0x150 fs/sysfs/file.c:145
kernfs_fop_write_iter+0x3e0/0x5f0 fs/kernfs/file.c:345
new_sync_write fs/read_write.c:595 [inline]
vfs_write+0x6af/0x1050 fs/read_write.c:687
ksys_write+0x12a/0x250 fs/read_write.c:739
do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:79 [inline]
__do_fast_syscall_32+0x13a/0x8b0 arch/x86/entry/syscall_32.c:291
do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:316
entry_SYSENTER_compat_after_hwframe+0x84/0x8e-> #0 (kn->active#66){++++}-{0:0}:
check_prev_add+0xeb/0xe60 kernel/locking/lockdep.c:3181
check_prevs_add kernel/locking/lockdep.c:3300 [inline]
validate_chain kernel/locking/lockdep.c:3924 [inline]
__lock_acquire+0x1492/0x1ec0 kernel/locking/lockdep.c:5254
lock_acquire kernel/locking/lockdep.c:5908 [inline]
lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5865
kernfs_drain+0x4f0/0x600 fs/kernfs/dir.c:532
__kernfs_remove+0x34c/0xb80 fs/kernfs/dir.c:1579
kernfs_remove_by_name_ns+0x7c/0x120 fs/kernfs/dir.c:1797
kernfs_remove_by_name include/linux/kernfs.h:644 [inline]
remove_files+0x96/0x1c0 fs/sysfs/group.c:28
sysfs_remove_group+0x8b/0x1b0 fs/sysfs/group.c:328
sysfs_remove_groups fs/sysfs/group.c:352 [inline]
sysfs_remove_groups+0x60/0xb0 fs/sysfs/group.c:344
device_remove_groups drivers/base/core.c:2918 [inline]
device_remove_attrs+0x192/0x290 drivers/base/core.c:3048
device_del+0x36e/0x9b0 drivers/base/core.c:3964
serio_destroy_port+0x476/0x590 drivers/input/serio/serio.c:543
serio_unregister_port+0x2b/0x40 drivers/input/serio/serio.c:680
userio_char_release+0x91/0xe0 drivers/input/serio/userio.c:105
__fput+0x3ff/0xb50 fs/file_table.c:512
task_work_run+0x150/0x240 kernel/task_work.c:233
resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
__exit_to_user_mode_loop kernel/entry/common.c:70 [inline]
exit_to_user_mode_loop+0x1d8/0x700 kernel/entry/common.c:101
__exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline]
syscall_exit_to_user_mode include/linux/entry-common.h:336 [inline]
__do_fast_syscall_32+0x59f/0x8b0 arch/x86/entry/syscall_32.c:294
do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:316
entry_SYSENTER_compat_after_hwframe+0x84/0x8eother info that might help us debug this:
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(serio_mutex);
lock(kn->active#66);
lock(serio_mutex); lock(kn->active#66);
*** DEADLOCK ***
locks held by syz.0.17/6098: 1, last CPU#2:
#0: ffffffff904e2360 (serio_mutex){+.+.}-{4:4}, at: class_mutex_constructor include/linux/mutex.h:253 [inline] #0: ffffffff904e2360 (serio_mutex){+.+.}-{4:4}, at: serio_unregister_port+0x1b/0x40 drivers/input/serio/serio.c:677
stack backtrace: CPU: 2 UID: 0 PID: 6098 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: <TASK> __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_circular_bug.cold+0x178/0x1be kernel/locking/lockdep.c:2059 check_noncircular+0x146/0x160 kernel/locking/lockdep.c:2191 check_prev_add+0xeb/0xe60 kernel/locking/lockdep.c:3181 check_prevs_add kernel/locking/lockdep.c:3300 [inline] validate_chain kernel/locking/lockdep.c:3924 [inline] __lock_acquire+0x1492/0x1ec0 kernel/locking/lockdep.c:5254 lock_acquire kernel/locking/lockdep.c:5908 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5865 kernfs_drain+0x4f0/0x600 fs/kernfs/dir.c:532 __kernfs_remove+0x34c/0xb80 fs/kernfs/dir.c:1579 kernfs_remove_by_name_ns+0x7c/0x120 fs/kernfs/dir.c:1797 kernfs_remove_by_name include/linux/kernfs.h:644 [inline] remove_files+0x96/0x1c0 fs/sysfs/group.c:28 sysfs_remove_group+0x8b/0x1b0 fs/sysfs/group.c:328 sysfs_remove_groups fs/sysfs/group.c:352 [inline] sysfs_remove_groups+0x60/0xb0 fs/sysfs/group.c:344 device_remove_groups drivers/base/core.c:2918 [inline] device_remove_attrs+0x192/0x290 drivers/base/core.c:3048 device_del+0x36e/0x9b0 drivers/base/core.c:3964 serio_destroy_port+0x476/0x590 drivers/input/serio/serio.c:543 serio_unregister_port+0x2b/0x40 drivers/input/serio/serio.c:680 userio_char_release+0x91/0xe0 drivers/input/serio/userio.c:105 __fput+0x3ff/0xb50 fs/file_table.c:512 task_work_run+0x150/0x240 kernel/task_work.c:233 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] __exit_to_user_mode_loop kernel/entry/common.c:70 [inline] exit_to_user_mode_loop+0x1d8/0x700 kernel/entry/common.c:101 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline] syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:336 [inline] __do_fast_syscall_32+0x59f/0x8b0 arch/x86/entry/syscall_32.c:294 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:316 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf6ffefec Code: Unable to access opcode bytes at 0xf6ffefc2. RSP: 002b:00000000ffbd8fbc EFLAGS: 00000202 ORIG_RAX: 00000000000001b4 RAX: 0000000000000000 RBX: 0000000000000003 RCX: 000000000000001e RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 </TASK>
---
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.