syzbot


WARNING: refcount bug in smc_release (2)

Status: fixed on 2020/02/14 01:19
Subsystems: net s390
[Documentation on labels]
Reported-by: syzbot+96d3f9ff6a86d37e44c8@syzkaller.appspotmail.com
Fix commit: 86434744fedf net/smc: add fallback check to connect()
First crash: 1664d, last: 1639d
Cause bisection: introduced by (bisect log) :
commit 50717a37db032ce783f50685a73bb2ac68471a5a
Author: Ursula Braun <ubraun@linux.ibm.com>
Date: Fri Apr 12 10:57:23 2019 +0000

  net/smc: nonblocking connect rework

Crash: WARNING in smc_unhash_sk (log)
Repro: C syz .config
  
Discussions (5)
Title Replies (including bot) Last reply
[PATCH AUTOSEL 5.4 001/187] ASoC: rt5682: fix i2c arbitration lost issue 142 (142) 2020/01/30 19:50
[PATCH 5.4 000/191] 5.4.8-stable review 215 (215) 2020/01/06 09:03
[PATCH net] net/smc: add fallback check to connect() 2 (2) 2019/12/15 19:15
Re: WARNING: refcount bug in smc_release (2) 1 (1) 2019/12/04 11:47
WARNING: refcount bug in smc_release (2) 0 (4) 2019/12/01 12:21
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream WARNING: refcount bug in smc_release net s390 C done 8 1671d 1694d 13/28 fixed on 2019/11/23 02:56
upstream WARNING: refcount bug in smc_release (3) net s390 1 1385d 1374d 15/28 fixed on 2020/09/25 01:17

Sample crash report:
------------[ cut here ]------------
refcount_t: underflow; use-after-free.
WARNING: CPU: 1 PID: 9807 at lib/refcount.c:28 refcount_warn_saturate+0x1dc/0x1f0 lib/refcount.c:28
Kernel panic - not syncing: panic_on_warn set ...
CPU: 1 PID: 9807 Comm: syz-executor293 Not tainted 5.4.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x197/0x210 lib/dump_stack.c:118
 panic+0x2e3/0x75c kernel/panic.c:221
 __warn.cold+0x2f/0x3e kernel/panic.c:582
 report_bug+0x289/0x300 lib/bug.c:195
 fixup_bug arch/x86/kernel/traps.c:174 [inline]
 fixup_bug arch/x86/kernel/traps.c:169 [inline]
 do_error_trap+0x11b/0x200 arch/x86/kernel/traps.c:267
 do_invalid_op+0x37/0x50 arch/x86/kernel/traps.c:286
 invalid_op+0x23/0x30 arch/x86/entry/entry_64.S:1027
RIP: 0010:refcount_warn_saturate+0x1dc/0x1f0 lib/refcount.c:28
Code: e9 d8 fe ff ff 48 89 df e8 c1 5a 24 fe e9 85 fe ff ff e8 e7 08 e7 fd 48 c7 c7 a0 6f 4f 88 c6 05 60 b8 a4 06 01 e8 53 bd b7 fd <0f> 0b e9 ac fe ff ff 0f 1f 00 66 2e 0f 1f 84 00 00 00 00 00 55 48
RSP: 0018:ffff888093c97998 EFLAGS: 00010286
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff815e4316 RDI: ffffed1012792f25
RBP: ffff888093c979a8 R08: ffff8880a04d4380 R09: ffffed1015d26621
R10: ffffed1015d26620 R11: ffff8880ae933107 R12: 0000000000000003
R13: 0000000000000000 R14: ffff8880a118d380 R15: ffff88809427e558
 refcount_sub_and_test include/linux/refcount.h:261 [inline]
 refcount_dec_and_test include/linux/refcount.h:281 [inline]
 sock_put include/net/sock.h:1728 [inline]
 smc_release+0x445/0x520 net/smc/af_smc.c:202
 __sock_release+0xce/0x280 net/socket.c:591
 sock_close+0x1e/0x30 net/socket.c:1269
 __fput+0x2ff/0x890 fs/file_table.c:280
 ____fput+0x16/0x20 fs/file_table.c:313
 task_work_run+0x145/0x1c0 kernel/task_work.c:113
 exit_task_work include/linux/task_work.h:22 [inline]
 do_exit+0x8e7/0x2ef0 kernel/exit.c:797
 do_group_exit+0x135/0x360 kernel/exit.c:895
 get_signal+0x47c/0x24f0 kernel/signal.c:2734
 do_signal+0x87/0x1700 arch/x86/kernel/signal.c:815
 exit_to_usermode_loop+0x286/0x380 arch/x86/entry/common.c:160
 prepare_exit_to_usermode arch/x86/entry/common.c:195 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:278 [inline]
 do_syscall_32_irqs_on arch/x86/entry/common.c:352 [inline]
 do_fast_syscall_32+0xbbd/0xe16 arch/x86/entry/common.c:408
 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139
RIP: 0023:0xf7f69a39
Code: Bad RIP value.
RSP: 002b:00000000f7f441ec EFLAGS: 00000296 ORIG_RAX: 00000000000000f0
RAX: fffffffffffffe00 RBX: 00000000080fb018 RCX: 0000000000000080
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000006
RBP: 0000000020000040 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
Kernel Offset: disabled
Rebooting in 86400 seconds..

Crashes (9):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/12/01 04:36 upstream 32ef9553635a a76bf83f .config console log report syz C ci-upstream-kasan-gce-386
2019/12/01 09:44 upstream 32ef9553635a a76bf83f .config console log report syz ci-upstream-kasan-gce-selinux-root
2019/12/01 07:15 upstream 32ef9553635a a76bf83f .config console log report syz ci-upstream-kasan-gce-smack-root
2019/11/30 19:51 upstream 81b6b96475ac 3a75be00 .config console log report syz ci-upstream-kasan-gce-root
2019/12/12 15:16 upstream 687dec9b9459 d973f528 .config console log report ci-upstream-kasan-gce-selinux-root
2019/12/10 17:28 net-old 868afbaca1e2 5a5826a1 .config console log report ci-upstream-net-this-kasan-gce
2019/12/18 13:12 net-next-old 1f2565780e9b f2fe0772 .config console log report ci-upstream-net-kasan-gce
2019/12/02 17:08 net-next-old 81b6b96475ac f879db37 .config console log report ci-upstream-net-kasan-gce
2019/11/23 06:10 net-next-old c4f2cbd37651 598ca6c8 .config console log report ci-upstream-net-kasan-gce
* Struck through repros no longer work on HEAD.