syzbot


possible deadlock in ax25_device_event

Status: upstream: reported on 2025/02/23 00:49
Reported-by: syzbot+2fe6437a4558c0a468dd@syzkaller.appspotmail.com
First crash: 64d, last: 11d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in ax25_device_event (2) hams 1 150d 150d 0/28 closed as invalid on 2025/01/15 12:30
upstream possible deadlock in ax25_device_event hams 1 349d 349d 0/28 closed as invalid on 2024/06/03 15:58

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
5.15.180-syzkaller #0 Not tainted
------------------------------------------------------
syz.3.202/5111 is trying to acquire lock:
ffff88807e53e120 (sk_lock-AF_AX25){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1684 [inline]
ffff88807e53e120 (sk_lock-AF_AX25){+.+.}-{0:0}, at: ax25_kill_by_device net/ax25/af_ax25.c:99 [inline]
ffff88807e53e120 (sk_lock-AF_AX25){+.+.}-{0:0}, at: ax25_device_event+0x239/0x510 net/ax25/af_ax25.c:142

but task is already holding lock:
ffffffff8dc44148 (rtnl_mutex){+.+.}-{3:3}, at: dev_ioctl+0x4f1/0xf60 net/core/dev_ioctl.c:586

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (rtnl_mutex){+.+.}-{3:3}:
       lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
       __mutex_lock_common+0x1da/0x25a0 kernel/locking/mutex.c:596
       __mutex_lock kernel/locking/mutex.c:729 [inline]
       mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
       ax25_setsockopt+0xa3a/0xe70 net/ax25/af_ax25.c:676
       __sys_setsockopt+0x57e/0x990 net/socket.c:2203
       __do_sys_setsockopt net/socket.c:2214 [inline]
       __se_sys_setsockopt net/socket.c:2211 [inline]
       __x64_sys_setsockopt+0xb1/0xc0 net/socket.c:2211
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #0 (sk_lock-AF_AX25){+.+.}-{0:0}:
       check_prev_add kernel/locking/lockdep.c:3053 [inline]
       check_prevs_add kernel/locking/lockdep.c:3172 [inline]
       validate_chain+0x1649/0x5930 kernel/locking/lockdep.c:3788
       __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012
       lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
       lock_sock_nested+0x44/0x100 net/core/sock.c:3253
       lock_sock include/net/sock.h:1684 [inline]
       ax25_kill_by_device net/ax25/af_ax25.c:99 [inline]
       ax25_device_event+0x239/0x510 net/ax25/af_ax25.c:142
       notifier_call_chain kernel/notifier.c:83 [inline]
       raw_notifier_call_chain+0xd0/0x170 kernel/notifier.c:391
       call_netdevice_notifiers_extack net/core/dev.c:2061 [inline]
       call_netdevice_notifiers net/core/dev.c:2075 [inline]
       dev_close_many+0x32c/0x4b0 net/core/dev.c:1650
       dev_close+0x1b3/0x2b0 net/core/dev.c:1672
       bpq_device_event+0x3c8/0x9d0 drivers/net/hamradio/bpqether.c:548
       notifier_call_chain kernel/notifier.c:83 [inline]
       raw_notifier_call_chain+0xd0/0x170 kernel/notifier.c:391
       call_netdevice_notifiers_extack net/core/dev.c:2061 [inline]
       call_netdevice_notifiers net/core/dev.c:2075 [inline]
       dev_close_many+0x32c/0x4b0 net/core/dev.c:1650
       dev_close+0x1b3/0x2b0 net/core/dev.c:1672
       bond_setup_by_slave+0x66/0x390 drivers/net/bonding/bond_main.c:1471
       bond_enslave+0x7b1/0x3c20 drivers/net/bonding/bond_main.c:1855
       bond_do_ioctl+0x2a6/0xb40 drivers/net/bonding/bond_main.c:4238
       dev_ifsioc+0xd7a/0x10c0 net/core/dev_ioctl.c:417
       dev_ioctl+0x504/0xf60 net/core/dev_ioctl.c:587
       sock_do_ioctl+0x34f/0x5a0 net/socket.c:1154
       sock_ioctl+0x484/0x770 net/socket.c:1257
       vfs_ioctl fs/ioctl.c:51 [inline]
       __do_sys_ioctl fs/ioctl.c:874 [inline]
       __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:860
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x66/0xd0

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(rtnl_mutex);
                               lock(sk_lock-AF_AX25);
                               lock(rtnl_mutex);
  lock(sk_lock-AF_AX25);

 *** DEADLOCK ***

1 lock held by syz.3.202/5111:
 #0: ffffffff8dc44148 (rtnl_mutex){+.+.}-{3:3}, at: dev_ioctl+0x4f1/0xf60 net/core/dev_ioctl.c:586

stack backtrace:
CPU: 0 PID: 5111 Comm: syz.3.202 Not tainted 5.15.180-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106
 check_noncircular+0x2f8/0x3b0 kernel/locking/lockdep.c:2133
 check_prev_add kernel/locking/lockdep.c:3053 [inline]
 check_prevs_add kernel/locking/lockdep.c:3172 [inline]
 validate_chain+0x1649/0x5930 kernel/locking/lockdep.c:3788
 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012
 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
 lock_sock_nested+0x44/0x100 net/core/sock.c:3253
 lock_sock include/net/sock.h:1684 [inline]
 ax25_kill_by_device net/ax25/af_ax25.c:99 [inline]
 ax25_device_event+0x239/0x510 net/ax25/af_ax25.c:142
 notifier_call_chain kernel/notifier.c:83 [inline]
 raw_notifier_call_chain+0xd0/0x170 kernel/notifier.c:391
 call_netdevice_notifiers_extack net/core/dev.c:2061 [inline]
 call_netdevice_notifiers net/core/dev.c:2075 [inline]
 dev_close_many+0x32c/0x4b0 net/core/dev.c:1650
 dev_close+0x1b3/0x2b0 net/core/dev.c:1672
 bpq_device_event+0x3c8/0x9d0 drivers/net/hamradio/bpqether.c:548
 notifier_call_chain kernel/notifier.c:83 [inline]
 raw_notifier_call_chain+0xd0/0x170 kernel/notifier.c:391
 call_netdevice_notifiers_extack net/core/dev.c:2061 [inline]
 call_netdevice_notifiers net/core/dev.c:2075 [inline]
 dev_close_many+0x32c/0x4b0 net/core/dev.c:1650
 dev_close+0x1b3/0x2b0 net/core/dev.c:1672
 bond_setup_by_slave+0x66/0x390 drivers/net/bonding/bond_main.c:1471
 bond_enslave+0x7b1/0x3c20 drivers/net/bonding/bond_main.c:1855
 bond_do_ioctl+0x2a6/0xb40 drivers/net/bonding/bond_main.c:4238
 dev_ifsioc+0xd7a/0x10c0 net/core/dev_ioctl.c:417
 dev_ioctl+0x504/0xf60 net/core/dev_ioctl.c:587
 sock_do_ioctl+0x34f/0x5a0 net/socket.c:1154
 sock_ioctl+0x484/0x770 net/socket.c:1257
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:860
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f057f1e0169
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f057d027038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f057f408080 RCX: 00007f057f1e0169
RDX: 0000200000000180 RSI: 0000000000008990 RDI: 0000000000000009
RBP: 00007f057f262a68 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000001 R14: 00007f057f408080 R15: 00007fff84a51188
 </TASK>
8021q: adding VLAN 0 to HW filter on device bond0
bond0: (slave rose0): Enslaving as an active interface with an up link

Crashes (9):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/04/16 22:41 linux-5.15.y f7347f400572 a95239b1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ax25_device_event
2025/04/08 20:53 linux-5.15.y 0c935c049b5c a775275d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ax25_device_event
2025/03/28 00:00 linux-5.15.y 0c935c049b5c 6c09fb82 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ax25_device_event
2025/02/26 09:46 linux-5.15.y c16c81c81336 d34966d1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ax25_device_event
2025/02/23 00:48 linux-5.15.y c16c81c81336 d34966d1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ax25_device_event
2025/02/23 00:48 linux-5.15.y c16c81c81336 d34966d1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ax25_device_event
2025/04/13 10:15 linux-5.15.y f7347f400572 0bd6db41 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ax25_device_event
2025/04/09 15:25 linux-5.15.y 0c935c049b5c 47d015b1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ax25_device_event
2025/04/04 04:22 linux-5.15.y 0c935c049b5c d7ae3a11 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ax25_device_event
* Struck through repros no longer work on HEAD.