vxcan0: j1939_tp_rxtimer: 0xffff88807854f800: rx timeout, send abort
======================================================
WARNING: possible circular locking dependency detected
6.3.0-rc3-syzkaller-00322-g4bdec23f971b #0 Not tainted
------------------------------------------------------
syz-executor.0/5091 is trying to acquire lock:
ffff888079cf10d0 (&priv->j1939_socks_lock){+.-.}-{2:2}, at: spin_lock_bh include/linux/spinlock.h:355 [inline]
ffff888079cf10d0 (&priv->j1939_socks_lock){+.-.}-{2:2}, at: j1939_sk_errqueue+0x96/0x150 net/can/j1939/socket.c:1081
but task is already holding lock:
ffff888079cf1088 (&priv->active_session_list_lock){+.-.}-{2:2}, at: spin_lock_bh include/linux/spinlock.h:355 [inline]
ffff888079cf1088 (&priv->active_session_list_lock){+.-.}-{2:2}, at: j1939_session_list_lock net/can/j1939/transport.c:238 [inline]
ffff888079cf1088 (&priv->active_session_list_lock){+.-.}-{2:2}, at: j1939_tp_rxtimer+0xd0/0x380 net/can/j1939/transport.c:1244
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+0x1e1/0x520 kernel/locking/lockdep.c:5669
__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:355 [inline]
j1939_session_list_lock net/can/j1939/transport.c:238 [inline]
j1939_session_activate+0x51/0x3e0 net/can/j1939/transport.c:1557
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:1105 [inline]
j1939_tp_rxtimer+0x1a8/0x380 net/can/j1939/transport.c:1232
__run_hrtimer kernel/time/hrtimer.c:1685 [inline]
__hrtimer_run_queues+0x59f/0xd10 kernel/time/hrtimer.c:1749
hrtimer_run_softirq+0x19a/0x2c0 kernel/time/hrtimer.c:1766
__do_softirq+0x2ab/0x908 kernel/softirq.c:571
invoke_softirq kernel/softirq.c:445 [inline]
__irq_exit_rcu+0x159/0x240 kernel/softirq.c:650
irq_exit_rcu+0x9/0x20 kernel/softirq.c:662
sysvec_apic_timer_interrupt+0x95/0xb0 arch/x86/kernel/apic/apic.c:1107
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645
finish_lock_switch+0x95/0x110 kernel/sched/core.c:5063
finish_task_switch+0x134/0x650 kernel/sched/core.c:5181
context_switch kernel/sched/core.c:5307 [inline]
__schedule+0x1743/0x4630 kernel/sched/core.c:6622
schedule+0xc3/0x180 kernel/sched/core.c:6698
do_nanosleep+0x18a/0x610 kernel/time/hrtimer.c:2044
hrtimer_nanosleep+0x226/0x460 kernel/time/hrtimer.c:2097
__do_sys_clock_nanosleep kernel/time/posix-timers.c:1277 [inline]
__se_sys_clock_nanosleep+0x327/0x3b0 kernel/time/posix-timers.c:1254
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
-> #1 (&jsk->sk_session_queue_lock){+.-.}-{2:2}:
lock_acquire+0x1e1/0x520 kernel/locking/lockdep.c:5669
__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:355 [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:1275
j1939_netdev_notify+0x20b/0x2e0 net/can/j1939/main.c:379
notifier_call_chain kernel/notifier.c:87 [inline]
raw_notifier_call_chain+0xd4/0x170 kernel/notifier.c:455
__dev_notify_flags+0x359/0x650
dev_change_flags+0xf0/0x1a0 net/core/dev.c:8604
do_setlink+0xe93/0x2ae0 net/core/rtnetlink.c:2833
__rtnl_newlink net/core/rtnetlink.c:3623 [inline]
rtnl_newlink+0x172d/0x2010 net/core/rtnetlink.c:3670
rtnetlink_rcv_msg+0x825/0xf40 net/core/rtnetlink.c:6174
netlink_rcv_skb+0x1df/0x430 net/netlink/af_netlink.c:2574
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:1942
sock_sendmsg_nosec net/socket.c:724 [inline]
sock_sendmsg net/socket.c:747 [inline]
____sys_sendmsg+0x58f/0x890 net/socket.c:2501
___sys_sendmsg net/socket.c:2555 [inline]
__sys_sendmsg+0x2ad/0x390 net/socket.c:2584
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x41/0xc0 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:3098 [inline]
check_prevs_add kernel/locking/lockdep.c:3217 [inline]
validate_chain+0x166b/0x58e0 kernel/locking/lockdep.c:3832
__lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5056
lock_acquire+0x1e1/0x520 kernel/locking/lockdep.c:5669
__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:355 [inline]
j1939_sk_errqueue+0x96/0x150 net/can/j1939/socket.c:1081
__j1939_session_cancel+0x321/0x480 net/can/j1939/transport.c:1128
j1939_tp_rxtimer+0x2d0/0x380 net/can/j1939/transport.c:1253
__run_hrtimer kernel/time/hrtimer.c:1685 [inline]
__hrtimer_run_queues+0x59f/0xd10 kernel/time/hrtimer.c:1749
hrtimer_run_softirq+0x19a/0x2c0 kernel/time/hrtimer.c:1766
__do_softirq+0x2ab/0x908 kernel/softirq.c:571
invoke_softirq kernel/softirq.c:445 [inline]
__irq_exit_rcu+0x159/0x240 kernel/softirq.c:650
irq_exit_rcu+0x9/0x20 kernel/softirq.c:662
sysvec_apic_timer_interrupt+0x95/0xb0 arch/x86/kernel/apic/apic.c:1107
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645
arch___clear_bit arch/x86/include/asm/bitops.h:94 [inline]
___clear_bit include/asm-generic/bitops/instrumented-non-atomic.h:45 [inline]
__reset_page_owner+0xc1/0x190 mm/page_owner.c:151
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1454 [inline]
free_pcp_prepare mm/page_alloc.c:1504 [inline]
free_unref_page_prepare+0xe2f/0xe70 mm/page_alloc.c:3388
free_unref_page_list+0x596/0x830 mm/page_alloc.c:3529
release_pages+0x219e/0x2470 mm/swap.c:1042
__pagevec_release+0x84/0x100 mm/swap.c:1062
pagevec_release include/linux/pagevec.h:63 [inline]
folio_batch_release include/linux/pagevec.h:132 [inline]
shmem_undo_range+0x6b6/0x1dd0 mm/shmem.c:946
shmem_truncate_range mm/shmem.c:1041 [inline]
shmem_evict_inode+0x258/0x9f0 mm/shmem.c:1156
evict+0x2a4/0x620 fs/inode.c:665
__dentry_kill+0x436/0x650 fs/dcache.c:607
dentry_kill+0xbb/0x290
dput+0x1f3/0x420 fs/dcache.c:913
__fput+0x5e4/0x890 fs/file_table.c:329
task_work_run+0x24a/0x300 kernel/task_work.c:179
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
exit_to_user_mode_loop+0xd9/0x100 kernel/entry/common.c:171
exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:203
__syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline]
syscall_exit_to_user_mode+0x64/0x280 kernel/entry/common.c:296
do_syscall_64+0x4d/0xc0 arch/x86/entry/common.c:86
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 ***
2 locks held by syz-executor.0/5091:
#0: ffffffff8cf25420 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x40 include/linux/rcupdate.h:326
#1: ffff888079cf1088 (&priv->active_session_list_lock){+.-.}-{2:2}, at: spin_lock_bh include/linux/spinlock.h:355 [inline]
#1: ffff888079cf1088 (&priv->active_session_list_lock){+.-.}-{2:2}, at: j1939_session_list_lock net/can/j1939/transport.c:238 [inline]
#1: ffff888079cf1088 (&priv->active_session_list_lock){+.-.}-{2:2}, at: j1939_tp_rxtimer+0xd0/0x380 net/can/j1939/transport.c:1244
stack backtrace:
CPU: 0 PID: 5091 Comm: syz-executor.0 Not tainted 6.3.0-rc3-syzkaller-00322-g4bdec23f971b #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106
check_noncircular+0x2fe/0x3b0 kernel/locking/lockdep.c:2178
check_prev_add kernel/locking/lockdep.c:3098 [inline]
check_prevs_add kernel/locking/lockdep.c:3217 [inline]
validate_chain+0x166b/0x58e0 kernel/locking/lockdep.c:3832
__lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5056
lock_acquire+0x1e1/0x520 kernel/locking/lockdep.c:5669
__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:355 [inline]
j1939_sk_errqueue+0x96/0x150 net/can/j1939/socket.c:1081
__j1939_session_cancel+0x321/0x480 net/can/j1939/transport.c:1128
j1939_tp_rxtimer+0x2d0/0x380 net/can/j1939/transport.c:1253
__run_hrtimer kernel/time/hrtimer.c:1685 [inline]
__hrtimer_run_queues+0x59f/0xd10 kernel/time/hrtimer.c:1749
hrtimer_run_softirq+0x19a/0x2c0 kernel/time/hrtimer.c:1766
__do_softirq+0x2ab/0x908 kernel/softirq.c:571
invoke_softirq kernel/softirq.c:445 [inline]
__irq_exit_rcu+0x159/0x240 kernel/softirq.c:650
irq_exit_rcu+0x9/0x20 kernel/softirq.c:662
sysvec_apic_timer_interrupt+0x95/0xb0 arch/x86/kernel/apic/apic.c:1107
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645
RIP: 0010:get_page_owner mm/page_owner.c:107 [inline]
RIP: 0010:__reset_page_owner+0xc1/0x190 mm/page_owner.c:152
Code: 9f 00 00 00 e8 20 ea a0 ff 41 83 ee 01 0f 82 b5 00 00 00 e8 11 ea a0 ff 48 89 df be 08 00 00 00 e8 94 a2 f6 ff 48 0f ba 33 01 <48> 8b 05 58 3e 19 0b 48 8d 2c 03 48 8d 7c 03 0c 48 89 f8 48 c1 e8
RSP: 0018:ffffc90003cbf550 EFLAGS: 00000257
RAX: ffffffff81e98301 RBX: ffff8880148b6600 RCX: ffffffff81e9831c
RDX: 0000000000000001 RSI: 0000000000000008 RDI: ffff8880148b6600
RBP: ffffea00022b6618 R08: dffffc0000000000 R09: ffffed1002916cc1
R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 1ffffffff2373ea8
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1454 [inline]
free_pcp_prepare mm/page_alloc.c:1504 [inline]
free_unref_page_prepare+0xe2f/0xe70 mm/page_alloc.c:3388
free_unref_page_list+0x596/0x830 mm/page_alloc.c:3529
release_pages+0x219e/0x2470 mm/swap.c:1042
__pagevec_release+0x84/0x100 mm/swap.c:1062
pagevec_release include/linux/pagevec.h:63 [inline]
folio_batch_release include/linux/pagevec.h:132 [inline]
shmem_undo_range+0x6b6/0x1dd0 mm/shmem.c:946
shmem_truncate_range mm/shmem.c:1041 [inline]
shmem_evict_inode+0x258/0x9f0 mm/shmem.c:1156
evict+0x2a4/0x620 fs/inode.c:665
__dentry_kill+0x436/0x650 fs/dcache.c:607
dentry_kill+0xbb/0x290
dput+0x1f3/0x420 fs/dcache.c:913
__fput+0x5e4/0x890 fs/file_table.c:329
task_work_run+0x24a/0x300 kernel/task_work.c:179
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
exit_to_user_mode_loop+0xd9/0x100 kernel/entry/common.c:171
exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:203
__syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline]
syscall_exit_to_user_mode+0x64/0x280 kernel/entry/common.c:296
do_syscall_64+0x4d/0xc0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fc94e28d567
Code: ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffdffb07448 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007fc94e28d567
RDX: 00007ffdffb0751a RSI: 000000000000000a RDI: 00007ffdffb07510
RBP: 00007ffdffb07510 R08: 00000000ffffffff R09: 00007ffdffb072e0
R10: 0000555555c568b3 R11: 0000000000000246 R12: 00007fc94e2e6b74
R13: 00007ffdffb085d0 R14: 0000555555c56810 R15: 00007ffdffb08610
vxcan0: j1939_tp_rxtimer: 0xffff88807854f800: abort rx timeout. Force session deactivation
----------------
Code disassembly (best guess), 2 bytes skipped:
0: 00 00 add %al,(%rax)
2: e8 20 ea a0 ff callq 0xffa0ea27
7: 41 83 ee 01 sub $0x1,%r14d
b: 0f 82 b5 00 00 00 jb 0xc6
11: e8 11 ea a0 ff callq 0xffa0ea27
16: 48 89 df mov %rbx,%rdi
19: be 08 00 00 00 mov $0x8,%esi
1e: e8 94 a2 f6 ff callq 0xfff6a2b7
23: 48 0f ba 33 01 btrq $0x1,(%rbx)
* 28: 48 8b 05 58 3e 19 0b mov 0xb193e58(%rip),%rax # 0xb193e87 <-- trapping instruction
2f: 48 8d 2c 03 lea (%rbx,%rax,1),%rbp
33: 48 8d 7c 03 0c lea 0xc(%rbx,%rax,1),%rdi
38: 48 89 f8 mov %rdi,%rax
3b: 48 rex.W
3c: c1 .byte 0xc1
3d: e8 .byte 0xe8