bisecting fixing commit since 4b0e041c9dada60197efc1697928cd32c2c70cd2 building syzkaller on b0e8efcb4b0aac61f4647a76bbe54a5d38a370ba testing commit 4b0e041c9dada60197efc1697928cd32c2c70cd2 with gcc (GCC) 8.1.0 kernel signature: 504bdadcefcccd90d39fb535424308b6fe8ec03f all runs: crashed: WARNING: refcount bug in cdev_get testing current HEAD 174651bdf802a2139065e8e31ce950e2f3fc4a94 testing commit 174651bdf802a2139065e8e31ce950e2f3fc4a94 with gcc (GCC) 8.1.0 kernel signature: 99b2f50a2efd8c17cd67d899be21716178fcf28c all runs: crashed: WARNING: refcount bug in cdev_get revisions tested: 2, total time: 24m49.141424201s (build: 16m49.022635758s, test: 7m1.076247803s) the crash still happens on HEAD commit msg: Linux 4.19.87 crash: WARNING: refcount bug in cdev_get input: syz1 as /devices/virtual/input/input637 input: syz1 as /devices/virtual/input/input638 input: syz1 as /devices/virtual/input/input639 ------------[ cut here ]------------ refcount_t: increment on 0; use-after-free. WARNING: CPU: 1 PID: 9540 at lib/refcount.c:153 refcount_inc_checked+0x2b/0x30 lib/refcount.c:153 Kernel panic - not syncing: panic_on_warn set ... CPU: 1 PID: 9540 Comm: syz-executor.4 Not tainted 4.19.87-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+0x123/0x177 lib/dump_stack.c:118 panic+0x1cd/0x387 kernel/panic.c:186 __warn.cold.8+0x1b/0x3c kernel/panic.c:541 report_bug+0x1a4/0x200 lib/bug.c:186 fixup_bug arch/x86/kernel/traps.c:178 [inline] do_error_trap+0x200/0x350 arch/x86/kernel/traps.c:296 do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:316 invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:1037 RIP: 0010:refcount_inc_checked+0x2b/0x30 lib/refcount.c:153 Code: 48 89 e5 e8 97 fe ff ff 84 c0 74 02 5d c3 80 3d ae ce ba 05 00 75 f5 48 c7 c7 20 05 fe 86 c6 05 9e ce ba 05 01 e8 d8 4c 47 fe <0f> 0b 5d c3 90 55 48 89 e5 41 57 49 89 f7 be 04 00 00 00 41 56 4c RSP: 0018:ffff88807580f900 EFLAGS: 00010282 RAX: 0000000000000000 RBX: ffff88808f010870 RCX: 0000000000000000 RDX: 0000000000000004 RSI: ffff888091972b00 RDI: ffffffff89a806a0 RBP: ffff88807580f900 R08: ffff888091972b20 R09: 0000000000000000 R10: 0000000000000000 R11: dffffc0000000000 R12: 0000000000000000 R13: ffff88809f785100 R14: ffff88809f4f8080 R15: ffff88809f785480 kref_get include/linux/kref.h:47 [inline] kobject_get+0x43/0x90 lib/kobject.c:613 cdev_get+0x46/0x80 fs/char_dev.c:364 chrdev_open+0xa3/0x5c0 fs/char_dev.c:409 do_dentry_open+0x3f4/0x1010 fs/open.c:796 vfs_open+0x9a/0xc0 fs/open.c:905 do_last fs/namei.c:3418 [inline] path_openat+0x691/0x3c00 fs/namei.c:3534 do_filp_open+0x177/0x250 fs/namei.c:3564 do_sys_open+0x1dd/0x350 fs/open.c:1088 __do_sys_open fs/open.c:1106 [inline] __se_sys_open fs/open.c:1101 [inline] __x64_sys_open+0x79/0xb0 fs/open.c:1101 do_syscall_64+0xd6/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x412bc1 Code: 75 14 b8 02 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 04 19 00 00 c3 48 83 ec 08 e8 2a fa ff ff 48 89 04 24 b8 02 00 00 00 0f 05 <48> 8b 3c 24 48 89 c2 e8 73 fa ff ff 48 89 d0 48 83 c4 08 48 3d 01 RSP: 002b:00007f0f30aca7a0 EFLAGS: 00000293 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 6666666666666667 RCX: 0000000000412bc1 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00007f0f30aca850 RBP: 000000000073bfa0 R08: 000000000000000f R09: 0000000000000000 R10: ffffffffffffffff R11: 0000000000000293 R12: 00007f0f30acb6d4 R13: 00000000004c7975 R14: 00000000004dda00 R15: 00000000ffffffff Kernel Offset: disabled Rebooting in 86400 seconds..