syzbot


KASAN: invalid-access Read in el1h_64_sync_handler

Status: auto-closed as invalid on 2021/10/24 10:34
Reported-by: syzbot+@syzkaller.appspotmail.com
First crash: 497d, last: 495d

Sample crash report:
netdevsim netdevsim0: Direct firmware load for ./file0 failed with error -2
netdevsim netdevsim0: Falling back to sysfs fallback for: ./file0
==================================================================
BUG: KASAN: invalid-access in __list_add_valid+0x10/0x90 lib/list_debug.c:22
Read at addr faff000023971690 by task syz-executor.0/9788
Pointer tag: [fa], memory tag: [fe]

CPU: 1 PID: 9788 Comm: syz-executor.0 Not tainted 5.14.0-rc3-syzkaller #0
Hardware name: linux,dummy-virt (DT)
Call trace:
 dump_backtrace+0x0/0x1b0 arch/arm64/kernel/stacktrace.c:76
 show_stack+0x18/0x24 arch/arm64/kernel/stacktrace.c:215
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x68/0x84 lib/dump_stack.c:105
 print_address_description+0x7c/0x2b4 mm/kasan/report.c:233
 __kasan_report mm/kasan/report.c:419 [inline]
 kasan_report+0x134/0x380 mm/kasan/report.c:436
 report_tag_fault arch/arm64/mm/fault.c:330 [inline]
 do_tag_recovery arch/arm64/mm/fault.c:342 [inline]
 __do_kernel_fault+0x1a8/0x1dc arch/arm64/mm/fault.c:383
 do_bad_area arch/arm64/mm/fault.c:479 [inline]
 do_tag_check_fault+0x74/0x90 arch/arm64/mm/fault.c:750
 do_mem_abort+0x44/0xb4 arch/arm64/mm/fault.c:826
 el1_abort+0x40/0x60 arch/arm64/kernel/entry-common.c:243
 el1h_64_sync_handler+0xb0/0xd0 arch/arm64/kernel/entry-common.c:318
 el1h_64_sync+0x78/0x7c arch/arm64/kernel/entry.S:569
 __list_add_valid+0x10/0x90 lib/list_debug.c:22
 __list_add include/linux/list.h:67 [inline]
 list_add include/linux/list.h:86 [inline]
 fw_load_sysfs_fallback drivers/base/firmware_loader/fallback.c:516 [inline]
 fw_load_from_user_helper drivers/base/firmware_loader/fallback.c:581 [inline]
 firmware_fallback_sysfs+0x1a4/0x460 drivers/base/firmware_loader/fallback.c:657
 _request_firmware+0x28c/0x510 drivers/base/firmware_loader/main.c:833
 request_firmware+0x48/0x70 drivers/base/firmware_loader/main.c:877
 devlink_compat_flash_update+0x9c/0x1ec net/core/devlink.c:11226
 ethtool_flash_device+0xf8/0x100 net/ethtool/ioctl.c:2072
 dev_ethtool+0x590/0x2280 net/ethtool/ioctl.c:2765
 dev_ioctl+0x4ec/0x5f0 net/core/dev_ioctl.c:440
 sock_do_ioctl+0x114/0x2b0 net/socket.c:1117
 sock_ioctl+0x28c/0x4a0 net/socket.c:1221
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:1069 [inline]
 __se_sys_ioctl fs/ioctl.c:1055 [inline]
 __arm64_sys_ioctl+0xa8/0xec fs/ioctl.c:1055
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x48/0x114 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x40/0xdc arch/arm64/kernel/syscall.c:145
 do_el0_svc+0x78/0x90 arch/arm64/kernel/syscall.c:184
 el0_svc+0x2c/0x54 arch/arm64/kernel/entry-common.c:511
 el0t_64_sync_handler+0x1a4/0x1b0 arch/arm64/kernel/entry-common.c:527
 el0t_64_sync+0x1b4/0x1b8 arch/arm64/kernel/entry.S:574

Allocated by task 9774:
 kasan_save_stack+0x28/0x60 mm/kasan/common.c:38
 kasan_set_track mm/kasan/common.c:46 [inline]
 set_alloc_info mm/kasan/common.c:434 [inline]
 ____kasan_kmalloc mm/kasan/common.c:513 [inline]
 ____kasan_kmalloc mm/kasan/common.c:472 [inline]
 __kasan_kmalloc+0xac/0xc4 mm/kasan/common.c:522
 kasan_kmalloc include/linux/kasan.h:264 [inline]
 kmem_cache_alloc_trace include/linux/slab.h:489 [inline]
 kmalloc include/linux/slab.h:591 [inline]
 kzalloc include/linux/slab.h:721 [inline]
 __allocate_fw_priv drivers/base/firmware_loader/main.c:187 [inline]
 alloc_lookup_fw_priv drivers/base/firmware_loader/main.c:251 [inline]
 _request_firmware_prepare drivers/base/firmware_loader/main.c:746 [inline]
 _request_firmware+0x180/0x510 drivers/base/firmware_loader/main.c:808
 request_firmware+0x48/0x70 drivers/base/firmware_loader/main.c:877
 devlink_compat_flash_update+0x9c/0x1ec net/core/devlink.c:11226
 ethtool_flash_device+0xf8/0x100 net/ethtool/ioctl.c:2072
 dev_ethtool+0x590/0x2280 net/ethtool/ioctl.c:2765
 dev_ioctl+0x4ec/0x5f0 net/core/dev_ioctl.c:440
 sock_do_ioctl+0x114/0x2b0 net/socket.c:1117
 sock_ioctl+0x28c/0x4a0 net/socket.c:1221
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:1069 [inline]
 __se_sys_ioctl fs/ioctl.c:1055 [inline]
 __arm64_sys_ioctl+0xa8/0xec fs/ioctl.c:1055
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x48/0x114 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x40/0xdc arch/arm64/kernel/syscall.c:145
 do_el0_svc+0x78/0x90 arch/arm64/kernel/syscall.c:184
 el0_svc+0x2c/0x54 arch/arm64/kernel/entry-common.c:511
 el0t_64_sync_handler+0x1a4/0x1b0 arch/arm64/kernel/entry-common.c:527
 el0t_64_sync+0x1b4/0x1b8 arch/arm64/kernel/entry.S:574

