======================================================
WARNING: possible circular locking dependency detected
6.5.0-rc3-syzkaller-g6eaae1980760 #0 Not tainted
------------------------------------------------------
syz-executor.0/12432 is trying to acquire lock:
ffff00011b357130 (sk_lock-AF_CAN){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1708 [inline]
ffff00011b357130 (sk_lock-AF_CAN){+.+.}-{0:0}, at: raw_bind+0xa8/0x608 net/can/raw.c:435

but task is already holding lock:
ffff8000909ba128 (rtnl_mutex){+.+.}-{3:3}, at: rtnl_lock+0x20/0x2c net/core/rtnetlink.c:78

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (rtnl_mutex){+.+.}-{3:3}:
       __mutex_lock_common+0x190/0x21a0 kernel/locking/mutex.c:603
       __mutex_lock kernel/locking/mutex.c:747 [inline]
       mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:799
       rtnl_lock+0x20/0x2c net/core/rtnetlink.c:78
       raw_release+0x198/0x728 net/can/raw.c:391
       __sock_release net/socket.c:654 [inline]
       sock_close+0xb8/0x1fc net/socket.c:1386
       __fput+0x324/0x824 fs/file_table.c:384
       ____fput+0x20/0x30 fs/file_table.c:412
       task_work_run+0x230/0x2e0 kernel/task_work.c:179
       exit_task_work include/linux/task_work.h:38 [inline]
       do_exit+0x63c/0x1f58 kernel/exit.c:874
       do_group_exit+0x194/0x22c kernel/exit.c:1024
       get_signal+0x14b0/0x159c kernel/signal.c:2877
       do_signal arch/arm64/kernel/signal.c:1249 [inline]
       do_notify_resume+0x3cc/0x3c90 arch/arm64/kernel/signal.c:1302
       exit_to_user_mode_prepare arch/arm64/kernel/entry-common.c:137 [inline]
       exit_to_user_mode arch/arm64/kernel/entry-common.c:144 [inline]
       el0_svc+0x94/0x160 arch/arm64/kernel/entry-common.c:648
       el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:665
       el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591

-> #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+0x3370/0x75e8 kernel/locking/lockdep.c:5144
       lock_acquire+0x23c/0x71c kernel/locking/lockdep.c:5761
       lock_sock_nested+0x5c/0x11c net/core/sock.c:3492
       lock_sock include/net/sock.h:1708 [inline]
       raw_bind+0xa8/0x608 net/can/raw.c:435
       __sys_bind+0x1e8/0x284 net/socket.c:1792
       __do_sys_bind net/socket.c:1803 [inline]
       __se_sys_bind net/socket.c:1801 [inline]
       __arm64_sys_bind+0x7c/0x94 net/socket.c:1801
       __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
       invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
       el0_svc_common+0x138/0x244 arch/arm64/kernel/syscall.c:139
       do_el0_svc+0x64/0x198 arch/arm64/kernel/syscall.c:188
       el0_svc+0x4c/0x160 arch/arm64/kernel/entry-common.c:647
       el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:665
       el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591

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.0/12432:
 #0: ffff8000909ba128 (rtnl_mutex){+.+.}-{3:3}, at: rtnl_lock+0x20/0x2c net/core/rtnetlink.c:78

stack backtrace:
CPU: 0 PID: 12432 Comm: syz-executor.0 Not tainted 6.5.0-rc3-syzkaller-g6eaae1980760 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2023
Call trace:
 dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:233
 show_stack+0x2c/0x44 arch/arm64/kernel/stacktrace.c:240
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xd0/0x124 lib/dump_stack.c:106
 dump_stack+0x1c/0x28 lib/dump_stack.c:113
 print_circular_bug+0x150/0x1b8 kernel/locking/lockdep.c:2068
 check_noncircular+0x310/0x404 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+0x3370/0x75e8 kernel/locking/lockdep.c:5144
 lock_acquire+0x23c/0x71c kernel/locking/lockdep.c:5761
 lock_sock_nested+0x5c/0x11c net/core/sock.c:3492
 lock_sock include/net/sock.h:1708 [inline]
 raw_bind+0xa8/0x608 net/can/raw.c:435
 __sys_bind+0x1e8/0x284 net/socket.c:1792
 __do_sys_bind net/socket.c:1803 [inline]
 __se_sys_bind net/socket.c:1801 [inline]
 __arm64_sys_bind+0x7c/0x94 net/socket.c:1801
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x244 arch/arm64/kernel/syscall.c:139
 do_el0_svc+0x64/0x198 arch/arm64/kernel/syscall.c:188
 el0_svc+0x4c/0x160 arch/arm64/kernel/entry-common.c:647
 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:665
 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591