syzbot


WARNING in kernfs_put

Status: fixed on 2019/12/01 20:17
Reported-by: syzbot+eb52b6be2f9023482083@syzkaller.appspotmail.com
Fix commit: e1666bcbae0c driver core: Fix use-after-free and double free on glue directory
First crash: 1974d, last: 1974d
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
linux-4.14 WARNING in kernfs_put C done 2 1970d 2037d 1/1 fixed on 2019/12/01 20:17
upstream WARNING in kernfs_put kernfs C 4 2091d 2212d 0/28 closed as dup on 2018/10/31 16:05

Sample crash report:
------------[ cut here ]------------
kernfs_put: bluetooth/hci6: released with incorrect active_ref 0
WARNING: CPU: 1 PID: 8152 at fs/kernfs/dir.c:525 kernfs_put fs/kernfs/dir.c:525 [inline]
WARNING: CPU: 1 PID: 8152 at fs/kernfs/dir.c:525 kernfs_put+0x4c6/0x5d0 fs/kernfs/dir.c:506
Kernel panic - not syncing: panic_on_warn set ...

kobject: 'hci4' (0000000096f8c634): kobject_add_internal: parent: 'bluetooth', set: 'devices'
CPU: 1 PID: 8152 Comm: syz-executor085 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
kobject: 'hci5' (0000000069d466ff): kobject_add_internal: parent: 'bluetooth', set: 'devices'
kobject: 'hci1' (00000000b16d0944): kobject_add_internal: parent: 'bluetooth', set: 'devices'
 __warn.cold+0x20/0x4a kernel/panic.c:540
kobject: 'hci2' (00000000fba06d42): kobject_uevent_env
 report_bug+0x263/0x2b0 lib/bug.c:186
kobject: 'hci1' (00000000b16d0944): kobject_uevent_env
 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
kobject: 'hci2' (00000000fba06d42): fill_kobj_path: path = '/devices/virtual/bluetooth/hci2'
 invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:1013
RIP: 0010:kernfs_put fs/kernfs/dir.c:525 [inline]
RIP: 0010:kernfs_put+0x4c6/0x5d0 fs/kernfs/dir.c:506
Code: 0f 85 1d 01 00 00 49 8b 75 30 48 89 75 c8 e8 81 4e 9e ff 48 8b 55 d0 44 89 f1 48 c7 c7 80 dc 57 87 48 8b 75 c8 e8 b8 27 72 ff <0f> 0b e9 61 fc ff ff e8 9e b3 d4 ff e9 ba fd ff ff 48 8b 7d d0 e8
RSP: 0018:ffff88809d777ac8 EFLAGS: 00010282
RAX: 0000000000000000 RBX: dffffc0000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff8155b1c6 RDI: ffffed1013aeef4b
RBP: ffff88809d777b20 R08: ffff88808b4ae400 R09: ffffed1015d24fe9
R10: ffffed1015d24fe8 R11: ffff8880ae927f47 R12: ffff8880a5ae20e0
R13: ffff8880a81377e0 R14: 0000000000000000 R15: ffff8880a5ae2110
kobject: 'hci3' (000000005eda11c4): fill_kobj_path: path = '/devices/virtual/bluetooth/hci3'
kobject: 'hci1' (00000000b16d0944): fill_kobj_path: path = '/devices/virtual/bluetooth/hci1'
 sysfs_put include/linux/sysfs.h:547 [inline]
 kobject_del.part.0+0x42/0xf0 lib/kobject.c:593
 kobject_del+0x20/0x30 lib/kobject.c:588
 device_del+0x701/0xb70 drivers/base/core.c:2099
kobject: 'hci4' (0000000096f8c634): kobject_uevent_env
 hci_unregister_dev+0x2c6/0x820 net/bluetooth/hci_core.c:3292
 vhci_release+0x76/0xf0 drivers/bluetooth/hci_vhci.c:354
 __fput+0x2dd/0x8b0 fs/file_table.c:278
kobject: 'hci4' (0000000096f8c634): fill_kobj_path: path = '/devices/virtual/bluetooth/hci4'
 ____fput+0x16/0x20 fs/file_table.c:309
kobject: 'rfkill565' (00000000ff39e5ff): kobject_add_internal: parent: 'hci3', set: 'devices'
 task_work_run+0x145/0x1c0 kernel/task_work.c:113
 exit_task_work include/linux/task_work.h:22 [inline]
 do_exit+0x933/0x2fa0 kernel/exit.c:876
kobject: 'hci5' (0000000069d466ff): kobject_uevent_env
kobject: 'rfkill565' (00000000ff39e5ff): kobject_uevent_env
 do_group_exit+0x135/0x370 kernel/exit.c:979
 __do_sys_exit_group kernel/exit.c:990 [inline]
 __se_sys_exit_group kernel/exit.c:988 [inline]
 __x64_sys_exit_group+0x44/0x50 kernel/exit.c:988
 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293
kobject: 'hci5' (0000000069d466ff): fill_kobj_path: path = '/devices/virtual/bluetooth/hci5'
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x440078
Code: 00 00 be 3c 00 00 00 eb 19 66 0f 1f 84 00 00 00 00 00 48 89 d7 89 f0 0f 05 48 3d 00 f0 ff ff 77 21 f4 48 89 d7 44 89 c0 0f 05 <48> 3d 00 f0 ff ff 76 e0 f7 d8 64 41 89 01 eb d8 0f 1f 84 00 00 00
RSP: 002b:00007fff390b30b8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000440078
RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000
RBP: 00000000004bf8b0 R08: 00000000000000e7 R09: ffffffffffffffd0
R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000000001
R13: 00000000006d1180 R14: 0000000000000000 R15: 0000000000000000
Kernel Offset: disabled
Rebooting in 86400 seconds..

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/06/27 07:23 linux-4.19.y aec3002d07fd 7509bf36 .config console log report syz C ci2-linux-4-19
* Struck through repros no longer work on HEAD.