bisecting fixing commit since 1ec8f1f0bffe34ebdf95dbe0fd4a6635a84612a8 building syzkaller on 505ab413c77ce8c6bd4658ea5e68ea2534d47b39 testing commit 1ec8f1f0bffe34ebdf95dbe0fd4a6635a84612a8 with gcc (GCC) 8.1.0 kernel signature: 352b64083510cab7dec16ad98a3b683e280b0ccf all runs: crashed: WARNING: refcount bug in cdev_get testing current HEAD fbc5fe7a54d02e11972e3b2a5ddb6ffc88162c8f testing commit fbc5fe7a54d02e11972e3b2a5ddb6ffc88162c8f with gcc (GCC) 8.1.0 kernel signature: 630ff0e89f15e04e48a0bf24e27bd90fec3c4fbe all runs: crashed: WARNING: refcount bug in cdev_get revisions tested: 2, total time: 28m14.133191741s (build: 16m6.621400553s, test: 11m8.678495651s) the crash still happens on HEAD commit msg: Linux 4.14.157 crash: WARNING: refcount bug in cdev_get input: syz0 as /devices/virtual/input/input6194 input: syz0 as /devices/virtual/input/input6196 input: syz0 as /devices/virtual/input/input6198 refcount_t: increment on 0; use-after-free. ------------[ cut here ]------------ WARNING: CPU: 0 PID: 25253 at lib/refcount.c:153 refcount_inc.cold.12+0x13/0x1a lib/refcount.c:153 Kernel panic - not syncing: panic_on_warn set ... CPU: 0 PID: 25253 Comm: syz-executor.1 Not tainted 4.14.157-syzkaller #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+0xf7/0x13b lib/dump_stack.c:58 panic+0x1b0/0x36a kernel/panic.c:183 __warn.cold.8+0x25/0x2a kernel/panic.c:547 report_bug+0x1a4/0x1f3 lib/bug.c:186 fixup_bug arch/x86/kernel/traps.c:177 [inline] do_error_trap+0x1bd/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.cold.12+0x13/0x1a lib/refcount.c:153 RSP: 0018:ffff8880890f7930 EFLAGS: 00010286 RAX: 000000000000002b RBX: ffff8880a4ec6e68 RCX: 0000000000000000 RDX: 000000000000002b RSI: ffff8880a0168ac0 RDI: ffffed101121ef1d RBP: ffff8880890f7930 R08: ffff8880a0168ae0 R09: 0000000000000000 R10: 0000000000000000 R11: dffffc0000000000 R12: 0000000000000000 R13: ffff8880804beb60 R14: ffff8880915d9340 R15: ffff8880804beee8 kref_get include/linux/kref.h:47 [inline] kobject_get+0x47/0x60 lib/kobject.c:596 cdev_get+0x46/0x80 fs/char_dev.c:364 chrdev_open+0x9c/0x5b0 fs/char_dev.c:409 do_dentry_open+0x623/0xdb0 fs/open.c:777 vfs_open+0xfc/0x240 fs/open.c:891 do_last fs/namei.c:3425 [inline] path_openat+0xe6d/0x3b50 fs/namei.c:3566 do_filp_open+0x16b/0x220 fs/namei.c:3600 do_sys_open+0x1c2/0x340 fs/open.c:1084 SYSC_open fs/open.c:1102 [inline] SyS_open+0x19/0x20 fs/open.c:1097 do_syscall_64+0x1c9/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x412bc1 RSP: 002b:00007fac7c77a7a0 EFLAGS: 00000293 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 6666666666666667 RCX: 0000000000412bc1 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00007fac7c77a850 RBP: 000000000073bfa0 R08: 000000000000000f R09: 0000000000000000 R10: 00007fac7c77b9d0 R11: 0000000000000293 R12: 00007fac7c77b6d4 R13: 00000000004c7975 R14: 00000000004dda00 R15: 00000000ffffffff Kernel Offset: disabled Rebooting in 86400 seconds..