Hello,
syzbot has tested the proposed patch but the reproducer still triggered
crash:
general protection fault in kernfs_add_one
Bluetooth: hci1: Failed to load firmware file mrvl/helper_uart_3000000.bin
kasan: GPF could be caused by NULL-ptr deref or user memory access
Bluetooth: hci1: Unable to download firmware helper
bluetooth hci2: Direct firmware load for mrvl/helper_uart_3000000.bin
failed with error -2
Bluetooth: hci2: Failed to load firmware file mrvl/helper_uart_3000000.bin
general protection fault: 0000 [#1] PREEMPT SMP KASAN
kobject: 'hci3' (00000000cfa3de3e): kobject_add_internal:
parent: 'bluetooth', set: 'devices'
CPU: 0 PID: 24628 Comm: syz-executor4 Not tainted 5.0.0-rc3+ #1
kobject: 'loop2' (000000005cf6d3fd): kobject_uevent_env
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: 'loop2' (000000005cf6d3fd): fill_kobj_path: path
= '/devices/virtual/block/loop2'
RSP: 0018:ffff8880a12ff4e8 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff87f351d5
RDX: 0000000000000001 RSI: ffffffff81fbb5db RDI: 0000000000000008
RBP: ffff8880a12ff528 R08: 1ffffffff1351190 R09: fffffbfff1351191
R10: fffffbfff1351190 R11: ffffffff89a88c87 R12: ffff88809735d7e0
R13: ffff88809735d7e0 R14: 0000000000000000 R15: 0000000000000000
FS: 00007fc304c1e700(0000) GS:ffff8880ae600000(0000) knlGS:0000000000000000
kobject: 'hci4' (00000000e5a98c19): kobject_add_internal:
parent: 'bluetooth', set: 'devices'
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000009f7fd0 CR3: 000000008cd54000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
kobject: 'hci5' (00000000474c9f72): kobject_add_internal:
parent: 'bluetooth', set: 'devices'
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
kernfs_create_dir_ns+0xff/0x160 fs/kernfs/dir.c:1031
sysfs_create_dir_ns+0x192/0x340 fs/sysfs/dir.c:59
kobject: 'hci3' (00000000cfa3de3e): kobject_uevent_env
kobject: 'hci5' (00000000474c9f72): kobject_uevent_env
create_dir lib/kobject.c:88 [inline]
kobject_add_internal lib/kobject.c:247 [inline]
kobject_add_internal.cold+0x129/0x6d8 lib/kobject.c:217
kobject: 'hci4' (00000000e5a98c19): kobject_uevent_env
kobject: 'hci3' (00000000cfa3de3e): fill_kobj_path: path
= '/devices/virtual/bluetooth/hci3'
kobject_add_varg lib/kobject.c:382 [inline]
kobject_add+0x150/0x1c0 lib/kobject.c:426
device_add+0x3d9/0x1800 drivers/base/core.c:1912
kobject: 'hci4' (00000000e5a98c19): fill_kobj_path: path
= '/devices/virtual/bluetooth/hci4'
hci_register_dev+0x3b9/0x9d0 net/bluetooth/hci_core.c:3261
kobject: 'hci5' (00000000474c9f72): fill_kobj_path: path
= '/devices/virtual/bluetooth/hci5'
hci_uart_register_dev drivers/bluetooth/hci_ldisc.c:680 [inline]
hci_uart_set_proto drivers/bluetooth/hci_ldisc.c:708 [inline]
hci_uart_tty_ioctl+0x72a/0xa70 drivers/bluetooth/hci_ldisc.c:763
tty_ioctl+0xb53/0x16c0 drivers/tty/tty_io.c:2661
kobject: 'rfkill7510' (00000000330e9fce): kobject_add_internal:
parent: 'hci5', set: 'devices'
kobject: 'rfkill7510' (00000000330e9fce): kobject_uevent_env
kobject: 'rfkill7510' (00000000330e9fce): fill_kobj_path: path
= '/devices/virtual/bluetooth/hci5/rfkill7510'
vfs_ioctl fs/ioctl.c:46 [inline]
file_ioctl fs/ioctl.c:509 [inline]
do_vfs_ioctl+0x107b/0x17d0 fs/ioctl.c:696
kobject: 'rfkill7511' (00000000f4d33c46): kobject_add_internal:
parent: 'hci4', set: 'devices'
bluetooth hci5: Direct firmware load for mrvl/helper_uart_3000000.bin
failed with error -2
Bluetooth: hci5: Failed to load firmware file mrvl/helper_uart_3000000.bin
Bluetooth: hci5: Unable to download firmware helper
ksys_ioctl+0xab/0xd0 fs/ioctl.c:713
kobject: 'rfkill7511' (00000000f4d33c46): kobject_uevent_env
__do_sys_ioctl fs/ioctl.c:720 [inline]
__se_sys_ioctl fs/ioctl.c:718 [inline]
__x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:718
do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290
kobject: 'hci6' (00000000a9f637dd): kobject_add_internal:
parent: 'bluetooth', set: 'devices'
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x457ec9
Code: 6d b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 3b b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fc304c1dc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
kobject: 'hci6' (00000000a9f637dd): kobject_uevent_env
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000457ec9
RDX: 000000000000000b RSI: 00000000400455c8 RDI: 0000000000000003
RBP: 000000000073bf00 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fc304c1e6d4
R13: 00000000004c078d R14: 00000000004d2110 R15: 00000000ffffffff
Modules linked in:
Bluetooth: hci2: Unable to download firmware helper
---[ end trace 850d637414898042 ]---
kobject: 'rfkill7511' (00000000f4d33c46): fill_kobj_path: path
= '/devices/virtual/bluetooth/hci4/rfkill7511'
RIP: 0010:kernfs_add_one+0x343/0x4d0 fs/kernfs/dir.c:812
kobject: 'rfkill7512' (00000000f4b4dced): kobject_add_internal:
parent: 'hci3', set: 'devices'
kobject: 'loop5' (00000000c0b2366d): kobject_uevent_env
kobject: 'rfkill7512' (00000000f4b4dced): kobject_uevent_env
kobject: 'rfkill7509' (00000000354a6f64): kobject_uevent_env
kobject: 'rfkill7508' (0000000035d47cae): kobject_uevent_env
kobject: 'hci6' (00000000a9f637dd): fill_kobj_path: path
= '/devices/virtual/bluetooth/hci6'
bluetooth hci4: Direct firmware load for mrvl/helper_uart_3000000.bin
failed with error -2
kobject: 'loop5' (00000000c0b2366d): fill_kobj_path: path
= '/devices/virtual/block/loop5'
Bluetooth: hci4: Failed to load firmware file mrvl/helper_uart_3000000.bin
Bluetooth: hci4: Unable to download firmware helper
kobject: 'rfkill7509' (00000000354a6f64): fill_kobj_path: path
= '/devices/virtual/bluetooth/hci2/rfkill7509'
kobject: 'rfkill7508' (0000000035d47cae): fill_kobj_path: path
= '/devices/virtual/bluetooth/hci1/rfkill7508'
kobject: 'hci8' (00000000a94b67fb): kobject_add_internal:
parent: 'bluetooth', set: 'devices'
kobject: 'rfkill7512' (00000000f4b4dced): fill_kobj_path: path
= '/devices/virtual/bluetooth/hci3/rfkill7512'
kobject: 'hci7' (0000000055ff7454): 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: 'hci8' (00000000a94b67fb): kobject_uevent_env
kobject: 'rfkill7510' (00000000330e9fce): kobject_uevent_env
kobject: 'hci7' (0000000055ff7454): kobject_uevent_env
kobject: 'rfkill7510' (00000000330e9fce): fill_kobj_path: path
= '/devices/virtual/bluetooth/hci5/rfkill7510'
bluetooth hci3: Direct firmware load for mrvl/helper_uart_3000000.bin
failed with error -2
kobject: 'rfkill7508' (0000000035d47cae): kobject_cleanup, parent
(null)
Bluetooth: hci3: Failed to load firmware file mrvl/helper_uart_3000000.bin
kobject: 'rfkill7509' (00000000354a6f64): kobject_cleanup, parent
(null)
Bluetooth: hci3: Unable to download firmware helper
kobject: 'hci8' (00000000a94b67fb): fill_kobj_path: path
= '/devices/virtual/bluetooth/hci8'
RSP: 0018:ffff8880a12ff4e8 EFLAGS: 00010202
kobject: 'rfkill7508' (0000000035d47cae): calling ktype release
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff87f351d5
kobject: 'hci7' (0000000055ff7454): fill_kobj_path: path
= '/devices/virtual/bluetooth/hci7'
RDX: 0000000000000001 RSI: ffffffff81fbb5db RDI: 0000000000000008
kobject: 'rfkill7513' (00000000673d8dff): kobject_add_internal:
parent: 'hci8', set: 'devices'
kobject: 'rfkill7509' (00000000354a6f64): calling ktype release
kobject: 'rfkill7508': free name
RBP: ffff8880a12ff528 R08: 1ffffffff1351190 R09: fffffbfff1351191
kobject: 'rfkill7511' (00000000f4d33c46): kobject_uevent_env
R10: fffffbfff1351190 R11: ffffffff89a88c87 R12: ffff88809735d7e0
kobject: 'rfkill7511' (00000000f4d33c46): fill_kobj_path: path
= '/devices/virtual/bluetooth/hci4/rfkill7511'
kobject: 'rfkill7513' (00000000673d8dff): kobject_uevent_env
kobject: 'hci1' (000000009db96ff4): kobject_uevent_env
kobject: 'rfkill7509': free name
kobject: 'hci1' (000000009db96ff4): fill_kobj_path: path
= '/devices/virtual/bluetooth/hci1'
R13: ffff88809735d7e0 R14: 0000000000000000 R15: 0000000000000000
kobject: 'hci1' (000000009db96ff4): kobject_cleanup, parent (null)
kobject: 'hci2' (000000008cf13029): kobject_uevent_env
kobject: 'hci1' (000000009db96ff4): calling ktype release
FS: 00007fc304c1e700(0000) GS:ffff8880ae600000(0000) knlGS:0000000000000000
kobject: 'hci1': free name
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
kobject: 'rfkill7513' (00000000673d8dff): fill_kobj_path: path
= '/devices/virtual/bluetooth/hci8/rfkill7513'
CR2: 00007ffcd6812e1c CR3: 000000008cd54000 CR4: 00000000001406f0
kobject: 'rfkill7514' (000000002988f9eb): kobject_add_internal:
parent: 'hci6', set: 'devices'
kobject: 'hci2' (000000008cf13029): fill_kobj_path: path
= '/devices/virtual/bluetooth/hci2'
kobject: 'rfkill7514' (000000002988f9eb): kobject_uevent_env
bluetooth hci8: Direct firmware load for mrvl/helper_uart_3000000.bin
failed with error -2
kobject: 'rfkill7514' (000000002988f9eb): fill_kobj_path: path
= '/devices/virtual/bluetooth/hci6/rfkill7514'
Bluetooth: hci8: Failed to load firmware file mrvl/helper_uart_3000000.bin
kobject: 'rfkill7515' (00000000716467e4): kobject_add_internal:
parent: 'hci7', set: 'devices'
Bluetooth: hci8: Unable to download firmware helper
bluetooth hci6: Direct firmware load for mrvl/helper_uart_3000000.bin
failed with error -2
kobject: 'loop1' (00000000bbc6d38a): kobject_uevent_env
Bluetooth: hci6: Failed to load firmware file mrvl/helper_uart_3000000.bin
kobject: 'hci2' (000000008cf13029): kobject_cleanup, parent (null)
Bluetooth: hci6: Unable to download firmware helper
kobject: 'rfkill7515' (00000000716467e4): kobject_uevent_env
kobject: 'hci1' (0000000015807452): kobject_add_internal:
parent: 'bluetooth', set: 'devices'
kobject: 'rfkill7515' (00000000716467e4): fill_kobj_path: path
= '/devices/virtual/bluetooth/hci7/rfkill7515'
kobject: 'hci2' (000000008cf13029): calling ktype release
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
kobject: 'hci1' (0000000015807452): kobject_uevent_env
kobject: 'hci2' (00000000cc3fa355): kobject_add_internal:
parent: 'bluetooth', set: 'devices'
kobject: 'loop1' (00000000bbc6d38a): fill_kobj_path: path
= '/devices/virtual/block/loop1'
kobject: 'hci2' (00000000cc3fa355): kobject_uevent_env
kobject: 'hci2': free name
kobject: 'rfkill7510' (00000000330e9fce): kobject_cleanup, parent
(null)
kobject: 'hci1' (0000000015807452): fill_kobj_path: path
= '/devices/virtual/bluetooth/hci1'
kobject: 'rfkill7511' (00000000f4d33c46): kobject_cleanup, parent
(null)
kobject: 'rfkill7516' (000000007582c824): kobject_add_internal:
parent: 'hci1', set: 'devices'
bluetooth hci7: Direct firmware load for mrvl/helper_uart_3000000.bin
failed with error -2
kobject: 'rfkill7516' (000000007582c824): kobject_uevent_env
Bluetooth: hci7: Failed to load firmware file mrvl/helper_uart_3000000.bin
kobject: 'rfkill7512' (00000000f4b4dced): kobject_uevent_env
Bluetooth: hci7: Unable to download firmware helper
kobject: 'rfkill7516' (000000007582c824): fill_kobj_path: path
= '/devices/virtual/bluetooth/hci1/rfkill7516'
kobject: 'hci2' (00000000cc3fa355): fill_kobj_path: path
= '/devices/virtual/bluetooth/hci2'
kobject: 'rfkill7512' (00000000f4b4dced): fill_kobj_path: path
= '/devices/virtual/bluetooth/hci3/rfkill7512'
kobject: 'rfkill7510' (00000000330e9fce): calling ktype release
kobject: 'hci9' (00000000b25cc2a7): kobject_add_internal:
parent: 'bluetooth', set: 'devices'
kobject: 'rfkill7511' (00000000f4d33c46): calling ktype release
bluetooth hci1: Direct firmware load for mrvl/helper_uart_3000000.bin
failed with error -2
kobject: 'rfkill7510': free name
Bluetooth: hci1: Failed to load firmware file mrvl/helper_uart_3000000.bin
kobject: 'hci9' (00000000b25cc2a7): kobject_uevent_env
Bluetooth: hci1: Unable to download firmware helper
kobject: 'rfkill7512' (00000000f4b4dced): kobject_cleanup, parent
(null)
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
kobject: 'rfkill7517' (00000000d8575753): kobject_add_internal:
parent: 'hci2', set: 'devices'
Tested on:
commit: 48b161983ae5 Merge tag 'xarray-5.0-rc3' of git://git.infra..
git tree: upstream
console output:
https://syzkaller.appspot.com/x/log.txt?x=10ba3707400000
kernel config:
https://syzkaller.appspot.com/x/.config?x=505743eba4e4f68
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
patch:
https://syzkaller.appspot.com/x/patch.diff?x=173a3707400000