syzbot


possible deadlock in smc_switch_to_fallback
Status: fixed on 2022/03/08 16:11
Reported-by: syzbot+e979d3597f48262cb4ee@syzkaller.appspotmail.com
Fix commit: 7a61432dc813 net/smc: Avoid warning of possible recursive locking
First crash: 189d, last: 166d

Sample crash report:
============================================
WARNING: possible recursive locking detected
5.16.0-rc2-syzkaller #0 Not tainted
--------------------------------------------
syz-executor.5/4475 is trying to acquire lock:
ffff888090758058 (&ei->socket.wq.wait){..-.}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline]
ffff888090758058 (&ei->socket.wq.wait){..-.}-{2:2}, at: smc_switch_to_fallback+0x3d5/0x8c0 net/smc/af_smc.c:588

but task is already holding lock:
ffff888080e60098 (&ei->socket.wq.wait){..-.}-{2:2}, at: smc_switch_to_fallback+0x3ca/0x8c0 net/smc/af_smc.c:587

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&ei->socket.wq.wait);
  lock(&ei->socket.wq.wait);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

2 locks held by syz-executor.5/4475:
 #0: ffff8880841d4ba0 (sk_lock-AF_SMC){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1645 [inline]
 #0: ffff8880841d4ba0 (sk_lock-AF_SMC){+.+.}-{0:0}, at: smc_setsockopt+0x2b7/0xa40 net/smc/af_smc.c:2449
 #1: ffff888080e60098 (&ei->socket.wq.wait){..-.}-{2:2}, at: smc_switch_to_fallback+0x3ca/0x8c0 net/smc/af_smc.c:587

stack backtrace:
CPU: 0 PID: 4475 Comm: syz-executor.5 Not tainted 5.16.0-rc2-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 print_deadlock_bug kernel/locking/lockdep.c:2956 [inline]
 check_deadlock kernel/locking/lockdep.c:2999 [inline]
 validate_chain kernel/locking/lockdep.c:3788 [inline]
 __lock_acquire.cold+0x149/0x3ab kernel/locking/lockdep.c:5027
 lock_acquire kernel/locking/lockdep.c:5637 [inline]
 lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5602
 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline]
 _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154
 spin_lock include/linux/spinlock.h:349 [inline]
 smc_switch_to_fallback+0x3d5/0x8c0 net/smc/af_smc.c:588
 smc_setsockopt+0x8ee/0xa40 net/smc/af_smc.c:2459
 __sys_setsockopt+0x2db/0x610 net/socket.c:2176
 __do_sys_setsockopt net/socket.c:2187 [inline]
 __se_sys_setsockopt net/socket.c:2184 [inline]
 __x64_sys_setsockopt+0xba/0x150 net/socket.c:2184
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f1291400ae9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f128e976188 EFLAGS: 00000246 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 00007f1291513f60 RCX: 00007f1291400ae9
RDX: 0000000000000021 RSI: 0000000000000006 RDI: 0000000000000003
RBP: 00007f129145af6d R08: 0000000000000010 R09: 0000000000000000
R10: 0000000020000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fff4f70932f R14: 00007f128e976300 R15: 0000000000022000
 </TASK>

