syzbot


WARNING: refcount bug in tcindex_data_put

Status: fixed on 2020/05/10 10:41
Subsystems: net
[Documentation on labels]
Reported-by: syzbot+8325e509a1bf83ec741d@syzkaller.appspotmail.com
Fix commit: a8eab6d35e22 net_sched: fix a missing refcnt in tcindex_init()
First crash: 1517d, last: 1515d
Cause bisection: introduced by (bisect log) :
commit 304e024216a802a7dc8ba75d36de82fa136bbf3e
Author: Cong Wang <xiyou.wangcong@gmail.com>
Date: Sat Mar 28 19:12:59 2020 +0000

  net_sched: add a temporary refcnt for struct tcindex_data

Crash: WARNING: refcount bug in process_one_work (log)
Repro: C syz .config
  
Discussions (5)
Title Replies (including bot) Last reply
[PATCH 5.6 00/38] 5.6.4-rc1 review 44 (44) 2020/04/14 10:36
[PATCH 5.5 00/44] 5.5.17-rc1 review 48 (48) 2020/04/14 10:36
[PATCH 5.4 00/41] 5.4.32-rc1 review 45 (45) 2020/04/14 10:36
[Patch net] net_sched: fix a missing refcnt in tcindex_init() 2 (2) 2020/04/03 23:01
WARNING: refcount bug in tcindex_data_put 0 (1) 2020/04/02 18:23

Sample crash report:
------------[ cut here ]------------
refcount_t: underflow; use-after-free.
WARNING: CPU: 0 PID: 7 at lib/refcount.c:28 refcount_warn_saturate+0x1d1/0x1e0 lib/refcount.c:28
Kernel panic - not syncing: panic_on_warn set ...
CPU: 0 PID: 7 Comm: kworker/u4:0 Not tainted 5.6.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: tc_filter_workqueue tcindex_destroy_work
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x188/0x20d lib/dump_stack.c:118
 panic+0x2e3/0x75c kernel/panic.c:221
 __warn.cold+0x2f/0x35 kernel/panic.c:582
 report_bug+0x27b/0x2f0 lib/bug.c:195
 fixup_bug arch/x86/kernel/traps.c:175 [inline]
 fixup_bug arch/x86/kernel/traps.c:170 [inline]
 do_error_trap+0x12b/0x220 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+0x1d1/0x1e0 lib/refcount.c:28
Code: e9 db fe ff ff 48 89 df e8 2c 95 1e fe e9 8a fe ff ff e8 c2 81 e1 fd 48 c7 c7 40 c6 71 88 c6 05 42 be f1 06 01 e8 17 f6 b2 fd <0f> 0b e9 af fe ff ff 0f 1f 84 00 00 00 00 00 41 56 41 55 41 54 55
RSP: 0018:ffffc90000cdfcf0 EFLAGS: 00010282
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff815ca861 RDI: fffff5200019bf90
RBP: 0000000000000003 R08: ffff8880a95a41c0 R09: ffffed1015cc66a1
R10: ffffed1015cc66a0 R11: ffff8880ae633507 R12: ffff8880a81c8c2c
R13: ffff8880a81c8c40 R14: ffff8880a9580e00 R15: ffff8880aa034800
 refcount_sub_and_test include/linux/refcount.h:261 [inline]
 refcount_dec_and_test include/linux/refcount.h:281 [inline]
 tcindex_data_put+0xd1/0xf0 net/sched/cls_tcindex.c:72
 process_one_work+0x965/0x16a0 kernel/workqueue.c:2266
 worker_thread+0x96/0xe20 kernel/workqueue.c:2412
 kthread+0x388/0x470 kernel/kthread.c:268
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352
Kernel Offset: disabled
Rebooting in 86400 seconds..

Crashes (27):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/04/01 21:08 net-old 304e024216a8 a34e2c33 .config console log report syz C ci-upstream-net-this-kasan-gce
2020/04/03 22:56 net-old 468c2a100208 5ed396e6 .config console log report ci-upstream-net-this-kasan-gce
2020/04/03 22:33 net-old 468c2a100208 5ed396e6 .config console log report ci-upstream-net-this-kasan-gce
2020/04/03 16:54 net-old 468c2a100208 5ed396e6 .config console log report ci-upstream-net-this-kasan-gce
2020/04/03 16:54 net-old 468c2a100208 5ed396e6 .config console log report ci-upstream-net-this-kasan-gce
2020/04/03 16:45 net-old 468c2a100208 5ed396e6 .config console log report ci-upstream-net-this-kasan-gce
2020/04/03 16:45 net-old 468c2a100208 5ed396e6 .config console log report ci-upstream-net-this-kasan-gce
2020/04/03 01:17 net-old 21f64e72e707 a34e2c33 .config console log report ci-upstream-net-this-kasan-gce
2020/04/02 22:30 net-old d61f4d61ff7f a34e2c33 .config console log report ci-upstream-net-this-kasan-gce
2020/04/02 21:43 net-old d61f4d61ff7f a34e2c33 .config console log report ci-upstream-net-this-kasan-gce
2020/04/02 21:06 net-old d61f4d61ff7f a34e2c33 .config console log report ci-upstream-net-this-kasan-gce
2020/04/02 18:18 net-old d61f4d61ff7f a34e2c33 .config console log report ci-upstream-net-this-kasan-gce
2020/04/02 17:23 net-old d61f4d61ff7f a34e2c33 .config console log report ci-upstream-net-this-kasan-gce
2020/04/02 13:46 net-old d61f4d61ff7f a34e2c33 .config console log report ci-upstream-net-this-kasan-gce
2020/04/02 08:38 net-old 304e024216a8 a34e2c33 .config console log report ci-upstream-net-this-kasan-gce
2020/04/02 07:55 net-old 304e024216a8 a34e2c33 .config console log report ci-upstream-net-this-kasan-gce
2020/04/02 06:27 net-old 304e024216a8 a34e2c33 .config console log report ci-upstream-net-this-kasan-gce
2020/04/02 06:06 net-old 304e024216a8 a34e2c33 .config console log report ci-upstream-net-this-kasan-gce
2020/04/02 03:19 net-old 304e024216a8 a34e2c33 .config console log report ci-upstream-net-this-kasan-gce
2020/04/02 00:38 net-old 304e024216a8 a34e2c33 .config console log report ci-upstream-net-this-kasan-gce
2020/04/02 00:28 net-old 304e024216a8 a34e2c33 .config console log report ci-upstream-net-this-kasan-gce
2020/04/01 20:05 net-old 304e024216a8 a34e2c33 .config console log report ci-upstream-net-this-kasan-gce
2020/04/01 19:56 net-old 304e024216a8 a34e2c33 .config console log report ci-upstream-net-this-kasan-gce
2020/04/01 19:55 net-old 304e024216a8 a34e2c33 .config console log report ci-upstream-net-this-kasan-gce
2020/04/01 19:47 net-old 304e024216a8 a34e2c33 .config console log report ci-upstream-net-this-kasan-gce
2020/04/01 19:30 net-old 304e024216a8 a34e2c33 .config console log report ci-upstream-net-this-kasan-gce
2020/04/01 19:17 net-old 304e024216a8 a34e2c33 .config console log report ci-upstream-net-this-kasan-gce
* Struck through repros no longer work on HEAD.