syzbot


WARNING: refcount bug in kobject_get

Status: fixed on 2020/01/03 09:37
Reported-by: syzbot+122b2c22c75de10ba756@syzkaller.appspotmail.com
Fix commit: 227db8e4c346 tipc: fix unlimited bundling of small messages
First crash: 2069d, last: 1836d
Fix bisection: fixed by (bisect log) :
commit 227db8e4c34674124ee6e4a9d534f3a0cc22304c
Author: Tuong Lien <tuong.t.lien@dektech.com.au>
Date: Wed Oct 2 11:49:43 2019 +0000

  tipc: fix unlimited bundling of small messages

  
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 1953d 2285d 0/28 closed as invalid on 2019/08/19 12:30
linux-4.19 WARNING: refcount bug in kobject_get C done 21 1836d 2065d 1/1 fixed on 2020/01/03 09:37
Fix bisection attempts (2)
Created Duration User Patch Repo Result
2020/01/03 01:25 3h56m bisect fix linux-4.14.y OK (1) job log
2019/12/04 00:57 28m bisect fix linux-4.14.y OK (0) job log log

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

CPU: 0 PID: 10588 Comm: syz-executor199 Not tainted 4.14.134 #29
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/0x19c 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:960
RIP: 0010:refcount_inc lib/refcount.c:153 [inline]
RIP: 0010:refcount_inc.cold+0x18/0x1f lib/refcount.c:151
RSP: 0018:ffff88809e2d79c0 EFLAGS: 00010286
RAX: 000000000000002b RBX: ffffffff86faaaa0 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff866d0e00 RDI: ffffed1013c5af2e
RBP: ffff88809e2d79c8 R08: 000000000000002b R09: ffff888092118d88
R10: 0000000000000000 R11: 0000000000000000 R12: ffff88821a9d34f8
R13: 0000000000000000 R14: ffff88821a9d34c0 R15: ffff88809725d6a0
 kref_get include/linux/kref.h:47 [inline]
 kobject_get+0x5b/0x70 lib/kobject.c:596
 kset_get include/linux/kobject.h:210 [inline]
 kobj_kset_join lib/kobject.c:169 [inline]
 kobject_add_internal.part.0+0xfc/0x340 lib/kobject.c:220
 kobject_add_internal lib/kobject.c:205 [inline]
 kobject_add_varg lib/kobject.c:364 [inline]
 kobject_add+0x11f/0x180 lib/kobject.c:409
 class_dir_create_and_add drivers/base/core.c:1484 [inline]
 get_device_parent.isra.0+0x415/0x560 drivers/base/core.c:1539
 device_add+0x2d3/0x1490 drivers/base/core.c:1795
 hci_register_dev+0x2d9/0x810 net/bluetooth/hci_core.c:3118
 __vhci_create_device+0x2a6/0x560 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+0x2a1/0x437 drivers/bluetooth/hci_vhci.c:299
 call_write_iter include/linux/fs.h:1777 [inline]
 new_sync_write fs/read_write.c:469 [inline]
 __vfs_write+0x4a7/0x6b0 fs/read_write.c:482
 vfs_write+0x198/0x500 fs/read_write.c:544
 SYSC_write fs/read_write.c:590 [inline]
 SyS_write+0xfd/0x230 fs/read_write.c:582
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x441279
RSP: 002b:00007ffccae67678 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000441279
RDX: 0000000000000002 RSI: 0000000020000000 RDI: 0000000000000003
RBP: 000000000007747d R08: 00000000004002c8 R09: 00000000004002c8
R10: 0000000000000004 R11: 0000000000000246 R12: 0000000000401ff0
R13: 0000000000402080 R14: 0000000000000000 R15: 0000000000000000
Kernel Offset: disabled
Rebooting in 86400 seconds..

Crashes (20):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/07/25 07:26 linux-4.14.y ff33472c282e 32329ceb .config console log report syz C ci2-linux-4-14
2019/07/04 15:06 linux-4.14.y e3c1b27308ae 55565fa0 .config console log report syz C ci2-linux-4-14
2019/04/27 06:58 linux-4.14.y 68d7a45eec10 b617407b .config console log report syz C ci2-linux-4-14
2019/04/26 11:12 linux-4.14.y 68d7a45eec10 b617407b .config console log report syz C ci2-linux-4-14
2019/04/23 21:11 linux-4.14.y 68d7a45eec10 2398edea .config console log report syz C ci2-linux-4-14
2019/04/14 12:01 linux-4.14.y 1ec8f1f0bffe 505ab413 .config console log report syz C ci2-linux-4-14
2019/05/04 05:59 linux-4.14.y 1c046f373132 d28f4ce5 .config console log report syz ci2-linux-4-14
2019/04/28 17:09 linux-4.14.y fa5941f45d7e b617407b .config console log report syz ci2-linux-4-14
2019/08/10 16:28 linux-4.14.y 3ffe1e79c174 acb51638 .config console log report ci2-linux-4-14
2019/08/03 08:43 linux-4.14.y 10d6aa565d05 6affd8e8 .config console log report ci2-linux-4-14
2019/07/30 17:27 linux-4.14.y ff33472c282e f28bf2a5 .config console log report ci2-linux-4-14
2019/07/25 18:04 linux-4.14.y ff33472c282e 0d7a1249 .config console log report ci2-linux-4-14
2019/07/01 00:08 linux-4.14.y f4cc0ed9b2c7 699d6448 .config console log report ci2-linux-4-14
2019/06/26 08:44 linux-4.14.y bc2bccef19ee 0a8d1a96 .config console log report ci2-linux-4-14
2019/06/21 07:56 linux-4.14.y bb263a2a2d43 34bf9440 .config console log report ci2-linux-4-14
2019/06/20 00:37 linux-4.14.y bb263a2a2d43 34bf9440 .config console log report ci2-linux-4-14
2019/06/14 15:25 linux-4.14.y 2bf3258a12af 998ccc76 .config console log report ci2-linux-4-14
2019/06/11 10:30 linux-4.14.y e6a95d8851f1 5b5826d0 .config console log report ci2-linux-4-14
2019/04/26 15:13 linux-4.14.y 68d7a45eec10 b617407b .config console log report ci2-linux-4-14
2019/04/14 09:43 linux-4.14.y 1ec8f1f0bffe 505ab413 .config console log report ci2-linux-4-14
* Struck through repros no longer work on HEAD.