vxcan0: j1939_tp_rxtimer: 0xffff888026d86400: rx timeout, send abort
vxcan0: j1939_xtp_rx_abort_one: 0xffff888063791800: 0x00000: (3) A timeout occurred and this is the connection abort to close the session.
======================================================
WARNING: possible circular locking dependency detected
6.6.0-rc1-syzkaller-00161-g9608c7b729e2 #0 Not tainted
------------------------------------------------------
kworker/0:0/8 is trying to acquire lock:
ffff88807df1d088 (&priv->active_session_list_lock){+.-.}-{2:2}, at: spin_lock_bh include/linux/spinlock.h:356 [inline]
ffff88807df1d088 (&priv->active_session_list_lock){+.-.}-{2:2}, at: j1939_session_list_lock net/can/j1939/transport.c:238 [inline]
ffff88807df1d088 (&priv->active_session_list_lock){+.-.}-{2:2}, at: j1939_session_activate+0x4d/0x3d0 net/can/j1939/transport.c:1564
but task is already holding lock:
ffff88807ad285c8 (&jsk->sk_session_queue_lock){+.-.}-{2:2}, at: spin_lock_bh include/linux/spinlock.h:356 [inline]
ffff88807ad285c8 (&jsk->sk_session_queue_lock){+.-.}-{2:2}, at: j1939_sk_queue_activate_next+0x54/0x3e0 net/can/j1939/socket.c:207
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #2 (&jsk->sk_session_queue_lock){+.-.}-{2:2}:
__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:356 [inline]
j1939_sk_queue_drop_all+0x3a/0x240 net/can/j1939/socket.c:139
j1939_sk_netdev_event_netdown+0xe9/0x150 net/can/j1939/socket.c:1282
j1939_netdev_notify+0x209/0x2e0 net/can/j1939/main.c:381
notifier_call_chain+0x18c/0x3a0 kernel/notifier.c:93
call_netdevice_notifiers_info net/core/dev.c:1970 [inline]
call_netdevice_notifiers_extack net/core/dev.c:2008 [inline]
call_netdevice_notifiers net/core/dev.c:2022 [inline]
dev_close_many+0x382/0x530 net/core/dev.c:1563
unregister_netdevice_many_notify+0x4e4/0x1900 net/core/dev.c:10911
rtnl_delete_link net/core/rtnetlink.c:3227 [inline]
rtnl_dellink+0x526/0x8e0 net/core/rtnetlink.c:3279
rtnetlink_rcv_msg+0x827/0xf50 net/core/rtnetlink.c:6444
netlink_rcv_skb+0x1db/0x420 net/netlink/af_netlink.c:2545
netlink_unicast_kernel net/netlink/af_netlink.c:1342 [inline]
netlink_unicast+0x7d8/0x970 net/netlink/af_netlink.c:1368
netlink_sendmsg+0xa33/0xd70 net/netlink/af_netlink.c:1910
sock_sendmsg_nosec net/socket.c:730 [inline]
sock_sendmsg net/socket.c:753 [inline]
____sys_sendmsg+0x58e/0x880 net/socket.c:2541
___sys_sendmsg net/socket.c:2595 [inline]
__sys_sendmsg+0x2ac/0x390 net/socket.c:2624
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
-> #1 (&priv->j1939_socks_lock){+.-.}-{2:2}:
__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:356 [inline]
j1939_sk_errqueue+0x92/0x140 net/can/j1939/socket.c:1083
__j1939_session_release net/can/j1939/transport.c:294 [inline]
kref_put include/linux/kref.h:65 [inline]
j1939_session_put+0xfb/0x460 net/can/j1939/transport.c:299
j1939_session_deactivate_locked net/can/j1939/transport.c:1086 [inline]
j1939_cancel_active_session+0x350/0x480 net/can/j1939/transport.c:2194
j1939_netdev_notify+0x201/0x2e0 net/can/j1939/main.c:380
notifier_call_chain+0x18c/0x3a0 kernel/notifier.c:93
call_netdevice_notifiers_info net/core/dev.c:1970 [inline]
call_netdevice_notifiers_extack net/core/dev.c:2008 [inline]
call_netdevice_notifiers net/core/dev.c:2022 [inline]
dev_close_many+0x382/0x530 net/core/dev.c:1563
unregister_netdevice_many_notify+0x4e4/0x1900 net/core/dev.c:10911
rtnl_delete_link net/core/rtnetlink.c:3227 [inline]
rtnl_dellink+0x526/0x8e0 net/core/rtnetlink.c:3279
rtnetlink_rcv_msg+0x827/0xf50 net/core/rtnetlink.c:6444
netlink_rcv_skb+0x1db/0x420 net/netlink/af_netlink.c:2545
netlink_unicast_kernel net/netlink/af_netlink.c:1342 [inline]
netlink_unicast+0x7d8/0x970 net/netlink/af_netlink.c:1368
netlink_sendmsg+0xa33/0xd70 net/netlink/af_netlink.c:1910
sock_sendmsg_nosec net/socket.c:730 [inline]
sock_sendmsg net/socket.c:753 [inline]
____sys_sendmsg+0x58e/0x880 net/socket.c:2541
___sys_sendmsg net/socket.c:2595 [inline]
__sys_sendmsg+0x2ac/0x390 net/socket.c:2624
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
-> #0 (&priv->active_session_list_lock){+.-.}-{2:2}:
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain kernel/locking/lockdep.c:3868 [inline]
__lock_acquire+0x39fb/0x7f70 kernel/locking/lockdep.c:5136
lock_acquire+0x1df/0x520 kernel/locking/lockdep.c:5753
__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:356 [inline]
j1939_session_list_lock net/can/j1939/transport.c:238 [inline]
j1939_session_activate+0x4d/0x3d0 net/can/j1939/transport.c:1564
j1939_sk_queue_activate_next_locked net/can/j1939/socket.c:181 [inline]
j1939_sk_queue_activate_next+0x268/0x3e0 net/can/j1939/socket.c:208
j1939_session_deactivate_activate_next net/can/j1939/transport.c:1108 [inline]
j1939_xtp_rx_abort_one+0x359/0x410 net/can/j1939/transport.c:1351
j1939_xtp_rx_abort net/can/j1939/transport.c:1362 [inline]
j1939_tp_cmd_recv net/can/j1939/transport.c:2111 [inline]
j1939_tp_recv+0x956/0x1000 net/can/j1939/transport.c:2144
j1939_can_recv+0x72e/0xb10 net/can/j1939/main.c:112
deliver net/can/af_can.c:572 [inline]
can_rcv_filter+0x349/0x7c0 net/can/af_can.c:606
can_receive+0x2f2/0x430 net/can/af_can.c:663
can_rcv+0x140/0x260 net/can/af_can.c:687
__netif_receive_skb_one_core net/core/dev.c:5523 [inline]
__netif_receive_skb+0x1c6/0x530 net/core/dev.c:5637
process_backlog+0x347/0x700 net/core/dev.c:5965
__napi_poll+0xc7/0x470 net/core/dev.c:6527
napi_poll net/core/dev.c:6594 [inline]
net_rx_action+0x787/0x1000 net/core/dev.c:6727
__do_softirq+0x2a7/0x8fc kernel/softirq.c:553
do_softirq+0x117/0x1e0 kernel/softirq.c:454
__local_bh_enable_ip+0x1b1/0x1f0 kernel/softirq.c:381
srcu_invoke_callbacks+0x1d5/0x420 kernel/rcu/srcutree.c:1713
process_one_work+0x775/0x1110 kernel/workqueue.c:2630
process_scheduled_works kernel/workqueue.c:2703 [inline]
worker_thread+0xabb/0x1060 kernel/workqueue.c:2784
kthread+0x2b0/0x340 kernel/kthread.c:388
ret_from_fork+0x44/0x70 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
other info that might help us debug this:
Chain exists of:
&priv->active_session_list_lock --> &priv->j1939_socks_lock --> &jsk->sk_session_queue_lock
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&jsk->sk_session_queue_lock);
lock(&priv->j1939_socks_lock);
lock(&jsk->sk_session_queue_lock);
lock(&priv->active_session_list_lock);
*** DEADLOCK ***
5 locks held by kworker/0:0/8:
#0: ffff888012872938 ((wq_completion)rcu_gp){+.+.}-{0:0}, at: process_one_work+0x64d/0x1110
#1: ffffc900000d7d20 ((work_completion)(&sdp->work)){+.+.}-{0:0}, at: process_one_work+0x686/0x1110 kernel/workqueue.c:2605
#2: ffffffff8d32a960 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x9/0x30 include/linux/rcupdate.h:303
#3: ffffffff8d32a960 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:302
#4: ffff88807ad285c8 (&jsk->sk_session_queue_lock){+.-.}-{2:2}, at: spin_lock_bh include/linux/spinlock.h:356 [inline]
#4: ffff88807ad285c8 (&jsk->sk_session_queue_lock){+.-.}-{2:2}, at: j1939_sk_queue_activate_next+0x54/0x3e0 net/can/j1939/socket.c:207
stack backtrace:
CPU: 0 PID: 8 Comm: kworker/0:0 Not tainted 6.6.0-rc1-syzkaller-00161-g9608c7b729e2 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023
Workqueue: rcu_gp srcu_invoke_callbacks
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106
check_noncircular+0x371/0x4a0 kernel/locking/lockdep.c:2187
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain kernel/locking/lockdep.c:3868 [inline]
__lock_acquire+0x39fb/0x7f70 kernel/locking/lockdep.c:5136
lock_acquire+0x1df/0x520 kernel/locking/lockdep.c:5753
__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:356 [inline]
j1939_session_list_lock net/can/j1939/transport.c:238 [inline]
j1939_session_activate+0x4d/0x3d0 net/can/j1939/transport.c:1564
j1939_sk_queue_activate_next_locked net/can/j1939/socket.c:181 [inline]
j1939_sk_queue_activate_next+0x268/0x3e0 net/can/j1939/socket.c:208
j1939_session_deactivate_activate_next net/can/j1939/transport.c:1108 [inline]
j1939_xtp_rx_abort_one+0x359/0x410 net/can/j1939/transport.c:1351
j1939_xtp_rx_abort net/can/j1939/transport.c:1362 [inline]
j1939_tp_cmd_recv net/can/j1939/transport.c:2111 [inline]
j1939_tp_recv+0x956/0x1000 net/can/j1939/transport.c:2144
j1939_can_recv+0x72e/0xb10 net/can/j1939/main.c:112
deliver net/can/af_can.c:572 [inline]
can_rcv_filter+0x349/0x7c0 net/can/af_can.c:606
can_receive+0x2f2/0x430 net/can/af_can.c:663
can_rcv+0x140/0x260 net/can/af_can.c:687
__netif_receive_skb_one_core net/core/dev.c:5523 [inline]
__netif_receive_skb+0x1c6/0x530 net/core/dev.c:5637
process_backlog+0x347/0x700 net/core/dev.c:5965
__napi_poll+0xc7/0x470 net/core/dev.c:6527
napi_poll net/core/dev.c:6594 [inline]
net_rx_action+0x787/0x1000 net/core/dev.c:6727
__do_softirq+0x2a7/0x8fc kernel/softirq.c:553
do_softirq+0x117/0x1e0 kernel/softirq.c:454
__local_bh_enable_ip+0x1b1/0x1f0 kernel/softirq.c:381
srcu_invoke_callbacks+0x1d5/0x420 kernel/rcu/srcutree.c:1713
process_one_work+0x775/0x1110 kernel/workqueue.c:2630
process_scheduled_works kernel/workqueue.c:2703 [inline]
worker_thread+0xabb/0x1060 kernel/workqueue.c:2784
kthread+0x2b0/0x340 kernel/kthread.c:388
ret_from_fork+0x44/0x70 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
vxcan0: j1939_tp_rxtimer: 0xffff888026d86400: abort rx timeout. Force session deactivation