kobject_add_internal failed for hci1 (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: 'hci1' (000000006e30b433): kobject_add_internal: parent: 'bluetooth', set: 'devices' CPU: 0 PID: 6325 Comm: syz-executor292 Not tainted 4.20.0-rc5+ #270 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 kobject: 'rfkill323' (000000004eeb4a6e): kobject_uevent_env RSP: 0018:ffff8881c2967580 EFLAGS: 00010202 RAX: dffffc0000000000 RBX: ffff8881c2fc3b60 RCX: ffffffff87d9e4c7 RDX: 0000000000000001 RSI: ffffffff81f8ff1a RDI: 0000000000000008 RBP: ffff8881c29675c8 R08: fffffbfff12cfaad R09: fffffbfff12cfaac R10: fffffbfff12cfaac R11: ffffffff8967d567 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 kobject: 'rfkill320' (00000000f858406a): calling ktype release FS: 0000000000000000(0000) GS:ffff8881dae00000(0063) knlGS:0000000008e0a840 CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033 CR2: 00000000080d6a20 CR3: 00000001c6a74000 CR4: 00000000001406f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 kobject: 'hci1' (000000006e30b433): kobject_uevent_env 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: 'rfkill323' (000000004eeb4a6e): fill_kobj_path: path = '/devices/virtual/bluetooth/hci4/rfkill323' create_dir lib/kobject.c:88 [inline] kobject_add_internal.cold.11+0x116/0x6af lib/kobject.c:247 kobject: 'hci1' (000000006e30b433): fill_kobj_path: path = '/devices/virtual/bluetooth/hci1' kobject: 'rfkill320': free name kobject_add_varg lib/kobject.c:382 [inline] kobject_add+0x13f/0x1b0 lib/kobject.c:426 kobject: 'rfkill324' (0000000026894e1c): kobject_add_internal: parent: 'hci1', set: 'devices' device_add+0x445/0x18e0 drivers/base/core.c:1879 kobject: 'rfkill323' (000000004eeb4a6e): kobject_uevent_env hci_register_dev+0x3b3/0x9c0 net/bluetooth/hci_core.c:3261 kobject: 'rfkill324' (0000000026894e1c): kobject_uevent_env kobject: 'hci0' (00000000c11b782d): kobject_uevent_env __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 kobject: 'rfkill323' (000000004eeb4a6e): fill_kobj_path: path = '/devices/virtual/bluetooth/hci4/rfkill323' call_write_iter include/linux/fs.h:1857 [inline] new_sync_write fs/read_write.c:474 [inline] __vfs_write+0x6b8/0x9f0 fs/read_write.c:487 kobject: 'hci0' (00000000c11b782d): fill_kobj_path: path = '/devices/virtual/bluetooth/hci0' vfs_write+0x1fc/0x560 fs/read_write.c:549 ksys_write+0x101/0x260 fs/read_write.c:598 kobject: 'rfkill324' (0000000026894e1c): fill_kobj_path: path = '/devices/virtual/bluetooth/hci1/rfkill324' __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+0x34d/0xfb2 arch/x86/entry/common.c:397 kobject: 'rfkill323' (000000004eeb4a6e): kobject_cleanup, parent (null) kobject: 'rfkill324' (0000000026894e1c): kobject_uevent_env kobject: 'hci0' (00000000c11b782d): kobject_cleanup, parent (null) entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 kobject: 'rfkill324' (0000000026894e1c): fill_kobj_path: path = '/devices/virtual/bluetooth/hci1/rfkill324' RIP: 0023:0xf7f56a29 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:00000000ff85581c EFLAGS: 00000246 ORIG_RAX: 0000000000000004 kobject: 'rfkill324' (0000000026894e1c): kobject_cleanup, parent (null) RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00000000200000c0 RDX: 0000000000000002 RSI: 00000000ff855964 RDI: 00000000ff85596c RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Modules linked in: kobject: 'rfkill323' (000000004eeb4a6e): calling ktype release kobject: 'hci0' (00000000c11b782d): calling ktype release kobject: 'regulatory.0' (00000000709d4280): kobject_uevent_env kobject: 'hci0' (000000000009dc2f): kobject_add_internal: parent: 'bluetooth', set: 'devices' kobject: 'regulatory.0' (00000000709d4280): fill_kobj_path: path = '/devices/platform/regulatory.0' kobject: 'hci3' (000000001aa29f28): kobject_add_internal: parent: 'bluetooth', set: 'devices' kobject: 'rfkill324' (0000000026894e1c): calling ktype release kobject: 'hci0': free name kobject: 'rfkill324': free name kobject: 'hci5' (000000007e05d66b): kobject_add_internal: parent: 'bluetooth', set: 'devices' kobject: 'rfkill323': free name kobject: 'hci0' (000000000009dc2f): kobject_uevent_env kobject: 'hci4' (000000003e82060f): kobject_uevent_env kobject: 'hci5' (000000007e05d66b): kobject_uevent_env kobject: 'hci1' (000000006e30b433): kobject_uevent_env kobject: 'hci3' (000000001aa29f28): kobject_uevent_env kobject: 'hci1' (000000006e30b433): fill_kobj_path: path = '/devices/virtual/bluetooth/hci1' kobject: 'hci0' (000000000009dc2f): fill_kobj_path: path = '/devices/virtual/bluetooth/hci0' kobject: 'hci4' (000000003e82060f): fill_kobj_path: path = '/devices/virtual/bluetooth/hci4' kobject: 'rfkill325' (00000000649feac7): kobject_add_internal: parent: 'hci0', set: 'devices' kobject: 'hci1' (000000006e30b433): kobject_cleanup, parent (null) kobject: 'hci3' (000000001aa29f28): fill_kobj_path: path = '/devices/virtual/bluetooth/hci3' kobject: 'hci4' (000000003e82060f): kobject_cleanup, parent (null) kobject: 'hci5' (000000007e05d66b): fill_kobj_path: path = '/devices/virtual/bluetooth/hci5' kobject: 'hci1' (000000006e30b433): calling ktype release kobject: 'rfkill325' (00000000649feac7): kobject_uevent_env kobject: 'hci4' (000000003e82060f): calling ktype release kobject: 'rfkill325' (00000000649feac7): fill_kobj_path: path = '/devices/virtual/bluetooth/hci0/rfkill325' kobject: 'hci1': free name kobject: 'rfkill326' (000000007c7aaee0): kobject_add_internal: parent: 'hci3', set: 'devices' kobject: 'hci4': free name kobject: 'rfkill326' (000000007c7aaee0): kobject_uevent_env kobject: 'hci1' (00000000d377f4a2): kobject_add_internal: parent: 'bluetooth', set: 'devices' kobject: 'rfkill325' (00000000649feac7): kobject_uevent_env kobject: 'hci1' (00000000d377f4a2): kobject_uevent_env kobject: 'hci4' (000000007707c785): kobject_add_internal: parent: 'bluetooth', set: 'devices' kobject: 'hci1' (00000000d377f4a2): fill_kobj_path: path = '/devices/virtual/bluetooth/hci1' kobject: 'hci4' (000000007707c785): kobject_uevent_env kobject: 'rfkill326' (000000007c7aaee0): fill_kobj_path: path = '/devices/virtual/bluetooth/hci3/rfkill326' kobject: 'rfkill325' (00000000649feac7): fill_kobj_path: path = '/devices/virtual/bluetooth/hci0/rfkill325' kobject: 'rfkill327' (0000000049a8df52): kobject_add_internal: parent: 'hci5', set: 'devices' kobject: 'rfkill326' (000000007c7aaee0): kobject_uevent_env kobject: 'rfkill327' (0000000049a8df52): kobject_uevent_env kobject: 'hci4' (000000007707c785): fill_kobj_path: path = '/devices/virtual/bluetooth/hci4' kobject: 'rfkill327' (0000000049a8df52): fill_kobj_path: path = '/devices/virtual/bluetooth/hci5/rfkill327' kobject: 'rfkill326' (000000007c7aaee0): fill_kobj_path: path = '/devices/virtual/bluetooth/hci3/rfkill326' kobject: 'rfkill328' (00000000d04ec777): kobject_add_internal: parent: 'hci1', set: 'devices' ---[ end trace d137b808ad2129d4 ]--- kobject: 'rfkill327' (0000000049a8df52): kobject_uevent_env RIP: 0010:kernfs_add_one+0x342/0x4d0 fs/kernfs/dir.c:812 kobject: 'rfkill327' (0000000049a8df52): fill_kobj_path: path = '/devices/virtual/bluetooth/hci5/rfkill327' 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: 'rfkill328' (00000000d04ec777): kobject_uevent_env RSP: 0018:ffff8881c2967580 EFLAGS: 00010202 kobject: 'rfkill328' (00000000d04ec777): fill_kobj_path: path = '/devices/virtual/bluetooth/hci1/rfkill328' RAX: dffffc0000000000 RBX: ffff8881c2fc3b60 RCX: ffffffff87d9e4c7 kobject: 'rfkill328' (00000000d04ec777): kobject_uevent_env kobject: 'rfkill325' (00000000649feac7): kobject_cleanup, parent (null) kobject: 'rfkill328' (00000000d04ec777): fill_kobj_path: path = '/devices/virtual/bluetooth/hci1/rfkill328' kobject: 'rfkill329' (000000004a70f483): kobject_add_internal: parent: 'hci4', set: 'devices' RDX: 0000000000000001 RSI: ffffffff81f8ff1a RDI: 0000000000000008 kobject: 'rfkill325' (00000000649feac7): calling ktype release RBP: ffff8881c29675c8 R08: fffffbfff12cfaad R09: fffffbfff12cfaac kobject: 'rfkill325': free name R10: fffffbfff12cfaac R11: ffffffff8967d567 R12: 0000000000000000 kobject: 'rfkill329' (000000004a70f483): kobject_uevent_env R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 kobject: 'hci0' (000000000009dc2f): kobject_uevent_env FS: 0000000000000000(0000) GS:ffff8881daf00000(0063) knlGS:0000000008e0a840 kobject: 'rfkill329' (000000004a70f483): fill_kobj_path: path = '/devices/virtual/bluetooth/hci4/rfkill329' CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033 kobject: 'rfkill326' (000000007c7aaee0): kobject_cleanup, parent (null) CR2: 00007f56ac3ea000 CR3: 00000001c6a74000 CR4: 00000000001406e0 kobject: 'rfkill327' (0000000049a8df52): kobject_cleanup, parent (null) kobject: 'rfkill328' (00000000d04ec777): kobject_cleanup, parent (null) kobject: 'rfkill329' (000000004a70f483): kobject_uevent_env DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 kobject: 'rfkill327' (0000000049a8df52): calling ktype release kobject: 'rfkill328' (00000000d04ec777): calling ktype release kobject: 'rfkill326' (000000007c7aaee0): calling ktype release DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 kobject: 'rfkill327': free name kobject: 'rfkill328': free name kobject: 'rfkill326': free name