loop0: rw=524288, sector=1056, nr_sectors = 16 limit=16 erofs: (device loop0): z_erofs_readahead: readahead error at page 6 @ nid 89 syz.0.859: attempt to access beyond end of device loop0: rw=524288, sector=16, nr_sectors = 40 limit=16 ================================================================== BUG: KASAN: use-after-free in memcpy_to_page include/linux/highmem.h:403 [inline] BUG: KASAN: use-after-free in z_erofs_transform_plain+0x3a7/0x4a0 fs/erofs/decompressor.c:347 Read of size 4096 at addr ffff88802a08a000 by task syz.0.859/6876 CPU: 0 PID: 6876 Comm: syz.0.859 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026 Call Trace: dump_stack_lvl+0x188/0x24e lib/dump_stack.c:106 print_address_description mm/kasan/report.c:316 [inline] print_report+0xa8/0x210 mm/kasan/report.c:420 kasan_report+0x10b/0x140 mm/kasan/report.c:524 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x235/0x290 mm/kasan/generic.c:189 memcpy+0x25/0x60 mm/kasan/shadow.c:65 memcpy_to_page include/linux/highmem.h:403 [inline] z_erofs_transform_plain+0x3a7/0x4a0 fs/erofs/decompressor.c:347 z_erofs_decompress_pcluster fs/erofs/zdata.c:1159 [inline] z_erofs_decompress_queue+0x169e/0x24a0 fs/erofs/zdata.c:1240 z_erofs_runqueue+0x198d/0x1b20 fs/erofs/zdata.c:1603 z_erofs_read_folio+0x35d/0x630 fs/erofs/zdata.c:1693 filemap_read_folio+0x164/0x7a0 mm/filemap.c:2490 filemap_update_page mm/filemap.c:2575 [inline] filemap_get_pages mm/filemap.c:2689 [inline] filemap_read+0x1846/0x3150 mm/filemap.c:2759 generic_file_read_iter+0x124/0x700 mm/filemap.c:2941 __kernel_read+0x2dd/0x6e0 fs/read_write.c:428 integrity_kernel_read+0x86/0xd0 security/integrity/iint.c:228 ima_calc_file_hash_tfm security/integrity/ima/ima_crypto.c:485 [inline] ima_calc_file_shash security/integrity/ima/ima_crypto.c:516 [inline] ima_calc_file_hash+0xb12/0x1950 security/integrity/ima/ima_crypto.c:573 ima_collect_measurement+0x503/0xb50 security/integrity/ima/ima_api.c:293 process_measurement+0x119b/0x1c40 security/integrity/ima/ima_main.c:351 ima_file_check+0xc8/0x110 security/integrity/ima/ima_main.c:534 do_open fs/namei.c:3636 [inline] path_openat+0x272b/0x2f10 fs/namei.c:3791 do_filp_open+0x1ee/0x420 fs/namei.c:3818 do_sys_openat2+0x14b/0x4f0 fs/open.c:1320 do_sys_open fs/open.c:1336 [inline] __do_sys_openat fs/open.c:1352 [inline] __se_sys_openat fs/open.c:1347 [inline] __x64_sys_openat+0x135/0x160 fs/open.c:1347 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f495a59e019 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 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 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f495b3d9028 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f495a825fa0 RCX: 00007f495a59e019 RDX: 0000000000080000 RSI: 0000200000000100 RDI: ffffffffffffff9c RBP: 00007f495a63500c R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f495a826038 R14: 00007f495a825fa0 R15: 00007fff5e8b8938 The buggy address belongs to the physical page: page:ffffea0000a82280 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x0 pfn:0x2a08a flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea00008dcf08 ffffea0001505e88 0000000000000000 raw: 0000000000000000 0000000000000001 00000000ffffff7f 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Unmovable, gfp_mask 0x152c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 6674, tgid 6672 (syz.0.783), ts 156610539464, free_ts 157104366332 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x173/0x1a0 mm/page_alloc.c:2560 prep_new_page mm/page_alloc.c:2567 [inline] get_page_from_freelist+0x206b/0x2180 mm/page_alloc.c:4358 __alloc_pages+0x1ec/0x4f0 mm/page_alloc.c:5658 folio_alloc+0x1c/0x60 mm/mempolicy.c:2292 filemap_alloc_folio+0xdb/0x480 mm/filemap.c:999 page_cache_ra_unbounded+0x17b/0x750 mm/readahead.c:248 do_async_mmap_readahead mm/filemap.c:3191 [inline] filemap_fault+0x57a/0x1590 mm/filemap.c:3245 __do_fault+0x13b/0x4e0 mm/memory.c:4278 do_read_fault mm/memory.c:4629 [inline] do_fault mm/memory.c:4758 [inline] handle_pte_fault mm/memory.c:5029 [inline] __handle_mm_fault mm/memory.c:5171 [inline] handle_mm_fault+0x2610/0x3d40 mm/memory.c:5292 faultin_page mm/gup.c:1026 [inline] __get_user_pages+0x40d/0xec0 mm/gup.c:1250 populate_vma_page_range+0x214/0x2b0 mm/gup.c:1607 __mm_populate+0x25c/0x380 mm/gup.c:1721 mm_populate include/linux/mm.h:2891 [inline] vm_mmap_pgoff+0x212/0x2d0 mm/util.c:525 ksys_mmap_pgoff+0x4bf/0x720 mm/mmap.c:1482 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1487 [inline] free_pcp_prepare mm/page_alloc.c:1537 [inline] free_unref_page_prepare+0x8e5/0x9e0 mm/page_alloc.c:3414 free_unref_page_list+0xbb/0x8e0 mm/page_alloc.c:3555 release_pages+0x20d1/0x2340 mm/swap.c:1035 __pagevec_release+0x6d/0xe0 mm/swap.c:1055 pagevec_release include/linux/pagevec.h:71 [inline] folio_batch_release include/linux/pagevec.h:135 [inline] truncate_inode_pages_range+0x35c/0x10b0 mm/truncate.c:397 kill_bdev block/bdev.c:76 [inline] blkdev_flush_mapping+0x12c/0x290 block/bdev.c:677 blkdev_put_whole block/bdev.c:708 [inline] blkdev_put+0x4a1/0x780 block/bdev.c:968 blkdev_close+0x51/0x80 block/fops.c:514 __fput+0x20a/0x8b0 fs/file_table.c:320 task_work_run+0x1d0/0x260 kernel/task_work.c:203 exit_task_work include/linux/task_work.h:39 [inline] do_exit+0x9d5/0x2570 kernel/exit.c:887 do_group_exit+0x229/0x2e0 kernel/exit.c:1030 __do_sys_exit_group kernel/exit.c:1041 [inline] __se_sys_exit_group kernel/exit.c:1039 [inline] __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1039 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Memory state around the buggy address: ffff88802a089f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88802a089f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88802a08a000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88802a08a080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88802a08a100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================