syzbot


WARNING: refcount bug in kobject_get

Status: fixed on 2020/01/03 09:37
Reported-by: syzbot+c89d96cb5cb7bfe23d4b@syzkaller.appspotmail.com
Fix commit: e1666bcbae0c driver core: Fix use-after-free and double free on glue directory
First crash: 1806d, last: 1576d
Fix bisection: fixed by (bisect log) :
commit e1666bcbae0c5edb6d7a752b31a8f28c59b54546
Author: Muchun Song <smuchun@gmail.com>
Date: Sat Jul 27 03:21:22 2019 +0000

  driver core: Fix use-after-free and double free on glue directory

  
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream WARNING: refcount bug in kobject_get kernel C 530 1693d 2026d 0/26 closed as invalid on 2019/08/19 12:30
linux-4.14 WARNING: refcount bug in kobject_get C done 20 1576d 1810d 1/1 fixed on 2020/01/03 09:37
Fix bisection attempts (2)
Created Duration User Patch Repo Result
2020/01/03 05:39 3h38m bisect fix linux-4.19.y job log (1)
2019/12/04 01:49 25m bisect fix linux-4.19.y job log (0) log

Sample crash report:
------------[ cut here ]------------
refcount_t: increment on 0; use-after-free.
WARNING: CPU: 0 PID: 9410 at lib/refcount.c:153 refcount_inc_checked lib/refcount.c:153 [inline]
WARNING: CPU: 0 PID: 9410 at lib/refcount.c:153 refcount_inc_checked+0x61/0x70 lib/refcount.c:151
Kernel panic - not syncing: panic_on_warn set ...

CPU: 0 PID: 9410 Comm: syz-executor146 Not tainted 4.19.56 #28
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+0x172/0x1f0 lib/dump_stack.c:113
 panic+0x263/0x507 kernel/panic.c:185
 __warn.cold+0x20/0x4a kernel/panic.c:540
 report_bug+0x263/0x2b0 lib/bug.c:186
 fixup_bug arch/x86/kernel/traps.c:178 [inline]
 fixup_bug arch/x86/kernel/traps.c:173 [inline]
 do_error_trap+0x204/0x360 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:1013
RIP: 0010:refcount_inc_checked lib/refcount.c:153 [inline]
RIP: 0010:refcount_inc_checked+0x61/0x70 lib/refcount.c:151
Code: 1d 1d 74 12 06 31 ff 89 de e8 9b 5f 47 fe 84 db 75 dd e8 52 5e 47 fe 48 c7 c7 c0 95 81 87 c6 05 fd 73 12 06 01 e8 8d 37 1b fe <0f> 0b eb c1 90 66 2e 0f 1f 84 00 00 00 00 00 55 48 89 e5 41 57 41
RSP: 0018:ffff88808ba0f920 EFLAGS: 00010286
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff8155b1c6 RDI: ffffed1011741f16
RBP: ffff88808ba0f930 R08: ffff88808180a380 R09: ffffed1015d04fe9
R10: ffffed1015d04fe8 R11: ffff8880ae827f47 R12: ffff8880a7f56338
R13: ffff88809a5aaa20 R14: ffff88809a5aaa18 R15: ffff8880a7f562b8
 kref_get include/linux/kref.h:47 [inline]
 kobject_get+0x66/0xc0 lib/kobject.c:613
 kset_get include/linux/kobject.h:213 [inline]
 kobj_kset_join lib/kobject.c:186 [inline]
 kobject_add_internal lib/kobject.c:238 [inline]
 kobject_add_internal+0x14f/0x380 lib/kobject.c:217
 kobject_add_varg lib/kobject.c:382 [inline]
 kobject_add+0x150/0x1c0 lib/kobject.c:426
 class_dir_create_and_add drivers/base/core.c:1560 [inline]
 get_device_parent.isra.0+0x415/0x570 drivers/base/core.c:1615
 device_add+0x2f4/0x1760 drivers/base/core.c:1871
 hci_register_dev+0x304/0x880 net/bluetooth/hci_core.c:3198
 __vhci_create_device+0x2d0/0x5a0 drivers/bluetooth/hci_vhci.c:139
 vhci_create_device drivers/bluetooth/hci_vhci.c:163 [inline]
 vhci_get_user drivers/bluetooth/hci_vhci.c:219 [inline]
 vhci_write+0x2d6/0x470 drivers/bluetooth/hci_vhci.c:299
 call_write_iter include/linux/fs.h:1820 [inline]
 new_sync_write fs/read_write.c:474 [inline]
 __vfs_write+0x587/0x810 fs/read_write.c:487
 vfs_write+0x20c/0x560 fs/read_write.c:549
 ksys_write+0x14f/0x2d0 fs/read_write.c:599
 __do_sys_write fs/read_write.c:611 [inline]
 __se_sys_write fs/read_write.c:608 [inline]
 __x64_sys_write+0x73/0xb0 fs/read_write.c:608
 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x441279
