loop2: detected capacity change from 0 to 16 erofs: (device loop2): mounted with root inode @ nid 36. syz.2.4180: attempt to access beyond end of device loop2: rw=524288, sector=8, nr_sectors = 16 limit=16 syz.2.4180: attempt to access beyond end of device loop2: rw=524288, sector=16, nr_sectors = 40 limit=16 ================================================================== BUG: KASAN: use-after-free in memcpy_to_page include/linux/highmem.h:427 [inline] BUG: KASAN: use-after-free in z_erofs_transform_plain+0x38c/0x460 fs/erofs/decompressor.c:347 Read of size 4096 at addr ffff888055738000 by task syz.2.4180/19049 CPU: 1 PID: 19049 Comm: syz.2.4180 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/18/2026 Call Trace: dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xa8/0x210 mm/kasan/report.c:468 kasan_report+0x117/0x150 mm/kasan/report.c:581 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x241/0x290 mm/kasan/generic.c:187 __asan_memcpy+0x29/0x70 mm/kasan/shadow.c:105 memcpy_to_page include/linux/highmem.h:427 [inline] z_erofs_transform_plain+0x38c/0x460 fs/erofs/decompressor.c:347 z_erofs_decompress_pcluster fs/erofs/zdata.c:1296 [inline] z_erofs_decompress_queue+0x1780/0x26f0 fs/erofs/zdata.c:1377 z_erofs_runqueue+0x1a4e/0x1bf0 fs/erofs/zdata.c:1778 z_erofs_read_folio+0x323/0x5c0 fs/erofs/zdata.c:1863 filemap_read_folio+0x172/0x760 mm/filemap.c:2420 filemap_update_page mm/filemap.c:2504 [inline] filemap_get_pages+0x13c7/0x1e90 mm/filemap.c:2618 filemap_read+0x402/0xf00 mm/filemap.c:2690 __kernel_read+0x2f3/0x710 fs/read_write.c:428 integrity_kernel_read+0x8a/0xd0 security/integrity/iint.c:221 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+0x91d/0x1910 security/integrity/ima/ima_crypto.c:573 ima_collect_measurement+0x4d4/0xa20 security/integrity/ima/ima_api.c:290 process_measurement+0x128e/0x1d70 security/integrity/ima/ima_main.c:370 ima_bprm_check+0xfb/0x200 security/integrity/ima/ima_main.c:543 search_binary_handler fs/exec.c:1763 [inline] exec_binprm fs/exec.c:1817 [inline] bprm_execve+0xa6e/0x1700 fs/exec.c:1892 do_execveat_common+0x51b/0x6c0 fs/exec.c:1998 do_execveat fs/exec.c:2083 [inline] __do_sys_execveat fs/exec.c:2157 [inline] __se_sys_execveat fs/exec.c:2151 [inline] __x64_sys_execveat+0xc4/0xe0 fs/exec.c:2151 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f4e7eb9ce59 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:00007f4e7fab5028 EFLAGS: 00000246 ORIG_RAX: 0000000000000142 RAX: ffffffffffffffda RBX: 00007f4e7ee15fa0 RCX: 00007f4e7eb9ce59 RDX: 0000000000000000 RSI: 0000200000000280 RDI: ffffffffffffff9c RBP: 00007f4e7ec32d6f R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f4e7ee16038 R14: 00007f4e7ee15fa0 R15: 00007fff477f7578 The buggy address belongs to the physical page: page:ffffea000155ce00 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x55738 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffff7f(buddy) raw: 00fff00000000000 ffffea000155c708 ffffea00016e4f88 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 0x540dc0(GFP_USER|__GFP_COMP|__GFP_ZERO|__GFP_ACCOUNT), pid 5775, tgid 5775 (syz-executor), ts 413637658038, free_ts 413732377541 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1c1/0x200 mm/page_alloc.c:1581 prep_new_page mm/page_alloc.c:1588 [inline] get_page_from_freelist+0x1951/0x19e0 mm/page_alloc.c:3220 __alloc_pages+0x1f0/0x460 mm/page_alloc.c:4500 pagetable_alloc include/linux/mm.h:2900 [inline] __pte_alloc_one include/asm-generic/pgalloc.h:68 [inline] pte_alloc_one+0x84/0x530 arch/x86/mm/pgtable.c:33 __pte_alloc+0x22/0x2a0 mm/memory.c:438 copy_pte_range mm/memory.c:1029 [inline] copy_pmd_range mm/memory.c:1168 [inline] copy_pud_range mm/memory.c:1205 [inline] copy_p4d_range mm/memory.c:1229 [inline] copy_page_range+0x2d96/0x3670 mm/memory.c:1323 dup_mmap kernel/fork.c:769 [inline] dup_mm kernel/fork.c:1694 [inline] copy_mm+0x1281/0x1d80 kernel/fork.c:1743 copy_process+0x16f7/0x3dc0 kernel/fork.c:2508 kernel_clone+0x24b/0x8a0 kernel/fork.c:2917 __do_sys_clone kernel/fork.c:3060 [inline] __se_sys_clone kernel/fork.c:3044 [inline] __x64_sys_clone+0x1b7/0x230 kernel/fork.c:3044 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xb0 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:1181 [inline] free_unref_page_prepare+0x7b2/0x8c0 mm/page_alloc.c:2365 free_unref_page_list+0xbe/0x860 mm/page_alloc.c:2504 release_pages+0x1f7a/0x2200 mm/swap.c:1022 tlb_batch_pages_flush mm/mmu_gather.c:99 [inline] tlb_flush_mmu_free mm/mmu_gather.c:294 [inline] tlb_flush_mmu+0x379/0x510 mm/mmu_gather.c:301 tlb_finish_mmu+0xf9/0x220 mm/mmu_gather.c:425 exit_mmap+0x428/0xb90 mm/mmap.c:3315 __mmput+0x118/0x3c0 kernel/fork.c:1357 exit_mm+0x24a/0x350 kernel/exit.c:570 do_exit+0x8dd/0x2460 kernel/exit.c:871 do_group_exit+0x21b/0x2d0 kernel/exit.c:1026 get_signal+0x12fc/0x13f0 kernel/signal.c:2902 arch_do_signal_or_restart+0xc2/0x800 arch/x86/kernel/signal.c:310 exit_to_user_mode_loop+0x70/0x110 kernel/entry/common.c:174 exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:210 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline] syscall_exit_to_user_mode+0x1a/0x50 kernel/entry/common.c:302 do_syscall_64+0x61/0xb0 arch/x86/entry/common.c:82 Memory state around the buggy address: ffff888055737f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888055737f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888055738000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888055738080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888055738100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================