kobject_add_internal failed for hci3 (error: -2 parent: bluetooth) Bluetooth: Can't register HCI device kasan: CONFIG_KASAN_INLINE enabled kasan: GPF could be caused by NULL-ptr deref or user memory access kobject_add_internal failed for hci1 (error: -2 parent: bluetooth) general protection fault: 0000 [#1] PREEMPT SMP KASAN Bluetooth: Can't register HCI device CPU: 1 PID: 7916 Comm: syz-executor327 Not tainted 5.0.0+ #5 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:ffff88808bc27858 EFLAGS: 00010202 kobject: 'hci1' (00000000a60c7f94): kobject_add_internal: parent: 'bluetooth', set: 'devices' RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff87026eb8 RDX: 0000000000000001 RSI: ffffffff81d2502b RDI: 0000000000000008 RBP: ffff88808bc27898 R08: 1ffffffff1151224 R09: fffffbfff1151225 R10: fffffbfff1151224 R11: ffffffff88a89127 R12: ffff88808eb0e000 R13: ffff88808eb0e000 R14: 0000000000000000 R15: 0000000000000000 FS: 00007f2d380a6700(0000) GS:ffff8880ae900000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000004 CR3: 00000000a92a1000 CR4: 00000000001406e0 kobject: 'hci3' (0000000081bba7cd): kobject_add_internal: parent: 'bluetooth', set: 'devices' Call Trace: kernfs_create_dir_ns+0xff/0x160 fs/kernfs/dir.c:1031 sysfs_create_dir_ns+0x131/0x2a0 fs/sysfs/dir.c:59 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_add_varg lib/kobject.c:382 [inline] kobject_add+0x150/0x1c0 lib/kobject.c:426 device_add+0x3d5/0x1870 drivers/base/core.c:1912 hci_register_dev+0x304/0x880 net/bluetooth/hci_core.c:3261 __vhci_create_device+0x2d0/0x5a0 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+0x2d0/0x470 drivers/bluetooth/hci_vhci.c:299 call_write_iter include/linux/fs.h:1869 [inline] new_sync_write fs/read_write.c:474 [inline] __vfs_write+0x613/0x8e0 fs/read_write.c:487 vfs_write+0x20c/0x580 fs/read_write.c:549 ksys_write+0xea/0x1f0 fs/read_write.c:598 __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 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x44a1f9 Code: e8 0c 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 9b cc fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f2d380a5db8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00000000006dbc28 RCX: 000000000044a1f9 RDX: 0000000000000002 RSI: 00000000200000c0 RDI: 0000000000000003 RBP: 00000000006dbc20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000006dbc2c R13: 00007ffe34f27d2f R14: 00007f2d380a69c0 R15: 0000000000000000 Modules linked in: kobject: 'rfkill127' (00000000e2bb1f78): kobject_uevent_env kobject: 'hci1' (00000000a60c7f94): kobject_uevent_env kobject: 'hci4' (00000000c9d970c9): kobject_add_internal: parent: 'bluetooth', set: 'devices' kobject: 'hci1' (00000000ef71e953): kobject_cleanup, parent (null) kobject: 'hci4' (00000000c9d970c9): kobject_uevent_env kobject: 'hci1' (00000000ef71e953): calling ktype release kobject: 'hci4' (00000000c9d970c9): fill_kobj_path: path = '/devices/virtual/bluetooth/hci4' kobject: 'hci1' (00000000a60c7f94): fill_kobj_path: path = '/devices/virtual/bluetooth/hci1' ---[ end trace 96f956127235ac6c ]--- kobject: 'hci1': free name kobject: 'rfkill127' (00000000e2bb1f78): fill_kobj_path: path = '/devices/virtual/bluetooth/hci2/rfkill127' kobject: 'rfkill129' (000000008b8b5ade): kobject_add_internal: parent: 'hci1', set: 'devices' RIP: 0010:kernfs_add_one+0x343/0x4d0 fs/kernfs/dir.c:812 kobject: 'hci3' (0000000081bba7cd): kobject_uevent_env 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: 'hci3' (0000000081bba7cd): fill_kobj_path: path = '/devices/virtual/bluetooth/hci3' kobject: 'hci5' (0000000042c47044): kobject_add_internal: parent: 'bluetooth', set: 'devices' kobject: 'rfkill129' (000000008b8b5ade): kobject_uevent_env kobject: 'hci5' (0000000042c47044): kobject_uevent_env kobject: 'hci6' (0000000026f04a48): kobject_add_internal: parent: 'bluetooth', set: 'devices' RSP: 0018:ffff88808bc27858 EFLAGS: 00010202 kobject: 'hci6' (0000000026f04a48): kobject_uevent_env RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff87026eb8 kobject: 'hci5' (0000000042c47044): fill_kobj_path: path = '/devices/virtual/bluetooth/hci5' RDX: 0000000000000001 RSI: ffffffff81d2502b RDI: 0000000000000008 kobject: 'hci6' (0000000026f04a48): fill_kobj_path: path = '/devices/virtual/bluetooth/hci6' RBP: ffff88808bc27898 R08: 1ffffffff1151224 R09: fffffbfff1151225 kobject: 'rfkill129' (000000008b8b5ade): fill_kobj_path: path = '/devices/virtual/bluetooth/hci1/rfkill129' R10: fffffbfff1151224 R11: ffffffff88a89127 R12: ffff88808eb0e000 kobject: 'hci7' (000000001bd21a61): kobject_add_internal: parent: 'bluetooth', set: 'devices' R13: ffff88808eb0e000 R14: 0000000000000000 R15: 0000000000000000 kobject: 'hci7' (000000001bd21a61): kobject_uevent_env FS: 00007f2d380a6700(0000) GS:ffff8880ae900000(0000) knlGS:0000000000000000 kobject: 'hci7' (000000001bd21a61): fill_kobj_path: path = '/devices/virtual/bluetooth/hci7' CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 kobject: 'rfkill127' (00000000e2bb1f78): kobject_cleanup, parent (null) CR2: 0000000000000004 CR3: 00000000a92a1000 CR4: 00000000001406e0 kobject: 'rfkill130' (0000000062a3d5a8): kobject_add_internal: parent: 'hci3', set: 'devices'