syzbot


WARNING: refcount bug in kobject_put

Status: closed as dup on 2018/11/02 15:33
Subsystems: kernel
[Documentation on labels]
Reported-by: syzbot+3ed2626dbfac197ce4d4@syzkaller.appspotmail.com
First crash: 1999d, last: 1760d
Duplicate of
Title Repro Cause bisect Fix bisect Count Last Reported
WARNING in kernfs_get C done 316 1724d 2053d
Discussions (1)
Title Replies (including bot) Last reply
WARNING: refcount bug in kobject_put 1 (2) 2018/11/02 15:33
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 WARNING: refcount bug in kobject_put C done 3 1719d 1826d 1/1 fixed on 2019/12/04 13:46

Sample crash report:
------------[ cut here ]------------
refcount_t: underflow; use-after-free.
WARNING: CPU: 1 PID: 7046 at lib/refcount.c:187 refcount_sub_and_test_checked+0x2c9/0x310 lib/refcount.c:187
Kernel panic - not syncing: panic_on_warn set ...
CPU: 1 PID: 7046 Comm: syz-executor895 Not tainted 4.19.0+ #315
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+0x244/0x39d lib/dump_stack.c:113
 panic+0x2ad/0x55c kernel/panic.c:188
 __warn.cold.8+0x20/0x45 kernel/panic.c:540
 report_bug+0x254/0x2d0 lib/bug.c:186
 fixup_bug arch/x86/kernel/traps.c:178 [inline]
 do_error_trap+0x11b/0x200 arch/x86/kernel/traps.c:271
 do_invalid_op+0x36/0x40 arch/x86/kernel/traps.c:290
 invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:969
RIP: 0010:refcount_sub_and_test_checked+0x2c9/0x310 lib/refcount.c:187
Code: 89 de e8 0a 87 ed fd 84 db 74 07 31 db e9 4d ff ff ff e8 2a 86 ed fd 48 c7 c7 20 9d 60 88 c6 05 85 5e 7f 06 01 e8 c7 e6 b6 fd <0f> 0b 31 db e9 2c ff ff ff 48 89 cf e8 56 cd 30 fe e9 41 fe ff ff
RSP: 0018:ffff8801bcdd76a8 EFLAGS: 00010286
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff8165d6c5 RDI: 0000000000000005
RBP: ffff8801bcdd7790 R08: ffff8801bcb98700 R09: ffffed003b5e5020
R10: ffffed003b5e5020 R11: ffff8801daf28107 R12: ffff8801d72459b8
R13: 00000000ffffffff R14: ffff8801bcdd7768 R15: ffff8801bcdfa620
 refcount_dec_and_test_checked+0x1a/0x20 lib/refcount.c:212
 kref_put include/linux/kref.h:69 [inline]
 kobject_put+0x6c/0xe0 lib/kobject.c:708
 kset_put include/linux/kobject.h:218 [inline]
 kobj_kset_leave+0x25b/0x3f0 lib/kobject.c:201
 kobject_del.part.4+0x79/0xf0 lib/kobject.c:596
 kobject_del+0x1f/0x30 lib/kobject.c:588
 cleanup_glue_dir.part.19+0x1c2/0x210 drivers/base/core.c:1651
 cleanup_glue_dir drivers/base/core.c:681 [inline]
 device_del+0x813/0xb70 drivers/base/core.c:2094
 hci_unregister_dev+0x3a2/0x990 net/bluetooth/hci_core.c:3355
 vhci_release+0x76/0xf0 drivers/bluetooth/hci_vhci.c:354
 __fput+0x385/0xa30 fs/file_table.c:278
 ____fput+0x15/0x20 fs/file_table.c:309
 task_work_run+0x1e8/0x2a0 kernel/task_work.c:113
 tracehook_notify_resume include/linux/tracehook.h:188 [inline]
 exit_to_usermode_loop+0x318/0x380 arch/x86/entry/common.c:166
 prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:268 [inline]
 do_syscall_64+0x6be/0x820 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x400dd0
Code: 01 f0 ff ff 0f 83 b0 0a 00 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 83 3d fd 18 2d 00 00 75 14 b8 03 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 84 0a 00 00 c3 48 83 ec 08 e8 3a 01 00 00
RSP: 002b:00007ffc5caf19d8 EFLAGS: 00000246 ORIG_RAX: 0000000000000003
RAX: 0000000000000000 RBX: 0000000000000003 RCX: 0000000000400dd0
RDX: 0000000000000002 RSI: 00000000200000c0 RDI: 0000000000000003
RBP: 0000000000000000 R08: 00000000004002c8 R09: 00000000004002c8
R10: 0000000000b0c880 R11: 0000000000000246 R12: 000000000000b95f
R13: 0000000000401d70 R14: 0000000000000000 R15: 0000000000000000
Kernel Offset: disabled
Rebooting in 86400 seconds..

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/11/02 14:26 upstream e468f5c06b5e 1f38e9ae .config console log report syz C ci-upstream-kasan-gce
2018/12/29 05:54 linux-next 6a1d293238c1 e33ad0f1 .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/12/21 00:16 upstream 1d51b4b1d3f2 aaf59e84 .config console log report ci-upstream-kasan-gce-root
2019/06/29 15:52 linux-next 48568d8c7f47 7509bf36 .config console log report ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.