syzbot


possible deadlock in smc_switch_to_fallback

Status: fixed on 2022/03/08 16:11
Subsystems: net s390
[Documentation on labels]
Reported-by: syzbot+e979d3597f48262cb4ee@syzkaller.appspotmail.com
Fix commit: 7a61432dc813 net/smc: Avoid warning of possible recursive locking
First crash: 1060d, last: 1037d
Discussions (5)
Title Replies (including bot) Last reply
[PATCH 5.4 00/70] 5.4.164-rc1 review 77 (77) 2021/12/08 10:29
[PATCH 5.15 000/207] 5.15.7-rc1 review 215 (215) 2021/12/07 20:42
[PATCH 5.10 000/130] 5.10.84-rc1 review 140 (140) 2021/12/07 08:19
[PATCH net] net/smc: Avoid warning of possible recursive locking 3 (3) 2021/11/22 15:00
[syzbot] possible deadlock in smc_switch_to_fallback 3 (4) 2021/11/22 03:41
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in smc_switch_to_fallback (2) net s390 C error 3614 13m 109d 0/28 upstream: reported C repro on 2024/06/24 15:15

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