====================================================== WARNING: possible circular locking dependency detected 5.15.173-syzkaller #0 Not tainted ------------------------------------------------------ syz.4.928/7585 is trying to acquire lock: ffff888019f813d0 ((work_completion)(&new_smc->smc_listen_work)){+.+.}-{0:0}, at: __flush_work+0xcf/0x1a0 kernel/workqueue.c:3090 but task is already holding lock: ffff888019f80120 (sk_lock-AF_SMC/1){+.+.}-{0:0}, at: smc_release+0x22d/0x530 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (sk_lock-AF_SMC/1){+.+.}-{0:0}: lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 lock_sock_nested+0x44/0x100 net/core/sock.c:3250 smc_listen_out+0x84/0x320 net/smc/af_smc.c:1480 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457 kthread+0x3f6/0x4f0 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 -> #0 ((work_completion)(&new_smc->smc_listen_work)){+.+.}-{0:0}: check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain+0x1649/0x5930 kernel/locking/lockdep.c:3788 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 __flush_work+0xeb/0x1a0 kernel/workqueue.c:3090 __cancel_work_timer+0x519/0x6a0 kernel/workqueue.c:3181 smc_clcsock_release+0x5e/0xe0 net/smc/smc_close.c:29 __smc_release+0x3b9/0x530 net/smc/af_smc.c:171 smc_close_non_accepted+0xd4/0x1e0 net/smc/af_smc.c:1426 smc_close_cleanup_listen net/smc/smc_close.c:45 [inline] smc_close_active+0x9f3/0xdb0 net/smc/smc_close.c:219 __smc_release+0xa6/0x530 net/smc/af_smc.c:147 smc_release+0x2d5/0x530 net/smc/af_smc.c:214 __sock_release net/socket.c:649 [inline] sock_close+0xcd/0x230 net/socket.c:1336 __fput+0x3fe/0x8e0 fs/file_table.c:280 task_work_run+0x129/0x1a0 kernel/task_work.c:188 exit_task_work include/linux/task_work.h:33 [inline] do_exit+0x6a3/0x2480 kernel/exit.c:874 do_group_exit+0x144/0x310 kernel/exit.c:996 get_signal+0xc66/0x14e0 kernel/signal.c:2900 arch_do_signal_or_restart+0xc3/0x1890 arch/x86/kernel/signal.c:867 handle_signal_work kernel/entry/common.c:154 [inline] exit_to_user_mode_loop+0x97/0x130 kernel/entry/common.c:178 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x5d/0x240 kernel/entry/common.c:307 do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(sk_lock-AF_SMC/1); lock((work_completion)(&new_smc->smc_listen_work)); lock(sk_lock-AF_SMC/1); lock((work_completion)(&new_smc->smc_listen_work)); *** DEADLOCK *** 2 locks held by syz.4.928/7585: #0: ffff8880683e1410 (&sb->s_type->i_mutex_key#11){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:789 [inline] #0: ffff8880683e1410 (&sb->s_type->i_mutex_key#11){+.+.}-{3:3}, at: __sock_release net/socket.c:648 [inline] #0: ffff8880683e1410 (&sb->s_type->i_mutex_key#11){+.+.}-{3:3}, at: sock_close+0x98/0x230 net/socket.c:1336 #1: ffff888019f80120 (sk_lock-AF_SMC/1){+.+.}-{0:0}, at: smc_release+0x22d/0x530 stack backtrace: CPU: 0 PID: 7585 Comm: syz.4.928 Not tainted 5.15.173-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 check_noncircular+0x2f8/0x3b0 kernel/locking/lockdep.c:2133 check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain+0x1649/0x5930 kernel/locking/lockdep.c:3788 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 __flush_work+0xeb/0x1a0 kernel/workqueue.c:3090 __cancel_work_timer+0x519/0x6a0 kernel/workqueue.c:3181 smc_clcsock_release+0x5e/0xe0 net/smc/smc_close.c:29 __smc_release+0x3b9/0x530 net/smc/af_smc.c:171 smc_close_non_accepted+0xd4/0x1e0 net/smc/af_smc.c:1426 smc_close_cleanup_listen net/smc/smc_close.c:45 [inline] smc_close_active+0x9f3/0xdb0 net/smc/smc_close.c:219 __smc_release+0xa6/0x530 net/smc/af_smc.c:147 smc_release+0x2d5/0x530 net/smc/af_smc.c:214 __sock_release net/socket.c:649 [inline] sock_close+0xcd/0x230 net/socket.c:1336 __fput+0x3fe/0x8e0 fs/file_table.c:280 task_work_run+0x129/0x1a0 kernel/task_work.c:188 exit_task_work include/linux/task_work.h:33 [inline] do_exit+0x6a3/0x2480 kernel/exit.c:874 do_group_exit+0x144/0x310 kernel/exit.c:996 get_signal+0xc66/0x14e0 kernel/signal.c:2900 arch_do_signal_or_restart+0xc3/0x1890 arch/x86/kernel/signal.c:867 handle_signal_work kernel/entry/common.c:154 [inline] exit_to_user_mode_loop+0x97/0x130 kernel/entry/common.c:178 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x5d/0x240 kernel/entry/common.c:307 do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f4855b0fd19 Code: Unable to access opcode bytes at RIP 0x7f4855b0fcef. RSP: 002b:00007f48539800e8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffe00 RBX: 00007f4855cfffa8 RCX: 00007f4855b0fd19 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007f4855cfffa8 RBP: 00007f4855cfffa0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f4855cfffac R13: 0000000000000000 R14: 00007ffe47d83c60 R15: 00007ffe47d83d48