kobject_add_internal failed for hci2 (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 general protection fault: 0000 [#1] PREEMPT SMP KASAN kobject: 'hci4' (00000000c1b8ca1f): kobject_add_internal: parent: 'bluetooth', set: 'devices' CPU: 1 PID: 7884 Comm: syz-executor635 Not tainted 5.0.0-rc8+ #89 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: 'hci4' (00000000c1b8ca1f): kobject_uevent_env RSP: 0018:ffff88809d03f848 EFLAGS: 00010202 RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff87026908 RDX: 0000000000000001 RSI: ffffffff81d2510b RDI: 0000000000000008 RBP: ffff88809d03f888 R08: 1ffffffff115121c R09: fffffbfff115121d R10: fffffbfff115121c R11: ffffffff88a890e7 R12: ffff8880987907e0 R13: ffff8880987907e0 R14: 0000000000000000 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff8880ae900000(0063) knlGS:00000000095b4840 CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033 kobject: 'hci4' (00000000c1b8ca1f): fill_kobj_path: path = '/devices/virtual/bluetooth/hci4' CR2: 00007fb2d12ef000 CR3: 00000000a989f000 CR4: 00000000001406e0 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: 'hci2' (00000000294454d7): kobject_cleanup, parent (null) 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: 'hci2' (00000000294454d7): calling ktype release kobject: 'hci2': free name device_add+0x3d5/0x1870 drivers/base/core.c:1912 kobject: 'rfkill271' (00000000ac7f35bb): kobject_add_internal: parent: 'hci5', set: 'devices' hci_register_dev+0x304/0x880 net/bluetooth/hci_core.c:3261 __vhci_create_device+0x2d0/0x5a0 drivers/bluetooth/hci_vhci.c:139 kobject: 'rfkill271' (00000000ac7f35bb): 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: 'rfkill270' (000000000b4f01f1): kobject_uevent_env vfs_write+0x20c/0x580 fs/read_write.c:549 ksys_write+0xea/0x1f0 fs/read_write.c:598 kobject: 'rfkill271' (00000000ac7f35bb): fill_kobj_path: path = '/devices/virtual/bluetooth/hci5/rfkill271' kobject: 'rfkill270' (000000000b4f01f1): fill_kobj_path: path = '/devices/virtual/bluetooth/hci3/rfkill270' __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 do_syscall_32_irqs_on arch/x86/entry/common.c:326 [inline] do_fast_syscall_32+0x281/0xc98 arch/x86/entry/common.c:397 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 kobject: 'hci2' (00000000030a7ccf): kobject_add_internal: parent: 'bluetooth', set: 'devices' RIP: 0023:0xf7f75869 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:00000000ffda8d6c EFLAGS: 00000246 ORIG_RAX: 0000000000000004 kobject: 'rfkill272' (00000000eda42ee5): kobject_add_internal: parent: 'hci4', set: 'devices' RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000020000040 RDX: 0000000000000002 RSI: 0000000000000001 RDI: 00000000ffda8ea4 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Modules linked in: kobject: 'rfkill271' (00000000ac7f35bb): kobject_uevent_env kobject: 'hci6' (000000001cf5bbcd): kobject_add_internal: parent: 'bluetooth', set: 'devices' kobject: 'hci2' (00000000030a7ccf): kobject_uevent_env kobject: 'hci6' (000000001cf5bbcd): kobject_uevent_env kobject: 'rfkill272' (00000000eda42ee5): kobject_uevent_env kobject: 'hci6' (000000001cf5bbcd): fill_kobj_path: path = '/devices/virtual/bluetooth/hci6' kobject: 'hci2' (00000000030a7ccf): fill_kobj_path: path = '/devices/virtual/bluetooth/hci2' kobject: 'rfkill271' (00000000ac7f35bb): fill_kobj_path: path = '/devices/virtual/bluetooth/hci5/rfkill271' kobject: 'rfkill272' (00000000eda42ee5): fill_kobj_path: path = '/devices/virtual/bluetooth/hci4/rfkill272' ---[ end trace f14a1a4ef9199320 ]--- kobject: 'rfkill270' (000000000b4f01f1): kobject_cleanup, parent (null) kobject: 'rfkill273' (00000000bc51a2ad): kobject_add_internal: parent: 'hci6', set: 'devices' kobject: 'rfkill272' (00000000eda42ee5): kobject_uevent_env kobject: 'rfkill273' (00000000bc51a2ad): kobject_uevent_env kobject: 'rfkill270' (000000000b4f01f1): calling ktype release RIP: 0010:kernfs_add_one+0x343/0x4d0 fs/kernfs/dir.c:812 kobject: 'rfkill272' (00000000eda42ee5): fill_kobj_path: path = '/devices/virtual/bluetooth/hci4/rfkill272' kobject: 'rfkill273' (00000000bc51a2ad): fill_kobj_path: path = '/devices/virtual/bluetooth/hci6/rfkill273' kobject: 'rfkill270': free name 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' (00000000e85a0c55): kobject_uevent_env kobject: 'rfkill271' (00000000ac7f35bb): kobject_cleanup, parent (null) kobject: 'rfkill274' (00000000355eca42): kobject_add_internal: parent: 'hci2', set: 'devices' kobject: 'rfkill273' (00000000bc51a2ad): kobject_uevent_env kobject: 'hci3' (00000000e85a0c55): fill_kobj_path: path = '/devices/virtual/bluetooth/hci3' kobject: 'rfkill271' (00000000ac7f35bb): calling ktype release kobject: 'rfkill274' (00000000355eca42): kobject_uevent_env kobject: 'rfkill273' (00000000bc51a2ad): fill_kobj_path: path = '/devices/virtual/bluetooth/hci6/rfkill273' kobject: 'rfkill274' (00000000355eca42): fill_kobj_path: path = '/devices/virtual/bluetooth/hci2/rfkill274' RSP: 0018:ffff88809d03f848 EFLAGS: 00010202 kobject: 'hci3' (00000000e85a0c55): kobject_cleanup, parent (null) kobject: 'rfkill271': free name kobject: 'rfkill272' (00000000eda42ee5): kobject_cleanup, parent (null) kobject: 'rfkill273' (00000000bc51a2ad): kobject_cleanup, parent (null) kobject: 'rfkill274' (00000000355eca42): kobject_uevent_env kobject: 'hci5' (000000004e4c25ba): kobject_uevent_env kobject: 'hci3' (00000000e85a0c55): calling ktype release RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff87026908 kobject: 'rfkill272' (00000000eda42ee5): calling ktype release kobject: 'rfkill273' (00000000bc51a2ad): calling ktype release kobject: 'rfkill272': free name RDX: 0000000000000001 RSI: ffffffff81d2510b RDI: 0000000000000008 kobject: 'rfkill274' (00000000355eca42): fill_kobj_path: path = '/devices/virtual/bluetooth/hci2/rfkill274' RBP: ffff88809d03f888 R08: 1ffffffff115121c R09: fffffbfff115121d kobject: 'hci3': free name kobject: 'hci5' (000000004e4c25ba): fill_kobj_path: path = '/devices/virtual/bluetooth/hci5' kobject: 'hci4' (00000000c1b8ca1f): kobject_uevent_env kobject: 'rfkill273': free name kobject: 'hci4' (00000000c1b8ca1f): fill_kobj_path: path = '/devices/virtual/bluetooth/hci4' kobject: 'hci5' (000000004e4c25ba): kobject_cleanup, parent (null) kobject: 'rfkill274' (00000000355eca42): kobject_cleanup, parent (null) kobject: 'hci6' (000000001cf5bbcd): kobject_uevent_env kobject: 'rfkill274' (00000000355eca42): calling ktype release kobject: 'hci6' (000000001cf5bbcd): fill_kobj_path: path = '/devices/virtual/bluetooth/hci6' R10: fffffbfff115121c R11: ffffffff88a890e7 R12: ffff8880987907e0 kobject: 'hci5' (000000004e4c25ba): calling ktype release kobject: 'hci4' (00000000c1b8ca1f): kobject_cleanup, parent (null) kobject: 'hci3' (00000000259f08f1): kobject_add_internal: parent: 'bluetooth', set: 'devices' kobject: 'hci4' (00000000c1b8ca1f): calling ktype release kobject: 'hci6' (000000001cf5bbcd): kobject_cleanup, parent (null) kobject: 'rfkill274': free name kobject: 'hci5': free name R13: ffff8880987907e0 R14: 0000000000000000 R15: 0000000000000000 kobject: 'hci6' (000000001cf5bbcd): calling ktype release kobject: 'hci2' (00000000030a7ccf): kobject_uevent_env kobject: 'hci3' (00000000259f08f1): kobject_uevent_env kobject: 'hci4': free name kobject: 'hci6': free name FS: 0000000000000000(0000) GS:ffff8880ae800000(0063) knlGS:00000000095b4840 kobject: 'hci3' (00000000259f08f1): fill_kobj_path: path = '/devices/virtual/bluetooth/hci3' kobject: 'hci2' (00000000030a7ccf): fill_kobj_path: path = '/devices/virtual/bluetooth/hci2' kobject: 'hci4' (000000000bd4081a): kobject_add_internal: parent: 'bluetooth', set: 'devices' CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033 kobject: 'rfkill275' (00000000bb9fd34a): kobject_add_internal: parent: 'hci3', set: 'devices' kobject: 'hci2' (00000000030a7ccf): kobject_cleanup, parent (null) kobject: 'hci2' (0000000063d2e6e1): kobject_add_internal: parent: 'bluetooth', set: 'devices' kobject: 'hci5' (0000000009358390): kobject_add_internal: parent: 'bluetooth', set: 'devices' kobject: 'hci4' (000000000bd4081a): kobject_uevent_env kobject: 'hci5' (0000000009358390): kobject_uevent_env kobject: 'hci2' (0000000063d2e6e1): kobject_uevent_env kobject: 'hci2' (00000000030a7ccf): calling ktype release kobject: 'rfkill275' (00000000bb9fd34a): kobject_uevent_env CR2: 00007fb2d12ef000 CR3: 00000000a989f000 CR4: 00000000001406f0 kobject: 'hci4' (000000000bd4081a): fill_kobj_path: path = '/devices/virtual/bluetooth/hci4' DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 kobject: 'hci2' (0000000063d2e6e1): fill_kobj_path: path = '/devices/virtual/bluetooth/hci2' kobject: 'hci5' (0000000009358390): fill_kobj_path: path = '/devices/virtual/bluetooth/hci5' kobject: 'rfkill275' (00000000bb9fd34a): fill_kobj_path: path = '/devices/virtual/bluetooth/hci3/rfkill275' kobject: 'hci2': free name kobject: 'rfkill276' (0000000099dec1dc): kobject_add_internal: parent: 'hci4', set: 'devices' DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 kobject: 'rfkill275' (00000000bb9fd34a): kobject_uevent_env