syzbot


WARNING: refcount bug in sctp_wfree

Status: fixed on 2020/05/10 10:41
Subsystems: sctp
[Documentation on labels]
Reported-by: syzbot+cea71eec5d6de256d54d@syzkaller.appspotmail.com
Fix commit: 5c3e82fe1596 sctp: fix refcount bug in sctp_wfree
First crash: 1737d, last: 1716d
Cause bisection: introduced by (bisect log) :
commit fb041bb7c0a918b95c6889fc965cdc4a75b4c0ca
Author: Will Deacon <will@kernel.org>
Date: Thu Nov 21 11:59:00 2019 +0000

  locking/refcount: Consolidate implementations of refcount_t

Crash: WARNING: refcount bug in sock_wfree (log)
Repro: C syz .config
  
Discussions (14)
Title Replies (including bot) Last reply
[PATCH 5.4 000/134] 5.4.47-rc1 review 141 (141) 2021/01/28 17:06
[PATCH 4.19 00/54] 4.19.115-rc1 review 70 (70) 2020/05/27 20:33
[PATCH 4.14 00/38] 4.14.176-rc1 review 44 (44) 2020/04/14 10:36
[PATCH 4.9 00/32] 4.9.219-rc1 review 36 (36) 2020/04/14 10:35
[PATCH 5.6 00/29] 5.6.3-rc1 review 34 (34) 2020/04/07 14:49
[PATCH 5.5 00/46] 5.5.16-rc1 review 50 (50) 2020/04/07 14:48
[PATCH v6] sctp: fix refcount bug in sctp_wfree 3 (3) 2020/03/30 04:58
[PATCH v5 RESEND] sctp: fix refcount bug in sctp_wfree 3 (3) 2020/03/27 03:02
[PATCH v5] sctp: fix refcount bug in sctp_wfree 2 (2) 2020/03/27 01:26
WARNING: refcount bug in sctp_wfree 17 (30) 2020/03/26 21:25
[PATCH v4] sctp: fix refcount bug in sctp_wfree 6 (6) 2020/03/26 06:13
[PATCH v3] sctp: fix refcount bug in sctp_wfree 9 (9) 2020/03/21 01:33
[PATCH v2] sctp: fix refcount bug in sctp_wfree 7 (7) 2020/03/18 04:22
[PATCH] sctp: fix refcount bug in sctp_wfree 4 (4) 2020/03/17 04:44
Last patch testing requests (33)
Created Duration User Patch Repo Result
2020/03/26 16:17 17m anenbupt@gmail.com patch upstream OK
2020/03/22 06:41 16m anenbupt@gmail.com https://github.com/hqj/hqjagain_test.git datamsg_list OK
2020/03/22 04:12 16m anenbupt@gmail.com https://github.com/hqj/hqjagain_test.git sctp_for_each_tx_datachunk OK
2020/03/22 00:33 17m anenbupt@gmail.com https://github.com/hqj/hqjagain_test.git sctp_wfree OK
2020/03/21 15:08 17m anenbupt@gmail.com https://github.com/hqj/hqjagain_test.git sctp_wfree report log
2020/03/20 11:11 17m anenbupt@gmail.com https://github.com/hqj/hqjagain_test.git sctp_wfree_refcount_bug OK
2020/03/20 02:45 16m anenbupt@gmail.com https://github.com/hqj/hqjagain_test.git sctp_wfree report log
2020/03/19 15:00 17m anenbupt@gmail.com https://github.com/hqj/hqjagain_test.git sctp_wfree report log
2020/03/19 11:08 16m anenbupt@gmail.com https://github.com/hqj/hqjagain_test.git sctp_wfree report log
2020/03/19 04:34 17m anenbupt@gmail.com https://github.com/hqj/hqjagain_test.git sctp_wfree report log
2020/03/19 03:24 4m anenbupt@gmail.com https://github.com/hqj/hqjagain_test.git sctp_wfree error
2020/03/18 11:36 12m anenbupt@gmail.com https://github.com/hqj/hqjagain_test.git sctp_wfree report log
2020/03/18 03:22 14m anenbupt@gmail.com https://github.com/hqj/hqjagain_test.git sctp_wfree report log
2020/03/18 01:34 12m anenbupt@gmail.com https://github.com/hqj/hqjagain_test.git sctp_wfree report log
2020/03/17 16:11 11m anenbupt@gmail.com https://github.com/hqj/hqjagain_test.git sctp_wfree report log
2020/03/17 15:17 11m anenbupt@gmail.com https://github.com/hqj/hqjagain_test.git sctp_wfree report log
2020/03/17 11:02 9m anenbupt@gmail.com https://github.com/hqj/hqjagain_test.git sctp_wfree report log
2020/03/17 07:43 16m anenbupt@gmail.com https://github.com/hqj/hqjagain_test.git sctp_wfree report log
2020/03/17 04:26 17m anenbupt@gmail.com https://github.com/hqj/hqjagain_test.git sctp_wfree_refcount_bug OK
2020/03/15 23:06 16m anenbupt@gmail.com https://github.com/hqj/hqjagain_test.git sctp_wfree_refcount_bug OK
2020/03/15 08:34 16m anenbupt@gmail.com https://github.com/hqj/hqjagain_test.git sctp_wfree_refcount_bug OK
2020/03/15 07:59 9m anenbupt@gmail.com https://github.com/hqj/hqjagain_test.git sctp_wfree_refcount_bug report log
2020/03/15 07:19 17m anenbupt@gmail.com https://github.com/hqj/hqjagain_test.git sctp_wfree OK
2020/03/15 06:09 16m anenbupt@gmail.com https://github.com/hqj/hqjagain_test.git sctp_wfree report log
2020/03/15 02:49 4m anenbupt@gmail.com https://github.com/hqj/hqjagain_test.git sctp_wfree error
2020/03/15 01:28 13m anenbupt@gmail.com https://github.com/hqj/hqjagain_test.git sctp_wfree report log
2020/03/15 00:21 9m anenbupt@gmail.com https://github.com/hqj/hqjagain_test.git sctp_wfree report log
2020/03/14 15:46 0m anenbupt@gmail.com https://github.com/hqj/hqjagain_test.git scup_wfree error
2020/03/14 13:41 4m anenbupt@gmail.com https://github.com/hqj/hqjagain_test.git sctp_wfree error
2020/03/14 11:17 9m anenbupt@gmail.com https://github.com/hqj/hqjagain_test.git sctp_wfree report log
2020/03/14 05:10 9m anenbupt@gmail.com https://github.com/hqj/hqjagain_test.git sctp_wfree report log
2020/03/14 02:55 3m anenbupt@gmail.com https://github.com/hqj/hqjagain_test.git sctp_wfree error
2020/03/14 02:54 0m anenbupt@gmail.com https://github.com/hqj/hqjagain_test.git scup_wfree error

