vxcan0: j1939_tp_rxtimer: 0xffff888078d15c00: rx timeout, send abort ====================================================== WARNING: possible circular locking dependency detected 6.0.0-rc3-syzkaller-00328-g42cf58c272ee #0 Not tainted ------------------------------------------------------ modprobe/12083 is trying to acquire lock: ffff88807a1510d0 (&priv->j1939_socks_lock){+.-.}-{2:2}, at: spin_lock_bh include/linux/spinlock.h:354 [inline] ffff88807a1510d0 (&priv->j1939_socks_lock){+.-.}-{2:2}, at: j1939_sk_errqueue+0x92/0x160 net/can/j1939/socket.c:1081 but task is already holding lock: ffff88807a151088 (&priv->active_session_list_lock){+.-.}-{2:2}, at: spin_lock_bh include/linux/spinlock.h:354 [inline] ffff88807a151088 (&priv->active_session_list_lock){+.-.}-{2:2}, at: j1939_session_list_lock net/can/j1939/transport.c:238 [inline] ffff88807a151088 (&priv->active_session_list_lock){+.-.}-{2:2}, at: j1939_tp_rxtimer+0xb8/0xa20 net/can/j1939/transport.c:1246 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&priv->active_session_list_lock){+.-.}-{2:2}: lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5666 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline] _raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178 spin_lock_bh include/linux/spinlock.h:354 [inline] j1939_session_list_lock net/can/j1939/transport.c:238 [inline] j1939_session_activate+0x4d/0x450 net/can/j1939/transport.c:1559 j1939_sk_queue_activate_next_locked net/can/j1939/socket.c:181 [inline] j1939_sk_queue_activate_next+0x279/0x3f0 net/can/j1939/socket.c:208 j1939_xtp_rx_eoma net/can/j1939/transport.c:1405 [inline] j1939_tp_cmd_recv net/can/j1939/transport.c:2094 [inline] j1939_tp_recv+0xc83/0x14f0 net/can/j1939/transport.c:2139 j1939_can_recv+0x67c/0xa90 net/can/j1939/main.c:108 deliver net/can/af_can.c:574 [inline] can_rcv_filter+0x35e/0x800 net/can/af_can.c:608 can_receive+0x2e8/0x410 net/can/af_can.c:665 can_rcv+0xda/0x200 net/can/af_can.c:696 __netif_receive_skb_one_core net/core/dev.c:5485 [inline] __netif_receive_skb+0x1c5/0x500 net/core/dev.c:5599 process_backlog+0x4f8/0x8b0 net/core/dev.c:5927 __napi_poll+0xbe/0x4b0 net/core/dev.c:6511 napi_poll net/core/dev.c:6578 [inline] net_rx_action+0x76c/0x10b0 net/core/dev.c:6689 __do_softirq+0x382/0x793 kernel/softirq.c:571 run_ksoftirqd+0xc1/0x120 kernel/softirq.c:934 smpboot_thread_fn+0x533/0x9d0 kernel/smpboot.c:164 kthread+0x266/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 -> #1 (&jsk->sk_session_queue_lock){+.-.}-{2:2}: lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5666 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline] _raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178 spin_lock_bh include/linux/spinlock.h:354 [inline] j1939_sk_queue_drop_all+0x3f/0x250 net/can/j1939/socket.c:139 j1939_sk_netdev_event_netdown+0xf5/0x160 net/can/j1939/socket.c:1275 j1939_netdev_notify+0x204/0x330 net/can/j1939/main.c:372 notifier_call_chain kernel/notifier.c:87 [inline] raw_notifier_call_chain+0xe7/0x170 kernel/notifier.c:455 __dev_notify_flags+0x2ef/0x5f0 dev_change_flags+0xe3/0x190 net/core/dev.c:8632 do_setlink+0xdb2/0x3f00 net/core/rtnetlink.c:2780 __rtnl_newlink net/core/rtnetlink.c:3546 [inline] rtnl_newlink+0x183e/0x2060 net/core/rtnetlink.c:3593 rtnetlink_rcv_msg+0x7c9/0xeb0 net/core/rtnetlink.c:6090 netlink_rcv_skb+0x1f0/0x460 net/netlink/af_netlink.c:2501 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x7e7/0x9c0 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x9b3/0xcd0 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg net/socket.c:734 [inline] ____sys_sendmsg+0x597/0x8e0 net/socket.c:2482 ___sys_sendmsg net/socket.c:2536 [inline] __sys_sendmsg+0x28e/0x390 net/socket.c:2565 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (&priv->j1939_socks_lock){+.-.}-{2:2}: check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain+0x1872/0x6600 kernel/locking/lockdep.c:3829 __lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5053 lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5666 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline] _raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178 spin_lock_bh include/linux/spinlock.h:354 [inline] j1939_sk_errqueue+0x92/0x160 net/can/j1939/socket.c:1081 j1939_tp_rxtimer+0x479/0xa20 net/can/j1939/transport.c:1255 __run_hrtimer kernel/time/hrtimer.c:1685 [inline] __hrtimer_run_queues+0x50b/0xa60 kernel/time/hrtimer.c:1749 hrtimer_run_softirq+0x1a1/0x580 kernel/time/hrtimer.c:1766 __do_softirq+0x382/0x793 kernel/softirq.c:571 __irq_exit_rcu+0xec/0x170 kernel/softirq.c:650 irq_exit_rcu+0x5/0x20 kernel/softirq.c:662 sysvec_apic_timer_interrupt+0x91/0xb0 arch/x86/kernel/apic/apic.c:1106 asm_sysvec_apic_timer_interrupt+0x16/0x20 lock_acquire+0x21e/0x400 kernel/locking/lockdep.c:5670 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:349 [inline] fast_dput fs/dcache.c:789 [inline] dput+0x230/0x410 fs/dcache.c:900 step_into+0x349/0x1060 fs/namei.c:1846 open_last_lookups fs/namei.c:3504 [inline] path_openat+0x174c/0x2e00 fs/namei.c:3688 do_filp_open+0x275/0x500 fs/namei.c:3718 do_sys_openat2+0x13b/0x500 fs/open.c:1311 do_sys_open fs/open.c:1327 [inline] __do_sys_openat fs/open.c:1343 [inline] __se_sys_openat fs/open.c:1338 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1338 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd other info that might help us debug this: Chain exists of: &priv->j1939_socks_lock --> &jsk->sk_session_queue_lock --> &priv->active_session_list_lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&priv->active_session_list_lock); lock(&jsk->sk_session_queue_lock); lock(&priv->active_session_list_lock); lock(&priv->j1939_socks_lock); *** DEADLOCK *** 3 locks held by modprobe/12083: #0: ffffffff8cd20860 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:279 #1: ffff88801ef13e08 (&dentry->d_lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline] #1: ffff88801ef13e08 (&dentry->d_lock){+.+.}-{2:2}, at: fast_dput fs/dcache.c:789 [inline] #1: ffff88801ef13e08 (&dentry->d_lock){+.+.}-{2:2}, at: dput+0x230/0x410 fs/dcache.c:900 #2: ffff88807a151088 (&priv->active_session_list_lock){+.-.}-{2:2}, at: spin_lock_bh include/linux/spinlock.h:354 [inline] #2: ffff88807a151088 (&priv->active_session_list_lock){+.-.}-{2:2}, at: j1939_session_list_lock net/can/j1939/transport.c:238 [inline] #2: ffff88807a151088 (&priv->active_session_list_lock){+.-.}-{2:2}, at: j1939_tp_rxtimer+0xb8/0xa20 net/can/j1939/transport.c:1246 stack backtrace: CPU: 0 PID: 12083 Comm: modprobe Not tainted 6.0.0-rc3-syzkaller-00328-g42cf58c272ee #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 check_noncircular+0x2f9/0x3b0 kernel/locking/lockdep.c:2175 check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain+0x1872/0x6600 kernel/locking/lockdep.c:3829 __lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5053 lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5666 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline] _raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178 spin_lock_bh include/linux/spinlock.h:354 [inline] j1939_sk_errqueue+0x92/0x160 net/can/j1939/socket.c:1081 j1939_tp_rxtimer+0x479/0xa20 net/can/j1939/transport.c:1255 __run_hrtimer kernel/time/hrtimer.c:1685 [inline] __hrtimer_run_queues+0x50b/0xa60 kernel/time/hrtimer.c:1749 hrtimer_run_softirq+0x1a1/0x580 kernel/time/hrtimer.c:1766 __do_softirq+0x382/0x793 kernel/softirq.c:571 __irq_exit_rcu+0xec/0x170 kernel/softirq.c:650 irq_exit_rcu+0x5/0x20 kernel/softirq.c:662 sysvec_apic_timer_interrupt+0x91/0xb0 arch/x86/kernel/apic/apic.c:1106 asm_sysvec_apic_timer_interrupt+0x16/0x20 RIP: 0010:lock_acquire+0x21e/0x400 kernel/locking/lockdep.c:5670 Code: 23 00 74 08 4c 89 f7 e8 80 f7 73 00 f6 44 24 61 02 0f 85 76 01 00 00 41 f7 c7 00 02 00 00 74 01 fb 48 c7 44 24 40 0e 36 e0 45 <4b> c7 04 2c 00 00 00 00 43 c7 44 2c 09 00 00 00 00 43 c7 44 2c 11 RSP: 0018:ffffc900053e7620 EFLAGS: 00000206 RAX: 0000000000000001 RBX: 1ffff92000a7ced0 RCX: ffff88807cb24570 RDX: dffffc0000000000 RSI: ffffffff8aad8840 RDI: ffffffff8b0a59a0 RBP: ffffc900053e7780 R08: dffffc0000000000 R09: fffffbfff1ff3c0a R10: fffffbfff1ff3c0a R11: 1ffffffff1ff3c09 R12: dffffc0000000000 R13: 1ffff92000a7cecc R14: ffffc900053e7680 R15: 0000000000000246 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:349 [inline] fast_dput fs/dcache.c:789 [inline] dput+0x230/0x410 fs/dcache.c:900 step_into+0x349/0x1060 fs/namei.c:1846 open_last_lookups fs/namei.c:3504 [inline] path_openat+0x174c/0x2e00 fs/namei.c:3688 do_filp_open+0x275/0x500 fs/namei.c:3718 do_sys_openat2+0x13b/0x500 fs/open.c:1311 do_sys_open fs/open.c:1327 [inline] __do_sys_openat fs/open.c:1343 [inline] __se_sys_openat fs/open.c:1338 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1338 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f22dc4a4064 Code: f9 41 89 f0 41 83 e2 40 75 2c 89 f0 25 00 00 41 00 3d 00 00 41 00 74 1e 44 89 c2 4c 89 ce bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 77 2c c3 0f 1f 00 48 8d 44 24 08 c7 44 24 b8 10 RSP: 002b:00007ffdbcd34498 EFLAGS: 00000287 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f22dc4a4064 RDX: 0000000000080000 RSI: 00007ffdbcd34510 RDI: 00000000ffffff9c RBP: 00007ffdbcd34500 R08: 0000000000080000 R09: 00007ffdbcd34510 R10: 0000000000000000 R11: 0000000000000287 R12: 00007ffdbcd346ff R13: 00007ffdbcd34510 R14: 00007ffdbcd34517 R15: 00007ffdbcd34710 vxcan0: j1939_xtp_rx_abort_one: 0xffff88801cdef000: 0x00000: (3) A timeout occurred and this is the connection abort to close the session. vxcan0: j1939_xtp_rx_abort_one: 0xffff88807ccca800: 0x00000: (3) A timeout occurred and this is the connection abort to close the session. vxcan0: j1939_xtp_rx_abort_one: 0xffff88801cdefc00: 0x00000: (3) A timeout occurred and this is the connection abort to close the session. vxcan0: j1939_tp_rxtimer: 0xffff888078d15c00: abort rx timeout. Force session deactivation vxcan0: j1939_tp_rxtimer: 0xffff888022d0bc00: rx timeout, send abort vxcan0: j1939_tp_rxtimer: 0xffff888022d0bc00: abort rx timeout. Force session deactivation ---------------- Code disassembly (best guess): 0: 23 00 and (%rax),%eax 2: 74 08 je 0xc 4: 4c 89 f7 mov %r14,%rdi 7: e8 80 f7 73 00 callq 0x73f78c c: f6 44 24 61 02 testb $0x2,0x61(%rsp) 11: 0f 85 76 01 00 00 jne 0x18d 17: 41 f7 c7 00 02 00 00 test $0x200,%r15d 1e: 74 01 je 0x21 20: fb sti 21: 48 c7 44 24 40 0e 36 movq $0x45e0360e,0x40(%rsp) 28: e0 45 * 2a: 4b c7 04 2c 00 00 00 movq $0x0,(%r12,%r13,1) <-- trapping instruction 31: 00 32: 43 c7 44 2c 09 00 00 movl $0x0,0x9(%r12,%r13,1) 39: 00 00 3b: 43 rex.XB 3c: c7 .byte 0xc7 3d: 44 2c 11 rex.R sub $0x11,%al