kobject_add_internal failed for hci1 (error: -2 parent: bluetooth) Bluetooth: Can't register HCI device Bluetooth: Can't register HCI device kasan: CONFIG_KASAN_INLINE enabled kasan: GPF could be caused by NULL-ptr deref or user memory access general protection fault: 0000 [#1] PREEMPT SMP KASAN kobject: 'hci5' (000000009b89633c): kobject_add_internal: parent: 'bluetooth', set: 'devices' CPU: 0 PID: 8605 Comm: syz-executor620 Not tainted 5.0.0-rc7+ #78 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:kernfs_add_one+0x343/0x4d0 fs/kernfs/dir.c:812 Code: 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 52 01 00 00 48 b8 00 00 00 00 00 fc ff df 48 8b 5b 70 48 8d 7b 08 48 89 fa 48 c1 ea 03 <0f> b6 04 02 84 c0 74 08 3c 03 0f 8e 1f 01 00 00 8b 5b 08 31 ff 83 RSP: 0018:ffff888098d97858 EFLAGS: 00010202 RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff870246c8 RDX: 0000000000000001 RSI: ffffffff81d2548b RDI: 0000000000000008 RBP: ffff888098d97898 R08: 1ffffffff115123c R09: fffffbfff115123d R10: fffffbfff115123c R11: ffffffff88a891e7 R12: ffff888093c6f620 R13: ffff888093c6f620 R14: 0000000000000000 R15: 0000000000000000 FS: 0000000001d8f880(0000) GS:ffff8880ae800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000006cb090 CR3: 000000008bb62000 CR4: 00000000001406f0 kobject: 'hci3' (000000001aebdb23): kobject_uevent_env DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: kernfs_create_dir_ns+0xff/0x160 fs/kernfs/dir.c:1031 sysfs_create_dir_ns+0x131/0x2a0 fs/sysfs/dir.c:59 kobject: 'hci3' (000000001aebdb23): fill_kobj_path: path = '/devices/virtual/bluetooth/hci3' create_dir lib/kobject.c:88 [inline] kobject_add_internal lib/kobject.c:247 [inline] kobject_add_internal.cold+0xe5/0x5d4 lib/kobject.c:217 kobject: 'hci3' (000000001aebdb23): kobject_cleanup, parent (null) kobject_add_varg lib/kobject.c:382 [inline] kobject_add+0x150/0x1c0 lib/kobject.c:426 kobject: 'hci3' (000000001aebdb23): calling ktype release device_add+0x3d5/0x1870 drivers/base/core.c:1912 kobject: 'hci3': free name hci_register_dev+0x304/0x880 net/bluetooth/hci_core.c:3261 __vhci_create_device+0x2d0/0x5a0 drivers/bluetooth/hci_vhci.c:139 kobject: 'rfkill489' (00000000b658a6d5): kobject_uevent_env vhci_create_device drivers/bluetooth/hci_vhci.c:163 [inline] vhci_get_user drivers/bluetooth/hci_vhci.c:219 [inline] vhci_write+0x2d0/0x470 drivers/bluetooth/hci_vhci.c:299 call_write_iter include/linux/fs.h:1863 [inline] new_sync_write fs/read_write.c:474 [inline] __vfs_write+0x613/0x8e0 fs/read_write.c:487 kobject: 'rfkill487' (00000000185d7536): kobject_uevent_env kobject: 'hci5' (000000009b89633c): kobject_uevent_env vfs_write+0x20c/0x580 fs/read_write.c:549 kobject: 'hci5' (000000009b89633c): fill_kobj_path: path = '/devices/virtual/bluetooth/hci5' ksys_write+0xea/0x1f0 fs/read_write.c:598 kobject: 'rfkill489' (00000000b658a6d5): fill_kobj_path: path = '/devices/virtual/bluetooth/hci4/rfkill489' kobject: 'rfkill487' (00000000185d7536): fill_kobj_path: path = '/devices/virtual/bluetooth/hci1/rfkill487' __do_sys_write fs/read_write.c:610 [inline] __se_sys_write fs/read_write.c:607 [inline] __x64_sys_write+0x73/0xb0 fs/read_write.c:607 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 kobject: 'rfkill488' (0000000007330821): kobject_cleanup, parent (null) entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x440e49 kobject: 'rfkill490' (000000008c6b84e8): kobject_add_internal: parent: 'hci5', set: 'devices' 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 0b 0a fc ff c3 66 2e 0f 1f 84 00 00 00 00 kobject: 'rfkill490' (000000008c6b84e8): kobject_uevent_env RSP: 002b:00007ffe9311dd38 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000440e49 RDX: 0000000000000002 RSI: 00000000200000c0 RDI: 0000000000000003 RBP: 00000000000121bc R08: 00000000004002c8 R09: 00000000004002c8 kobject: 'rfkill488' (0000000007330821): calling ktype release R10: 0000000001d8f880 R11: 0000000000000246 R12: 0000000000401ce0 R13: 0000000000401d70 R14: 0000000000000000 R15: 0000000000000000 Modules linked in: kobject: 'rfkill489' (00000000b658a6d5): kobject_uevent_env kobject: 'hci3' (0000000059a1068a): kobject_add_internal: parent: 'bluetooth', set: 'devices' kobject: 'rfkill488': free name kobject: 'hci3' (0000000059a1068a): kobject_uevent_env kobject: 'rfkill489' (00000000b658a6d5): fill_kobj_path: path = '/devices/virtual/bluetooth/hci4/rfkill489' kobject: 'hci3' (0000000059a1068a): fill_kobj_path: path = '/devices/virtual/bluetooth/hci3' kobject: 'rfkill490' (000000008c6b84e8): fill_kobj_path: path = '/devices/virtual/bluetooth/hci5/rfkill490' ---[ end trace 14f5c15bc66c9aa5 ]--- kobject: 'hci0' (000000009e005c32): kobject_uevent_env RIP: 0010:kernfs_add_one+0x343/0x4d0 fs/kernfs/dir.c:812 kobject: 'rfkill487' (00000000185d7536): kobject_cleanup, parent (null) Code: 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 52 01 00 00 48 b8 00 00 00 00 00 fc ff df 48 8b 5b 70 48 8d 7b 08 48 89 fa 48 c1 ea 03 <0f> b6 04 02 84 c0 74 08 3c 03 0f 8e 1f 01 00 00 8b 5b 08 31 ff 83 kobject: 'rfkill490' (000000008c6b84e8): kobject_uevent_env kobject: 'rfkill491' (000000001d625976): kobject_add_internal: parent: 'hci3', set: 'devices' kobject: 'hci0' (000000009e005c32): fill_kobj_path: path = '/devices/virtual/bluetooth/hci0' RSP: 0018:ffff888098d97858 EFLAGS: 00010202 kobject: 'rfkill487' (00000000185d7536): calling ktype release kobject: 'rfkill491' (000000001d625976): kobject_uevent_env kobject: 'hci0' (000000009e005c32): kobject_cleanup, parent (null) kobject: 'rfkill491' (000000001d625976): fill_kobj_path: path = '/devices/virtual/bluetooth/hci3/rfkill491' kobject: 'rfkill490' (000000008c6b84e8): fill_kobj_path: path = '/devices/virtual/bluetooth/hci5/rfkill490' kobject: 'rfkill489' (00000000b658a6d5): kobject_cleanup, parent (null) RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff870246c8 kobject: 'rfkill487': free name kobject: 'rfkill491' (000000001d625976): kobject_uevent_env kobject: 'hci1' (00000000a37cc057): kobject_uevent_env kobject: 'rfkill490' (000000008c6b84e8): kobject_cleanup, parent (null) kobject: 'rfkill489' (00000000b658a6d5): calling ktype release kobject: 'rfkill490' (000000008c6b84e8): calling ktype release kobject: 'hci0' (000000009e005c32): calling ktype release kobject: 'hci1' (00000000a37cc057): fill_kobj_path: path = '/devices/virtual/bluetooth/hci1' kobject: 'hci0': free name kobject: 'rfkill491' (000000001d625976): fill_kobj_path: path = '/devices/virtual/bluetooth/hci3/rfkill491' kobject: 'rfkill489': free name kobject: 'hci1' (00000000a37cc057): kobject_cleanup, parent (null) RDX: 0000000000000001 RSI: ffffffff81d2548b RDI: 0000000000000008 kobject: 'rfkill490': free name RBP: ffff888098d97898 R08: 1ffffffff115123c R09: fffffbfff115123d kobject: 'rfkill491' (000000001d625976): kobject_cleanup, parent (null) kobject: 'hci4' (000000009c18dd82): kobject_uevent_env kobject: 'hci5' (000000009b89633c): kobject_uevent_env kobject: 'hci4' (000000009c18dd82): fill_kobj_path: path = '/devices/virtual/bluetooth/hci4' kobject: 'hci1' (00000000a37cc057): calling ktype release R10: fffffbfff115123c R11: ffffffff88a891e7 R12: ffff888093c6f620 kobject: 'hci1': free name kobject: 'hci4' (000000009c18dd82): kobject_cleanup, parent (null) kobject: 'hci0' (00000000a19a479a): kobject_add_internal: parent: 'bluetooth', set: 'devices' kobject: 'hci4' (000000009c18dd82): calling ktype release kobject: 'rfkill491' (000000001d625976): calling ktype release R13: ffff888093c6f620 R14: 0000000000000000 R15: 0000000000000000 kobject: 'hci5' (000000009b89633c): fill_kobj_path: path = '/devices/virtual/bluetooth/hci5' kobject: 'hci5' (000000009b89633c): kobject_cleanup, parent (null) FS: 0000000001d8f880(0000) GS:ffff8880ae800000(0000) knlGS:0000000000000000 kobject: 'rfkill491': free name kobject: 'hci4': free name kobject: 'hci5' (000000009b89633c): calling ktype release kobject: 'hci0' (00000000a19a479a): kobject_uevent_env kobject: 'hci1' (000000005ce2afb3): kobject_add_internal: parent: 'bluetooth', set: 'devices' CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 kobject: 'hci5': free name kobject: 'hci0' (00000000a19a479a): fill_kobj_path: path = '/devices/virtual/bluetooth/hci0' kobject: 'hci3' (0000000059a1068a): kobject_uevent_env kobject: 'rfkill492' (000000001512904b): kobject_add_internal: parent: 'hci0', set: 'devices' kobject: 'hci4' (00000000c2a3ec1f): kobject_add_internal: parent: 'bluetooth', set: 'devices' CR2: 00007ffe9311dd44 CR3: 000000008bb62000 CR4: 00000000001406f0 kobject: 'hci3' (0000000059a1068a): fill_kobj_path: path = '/devices/virtual/bluetooth/hci3' DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 kobject: 'hci1' (000000005ce2afb3): kobject_uevent_env kobject: 'rfkill492' (000000001512904b): kobject_uevent_env kobject: 'hci1' (000000005ce2afb3): fill_kobj_path: path = '/devices/virtual/bluetooth/hci1' DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 kobject: 'hci3' (0000000059a1068a): kobject_cleanup, parent (null) kobject: 'rfkill492' (000000001512904b): fill_kobj_path: path = '/devices/virtual/bluetooth/hci0/rfkill492' kobject: 'hci4' (00000000c2a3ec1f): kobject_uevent_env