syz.0.47: attempt to access beyond end of device loop0: rw=524288, sector=14425508768, nr_sectors = 8 limit=16 ================================================================== BUG: KASAN: use-after-free in z_erofs_transform_plain+0x380/0x460 fs/erofs/decompressor.c:350 Read of size 1622 at addr ffff0000c9111e5b by task syz.0.47/4560 CPU: 0 PID: 4560 Comm: syz.0.47 Not tainted 6.1.110-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call trace: dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x174/0x4c0 mm/kasan/report.c:395 kasan_report+0xd4/0x130 mm/kasan/report.c:495 kasan_check_range+0x264/0x2a4 mm/kasan/generic.c:189 memcpy+0x48/0x90 mm/kasan/shadow.c:65 z_erofs_transform_plain+0x380/0x460 fs/erofs/decompressor.c:350 z_erofs_decompress+0x9c/0xd4 fs/erofs/decompressor.c:439 z_erofs_decompress_pcluster fs/erofs/zdata.c:1173 [inline] z_erofs_decompress_queue+0x13a8/0x2360 fs/erofs/zdata.c:1256 z_erofs_runqueue+0x1508/0x1750 fs/erofs/zdata.c:1614 z_erofs_readahead+0x988/0xe04 fs/erofs/zdata.c:1758 read_pages+0x168/0x6a0 mm/readahead.c:161 page_cache_ra_unbounded+0x46c/0x58c mm/readahead.c:270 do_page_cache_ra mm/readahead.c:300 [inline] force_page_cache_ra+0x248/0x2b0 mm/readahead.c:331 force_page_cache_readahead mm/internal.h:106 [inline] generic_fadvise+0x3f8/0x648 mm/fadvise.c:107 vfs_fadvise mm/fadvise.c:185 [inline] ksys_fadvise64_64 mm/fadvise.c:199 [inline] __do_sys_fadvise64_64 mm/fadvise.c:207 [inline] __se_sys_fadvise64_64 mm/fadvise.c:205 [inline] __arm64_sys_fadvise64_64+0x12c/0x174 mm/fadvise.c:205 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 The buggy address belongs to the physical page: page:00000000e6fe3fed refcount:2 mapcount:0 mapping:000000000ac8aa5d index:0x1 pfn:0x109111 memcg:ffff0000f27b8000 aops:managed_cache_aops ino:0 flags: 0x5ffd00000002014(uptodate|lru|private|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffd00000002014 fffffc0003d0a388 fffffc0003cb61c8 ffff0000e12f07c8 raw: 0000000000000001 ffff0000debda000 00000002ffffffff ffff0000f27b8000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000c9111f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff0000c9111f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff0000c9112000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000c9112080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc ffff0000c9112100: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ==================================================================