kobject_add_internal failed for hci1 (error: -2 parent: bluetooth) kasan: CONFIG_KASAN_INLINE enabled Bluetooth: Can't register HCI device Bluetooth: Can't register HCI device kasan: GPF could be caused by NULL-ptr deref or user memory access general protection fault: 0000 [#1] PREEMPT SMP KASAN kobject: 'rfkill344' (0000000002cdfbbe): kobject_uevent_env CPU: 0 PID: 8023 Comm: syz-executor873 Not tainted 5.0.0+ #8 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 kobject: 'hci0' (00000000579f20d0): kobject_uevent_env RSP: 0018:ffff8880a0b3f858 EFLAGS: 00010202 RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff8705eb68 RDX: 0000000000000001 RSI: ffffffff81d2fccb RDI: 0000000000000008 RBP: ffff8880a0b3f898 R08: 1ffffffff1151404 R09: fffffbfff1151405 R10: fffffbfff1151404 R11: ffffffff88a8a027 R12: ffff8880a4727ee0 R13: ffff8880a4727ee0 R14: 0000000000000000 R15: 0000000000000000 FS: 00000000019fc880(0000) GS:ffff8880ae800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000004bf6c8 CR3: 00000000964dd000 CR4: 00000000001406f0 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: 'hci4' (00000000b268e4f9): kobject_add_internal: parent: 'bluetooth', set: 'devices' 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 kobject: 'rfkill344' (0000000002cdfbbe): fill_kobj_path: path = '/devices/virtual/bluetooth/hci2/rfkill344' device_add+0x3d5/0x1870 drivers/base/core.c:1912 kobject: 'hci0' (00000000579f20d0): fill_kobj_path: path = '/devices/virtual/bluetooth/hci0' hci_register_dev+0x304/0x880 net/bluetooth/hci_core.c:3307 __vhci_create_device+0x2d0/0x5a0 drivers/bluetooth/hci_vhci.c:139 kobject: 'rfkill344' (0000000002cdfbbe): kobject_cleanup, parent (null) 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 kobject: 'rfkill344' (0000000002cdfbbe): calling ktype release kobject: 'hci4' (00000000b268e4f9): kobject_uevent_env vfs_write+0x20c/0x580 fs/read_write.c:549 ksys_write+0xea/0x1f0 fs/read_write.c:598 kobject: 'hci0' (00000000579f20d0): kobject_cleanup, parent (null) __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: 'hci4' (00000000b268e4f9): fill_kobj_path: path = '/devices/virtual/bluetooth/hci4' entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x441139 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 kobject: 'rfkill345' (00000000774a2e37): kobject_add_internal: parent: 'hci4', set: 'devices' RSP: 002b:00007fff4909c828 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000441139 RDX: 0000000000000002 RSI: 00000000200000c0 RDI: 0000000000000003 RBP: 0000000000016d0d R08: 00000000004002c8 R09: 00000000004002c8 kobject: 'rfkill344': free name R10: 0000000000000004 R11: 0000000000000246 R12: 0000000000401eb0 R13: 0000000000401f40 R14: 0000000000000000 R15: 0000000000000000 Modules linked in: kobject: 'hci0' (00000000482e0941): kobject_add_internal: parent: 'bluetooth', set: 'devices' kobject: 'rfkill345' (00000000774a2e37): kobject_uevent_env kobject: 'hci0' (00000000482e0941): kobject_uevent_env kobject: 'hci0' (00000000579f20d0): calling ktype release kobject: 'hci0' (00000000482e0941): fill_kobj_path: path = '/devices/virtual/bluetooth/hci0' kobject: 'hci0': free name ---[ end trace 42500ea766b3a94e ]--- kobject: 'rfkill345' (00000000774a2e37): fill_kobj_path: path = '/devices/virtual/bluetooth/hci4/rfkill345' RIP: 0010:kernfs_add_one+0x343/0x4d0 fs/kernfs/dir.c:812 kobject: 'hci2' (00000000b3481241): 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: 'hci5' (000000008a12dc17): kobject_add_internal: parent: 'bluetooth', set: 'devices' kobject: 'rfkill343' (0000000005709bee): kobject_cleanup, parent (null) kobject: 'hci2' (00000000b3481241): fill_kobj_path: path = '/devices/virtual/bluetooth/hci2' kobject: 'rfkill346' (00000000b9603cc9): kobject_add_internal: parent: 'hci0', set: 'devices' kobject: 'hci5' (000000008a12dc17): kobject_uevent_env kobject: 'rfkill343' (0000000005709bee): calling ktype release kobject: 'hci2' (00000000b3481241): kobject_cleanup, parent (null) kobject: 'rfkill343': free name kobject: 'hci5' (000000008a12dc17): fill_kobj_path: path = '/devices/virtual/bluetooth/hci5' kobject: 'hci1' (00000000edf76643): kobject_uevent_env kobject: 'hci2' (00000000b3481241): calling ktype release RSP: 0018:ffff8880a0b3f858 EFLAGS: 00010202 kobject: 'rfkill346' (00000000b9603cc9): kobject_uevent_env kobject: 'hci1' (00000000edf76643): fill_kobj_path: path = '/devices/virtual/bluetooth/hci1' kobject: 'rfkill346' (00000000b9603cc9): fill_kobj_path: path = '/devices/virtual/bluetooth/hci0/rfkill346' RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff8705eb68 kobject: 'hci2': free name kobject: 'hci1' (00000000edf76643): kobject_cleanup, parent (null) kobject: 'rfkill345' (00000000774a2e37): kobject_uevent_env RDX: 0000000000000001 RSI: ffffffff81d2fccb RDI: 0000000000000008 kobject: 'rfkill347' (000000005120ee1d): kobject_add_internal: parent: 'hci5', set: 'devices' kobject: 'hci1' (00000000edf76643): calling ktype release kobject: 'rfkill346' (00000000b9603cc9): kobject_uevent_env RBP: ffff8880a0b3f898 R08: 1ffffffff1151404 R09: fffffbfff1151405 kobject: 'rfkill347' (000000005120ee1d): kobject_uevent_env kobject: 'hci1': free name kobject: 'hci1' (00000000444934b9): kobject_add_internal: parent: 'bluetooth', set: 'devices' R10: fffffbfff1151404 R11: ffffffff88a8a027 R12: ffff8880a4727ee0 kobject: 'rfkill346' (00000000b9603cc9): fill_kobj_path: path = '/devices/virtual/bluetooth/hci0/rfkill346' R13: ffff8880a4727ee0 R14: 0000000000000000 R15: 0000000000000000 kobject: 'hci1' (00000000444934b9): kobject_uevent_env kobject: 'rfkill345' (00000000774a2e37): fill_kobj_path: path = '/devices/virtual/bluetooth/hci4/rfkill345' kobject: 'rfkill347' (000000005120ee1d): fill_kobj_path: path = '/devices/virtual/bluetooth/hci5/rfkill347' FS: 00000000019fc880(0000) GS:ffff8880ae800000(0000) knlGS:0000000000000000 kobject: 'hci1' (00000000444934b9): fill_kobj_path: path = '/devices/virtual/bluetooth/hci1' CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 kobject: 'hci2' (00000000407645de): kobject_add_internal: parent: 'bluetooth', set: 'devices' kobject: 'rfkill347' (000000005120ee1d): kobject_uevent_env kobject: 'rfkill346' (00000000b9603cc9): kobject_cleanup, parent (null) CR2: 00000000004bf6c8 CR3: 00000000964dd000 CR4: 00000000001406f0 kobject: 'rfkill345' (00000000774a2e37): kobject_cleanup, parent (null) kobject: 'rfkill348' (00000000487dd3c9): kobject_add_internal: parent: 'hci1', set: 'devices' kobject: 'rfkill345' (00000000774a2e37): calling ktype release kobject: 'rfkill347' (000000005120ee1d): fill_kobj_path: path = '/devices/virtual/bluetooth/hci5/rfkill347'