======================================================
WARNING: possible circular locking dependency detected
6.5.0-rc3-syzkaller #0 Not tainted
------------------------------------------------------
kworker/0:0/7 is trying to acquire lock:
ffff88807d185088 (&priv->active_session_list_lock){+.-.}-{2:2}, at: spin_lock_bh include/linux/spinlock.h:356 [inline]
ffff88807d185088 (&priv->active_session_list_lock){+.-.}-{2:2}, at: j1939_session_list_lock net/can/j1939/transport.c:238 [inline]
ffff88807d185088 (&priv->active_session_list_lock){+.-.}-{2:2}, at: j1939_session_activate+0x51/0x3e0 net/can/j1939/transport.c:1564
but task is already holding lock:
ffff88807dc2a5c0 (&jsk->sk_session_queue_lock){+.-.}-{2:2}, at: spin_lock_bh include/linux/spinlock.h:356 [inline]
ffff88807dc2a5c0 (&jsk->sk_session_queue_lock){+.-.}-{2:2}, at: j1939_sk_queue_activate_next+0x58/0x3f0 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+0x35/0x50 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+0xed/0x160 net/can/j1939/socket.c:1280
j1939_netdev_notify+0x20d/0x2e0 net/can/j1939/main.c:381
notifier_call_chain+0x18c/0x3a0 kernel/notifier.c:93
call_netdevice_notifiers_info net/core/dev.c:1962 [inline]
call_netdevice_notifiers_extack net/core/dev.c:2000 [inline]
call_netdevice_notifiers net/core/dev.c:2014 [inline]
dev_close_many+0x386/0x530 net/core/dev.c:1555
unregister_netdevice_many_notify+0x4ec/0x1880 net/core/dev.c:10823
rtnl_delete_link net/core/rtnetlink.c:3214 [inline]
rtnl_dellink+0x52a/0x8e0 net/core/rtnetlink.c:3266
rtnetlink_rcv_msg+0x82b/0xf50 net/core/rtnetlink.c:6424
netlink_rcv_skb+0x1df/0x430 net/netlink/af_netlink.c:2549
netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline]
netlink_unicast+0x7c3/0x990 net/netlink/af_netlink.c:1365
netlink_sendmsg+0xa2a/0xd60 net/netlink/af_netlink.c:1914
sock_sendmsg_nosec net/socket.c:725 [inline]
sock_sendmsg net/socket.c:748 [inline]
____sys_sendmsg+0x592/0x890 net/socket.c:2494
___sys_sendmsg net/socket.c:2548 [inline]
__sys_sendmsg+0x2b0/0x3a0 net/socket.c:2577
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x41/0x90 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+0x35/0x50 kernel/locking/spinlock.c:178
spin_lock_bh include/linux/spinlock.h:356 [inline]
j1939_sk_errqueue+0x96/0x150 net/can/j1939/socket.c:1081
__j1939_session_release net/can/j1939/transport.c:294 [inline]
kref_put include/linux/kref.h:65 [inline]
j1939_session_put+0xff/0x460 net/can/j1939/transport.c:299
j1939_session_deactivate_locked net/can/j1939/transport.c:1086 [inline]
j1939_cancel_active_session+0x354/0x480 net/can/j1939/transport.c:2194
j1939_netdev_notify+0x205/0x2e0 net/can/j1939/main.c:380
notifier_call_chain+0x18c/0x3a0 kernel/notifier.c:93
call_netdevice_notifiers_info net/core/dev.c:1962 [inline]
call_netdevice_notifiers_extack net/core/dev.c:2000 [inline]
call_netdevice_notifiers net/core/dev.c:2014 [inline]
dev_close_many+0x386/0x530 net/core/dev.c:1555
unregister_netdevice_many_notify+0x4ec/0x1880 net/core/dev.c:10823
rtnl_delete_link net/core/rtnetlink.c:3214 [inline]
rtnl_dellink+0x52a/0x8e0 net/core/rtnetlink.c:3266
rtnetlink_rcv_msg+0x82b/0xf50 net/core/rtnetlink.c:6424
netlink_rcv_skb+0x1df/0x430 net/netlink/af_netlink.c:2549
netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline]
netlink_unicast+0x7c3/0x990 net/netlink/af_netlink.c:1365
netlink_sendmsg+0xa2a/0xd60 net/netlink/af_netlink.c:1914
sock_sendmsg_nosec net/socket.c:725 [inline]
sock_sendmsg net/socket.c:748 [inline]
____sys_sendmsg+0x592/0x890 net/socket.c:2494
___sys_sendmsg net/socket.c:2548 [inline]
__sys_sendmsg+0x2b0/0x3a0 net/socket.c:2577
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x41/0x90 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:3142 [inline]
check_prevs_add kernel/locking/lockdep.c:3261 [inline]
validate_chain kernel/locking/lockdep.c:3876 [inline]
__lock_acquire+0x39ff/0x7f70 kernel/locking/lockdep.c:5144
lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5761
__raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline]
_raw_spin_lock_bh+0x35/0x50 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+0x51/0x3e0 net/can/j1939/transport.c:1564
j1939_sk_queue_activate_next_locked net/can/j1939/socket.c:181 [inline]
j1939_sk_queue_activate_next+0x26c/0x3f0 net/can/j1939/socket.c:208
j1939_session_deactivate_activate_next net/can/j1939/transport.c:1108 [inline]
j1939_session_completed net/can/j1939/transport.c:1222 [inline]
j1939_xtp_rx_eoma_one net/can/j1939/transport.c:1395 [inline]
j1939_xtp_rx_eoma+0x323/0x530 net/can/j1939/transport.c:1410
j1939_tp_cmd_recv net/can/j1939/transport.c:2099 [inline]
j1939_tp_recv+0x88e/0x1050 net/can/j1939/transport.c:2144
j1939_can_recv+0x732/0xb20 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+0x144/0x260 net/can/af_can.c:687
__netif_receive_skb_one_core net/core/dev.c:5452 [inline]
__netif_receive_skb+0x1ca/0x530 net/core/dev.c:5566
process_backlog+0x34b/0x710 net/core/dev.c:5894
__napi_poll+0xc7/0x470 net/core/dev.c:6460
napi_poll net/core/dev.c:6527 [inline]
net_rx_action+0x78b/0x1010 net/core/dev.c:6660
__do_softirq+0x2ab/0x908 kernel/softirq.c:553
do_softirq+0x11b/0x1e0 kernel/softirq.c:454
__local_bh_enable_ip+0x1b5/0x1f0 kernel/softirq.c:381
spin_unlock_bh include/linux/spinlock.h:396 [inline]
cfg80211_inform_single_bss_frame_data net/wireless/scan.c:2887 [inline]
cfg80211_inform_bss_frame_data+0xe8d/0x1870 net/wireless/scan.c:2912
ieee80211_bss_info_update+0x80c/0xb20 net/mac80211/scan.c:211
ieee80211_rx_bss_info net/mac80211/ibss.c:1124 [inline]
ieee80211_rx_mgmt_probe_beacon net/mac80211/ibss.c:1613 [inline]
ieee80211_ibss_rx_queued_mgmt+0x18e5/0x2ca0 net/mac80211/ibss.c:1642
ieee80211_iface_process_skb net/mac80211/iface.c:1604 [inline]
ieee80211_iface_work+0x7bd/0xcf0 net/mac80211/iface.c:1658
cfg80211_wiphy_work+0x21e/0x250 net/wireless/core.c:435
process_one_work+0x92c/0x12c0 kernel/workqueue.c:2597
worker_thread+0xa63/0x1210 kernel/workqueue.c:2748
kthread+0x2b8/0x350 kernel/kthread.c:389
ret_from_fork+0x2e/0x60 arch/x86/kernel/process.c:145
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:296
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 ***
7 locks held by kworker/0:0/7:
#0: ffff888012870d38 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work+0x7e3/0x12c0 kernel/workqueue.c:2569
#1: ffffc900000c7d00 ((work_completion)(&rdev->wiphy_work)){+.+.}-{0:0}, at: process_one_work+0x82b/0x12c0 kernel/workqueue.c:2571
#2: ffff888068e50768 (&rdev->wiphy.mtx){+.+.}-{3:3}, at: wiphy_lock include/net/cfg80211.h:5773 [inline]
#2: ffff888068e50768 (&rdev->wiphy.mtx){+.+.}-{3:3}, at: cfg80211_wiphy_work+0x35/0x250 net/wireless/core.c:422
#3: ffff888073288cc0 (&wdev->mtx){+.+.}-{3:3}, at: sdata_lock net/mac80211/ieee80211_i.h:1135 [inline]
#3: ffff888073288cc0 (&wdev->mtx){+.+.}-{3:3}, at: ieee80211_ibss_rx_queued_mgmt+0x11c/0x2ca0 net/mac80211/ibss.c:1631
#4: ffffffff8d3261a0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x9/0x40 include/linux/rcupdate.h:303
#5: ffffffff8d3261a0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x40 include/linux/rcupdate.h:302
#6: ffff88807dc2a5c0 (&jsk->sk_session_queue_lock){+.-.}-{2:2}, at: spin_lock_bh include/linux/spinlock.h:356 [inline]
#6: ffff88807dc2a5c0 (&jsk->sk_session_queue_lock){+.-.}-{2:2}, at: j1939_sk_queue_activate_next+0x58/0x3f0 net/can/j1939/socket.c:207
stack backtrace:
CPU: 0 PID: 7 Comm: kworker/0:0 Not tainted 6.5.0-rc3-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2023
Workqueue: events cfg80211_wiphy_work
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106
check_noncircular+0x375/0x4a0 kernel/locking/lockdep.c:2195
check_prev_add kernel/locking/lockdep.c:3142 [inline]
check_prevs_add kernel/locking/lockdep.c:3261 [inline]
validate_chain kernel/locking/lockdep.c:3876 [inline]
__lock_acquire+0x39ff/0x7f70 kernel/locking/lockdep.c:5144
lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5761
__raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline]
_raw_spin_lock_bh+0x35/0x50 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+0x51/0x3e0 net/can/j1939/transport.c:1564
j1939_sk_queue_activate_next_locked net/can/j1939/socket.c:181 [inline]
j1939_sk_queue_activate_next+0x26c/0x3f0 net/can/j1939/socket.c:208
j1939_session_deactivate_activate_next net/can/j1939/transport.c:1108 [inline]
j1939_session_completed net/can/j1939/transport.c:1222 [inline]
j1939_xtp_rx_eoma_one net/can/j1939/transport.c:1395 [inline]
j1939_xtp_rx_eoma+0x323/0x530 net/can/j1939/transport.c:1410
j1939_tp_cmd_recv net/can/j1939/transport.c:2099 [inline]
j1939_tp_recv+0x88e/0x1050 net/can/j1939/transport.c:2144
j1939_can_recv+0x732/0xb20 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+0x144/0x260 net/can/af_can.c:687
__netif_receive_skb_one_core net/core/dev.c:5452 [inline]
__netif_receive_skb+0x1ca/0x530 net/core/dev.c:5566
process_backlog+0x34b/0x710 net/core/dev.c:5894
__napi_poll+0xc7/0x470 net/core/dev.c:6460
napi_poll net/core/dev.c:6527 [inline]
net_rx_action+0x78b/0x1010 net/core/dev.c:6660
__do_softirq+0x2ab/0x908 kernel/softirq.c:553
do_softirq+0x11b/0x1e0 kernel/softirq.c:454
__local_bh_enable_ip+0x1b5/0x1f0 kernel/softirq.c:381
spin_unlock_bh include/linux/spinlock.h:396 [inline]
cfg80211_inform_single_bss_frame_data net/wireless/scan.c:2887 [inline]
cfg80211_inform_bss_frame_data+0xe8d/0x1870 net/wireless/scan.c:2912
ieee80211_bss_info_update+0x80c/0xb20 net/mac80211/scan.c:211
ieee80211_rx_bss_info net/mac80211/ibss.c:1124 [inline]
ieee80211_rx_mgmt_probe_beacon net/mac80211/ibss.c:1613 [inline]
ieee80211_ibss_rx_queued_mgmt+0x18e5/0x2ca0 net/mac80211/ibss.c:1642
ieee80211_iface_process_skb net/mac80211/iface.c:1604 [inline]
ieee80211_iface_work+0x7bd/0xcf0 net/mac80211/iface.c:1658
cfg80211_wiphy_work+0x21e/0x250 net/wireless/core.c:435
process_one_work+0x92c/0x12c0 kernel/workqueue.c:2597
worker_thread+0xa63/0x1210 kernel/workqueue.c:2748
kthread+0x2b8/0x350 kernel/kthread.c:389
ret_from_fork+0x2e/0x60 arch/x86/kernel/process.c:145
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:296
RIP: 0000:0x0
Code: Unable to access opcode bytes at 0xffffffffffffffd6.
RSP: 0000:0000000000000000 EFLAGS: 00000000 ORIG_RAX: 0000000000000000
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
vxcan0 (unregistered): j1939_tp_rxtimer: 0xffff888064496400: rx timeout, send abort
vxcan0: j1939_xtp_rx_dat: no tx connection found
vxcan0 (unregistered): j1939_tp_rxtimer: 0xffff888064496400: abort rx timeout. Force session deactivation
vxcan0 (unregistered): j1939_tp_rxtimer: 0xffff888077679000: rx timeout, send abort
vxcan0: j1939_xtp_rx_dat: no tx connection found
vxcan0 (unregistering): j1939_xtp_rx_dat: no rx connection found
vxcan0 (unregistering): j1939_xtp_rx_dat: no tx connection found
vxcan0 (unregistering): j1939_xtp_rx_dat: no rx connection found
vxcan0 (unregistering): j1939_xtp_rx_dat: no tx connection found
vxcan0 (unregistering): j1939_xtp_rx_dat: no rx connection found
vxcan0 (unregistering): j1939_xtp_rx_dat: no tx connection found
vxcan0 (unregistering): j1939_xtp_rx_dat: no rx connection found
vxcan0 (unregistering): j1939_xtp_rx_dat: no tx connection found
vxcan0 (unregistering): j1939_xtp_rx_dat: no rx connection found
vxcan0 (unregistering): j1939_xtp_rx_dat: no tx connection found
vxcan0 (unregistering): j1939_xtp_rx_dat: no rx connection found
vxcan0 (unregistering): j1939_xtp_rx_dat: no tx connection found
vxcan0 (unregistering): j1939_xtp_rx_dat: no rx connection found
vxcan0 (unregistering): j1939_xtp_rx_dat: no tx connection found
vxcan0 (unregistering): j1939_xtp_rx_dat: no rx connection found
vxcan0 (unregistering): j1939_xtp_rx_dat: no tx connection found
vxcan0 (unregistering): j1939_xtp_rx_dat: no rx connection found
vxcan0 (unregistering): j1939_xtp_rx_dat: no tx connection found
vxcan0 (unregistering): j1939_xtp_rx_dat: no rx connection found
vxcan0 (unregistering): j1939_xtp_rx_dat: no tx connection found
vxcan0 (unregistering): j1939_xtp_rx_dat: no rx connection found
vxcan0 (unregistering): j1939_xtp_rx_dat: no tx connection found
vxcan0 (unregistering): j1939_xtp_rx_dat: no rx connection found
vxcan0 (unregistering): j1939_xtp_rx_dat: no tx connection found
vxcan0 (unregistering): j1939_xtp_rx_dat: no rx connection found
vxcan0 (unregistering): j1939_xtp_rx_dat: no tx connection found
vxcan0 (unregistering): j1939_xtp_rx_dat: no rx connection found
vxcan0 (unregistering): j1939_xtp_rx_dat: no tx connection found
vxcan0 (unregistering): j1939_xtp_rx_dat: no rx connection found
vxcan0 (unregistering): j1939_xtp_rx_dat: no tx connection found
vxcan0 (unregistering): j1939_xtp_rx_dat: no rx connection found
vxcan0 (unregistering): j1939_xtp_rx_dat: no tx connection found
vxcan0 (unregistering): j1939_xtp_rx_dat: no rx connection found
vxcan0 (unregistered): j1939_tp_rxtimer: 0xffff888077679000: abort rx timeout. Force session deactivation