Code: e8 ac e8 ff ff 48 83 c4 18 c3 0f 1f 80 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 eb 08 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffe370df8c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000441279
RDX: 0000000000000002 RSI: 0000000020000000 RDI: 0000000000000003
RBP: 000000000007440a R08: 00000000004002c8 R09: 00000000004002c8
R10: 0000000000000004 R11: 0000000000000246 R12: 0000000000401ff0
R13: 0000000000402080 R14: 0000000000000000 R15: 0000000000000000
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/07/01 19:17 linux-4.19.y aec3002d07fd 907bf746 .config console log report syz C ci2-linux-4-19
2019/07/01 02:42 linux-4.19.y aec3002d07fd 699d6448 .config console log report syz C ci2-linux-4-19
2019/07/01 00:23 linux-4.19.y aec3002d07fd 699d6448 .config console log report syz C ci2-linux-4-19
2019/05/21 22:45 linux-4.19.y dafc674bbcb1 13427bd9 .config console log report syz C ci2-linux-4-19
2019/05/04 06:16 linux-4.19.y a03957ab0fd5 d28f4ce5 .config console log report syz C ci2-linux-4-19
2019/04/29 03:57 linux-4.19.y 19bb613acb9a b617407b .config console log report syz C ci2-linux-4-19
2019/04/28 16:53 linux-4.19.y 19bb613acb9a b617407b .config console log report syz C ci2-linux-4-19
2019/04/27 05:18 linux-4.19.y c98875d930e9 b617407b .config console log report syz C ci2-linux-4-19
2019/04/27 04:05 linux-4.19.y c98875d930e9 b617407b .config console log report syz C ci2-linux-4-19
2019/04/26 18:27 linux-4.19.y c98875d930e9 b617407b .config console log report syz C ci2-linux-4-19
2019/04/23 03:40 linux-4.19.y c98875d930e9 53199d6e .config console log report syz C ci2-linux-4-19
2019/04/21 04:17 linux-4.19.y c98875d930e9 b0e8efcb .config console log report syz C ci2-linux-4-19
2019/04/18 15:22 linux-4.19.y 4b0e041c9dad b0e8efcb .config console log report syz C ci2-linux-4-19
2019/08/13 12:25 linux-4.19.y 893af1c79e42 74d61399 .config console log report ci2-linux-4-19
2019/08/11 11:48 linux-4.19.y 893af1c79e42 acb51638 .config console log report ci2-linux-4-19
2019/07/21 05:07 linux-4.19.y 3bd837bfe431 1656845f .config console log report ci2-linux-4-19
2019/07/20 00:54 linux-4.19.y 3bd837bfe431 1656845f .config console log report ci2-linux-4-19
2019/07/19 05:16 linux-4.19.y 3bd837bfe431 7bb222f7 .config console log report ci2-linux-4-19
2019/06/24 19:10 linux-4.19.y 78778071092e 2873954b .config console log report ci2-linux-4-19
2019/04/26 00:45 linux-4.19.y c98875d930e9 f46aabc8 .config console log report ci2-linux-4-19
2019/04/19 18:32 linux-4.19.y 4b0e041c9dad b0e8efcb .config console log report ci2-linux-4-19
* Struck through repros no longer work on HEAD.