kobject_add_internal failed for hci5 (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: 'hci4' (0000000037318a2b): calling ktype release CPU: 1 PID: 5858 Comm: syz-executor682 Not tainted 4.19.0+ #218 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:kernfs_add_one+0x342/0x4d0 fs/kernfs/dir.c:812 Code: 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 49 01 00 00 48 b8 00 00 00 00 00 fc ff df 4d 8b 6d 70 49 8d 7d 08 48 89 fa 48 c1 ea 03 <0f> b6 04 02 84 c0 74 08 3c 03 0f 8e 16 01 00 00 45 8b 6d 08 31 ff RSP: 0018:ffff8801d32c7580 EFLAGS: 00010202 RAX: dffffc0000000000 RBX: ffff8801b9dc78c0 RCX: ffffffff87ce0367 RDX: 0000000000000001 RSI: ffffffff81f8e5aa RDI: 0000000000000008 RBP: ffff8801d32c75c8 R08: fffffbfff12cf9e1 R09: fffffbfff12cf9e0 R10: fffffbfff12cf9e0 R11: ffffffff8967cf07 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff8801daf00000(0063) knlGS:000000000a04b840 CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033 CR2: 00007f5261372000 CR3: 00000001d9731000 CR4: 00000000001406e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 kobject: 'hci1' (00000000c5746260): kobject_cleanup, parent (null) DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: kernfs_create_dir_ns+0xf6/0x160 fs/kernfs/dir.c:1031 sysfs_create_dir_ns+0x19b/0x340 fs/sysfs/dir.c:58 kobject: 'bluetooth' (00000000ecf697bf): kobject_add_internal: parent: 'virtual', set: '(null)' create_dir lib/kobject.c:88 [inline] kobject_add_internal.cold.11+0x116/0x6af lib/kobject.c:247 kobject: 'hci4': free name kobject: 'hci1' (00000000c5746260): calling ktype release kobject_add_varg lib/kobject.c:382 [inline] kobject_add+0x13f/0x1b0 lib/kobject.c:426 kobject: 'hci1' (000000007897d619): kobject_add_internal: parent: 'bluetooth', set: 'devices' device_add+0x445/0x18e0 drivers/base/core.c:1879 kobject: 'hci2' (00000000fa6a7047): kobject_add_internal: parent: 'bluetooth', set: 'devices' hci_register_dev+0x3b3/0x9c0 net/bluetooth/hci_core.c:3261 kobject: 'hci1' (000000007897d619): kobject_uevent_env kobject: 'hci1': free name __vhci_create_device+0x2c1/0x580 drivers/bluetooth/hci_vhci.c:139 vhci_create_device drivers/bluetooth/hci_vhci.c:163 [inline] vhci_get_user drivers/bluetooth/hci_vhci.c:219 [inline] vhci_write+0x2de/0x470 drivers/bluetooth/hci_vhci.c:299 call_write_iter include/linux/fs.h:1839 [inline] new_sync_write fs/read_write.c:474 [inline] __vfs_write+0x6b8/0x9f0 fs/read_write.c:487 kobject: 'hci1' (000000007897d619): fill_kobj_path: path = '/devices/virtual/bluetooth/hci1' kobject: 'hci2' (00000000fa6a7047): kobject_uevent_env vfs_write+0x1fc/0x560 fs/read_write.c:549 ksys_write+0x101/0x260 fs/read_write.c:598 kobject: 'rfkill182' (0000000033037493): kobject_add_internal: parent: 'hci1', set: 'devices' __do_sys_write fs/read_write.c:610 [inline] __se_sys_write fs/read_write.c:607 [inline] __ia32_sys_write+0x71/0xb0 fs/read_write.c:607 kobject: 'hci2' (00000000fa6a7047): fill_kobj_path: path = '/devices/virtual/bluetooth/hci2' do_syscall_32_irqs_on arch/x86/entry/common.c:326 [inline] do_fast_syscall_32+0x34d/0xfb2 arch/x86/entry/common.c:397 kobject: 'rfkill182' (0000000033037493): kobject_uevent_env kobject: 'hci3' (0000000017039966): kobject_add_internal: parent: 'bluetooth', set: 'devices' kobject: 'rfkill182' (0000000033037493): fill_kobj_path: path = '/devices/virtual/bluetooth/hci1/rfkill182' entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 kobject: 'hci3' (0000000017039966): kobject_uevent_env RIP: 0023:0xf7fe1a29 Code: 85 d2 74 02 89 0a 5b 5d c3 8b 04 24 c3 8b 14 24 c3 8b 3c 24 c3 90 90 90 90 90 90 90 90 90 90 90 90 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 eb 0d 90 90 90 90 90 90 90 90 90 90 90 90 RSP: 002b:00000000fff0809c EFLAGS: 00000246 ORIG_RAX: 0000000000000004 kobject: 'rfkill183' (00000000edd903ce): kobject_add_internal: parent: 'hci2', set: 'devices' RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00000000200000c0 RDX: 0000000000000002 RSI: 00000000fff081e4 RDI: 00000000fff081ec RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 kobject: 'rfkill182' (0000000033037493): kobject_uevent_env R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Modules linked in: kobject: 'hci3' (0000000017039966): fill_kobj_path: path = '/devices/virtual/bluetooth/hci3' kobject: 'hci4' (000000001f3e76fe): kobject_add_internal: parent: 'bluetooth', set: 'devices' kobject: 'hci5' (000000007f160bd8): kobject_add_internal: parent: 'bluetooth', set: 'devices' kobject: 'rfkill183' (00000000edd903ce): kobject_uevent_env kobject: 'hci5' (000000007f160bd8): kobject_uevent_env kobject: 'rfkill182' (0000000033037493): fill_kobj_path: path = '/devices/virtual/bluetooth/hci1/rfkill182' kobject: 'hci5' (000000007f160bd8): fill_kobj_path: path = '/devices/virtual/bluetooth/hci5' kobject: 'hci4' (000000001f3e76fe): kobject_uevent_env kobject: 'rfkill183' (00000000edd903ce): fill_kobj_path: path = '/devices/virtual/bluetooth/hci2/rfkill183' kobject: 'hci4' (000000001f3e76fe): fill_kobj_path: path = '/devices/virtual/bluetooth/hci4' kobject: 'rfkill184' (000000007c35a833): kobject_add_internal: parent: 'hci3', set: 'devices' ---[ end trace b79988b338bb68ba ]--- kobject: 'rfkill183' (00000000edd903ce): kobject_uevent_env RIP: 0010:kernfs_add_one+0x342/0x4d0 fs/kernfs/dir.c:812 kobject: 'rfkill184' (000000007c35a833): kobject_uevent_env kobject: 'rfkill183' (00000000edd903ce): fill_kobj_path: path = '/devices/virtual/bluetooth/hci2/rfkill183' kobject: 'rfkill184' (000000007c35a833): fill_kobj_path: path = '/devices/virtual/bluetooth/hci3/rfkill184' Code: 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 49 01 00 00 48 b8 00 00 00 00 00 fc ff df 4d 8b 6d 70 49 8d 7d 08 48 89 fa 48 c1 ea 03 <0f> b6 04 02 84 c0 74 08 3c 03 0f 8e 16 01 00 00 45 8b 6d 08 31 ff kobject: 'rfkill184' (000000007c35a833): kobject_uevent_env kobject: 'rfkill182' (0000000033037493): kobject_cleanup, parent (null) kobject: 'rfkill185' (00000000f0f04b16): kobject_add_internal: parent: 'hci5', set: 'devices' kobject: 'rfkill182' (0000000033037493): calling ktype release kobject: 'rfkill184' (000000007c35a833): fill_kobj_path: path = '/devices/virtual/bluetooth/hci3/rfkill184' kobject: 'rfkill182': free name kobject: 'rfkill185' (00000000f0f04b16): kobject_uevent_env kobject: 'hci1' (000000007897d619): kobject_uevent_env RSP: 0018:ffff8801d32c7580 EFLAGS: 00010202 kobject: 'hci1' (000000007897d619): fill_kobj_path: path = '/devices/virtual/bluetooth/hci1' RAX: dffffc0000000000 RBX: ffff8801b9dc78c0 RCX: ffffffff87ce0367 kobject: 'hci1' (000000007897d619): kobject_cleanup, parent (null) RDX: 0000000000000001 RSI: ffffffff81f8e5aa RDI: 0000000000000008 kobject: 'rfkill185' (00000000f0f04b16): fill_kobj_path: path = '/devices/virtual/bluetooth/hci5/rfkill185' RBP: ffff8801d32c75c8 R08: fffffbfff12cf9e1 R09: fffffbfff12cf9e0 kobject: 'hci1' (000000007897d619): calling ktype release R10: fffffbfff12cf9e0 R11: ffffffff8967cf07 R12: 0000000000000000 kobject: 'hci1': free name R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 kobject: 'rfkill186' (00000000cdcd4c0a): kobject_add_internal: parent: 'hci4', set: 'devices' FS: 0000000000000000(0000) GS:ffff8801daf00000(0063) knlGS:000000000a04b840 kobject: 'rfkill185' (00000000f0f04b16): kobject_uevent_env CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033 kobject: 'rfkill186' (00000000cdcd4c0a): kobject_uevent_env CR2: 0000000000cdc028 CR3: 00000001d9731000 CR4: 00000000001406e0 kobject: 'rfkill185' (00000000f0f04b16): fill_kobj_path: path = '/devices/virtual/bluetooth/hci5/rfkill185' DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 kobject: 'rfkill186' (00000000cdcd4c0a): fill_kobj_path: path = '/devices/virtual/bluetooth/hci4/rfkill186' kobject: 'hci1' (000000006e6858f9): kobject_add_internal: parent: 'bluetooth', set: 'devices' kobject: 'rfkill183' (00000000edd903ce): kobject_cleanup, parent (null) DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 kobject: 'rfkill186' (00000000cdcd4c0a): kobject_uevent_env kobject: 'rfkill184' (000000007c35a833): kobject_cleanup, parent (null) kobject: 'rfkill185' (00000000f0f04b16): kobject_cleanup, parent (null) kobject: 'hci1' (000000006e6858f9): kobject_uevent_env kobject: 'rfkill186' (00000000cdcd4c0a): fill_kobj_path: path = '/devices/virtual/bluetooth/hci4/rfkill186' kobject: 'rfkill184' (000000007c35a833): calling ktype release kobject: 'rfkill183' (00000000edd903ce): calling ktype release kobject: 'hci1' (000000006e6858f9): fill_kobj_path: path = '/devices/virtual/bluetooth/hci1' kobject: 'rfkill185' (00000000f0f04b16): calling ktype release kobject: 'rfkill184': free name