Sample crash report:
------------[ cut here ]------------
refcount_t: underflow; use-after-free.
WARNING: CPU: 0 PID: 7211 at lib/refcount.c:28 refcount_warn_saturate+0x15b/0x1a0 lib/refcount.c:28
Kernel panic - not syncing: panic_on_warn set ...
CPU: 0 PID: 7211 Comm: syz-executor869 Not tainted 5.6.0-rc7-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+0x1e9/0x30e lib/dump_stack.c:118
 panic+0x264/0x7a0 kernel/panic.c:221
 __warn+0x209/0x210 kernel/panic.c:582
 report_bug+0x1ac/0x2d0 lib/bug.c:195
 fixup_bug arch/x86/kernel/traps.c:174 [inline]
 do_error_trap+0xca/0x1c0 arch/x86/kernel/traps.c:267
 do_invalid_op+0x32/0x40 arch/x86/kernel/traps.c:286
 invalid_op+0x23/0x30 arch/x86/entry/entry_64.S:1027
RIP: 0010:refcount_warn_saturate+0x15b/0x1a0 lib/refcount.c:28
Code: c7 24 02 d1 88 31 c0 e8 d3 e3 b2 fd 0f 0b eb 85 e8 5a 05 e0 fd c6 05 f0 41 b1 05 01 48 c7 c7 50 02 d1 88 31 c0 e8 b5 e3 b2 fd <0f> 0b e9 64 ff ff ff e8 39 05 e0 fd c6 05 d0 41 b1 05 01 48 c7 c7
RSP: 0018:ffffc900015d77d0 EFLAGS: 00010246
RAX: ee06f2d01d3db900 RBX: 0000000000000003 RCX: ffff88809755e1c0
RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000
RBP: 0000000000000003 R08: ffffffff815e07a6 R09: ffffed1015d06618
R10: ffffed1015d06618 R11: 0000000000000000 R12: dffffc0000000000
R13: ffff8880a833c000 R14: ffff88809f2817c0 R15: 1ffff11013b282b0
 sctp_wfree+0x3b1/0x710 net/sctp/socket.c:9111
 skb_release_head_state+0xfb/0x210 net/core/skbuff.c:651
 skb_release_all net/core/skbuff.c:662 [inline]
 __kfree_skb+0x22/0x1c0 net/core/skbuff.c:678
 sctp_chunk_destroy net/sctp/sm_make_chunk.c:1454 [inline]
 sctp_chunk_put+0x17b/0x200 net/sctp/sm_make_chunk.c:1481
 __sctp_outq_teardown+0x80a/0x9d0 net/sctp/outqueue.c:257
 sctp_association_free+0x21e/0x7c0 net/sctp/associola.c:339
 sctp_cmd_delete_tcb net/sctp/sm_sideeffect.c:930 [inline]
 sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1318 [inline]
 sctp_side_effects net/sctp/sm_sideeffect.c:1185 [inline]
 sctp_do_sm+0x3c01/0x5560 net/sctp/sm_sideeffect.c:1156
 sctp_primitive_ABORT+0x93/0xc0 net/sctp/primitive.c:104
 sctp_close+0x231/0x770 net/sctp/socket.c:1512
 inet_release+0x135/0x180 net/ipv4/af_inet.c:427
 __sock_release net/socket.c:605 [inline]
 sock_close+0xd8/0x260 net/socket.c:1283
 __fput+0x2d8/0x730 fs/file_table.c:280
 task_work_run+0x176/0x1b0 kernel/task_work.c:113
 exit_task_work include/linux/task_work.h:22 [inline]
 do_exit+0x5ef/0x1f80 kernel/exit.c:801
 do_group_exit+0x15e/0x2c0 kernel/exit.c:899
 __do_sys_exit_group+0x13/0x20 kernel/exit.c:910
 __se_sys_exit_group+0x10/0x10 kernel/exit.c:908
 __x64_sys_exit_group+0x37/0x40 kernel/exit.c:908
 do_syscall_64+0xf3/0x1b0 arch/x86/entry/common.c:294
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x43ef98
Code: Bad RIP value.
RSP: 002b:00007ffd76f5a2c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043ef98
RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000
RBP: 00000000004be7a8 R08: 00000000000000e7 R09: ffffffffffffffd0
R10: 000000002059aff8 R11: 0000000000000246 R12: 0000000000000001
R13: 00000000006d01a0 R14: 0000000000000000 R15: 0000000000000000
Kernel Offset: disabled
Rebooting in 86400 seconds..