Crashes (43575):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-selinux-root 2021/11/26 21:45 upstream a4849f6000e2 63eeac02 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-kasan-gce 2021/11/26 17:12 upstream a4849f6000e2 63eeac02 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-kasan-gce-root 2021/11/26 15:20 upstream a4849f6000e2 63eeac02 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-kasan-gce-smack-root 2021/11/26 12:30 upstream a4849f6000e2 63eeac02 .config log report info possible deadlock in smc_switch_to_fallback
ci-qemu-upstream 2021/11/25 22:21 upstream b501b85957de 63eeac02 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-kasan-gce-root 2021/11/20 00:57 upstream 9539ba4308ad 3a9d0024 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-kasan-gce-386 2021/11/26 15:12 upstream a4849f6000e2 63eeac02 .config log report info possible deadlock in smc_switch_to_fallback
ci-qemu2-arm64-compat 2021/11/26 11:20 upstream a4849f6000e2 63eeac02 .config log report info possible deadlock in smc_switch_to_fallback
ci-qemu2-arm64 2021/11/25 23:59 upstream b501b85957de 63eeac02 .config log report info possible deadlock in smc_switch_to_fallback
ci-qemu-upstream-386 2021/11/25 05:58 upstream 5f53fa508db0 545ab074 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/09 12:03 bpf b560b21f71eb a4a2a501 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/09 11:01 bpf b560b21f71eb a4a2a501 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/09 10:53 bpf b560b21f71eb a4a2a501 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/09 09:52 bpf b560b21f71eb a4a2a501 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/09 09:02 bpf b560b21f71eb a4a2a501 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/09 08:56 bpf b560b21f71eb a4a2a501 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/09 07:45 bpf b560b21f71eb a4a2a501 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/09 07:41 bpf b560b21f71eb a4a2a501 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/09 06:39 bpf b560b21f71eb a4a2a501 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/09 06:02 bpf b560b21f71eb a4a2a501 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/09 05:38 bpf b560b21f71eb a4a2a501 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/09 05:18 bpf b560b21f71eb a4a2a501 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/09 04:14 bpf b560b21f71eb a4a2a501 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/09 03:21 bpf b560b21f71eb a4a2a501 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/09 02:55 bpf b560b21f71eb a4a2a501 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/09 01:51 bpf b560b21f71eb a4a2a501 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/09 01:24 bpf b560b21f71eb a4a2a501 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/09 00:24 bpf b560b21f71eb a4a2a501 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/08 22:09 bpf b560b21f71eb a4a2a501 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/08 21:06 bpf b560b21f71eb a4a2a501 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/08 21:03 bpf b560b21f71eb a4a2a501 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/08 20:02 bpf b560b21f71eb a4a2a501 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/08 18:56 bpf b560b21f71eb a4a2a501 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/08 17:54 bpf b560b21f71eb a4a2a501 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/08 17:30 bpf b560b21f71eb a4a2a501 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/08 16:48 bpf 2fa7d94afc1a a4a2a501 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/08 16:21 bpf 2fa7d94afc1a a4a2a501 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/08 15:21 bpf 2fa7d94afc1a a4a2a501 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/08 14:19 bpf 2fa7d94afc1a a4a2a501 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/08 13:57 bpf 2fa7d94afc1a a4a2a501 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/08 12:57 bpf 2fa7d94afc1a a4a2a501 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/08 12:34 bpf 2fa7d94afc1a a4a2a501 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/08 12:27 bpf 2fa7d94afc1a a4a2a501 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/08 11:26 bpf 2fa7d94afc1a 0230ba3e .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/08 10:57 bpf 2fa7d94afc1a 0230ba3e .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/08 10:15 bpf 2fa7d94afc1a 0230ba3e .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/08 09:27 bpf 2fa7d94afc1a 0230ba3e .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/08 08:44 bpf 2fa7d94afc1a 0230ba3e .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/08 07:42 bpf 2fa7d94afc1a 0230ba3e .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/08 07:19 bpf 2fa7d94afc1a 0230ba3e .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/08 06:40 bpf 2fa7d94afc1a 0230ba3e .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/08 06:11 bpf 2fa7d94afc1a 0230ba3e .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-bpf-kasan-gce 2021/12/08 05:09 bpf 2fa7d94afc1a 0230ba3e .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-net-this-kasan-gce 2021/11/22 23:42 net 3bd6b2a838ba 545ab074 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-net-this-kasan-gce 2021/11/16 02:42 net cf4f5530bb55 83f5c9b5 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-net-kasan-gce 2021/11/27 06:33 net-next 35bf8c86eeb8 63eeac02 .config log report info possible deadlock in smc_switch_to_fallback
ci-upstream-linux-next-kasan-gce-root 2021/11/22 22:36 linux-next 5191249f8803 545ab074 .config log report info possible deadlock in smc_switch_to_fallback