====================================================== WARNING: possible circular locking dependency detected 6.5.0-rc3-syzkaller-00044-g0a8db05b571a #0 Not tainted ------------------------------------------------------ syz-executor.4/32071 is trying to acquire lock: ffff88803f37d130 (sk_lock-AF_CAN){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1708 [inline] ffff88803f37d130 (sk_lock-AF_CAN){+.+.}-{0:0}, at: raw_bind+0xa4/0x6e0 net/can/raw.c:435 but task is already holding lock: ffffffff8e4ba348 (rtnl_mutex){+.+.}-{3:3}, at: raw_bind+0x9a/0x6e0 net/can/raw.c:434 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (rtnl_mutex){+.+.}-{3:3}: __mutex_lock_common+0x1d8/0x2530 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x1b/0x20 kernel/locking/mutex.c:799 raw_release+0x1e6/0x870 net/can/raw.c:391 __sock_release net/socket.c:654 [inline] sock_close+0xd1/0x230 net/socket.c:1386 __fput+0x3f8/0x950 fs/file_table.c:384 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:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x64/0x280 kernel/entry/common.c:297 do_syscall_64+0x4d/0xc0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (sk_lock-AF_CAN){+.+.}-{0:0}: 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 lock_sock_nested+0x48/0x100 net/core/sock.c:3492 lock_sock include/net/sock.h:1708 [inline] raw_bind+0xa4/0x6e0 net/can/raw.c:435 __sys_bind+0x23a/0x2e0 net/socket.c:1792 __do_sys_bind net/socket.c:1803 [inline] __se_sys_bind net/socket.c:1801 [inline] __x64_sys_bind+0x7a/0x90 net/socket.c:1801 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 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(rtnl_mutex); lock(sk_lock-AF_CAN); lock(rtnl_mutex); lock(sk_lock-AF_CAN); *** DEADLOCK *** 1 lock held by syz-executor.4/32071: #0: ffffffff8e4ba348 (rtnl_mutex){+.+.}-{3:3}, at: raw_bind+0x9a/0x6e0 net/can/raw.c:434 stack backtrace: CPU: 0 PID: 32071 Comm: syz-executor.4 Not tainted 6.5.0-rc3-syzkaller-00044-g0a8db05b571a #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2023 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 lock_sock_nested+0x48/0x100 net/core/sock.c:3492 lock_sock include/net/sock.h:1708 [inline] raw_bind+0xa4/0x6e0 net/can/raw.c:435 __sys_bind+0x23a/0x2e0 net/socket.c:1792 __do_sys_bind net/socket.c:1803 [inline] __se_sys_bind net/socket.c:1801 [inline] __x64_sys_bind+0x7a/0x90 net/socket.c:1801 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 RIP: 0033:0x7f6939e7cb29 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f693aaef0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000031 RAX: ffffffffffffffda RBX: 00007f6939f9bf80 RCX: 00007f6939e7cb29 RDX: 0000000000000010 RSI: 0000000020000080 RDI: 0000000000000003 RBP: 00007f6939ec847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f6939f9bf80 R15: 00007ffcd88280e8