kasan: CONFIG_KASAN_INLINE enabled kobject_add_internal failed for hci5 (error: -2 parent: bluetooth) kasan: GPF could be caused by NULL-ptr deref or user memory access Bluetooth: Can't register HCI device general protection fault: 0000 [#1] PREEMPT SMP KASAN kobject: 'hci4' (0000000080c0b46e): kobject_uevent_env CPU: 0 PID: 9541 Comm: syz-executor519 Not tainted 5.0.0-rc8+ #88 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: 'hci3' (00000000574bef08): kobject_add_internal: parent: 'bluetooth', set: 'devices' RSP: 0018:ffff8880a0767858 EFLAGS: 00010202 RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff87026908 RDX: 0000000000000001 RSI: ffffffff81d2510b RDI: 0000000000000008 RBP: ffff8880a0767898 R08: 1ffffffff115121c R09: fffffbfff115121d R10: fffffbfff115121c R11: ffffffff88a890e7 R12: ffff88809295aee0 kobject: 'hci6' (000000004f71abfb): calling ktype release R13: ffff88809295aee0 R14: 0000000000000000 R15: 0000000000000000 FS: 000000000203a880(0000) GS:ffff8880ae800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000006cb090 CR3: 000000009bbfa000 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' (0000000080c0b46e): fill_kobj_path: path = '/devices/virtual/bluetooth/hci4' 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: 'hci3' (00000000574bef08): kobject_uevent_env device_add+0x3d5/0x1870 drivers/base/core.c:1912 kobject: 'hci4' (0000000080c0b46e): kobject_cleanup, parent (null) 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:1863 [inline] new_sync_write fs/read_write.c:474 [inline] __vfs_write+0x613/0x8e0 fs/read_write.c:487 kobject: 'hci6': free name kobject: 'hci4' (0000000080c0b46e): calling ktype release vfs_write+0x20c/0x580 fs/read_write.c:549 ksys_write+0xea/0x1f0 fs/read_write.c:598 kobject: 'hci3' (00000000574bef08): fill_kobj_path: path = '/devices/virtual/bluetooth/hci3' __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:0x440e59 kobject: 'hci4': free name 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 0b 0a fc ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007ffeeb2d48e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000440e59 RDX: 0000000000000002 RSI: 0000000020000040 RDI: 0000000000000003 RBP: 00000000000131d9 R08: 00000000004002c8 R09: 00000000004002c8 R10: 000000000203a880 R11: 0000000000000246 R12: 0000000000401cf0 R13: 0000000000401d80 R14: 0000000000000000 R15: 0000000000000000 Modules linked in: kobject: 'rfkill1684' (0000000060074db7): kobject_add_internal: parent: 'hci3', set: 'devices' kobject: 'hci5' (00000000e7691c7d): kobject_cleanup, parent (null) kobject: 'hci4' (000000009542cb5b): kobject_add_internal: parent: 'bluetooth', set: 'devices' kobject: 'hci5' (00000000e7691c7d): calling ktype release kobject: 'hci5' (0000000042184bda): kobject_add_internal: parent: 'bluetooth', set: 'devices' kobject: 'hci5': free name kobject: 'hci5' (0000000042184bda): kobject_uevent_env kobject: 'rfkill1684' (0000000060074db7): kobject_uevent_env kobject: 'hci5' (0000000042184bda): fill_kobj_path: path = '/devices/virtual/bluetooth/hci5' kobject: 'hci4' (000000009542cb5b): kobject_uevent_env ---[ end trace 74904b8c1c603857 ]--- kobject: 'hci4' (000000009542cb5b): fill_kobj_path: path = '/devices/virtual/bluetooth/hci4' RIP: 0010:kernfs_add_one+0x343/0x4d0 fs/kernfs/dir.c:812 kobject: 'hci6' (000000000fe5464c): kobject_add_internal: parent: 'bluetooth', set: 'devices' 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: 'hci6' (000000000fe5464c): kobject_uevent_env RSP: 0018:ffff8880a0767858 EFLAGS: 00010202 kobject: 'rfkill1684' (0000000060074db7): fill_kobj_path: path = '/devices/virtual/bluetooth/hci3/rfkill1684' RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff87026908 kobject: 'hci6' (000000000fe5464c): fill_kobj_path: path = '/devices/virtual/bluetooth/hci6' RDX: 0000000000000001 RSI: ffffffff81d2510b RDI: 0000000000000008 kobject: 'rfkill1685' (00000000598b97b2): kobject_add_internal: parent: 'hci1', set: 'devices' RBP: ffff8880a0767898 R08: 1ffffffff115121c R09: fffffbfff115121d kobject: 'rfkill1684' (0000000060074db7): kobject_uevent_env R10: fffffbfff115121c R11: ffffffff88a890e7 R12: ffff88809295aee0 kobject: 'rfkill1685' (00000000598b97b2): kobject_uevent_env R13: ffff88809295aee0 R14: 0000000000000000 R15: 0000000000000000 kobject: 'rfkill1684' (0000000060074db7): fill_kobj_path: path = '/devices/virtual/bluetooth/hci3/rfkill1684' FS: 000000000203a880(0000) GS:ffff8880ae900000(0000) knlGS:0000000000000000 kobject: 'rfkill1685' (00000000598b97b2): fill_kobj_path: path = '/devices/virtual/bluetooth/hci1/rfkill1685' CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 kobject: 'rfkill1686' (00000000f6d8eda3): kobject_add_internal: parent: 'hci5', set: 'devices' CR2: 00007fb0688af000 CR3: 000000009bbfa000 CR4: 00000000001406e0 kobject: 'rfkill1686' (00000000f6d8eda3): kobject_uevent_env