possible deadlock in register_netdev

Status: upstream: reported on 2026/11/10 16:35
Reported-by: syzbot+19f0393a5951349d70df@syzkaller.appspotmail.com
First crash: 9d19h, last: 9d19h
▶ ▼ Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in register_netdev net 4 syz, C unreliable unreliable 104 1931d 1937d 0/29 auto-obsoleted due to no activity on 2022/09/15 05:49

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.0.1176/8218 is trying to acquire lock:
ffffffff8e26ca48 (rtnl_mutex){+.+.}-{3:3}, at: register_netdev+0xf/0x50 net/core/dev.c:10546

but task is already holding lock:
ffff888060bdc098 (&tty->ldisc_sem){++++}-{0:0}, at: __tty_ldisc_lock drivers/tty/tty_ldisc.c:300 [inline]
ffff888060bdc098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_lock+0x68/0xb0 drivers/tty/tty_ldisc.c:324

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #9 (&tty->ldisc_sem){++++}-{0:0}:
       __ldsem_down_read_nested drivers/tty/tty_ldsem.c:300 [inline]
       ldsem_down_read+0x59/0xe0 drivers/tty/tty_ldsem.c:340
       tty_ldisc_ref_wait+0x21/0x70 drivers/tty/tty_ldisc.c:252
       file_tty_write+0x18f/0x8a0 drivers/tty/tty_io.c:1094
       do_iter_readv_writev+0x47d/0x5f0 fs/read_write.c:-1
       do_iter_write+0x1f8/0x7a0 fs/read_write.c:855
       iter_file_splice_write+0x6be/0xcf0 fs/splice.c:689
       do_splice_from fs/splice.c:767 [inline]
       do_splice+0xe51/0x1620 fs/splice.c:1108
       __do_splice fs/splice.c:1173 [inline]
       __do_sys_splice fs/splice.c:1379 [inline]
       __se_sys_splice+0x34d/0x440 fs/splice.c:1361
       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

-> #8 (&pipe->mutex/1){+.+.}-{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
       iter_file_splice_write+0x1b6/0xcf0 fs/splice.c:635
       do_splice_from fs/splice.c:767 [inline]
       do_splice+0xe51/0x1620 fs/splice.c:1108
       __do_splice fs/splice.c:1173 [inline]
       __do_sys_splice fs/splice.c:1379 [inline]
       __se_sys_splice+0x34d/0x440 fs/splice.c:1361
       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

-> #7 (sb_writers#3){.+.+}-{0:0}:
       percpu_down_read include/linux/percpu-rwsem.h:51 [inline]
       __sb_start_write include/linux/fs.h:1817 [inline]
       sb_start_write include/linux/fs.h:1887 [inline]
       file_start_write include/linux/fs.h:3054 [inline]
       lo_write_bvec+0x194/0x780 drivers/block/loop.c:315
       lo_write_simple drivers/block/loop.c:338 [inline]
       do_req_filebacked drivers/block/loop.c:656 [inline]
       loop_handle_cmd drivers/block/loop.c:2235 [inline]
       loop_process_work+0x1b66/0x24c0 drivers/block/loop.c:2275
       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

-> #6 ((work_completion)(&worker->work)){+.+.}-{0:0}:
       process_one_work+0x7ba/0xff0 kernel/workqueue.c:2286
       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

-> #5 ((wq_completion)loop0){+.+.}-{0:0}:
       flush_workqueue+0x16a/0x1390 kernel/workqueue.c:2830
       drain_workqueue+0xca/0x370 kernel/workqueue.c:2995
       destroy_workqueue+0x7b/0xb20 kernel/workqueue.c:4439
       __loop_clr_fd+0x22f/0xb50 drivers/block/loop.c:1384
       blkdev_put+0x52b/0x780 block/bdev.c:-1
       deactivate_locked_super+0x93/0xf0 fs/super.c:335
       cleanup_mnt+0x426/0x4d0 fs/namespace.c:1148
       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

-> #4 (&lo->lo_mutex){+.+.}-{3:3}:
       __mutex_lock_common+0x1e5/0x2400 kernel/locking/mutex.c:596
       __mutex_lock kernel/locking/mutex.c:729 [inline]
       mutex_lock_killable_nested+0x17/0x20 kernel/locking/mutex.c:758
       lo_open+0x6a/0x100 drivers/block/loop.c:2056
       blkdev_get_whole+0x90/0x390 block/bdev.c:665
       blkdev_get_by_dev+0x2da/0xa50 block/bdev.c:823
       blkdev_open+0x128/0x2c0 block/fops.c:466
       do_dentry_open+0x7f7/0xf90 fs/open.c:826
       do_open fs/namei.c:3659 [inline]
       path_openat+0x2718/0x2fb0 fs/namei.c:3793
       do_filp_open+0x1df/0x400 fs/namei.c:3820
       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

