syzbot


WARNING in kernfs_get

Status: fixed on 2019/12/05 23:59
Reported-by: syzbot+4950f058cfd2f22b7a83@syzkaller.appspotmail.com
Fix commit: e1666bcbae0c driver core: Fix use-after-free and double free on glue directory
First crash: 1816d, last: 1676d
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 (6)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream WARNING in kernfs_get (2) kernfs 2 1296d 1314d 0/26 auto-closed as invalid on 2021/01/25 03:55
linux-4.14 WARNING in kernfs_get C done 17 1700d 1820d 1/1 fixed on 2019/12/07 19:24
upstream WARNING in kernfs_get (4) kernfs syz error 3 432d 435d 0/26 auto-obsoleted due to no activity on 2023/06/07 19:32
upstream WARNING in kernfs_get C done 316 1715d 2044d 13/26 fixed on 2019/11/20 22:01
upstream WARNING in kernfs_get (3) kernfs 3 861d 865d 0/26 auto-closed as invalid on 2022/02/04 06:25
android-414 WARNING in kernfs_get syz 69 1679d 1831d 0/1 public: reported syz repro on 2019/04/10 15:44

Sample crash report:
kobject_add_internal failed for hci1 (error: -2 parent: bluetooth)
------------[ cut here ]------------
WARNING: CPU: 1 PID: 8787 at fs/kernfs/dir.c:494 kernfs_get.part.0.cold+0x11/0x18 fs/kernfs/dir.c:494
kobject: 'rfkill1257' (00000000562b049b): kobject_uevent_env
Kernel panic - not syncing: panic_on_warn set ...

CPU: 1 PID: 8787 Comm: syz-executor288 Not tainted 4.19.72 #0
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: 'hci3' (00000000323baaa7): kobject_add_internal: parent: 'bluetooth', set: 'devices'
kobject: 'rfkill1257' (00000000562b049b): fill_kobj_path: path = '/devices/virtual/bluetooth/hci5/rfkill1257'
 __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
kobject: 'hci3' (00000000323baaa7): kobject_uevent_env
kobject: 'hci3' (00000000323baaa7): fill_kobj_path: path = '/devices/virtual/bluetooth/hci3'
 do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:316
kobject: 'rfkill1257' (00000000562b049b): kobject_cleanup, parent           (null)
 invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:1037
RIP: 0010:kernfs_get.part.0.cold+0x11/0x18 fs/kernfs/dir.c:494
Code: ff e8 fc b5 9d ff 48 c7 c7 c0 31 58 87 e8 04 1c 88 ff 0f 0b e9 f5 a7 ff ff e8 e4 b5 9d ff 48 c7 c7 c0 31 58 87 e8 ec 1b 88 ff <0f> 0b e9 19 ac ff ff e8 cc b5 9d ff 48 c7 c7 c0 31 58 87 e8 d4 1b
RSP: 0018:ffff88808297f838 EFLAGS: 00010286
RAX: 0000000000000024 RBX: ffff88808bfeb1c0 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff8155cf16 RDI: ffffed101052fef9
kobject: 'rfkill1257' (00000000562b049b): calling ktype release
RBP: ffff88808297f848 R08: 0000000000000024 R09: ffffed1015d25079
R10: ffffed1015d25078 R11: ffff8880ae9283c7 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000001
 kernfs_get fs/kernfs/dir.c:493 [inline]
 kernfs_new_node+0xb8/0x130 fs/kernfs/dir.c:697
 kernfs_create_dir_ns+0x52/0x160 fs/kernfs/dir.c:1020
 sysfs_create_dir_ns+0x131/0x290 fs/sysfs/dir.c:58
kobject: 'rfkill1259' (0000000058d67df1): kobject_add_internal: parent: 'hci3', set: 'devices'
 create_dir lib/kobject.c:88 [inline]
 kobject_add_internal lib/kobject.c:247 [inline]
 kobject_add_internal.cold+0xe5/0x5d1 lib/kobject.c:217
 kobject_add_varg lib/kobject.c:382 [inline]
 kobject_add+0x150/0x1c0 lib/kobject.c:426
kobject: 'rfkill1259' (0000000058d67df1): kobject_uevent_env
kobject: 'rfkill1257': free name
 device_add+0x3cc/0x1760 drivers/base/core.c:1885
kobject: 'hci5' (00000000ee55fd0a): kobject_uevent_env
kobject: 'rfkill1259' (0000000058d67df1): fill_kobj_path: path = '/devices/virtual/bluetooth/hci3/rfkill1259'
 hci_register_dev+0x304/0x880 net/bluetooth/hci_core.c:3198
 __vhci_create_device+0x2d0/0x5a0 drivers/bluetooth/hci_vhci.c:139
kobject: 'hci5' (00000000ee55fd0a): fill_kobj_path: path = '/devices/virtual/bluetooth/hci5'
 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
kobject: 'rfkill1259' (0000000058d67df1): kobject_uevent_env
kobject: 'rfkill1259' (0000000058d67df1): fill_kobj_path: path = '/devices/virtual/bluetooth/hci3/rfkill1259'
 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
kobject: 'hci5' (00000000ee55fd0a): kobject_cleanup, parent           (null)
 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
kobject: 'hci5' (00000000ee55fd0a): calling ktype release
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:00007ffedd727cb8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000441279
RDX: 0000000000000002 RSI: 0000000020000040 RDI: 0000000000000003
RBP: 000000000006b89f R08: 00000000004002c8 R09: 00000000004002c8
R10: 0000000000000004 R11: 0000000000000246 R12: 0000000000401ff0
R13: 0000000000402080 R14: 0000000000000000 R15: 0000000000000000
Kernel Offset: disabled
Rebooting in 86400 seconds..

Crashes (14):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/09/12 16:08 linux-4.19.y ee809c7e0895 0b7672ee .config console log report syz C ci2-linux-4-19
2019/08/01 20:46 linux-4.19.y 9a9de33a9dfa 835dffe7 .config console log report syz C ci2-linux-4-19
2019/07/16 22:04 linux-4.19.y 3bd837bfe431 4ec4ea48 .config console log report syz C ci2-linux-4-19
2019/06/30 05:58 linux-4.19.y aec3002d07fd 7509bf36 .config console log report syz C ci2-linux-4-19
2019/06/07 18:04 linux-4.19.y e109a984cf38 cf9c3a50 .config console log report syz C ci2-linux-4-19
2019/04/25 23:08 linux-4.19.y c98875d930e9 f46aabc8 .config console log report syz C ci2-linux-4-19
2019/08/31 20:55 linux-4.19.y 97ab07e11fbf bad3cce2 .config console log report ci2-linux-4-19
2019/08/15 18:55 linux-4.19.y 893af1c79e42 faeffb00 .config console log report ci2-linux-4-19
2019/07/23 22:10 linux-4.19.y be9b6782a9eb de453f34 .config console log report ci2-linux-4-19
2019/07/21 01:08 linux-4.19.y 3bd837bfe431 1656845f .config console log report ci2-linux-4-19
2019/06/27 15:50 linux-4.19.y aec3002d07fd 7509bf36 .config console log report ci2-linux-4-19
2019/06/27 03:34 linux-4.19.y aec3002d07fd 7509bf36 .config console log report ci2-linux-4-19
2019/06/12 15:17 linux-4.19.y 768292d05361 794a1ad7 .config console log report ci2-linux-4-19
2019/06/04 19:22 linux-4.19.y e109a984cf38 e41a20c5 .config console log report ci2-linux-4-19
* Struck through repros no longer work on HEAD.