syzbot


WARNING: refcount bug in cdev_get

Status: fixed on 2020/01/24 06:24
Reported-by: syzbot+8f6326d01bc61afbc095@syzkaller.appspotmail.com
Fix commit: 03a709593040 net: usb: lan78xx: Connect PHY before registering MAC
First crash: 1722d, last: 1592d
Fix bisection: fixed by (bisect log) :
commit 03a70959304028f2eed3713f03bd1c92585699b0
Author: Andrew Lunn <andrew@lunn.ch>
Date: Thu Oct 17 19:29:26 2019 +0000

  net: usb: lan78xx: Connect PHY before registering MAC

  
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 WARNING: refcount bug in cdev_get C done 12 1597d 1722d 1/1 fixed on 2020/01/19 15:05
upstream WARNING: refcount bug in cdev_get C done 105 1578d 1718d 15/26 fixed on 2020/02/18 14:31
Fix bisection attempts (2)
Created Duration User Patch Repo Result
2020/01/24 01:58 4h23m bisect fix linux-4.14.y job log (1)
2019/12/25 01:31 27m bisect fix linux-4.14.y job log (0) log

Sample crash report:
input: syz1 as /devices/virtual/input/input1191
input: syz1 as /devices/virtual/input/input1192
refcount_t: increment on 0; use-after-free.
------------[ cut here ]------------
kobject: '(null)' (ffff888098f28968): calling ktype release
WARNING: CPU: 1 PID: 12651 at lib/refcount.c:153 refcount_inc lib/refcount.c:153 [inline]
WARNING: CPU: 1 PID: 12651 at lib/refcount.c:153 refcount_inc.cold+0x18/0x1f lib/refcount.c:151
Kernel panic - not syncing: panic_on_warn set ...

CPU: 1 PID: 12651 Comm: syz-executor938 Not tainted 4.14.146 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x138/0x197 lib/dump_stack.c:53
 panic+0x1f2/0x426 kernel/panic.c:182
 __warn.cold+0x2f/0x36 kernel/panic.c:546
 report_bug+0x216/0x254 lib/bug.c:186
 fixup_bug arch/x86/kernel/traps.c:177 [inline]
 fixup_bug arch/x86/kernel/traps.c:172 [inline]
 do_error_trap+0x1bb/0x310 arch/x86/kernel/traps.c:295
 do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:314
 invalid_op+0x1b/0x40 arch/x86/entry/entry_64.S:963
RIP: 0010:refcount_inc lib/refcount.c:153 [inline]
RIP: 0010:refcount_inc.cold+0x18/0x1f lib/refcount.c:151
RSP: 0018:ffff88808f92f980 EFLAGS: 00010286
RAX: 000000000000002b RBX: 1ffff11011f25f3d RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff866d10e0 RDI: ffffed1011f25f26
RBP: ffff88808f92f988 R08: 000000000000002b R09: ffff8880a1aca960
R10: 0000000000000000 R11: 0000000000000000 R12: ffff888098f289a0
R13: 0000000000000000 R14: ffff888096237500 R15: ffff888093d2e488
 kref_get include/linux/kref.h:47 [inline]
 kobject_get+0x5b/0x70 lib/kobject.c:596
 cdev_get+0x54/0xa0 fs/char_dev.c:364
 chrdev_open+0x9b/0x590 fs/char_dev.c:409
 do_dentry_open+0x73b/0xeb0 fs/open.c:777
 vfs_open+0x105/0x220 fs/open.c:891
 do_last fs/namei.c:3425 [inline]
 path_openat+0x8bd/0x3f70 fs/namei.c:3566
 do_filp_open+0x18e/0x250 fs/namei.c:3600
 do_sys_open+0x2c5/0x430 fs/open.c:1084
 SYSC_open fs/open.c:1102 [inline]
 SyS_open+0x2d/0x40 fs/open.c:1097
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x405831
RSP: 002b:00007f487cd9e960 EFLAGS: 00000293 ORIG_RAX: 0000000000000002
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000405831
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00007f487cd9e970
RBP: 6666666666666667 R08: 000000000000000f R09: 00007f487cd9f700
R10: 00007f487cd9f9d0 R11: 0000000000000293 R12: 00000000006dbc3c
R13: 000000000000001f R14: 0000000000000000 R15: 00000000317a7973
Kernel Offset: disabled
Rebooting in 86400 seconds..

Crashes (21):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/10/02 21:38 linux-4.14.y f6e27dbb1afa 2e29b534 .config console log report syz C ci2-linux-4-14
2019/09/23 04:13 linux-4.14.y f6e27dbb1afa d96e88f3 .config console log report syz C ci2-linux-4-14
2019/09/16 10:11 linux-4.14.y 968722f5371a 55c50e70 .config console log report syz C ci2-linux-4-14
2019/08/16 22:46 linux-4.14.y 45f092f9e9cb 8fd428a1 .config console log report syz C ci2-linux-4-14
2019/11/25 01:30 linux-4.14.y 43598c571e7e 598ca6c8 .config console log report ci2-linux-4-14
2019/11/01 10:34 linux-4.14.y ddef1e8e3f6e a41ca8fa .config console log report ci2-linux-4-14
2019/10/30 03:01 linux-4.14.y ddef1e8e3f6e 5ea87a66 .config console log report ci2-linux-4-14
2019/10/26 12:30 linux-4.14.y b98aebd29824 25bb509e .config console log report ci2-linux-4-14
2019/10/25 08:09 linux-4.14.y b98aebd29824 d01bb02a .config console log report ci2-linux-4-14
2019/10/12 14:24 linux-4.14.y e132c8d7b58d 426631dd .config console log report ci2-linux-4-14
2019/10/11 01:25 linux-4.14.y 42327896f194 1a3bad90 .config console log report ci2-linux-4-14
2019/09/28 01:33 linux-4.14.y f6e27dbb1afa d8074e0b .config console log report ci2-linux-4-14
2019/09/27 04:40 linux-4.14.y f6e27dbb1afa 2f1548bc .config console log report ci2-linux-4-14
2019/09/26 20:30 linux-4.14.y f6e27dbb1afa 2f1548bc .config console log report ci2-linux-4-14
2019/09/24 18:46 linux-4.14.y f6e27dbb1afa f8368f99 .config console log report ci2-linux-4-14
2019/09/21 17:03 linux-4.14.y f6e27dbb1afa d96e88f3 .config console log report ci2-linux-4-14
2019/09/09 22:41 linux-4.14.y 414510bc00a5 a60cb4cd .config console log report ci2-linux-4-14
2019/09/02 05:52 linux-4.14.y 01fd1694b93c db7c31ca .config console log report ci2-linux-4-14
2019/08/23 16:47 linux-4.14.y 45f092f9e9cb 78ded196 .config console log report ci2-linux-4-14
2019/08/19 05:16 linux-4.14.y 45f092f9e9cb b8ceabfc .config console log report ci2-linux-4-14
2019/08/17 18:44 linux-4.14.y 45f092f9e9cb 55bf8926 .config console log report ci2-linux-4-14
* Struck through repros no longer work on HEAD.