Crashes (20):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/03/28 01:15 upstream 527630fbf4f1 831e9a81 .config console log report syz C ci-upstream-kasan-gce-smack-root
2020/03/10 00:46 upstream 2c523b344dfa 35f53e45 .config console log report syz C ci-upstream-kasan-gce-smack-root
2020/03/31 02:37 upstream 673b41e04a03 c8d1cc20 .config console log report ci-upstream-kasan-gce-smack-root
2020/03/28 06:44 upstream 69c5eea3128e 831e9a81 .config console log report ci-upstream-kasan-gce-smack-root
2020/03/25 15:02 upstream 76ccd234269b 41f049cc .config console log report ci-upstream-kasan-gce-smack-root
2020/03/22 12:43 upstream b74b991fb8b9 78267cec .config console log report ci-upstream-kasan-gce-smack-root
2020/03/22 11:44 upstream b74b991fb8b9 78267cec .config console log report ci-upstream-kasan-gce-smack-root
2020/03/22 11:42 upstream b74b991fb8b9 78267cec .config console log report ci-upstream-kasan-gce-smack-root
2020/03/21 13:10 upstream 5ad0ec0b8652 4288d95e .config console log report ci-upstream-kasan-gce-smack-root
2020/03/21 13:09 upstream 5ad0ec0b8652 4288d95e .config console log report ci-upstream-kasan-gce-smack-root
2020/03/19 15:09 upstream 5076190daded 2c31c529 .config console log report ci-upstream-kasan-gce-smack-root
2020/03/19 15:08 upstream 5076190daded 2c31c529 .config console log report ci-upstream-kasan-gce-smack-root
2020/03/19 15:08 upstream 5076190daded 2c31c529 .config console log report ci-upstream-kasan-gce-smack-root
2020/03/19 15:00 upstream 5076190daded 2c31c529 .config console log report ci-upstream-kasan-gce-smack-root
2020/03/09 22:20 upstream 2c523b344dfa 35f53e45 .config console log report ci-upstream-kasan-gce-smack-root
2020/03/09 22:20 upstream 2c523b344dfa 35f53e45 .config console log report ci-upstream-kasan-gce-smack-root
2020/03/09 22:20 upstream 2c523b344dfa 35f53e45 .config console log report ci-upstream-kasan-gce-smack-root
2020/03/09 22:20 upstream 2c523b344dfa 35f53e45 .config console log report ci-upstream-kasan-gce-smack-root
2020/03/09 21:19 upstream 2c523b344dfa 35f53e45 .config console log report ci-upstream-kasan-gce-smack-root
2020/03/24 06:21 upstream 979e52ca0469 33e14df3 .config console log report ci-upstream-kasan-gce-386
* Struck through repros no longer work on HEAD.