-> #3 (&disk->open_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
       bd_register_pending_holders+0x33/0x310 block/holder.c:161
       device_add_disk+0x5ee/0xde0 block/genhd.c:493
       add_disk include/linux/genhd.h:200 [inline]
       md_alloc+0x80e/0xc10 drivers/md/md.c:5790
       add_named_array+0x1bd/0x290 drivers/md/md.c:-1
       param_attr_store+0x20a/0x300 kernel/params.c:594
       module_attr_store+0x5b/0x80 kernel/params.c:916
       kernfs_fop_write_iter+0x3a8/0x500 fs/kernfs/file.c:296
       call_write_iter include/linux/fs.h:2179 [inline]
       new_sync_write fs/read_write.c:507 [inline]
       vfs_write+0x748/0xd70 fs/read_write.c:594
       ksys_write+0x153/0x260 fs/read_write.c:647
       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

-> #2 (disks_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
       md_alloc+0x48/0xc10 drivers/md/md.c:5731
       add_named_array+0x1bd/0x290 drivers/md/md.c:-1
       param_attr_store+0x20a/0x300 kernel/params.c:594
       module_attr_store+0x5b/0x80 kernel/params.c:916
       kernfs_fop_write_iter+0x3a8/0x500 fs/kernfs/file.c:296
       call_write_iter include/linux/fs.h:2179 [inline]
       new_sync_write fs/read_write.c:507 [inline]
       vfs_write+0x748/0xd70 fs/read_write.c:594
       ksys_write+0x153/0x260 fs/read_write.c:647
       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 (param_lock){+.+.}-{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
       ieee80211_rate_control_ops_get net/mac80211/rate.c:192 [inline]
       rate_control_alloc net/mac80211/rate.c:239 [inline]
       ieee80211_init_rate_ctrl_alg+0x171/0x5e0 net/mac80211/rate.c:983
       ieee80211_register_hw+0x23c6/0x3a60 net/mac80211/main.c:1252
       mac80211_hwsim_new_radio+0x209d/0x4050 drivers/net/wireless/mac80211_hwsim.c:3373
       init_mac80211_hwsim+0x581/0x720 drivers/net/wireless/mac80211_hwsim.c:4607
       do_one_initcall+0x272/0x730 init/main.c:1276
       do_initcall_level+0x13d/0x1f0 init/main.c:1349
       do_initcalls+0x4b/0x90 init/main.c:1365
       kernel_init_freeable+0x3d5/0x560 init/main.c:1589
       kernel_init+0x19/0x1b0 init/main.c:1480
       ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

-> #0 (rtnl_mutex){+.+.}-{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
       __mutex_lock_common+0x1e5/0x2400 kernel/locking/mutex.c:596
       __mutex_lock kernel/locking/mutex.c:729 [inline]
       mutex_lock_killable_nested+0x17/0x20 kernel/locking/mutex.c:758
       register_netdev+0xf/0x50 net/core/dev.c:10546
       mkiss_open+0x3e8/0x860 drivers/net/hamradio/mkiss.c:727
       tty_ldisc_open drivers/tty/tty_ldisc.c:449 [inline]
       tty_set_ldisc+0x358/0x660 drivers/tty/tty_ldisc.c:579
       tty_ioctl+0xa8b/0xc30 drivers/tty/tty_io.c:2731
       vfs_ioctl fs/ioctl.c:51 [inline]
       __do_sys_ioctl fs/ioctl.c:874 [inline]
       __se_sys_ioctl+0xfa/0x170 fs/ioctl.c:860
       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:
  rtnl_mutex --> &pipe->mutex/1 --> &tty->ldisc_sem

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&tty->ldisc_sem);
                               lock(&pipe->mutex/1);
                               lock(&tty->ldisc_sem);
  lock(rtnl_mutex);

 *** DEADLOCK ***

2 locks held by syz.0.1176/8218:
 #0: ffff888060bdc1c0 (&tty->legacy_mutex){+.+.}-{3:3}, at: tty_set_ldisc+0x4a/0x660 drivers/tty/tty_ldisc.c:550
 #1: ffff888060bdc098 (&tty->ldisc_sem){++++}-{0:0}, at: __tty_ldisc_lock drivers/tty/tty_ldisc.c:300 [inline]
 #1: ffff888060bdc098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_lock+0x68/0xb0 drivers/tty/tty_ldisc.c:324

stack backtrace:
CPU: 0 PID: 8218 Comm: syz.0.1176 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/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
 __mutex_lock_common+0x1e5/0x2400 kernel/locking/mutex.c:596
 __mutex_lock kernel/locking/mutex.c:729 [inline]
 mutex_lock_killable_nested+0x17/0x20 kernel/locking/mutex.c:758
 register_netdev+0xf/0x50 net/core/dev.c:10546
 mkiss_open+0x3e8/0x860 drivers/net/hamradio/mkiss.c:727
 tty_ldisc_open drivers/tty/tty_ldisc.c:449 [inline]
 tty_set_ldisc+0x358/0x660 drivers/tty/tty_ldisc.c:579
 tty_ioctl+0xa8b/0xc30 drivers/tty/tty_io.c:2731
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl+0xfa/0x170 fs/ioctl.c:860
 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:0x7f30ba092f19
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:00007f30b82e0028 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f30ba30ffa0 RCX: 00007f30ba092f19
RDX: 0000200000000040 RSI: 0000000000005423 RDI: 0000000000000003
RBP: 00007f30ba121f6d R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f30ba310038 R14: 00007f30ba30ffa0 R15: 00007ffe7fd552c8
 </TASK>
mkiss: ax0: crc mode is auto.

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