====================================================== WARNING: possible circular locking dependency detected 6.1.123-syzkaller #0 Not tainted ------------------------------------------------------ syz.1.1480/10537 is trying to acquire lock: ffff8880630faad0 ((work_completion)(&new_smc->smc_listen_work)){+.+.}-{0:0}, at: __flush_work+0xe5/0xad0 kernel/workqueue.c:3072 but task is already holding lock: ffff8880630f97b0 (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+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 lock_sock_nested+0x44/0x100 net/core/sock.c:3485 smc_listen_out+0x11b/0x3d0 net/smc/af_smc.c:1865 process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292 worker_thread+0xa47/0x1200 kernel/workqueue.c:2439 kthread+0x28d/0x320 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 -> #0 ((work_completion)(&new_smc->smc_listen_work)){+.+.}-{0:0}: check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain+0x1661/0x5950 kernel/locking/lockdep.c:3825 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __flush_work+0xfe/0xad0 kernel/workqueue.c:3072 __cancel_work_timer+0x519/0x6a0 kernel/workqueue.c:3163 smc_clcsock_release+0x5e/0xe0 net/smc/smc_close.c:29 __smc_release+0x678/0x7f0 net/smc/af_smc.c:300 smc_close_non_accepted+0xd4/0x1e0 net/smc/af_smc.c:1798 smc_close_cleanup_listen net/smc/smc_close.c:45 [inline] smc_close_active+0xa75/0xe20 net/smc/smc_close.c:225 __smc_release+0xa0/0x7f0 net/smc/af_smc.c:276 smc_release+0x2d5/0x530 net/smc/af_smc.c:343 __sock_release net/socket.c:654 [inline] sock_close+0xcd/0x230 net/socket.c:1400 __fput+0x3f6/0x8d0 fs/file_table.c:320 task_work_run+0x246/0x300 kernel/task_work.c:203 exit_task_work include/linux/task_work.h:39 [inline] do_exit+0xa6e/0x26a0 kernel/exit.c:871 do_group_exit+0x202/0x2b0 kernel/exit.c:1021 get_signal+0x16f7/0x17d0 kernel/signal.c:2871 arch_do_signal_or_restart+0xb0/0x1a10 arch/x86/kernel/signal.c:871 exit_to_user_mode_loop+0x6a/0x100 kernel/entry/common.c:174 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:210 irqentry_exit_to_user_mode+0x5/0x30 kernel/entry/common.c:316 exc_page_fault+0x1c0/0x620 arch/x86/mm/fault.c:1490 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:608 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.1.1480/10537: #0: ffff88804daddc10 (&sb->s_type->i_mutex_key#10){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #0: ffff88804daddc10 (&sb->s_type->i_mutex_key#10){+.+.}-{3:3}, at: __sock_release net/socket.c:653 [inline] #0: ffff88804daddc10 (&sb->s_type->i_mutex_key#10){+.+.}-{3:3}, at: sock_close+0x98/0x230 net/socket.c:1400 #1: ffff8880630f97b0 (sk_lock-AF_SMC/1){+.+.}-{0:0}, at: smc_release+0x22d/0x530 stack backtrace: CPU: 0 PID: 10537 Comm: syz.1.1480 Not tainted 6.1.123-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/0x2cb lib/dump_stack.c:106 check_noncircular+0x2fa/0x3b0 kernel/locking/lockdep.c:2170 check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain+0x1661/0x5950 kernel/locking/lockdep.c:3825 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __flush_work+0xfe/0xad0 kernel/workqueue.c:3072 __cancel_work_timer+0x519/0x6a0 kernel/workqueue.c:3163 smc_clcsock_release+0x5e/0xe0 net/smc/smc_close.c:29 __smc_release+0x678/0x7f0 net/smc/af_smc.c:300 smc_close_non_accepted+0xd4/0x1e0 net/smc/af_smc.c:1798 smc_close_cleanup_listen net/smc/smc_close.c:45 [inline] smc_close_active+0xa75/0xe20 net/smc/smc_close.c:225 __smc_release+0xa0/0x7f0 net/smc/af_smc.c:276 smc_release+0x2d5/0x530 net/smc/af_smc.c:343 __sock_release net/socket.c:654 [inline] sock_close+0xcd/0x230 net/socket.c:1400 __fput+0x3f6/0x8d0 fs/file_table.c:320 task_work_run+0x246/0x300 kernel/task_work.c:203 exit_task_work include/linux/task_work.h:39 [inline] do_exit+0xa6e/0x26a0 kernel/exit.c:871 do_group_exit+0x202/0x2b0 kernel/exit.c:1021 get_signal+0x16f7/0x17d0 kernel/signal.c:2871 arch_do_signal_or_restart+0xb0/0x1a10 arch/x86/kernel/signal.c:871 exit_to_user_mode_loop+0x6a/0x100 kernel/entry/common.c:174 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:210 irqentry_exit_to_user_mode+0x5/0x30 kernel/entry/common.c:316 exc_page_fault+0x1c0/0x620 arch/x86/mm/fault.c:1490 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:608 RIP: 0033:0x7f15ff985d31 Code: Unable to access opcode bytes at 0x7f15ff985d07. RSP: 002b:00000000fffffe10 EFLAGS: 00010217 RAX: 0000000000000000 RBX: 00007f15ffb76080 RCX: 00007f15ff985d29 RDX: 0000000000000000 RSI: 00000000fffffe10 RDI: 0000000000000000 RBP: 00007f15ffa01b08 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f15ffb76080 R15: 00007ffdd5d2e308