WARNING in kernfs_put

12 views
Skip to first unread message

syzbot

unread,
Jun 27, 2019, 4:24:06 AM6/27/19
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: aec3002d Linux 4.19.56
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=13a3dc55a00000
kernel config: https://syzkaller.appspot.com/x/.config?x=48b721ea0070d1cd
dashboard link: https://syzkaller.appspot.com/bug?extid=eb52b6be2f9023482083
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17f93e3da00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1591a255a00000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+eb52b6...@syzkaller.appspotmail.com

------------[ 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..


---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this bug, for details see:
https://goo.gl/tpsmEJ#testing-patches

syzbot

unread,
Dec 1, 2019, 7:50:01 AM12/1/19
to syzkaller...@googlegroups.com
syzbot suspects this bug was fixed by commit:

commit e1666bcbae0c5edb6d7a752b31a8f28c59b54546
Author: Muchun Song <smu...@gmail.com>
Date: Sat Jul 27 03:21:22 2019 +0000

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

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=144c7712e00000
start commit: aec3002d Linux 4.19.56
git tree: linux-4.19.y
If the result looks correct, please mark the bug fixed by replying with:

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

For information about bisection process see: https://goo.gl/tpsmEJ#bisection
Reply all
Reply to author
Forward
0 new messages