program: r0 = socket$inet6_tcp(0xa, 0x1, 0x0) close(r0) r1 = socket(0x2b, 0x1, 0x1) bind$inet6(r0, &(0x7f0000000080)={0xa, 0x4e22, 0x0, @empty}, 0x1c) listen(r1, 0x5) r2 = socket$inet_smc(0x2b, 0x1, 0x0) connect$inet(r2, &(0x7f0000000000)={0x2, 0x4e22, @local}, 0x10) r3 = seccomp$SECCOMP_SET_MODE_FILTER_LISTENER(0x1, 0x0, &(0x7f0000000040)={0x0, &(0x7f0000000100)}) close_range(r3, 0xffffffffffffffff, 0x0) [ 79.914794][ T5287] Bluetooth: hci0: command tx timeout [ 80.117808][ T5325] [ 80.118979][ T5325] ====================================================== [ 80.122605][ T5325] WARNING: possible circular locking dependency detected [ 80.126246][ T5325] syzkaller #0 Not tainted [ 80.128259][ T5325] ------------------------------------------------------ [ 80.131357][ T5325] syz.0.0/5325 is trying to acquire lock: [ 80.133898][ T5325] ffff888037678a68 ((work_completion)(&new_smc->smc_listen_work)){+.+.}-{0:0}, at: __flush_work+0x100/0xc50 [ 80.139047][ T5325] [ 80.139047][ T5325] but task is already holding lock: [ 80.142198][ T5325] ffff888037678ee0 (sk_lock-AF_SMC/1){+.+.}-{0:0}, at: smc_release+0x255/0x560 [ 80.146100][ T5325] [ 80.146100][ T5325] which lock already depends on the new lock. [ 80.146100][ T5325] [ 80.150462][ T5325] [ 80.150462][ T5325] the existing dependency chain (in reverse order) is: [ 80.154162][ T5325] [ 80.154162][ T5325] -> #1 (sk_lock-AF_SMC/1){+.+.}-{0:0}: [ 80.157632][ T5325] lock_sock_nested+0x41/0x100 [ 80.159945][ T5325] smc_listen_out+0x109/0x3e0 [ 80.162272][ T5325] smc_listen_work+0x813/0x13f0 [ 80.164677][ T5325] process_scheduled_works+0xb5d/0x1860 [ 80.167394][ T5325] worker_thread+0xa53/0xfc0 [ 80.169720][ T5325] kthread+0x389/0x470 [ 80.171869][ T5325] ret_from_fork+0x514/0xb70 [ 80.174192][ T5325] ret_from_fork_asm+0x1a/0x30 [ 80.176580][ T5325] [ 80.176580][ T5325] -> #0 ((work_completion)(&new_smc->smc_listen_work)){+.+.}-{0:0}: [ 80.180924][ T5325] __lock_acquire+0x15a5/0x2cf0 [ 80.183309][ T5325] lock_acquire+0x106/0x350 [ 80.185541][ T5325] __flush_work+0x700/0xc50 [ 80.187832][ T5325] __cancel_work_sync+0xbe/0x110 [ 80.190264][ T5325] smc_clcsock_release+0x60/0xf0 [ 80.192741][ T5325] __smc_release+0x66b/0x7e0 [ 80.195033][ T5325] smc_close_non_accepted+0xd5/0x1f0 [ 80.197666][ T5325] smc_close_active+0xb67/0xf10 [ 80.200109][ T5325] __smc_release+0x8d/0x7e0 [ 80.202273][ T5325] smc_release+0x2ce/0x560 [ 80.204498][ T5325] sock_close+0xc3/0x240 [ 80.206736][ T5325] __fput+0x44f/0xa60 [ 80.208838][ T5325] task_work_run+0x1d9/0x270 [ 80.211113][ T5325] exit_to_user_mode_loop+0x193/0x680 [ 80.213758][ T5325] do_syscall_64+0x353/0x580 [ 80.216049][ T5325] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 80.218908][ T5325] [ 80.218908][ T5325] other info that might help us debug this: [ 80.218908][ T5325] [ 80.222930][ T5325] Possible unsafe locking scenario: [ 80.222930][ T5325] [ 80.225659][ T5325] CPU0 CPU1 [ 80.227767][ T5325] ---- ---- [ 80.229871][ T5325] lock(sk_lock-AF_SMC/1); [ 80.231692][ T5325] lock((work_completion)(&new_smc->smc_listen_work)); [ 80.235238][ T5325] lock(sk_lock-AF_SMC/1); [ 80.238013][ T5325] lock((work_completion)(&new_smc->smc_listen_work)); [ 80.240756][ T5325] [ 80.240756][ T5325] *** DEADLOCK *** [ 80.240756][ T5325] [ 80.244168][ T5325] 3 locks held by syz.0.0/5325: [ 80.246355][ T5325] #0: ffff8880484e1f00 (&sb->s_type->i_mutex_key#13){+.+.}-{4:4}, at: sock_close+0x9b/0x240 [ 80.250829][ T5325] #1: ffff888037678ee0 (sk_lock-AF_SMC/1){+.+.}-{0:0}, at: smc_release+0x255/0x560 [ 80.254639][ T5325] #2: ffffffff8e95cca0 (rcu_read_lock){....}-{1:3}, at: __flush_work+0x100/0xc50 [ 80.258520][ T5325] [ 80.258520][ T5325] stack backtrace: [ 80.260816][ T5325] CPU: 0 UID: 0 PID: 5325 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) [ 80.260825][ T5325] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 80.260831][ T5325] Call Trace: [ 80.260835][ T5325] [ 80.260838][ T5325] dump_stack_lvl+0xe8/0x150 [ 80.260848][ T5325] print_circular_bug+0x2e1/0x300 [ 80.260859][ T5325] check_noncircular+0x12e/0x150 [ 80.260873][ T5325] __lock_acquire+0x15a5/0x2cf0 [ 80.260884][ T5325] ? do_raw_spin_lock+0x12b/0x2f0 [ 80.260901][ T5325] ? __flush_work+0x100/0xc50 [ 80.260908][ T5325] lock_acquire+0x106/0x350 [ 80.260915][ T5325] ? __flush_work+0x100/0xc50 [ 80.260923][ T5325] ? __flush_work+0x100/0xc50 [ 80.260930][ T5325] __flush_work+0x700/0xc50 [ 80.260937][ T5325] ? __flush_work+0x100/0xc50 [ 80.260945][ T5325] ? __flush_work+0x100/0xc50 [ 80.260955][ T5325] ? __pfx___flush_work+0x10/0x10 [ 80.260966][ T5325] ? __pfx_wq_barrier_func+0x10/0x10 [ 80.260979][ T5325] ? __cancel_work_sync+0x5c/0x110 [ 80.260991][ T5325] __cancel_work_sync+0xbe/0x110 [ 80.261001][ T5325] smc_clcsock_release+0x60/0xf0 [ 80.261009][ T5325] __smc_release+0x66b/0x7e0 [ 80.261018][ T5325] ? __local_bh_enable_ip+0xd0/0x130 [ 80.261025][ T5325] smc_close_non_accepted+0xd5/0x1f0 [ 80.261035][ T5325] smc_close_active+0xb67/0xf10 [ 80.261042][ T5325] ? __pfx_sock_def_readable+0x10/0x10 [ 80.261049][ T5325] __smc_release+0x8d/0x7e0 [ 80.261057][ T5325] ? __local_bh_enable_ip+0xd0/0x130 [ 80.261064][ T5325] smc_release+0x2ce/0x560 [ 80.261073][ T5325] sock_close+0xc3/0x240 [ 80.261079][ T5325] ? __pfx_sock_close+0x10/0x10 [ 80.261085][ T5325] __fput+0x44f/0xa60 [ 80.261095][ T5325] task_work_run+0x1d9/0x270 [ 80.261108][ T5325] ? __pfx_task_work_run+0x10/0x10 [ 80.261123][ T5325] exit_to_user_mode_loop+0x193/0x680 [ 80.261133][ T5325] ? rcu_is_watching+0x15/0xb0 [ 80.261145][ T5325] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 80.261154][ T5325] do_syscall_64+0x353/0x580 [ 80.261161][ T5325] ? clear_bhb_loop+0x40/0x90 [ 80.261169][ T5325] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 80.261175][ T5325] RIP: 0033:0x7fde2639ce59 [ 80.261183][ T5325] Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 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 e8 ff ff ff f7 d8 64 89 01 48 [ 80.261192][ T5325] RSP: 002b:00007ffe65810de8 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4 [ 80.261203][ T5325] RAX: 0000000000000000 RBX: 00007fde26617da0 RCX: 00007fde2639ce59 [ 80.261209][ T5325] RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003 [ 80.261215][ T5325] RBP: 00007fde26617da0 R08: 00007fde26616038 R09: 0000000000000000 [ 80.261221][ T5325] R10: 0000000000df8d10 R11: 0000000000000246 R12: 0000000000013b0f [ 80.261228][ T5325] R13: 00007fde2661609c R14: 000000000001386a R15: 00007fde26616090 [ 80.261239][ T5325]