Freed by task 9774:
 kasan_save_stack+0x28/0x60 mm/kasan/common.c:38
 kasan_set_track+0x28/0x3c mm/kasan/common.c:46
 kasan_set_free_info+0x20/0x30 mm/kasan/tags.c:36
 ____kasan_slab_free.constprop.0+0x178/0x1e0 mm/kasan/common.c:366
 __kasan_slab_free+0x10/0x1c mm/kasan/common.c:374
 kasan_slab_free include/linux/kasan.h:230 [inline]
 slab_free_hook mm/slub.c:1625 [inline]
 slab_free_freelist_hook+0xc4/0x220 mm/slub.c:1650
 slab_free mm/slub.c:3210 [inline]
 kfree+0x2f4/0x43c mm/slub.c:4262
 __free_fw_priv drivers/base/firmware_loader/main.c:283 [inline]
 kref_put include/linux/kref.h:65 [inline]
 free_fw_priv+0xe0/0x10c drivers/base/firmware_loader/main.c:290
 firmware_free_data drivers/base/firmware_loader/main.c:586 [inline]
 release_firmware.part.0+0x50/0x74 drivers/base/firmware_loader/main.c:1055
 release_firmware drivers/base/firmware_loader/main.c:842 [inline]
 _request_firmware+0x2c4/0x510 drivers/base/firmware_loader/main.c:841
 request_firmware+0x48/0x70 drivers/base/firmware_loader/main.c:877
 devlink_compat_flash_update+0x9c/0x1ec net/core/devlink.c:11226
 ethtool_flash_device+0xf8/0x100 net/ethtool/ioctl.c:2072
 dev_ethtool+0x590/0x2280 net/ethtool/ioctl.c:2765
 dev_ioctl+0x4ec/0x5f0 net/core/dev_ioctl.c:440
 sock_do_ioctl+0x114/0x2b0 net/socket.c:1117
 sock_ioctl+0x28c/0x4a0 net/socket.c:1221
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:1069 [inline]
 __se_sys_ioctl fs/ioctl.c:1055 [inline]
 __arm64_sys_ioctl+0xa8/0xec fs/ioctl.c:1055
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x48/0x114 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x40/0xdc arch/arm64/kernel/syscall.c:145
 do_el0_svc+0x78/0x90 arch/arm64/kernel/syscall.c:184
 el0_svc+0x2c/0x54 arch/arm64/kernel/entry-common.c:511
 el0t_64_sync_handler+0x1a4/0x1b0 arch/arm64/kernel/entry-common.c:527
 el0t_64_sync+0x1b4/0x1b8 arch/arm64/kernel/entry.S:574

The buggy address belongs to the object at ffff000023971600
 which belongs to the cache kmalloc-256 of size 256
The buggy address is located 144 bytes inside of
 256-byte region [ffff000023971600, ffff000023971700)
The buggy address belongs to the page:
page:00000000d2684e54 refcount:1 mapcount:0 mapping:0000000000000000 index:0xfaff000023971600 pfn:0x63970
head:00000000d2684e54 order:1 compound_mapcount:0
flags: 0x1ffc00000010200(slab|head|node=0|zone=0|lastcpupid=0x7ff|kasantag=0x0)
raw: 01ffc00000010200 0000000000000000 0000000100000001 f5ff000002801300
raw: faff000023971600 000000008010000f 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff000023971400: f2 f2 f2 f2 f2 f2 f2 f2 f2 f2 fe fe fe fe fe fe
 ffff000023971500: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe
>ffff000023971600: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe
                                              ^
 ffff000023971700: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe
 ffff000023971800: f5 f5 f5 f5 f5 f5 f5 f5 f5 fe fe fe fe fe fe fe
==================================================================

Crashes (2):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-qemu2-arm64-mte 2021/07/26 10:27 upstream ff1176468d36 fd511809 .config log report info KASAN: invalid-access Read in el1h_64_sync_handler
ci-qemu2-arm64-mte 2021/07/24 04:36 upstream f0fddcec6b62 bc5f1d88 .config log report info KASAN: invalid-access Read in el1h_64_sync_handler
* Struck through repros no longer work on HEAD.