syz.3.1276: attempt to access beyond end of device loop3: 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+0x388/0x460 fs/erofs/decompressor.c:346 Read of size 4096 at addr ffff88805ac8e000 by task syz.3.1276/8409 CPU: 1 PID: 8409 Comm: syz.3.1276 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/18/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+0x388/0x460 fs/erofs/decompressor.c:346 z_erofs_decompress_pcluster fs/erofs/zdata.c:1159 [inline] z_erofs_decompress_queue+0x170d/0x2540 fs/erofs/zdata.c:1240 z_erofs_runqueue+0x1a48/0x1be0 fs/erofs/zdata.c:1603 z_erofs_read_folio+0x367/0x630 fs/erofs/zdata.c:1693 filemap_read_folio+0x16b/0x770 mm/filemap.c:2490 filemap_update_page mm/filemap.c:2575 [inline] filemap_get_pages mm/filemap.c:2689 [inline] filemap_read+0x1850/0x3020 mm/filemap.c:2759 generic_file_read_iter+0x136/0x740 mm/filemap.c:2941 __kernel_read+0x2ec/0x6d0 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+0x910/0x1900 security/integrity/ima/ima_crypto.c:573 ima_collect_measurement+0x503/0xb50 security/integrity/ima/ima_api.c:293 process_measurement+0x1183/0x1c30 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+0x26e8/0x2ee0 fs/namei.c:3791 do_filp_open+0x1f1/0x430 fs/namei.c:3818 do_sys_openat2+0x150/0x4b0 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:0x7f1649b9c819 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:00007f1647df6028 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f1649e15fa0 RCX: 00007f1649b9c819 RDX: 0000000000080000 RSI: 0000200000000100 RDI: ffffffffffffff9c RBP: 00007f1649c32c91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f1649e16038 R14: 00007f1649e15fa0 R15: 00007ffccfe01228 The buggy address belongs to the physical page: page:ffffea00016b2380 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5ac8e flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea00018e8d88 ffffea0000a08848 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 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 0x500dc0(GFP_USER|__GFP_ZERO|__GFP_ACCOUNT), pid 7796, tgid 7796 (syz-executor), ts 319858734674, free_ts 320895626074 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x173/0x1a0 mm/page_alloc.c:2559 prep_new_page mm/page_alloc.c:2566 [inline] get_page_from_freelist+0x1a1e/0x1ab0 mm/page_alloc.c:4357 __alloc_pages+0x1ec/0x4f0 mm/page_alloc.c:5657 __get_free_pages mm/page_alloc.c:5707 [inline] get_zeroed_page+0x13/0x30 mm/page_alloc.c:5716 __pud_alloc_one include/asm-generic/pgalloc.h:156 [inline] pud_alloc_one include/asm-generic/pgalloc.h:171 [inline] __pud_alloc+0x31/0x150 mm/memory.c:5463 pud_alloc include/linux/mm.h:2424 [inline] copy_pud_range mm/memory.c:1194 [inline] copy_p4d_range mm/memory.c:1238 [inline] copy_page_range+0x3506/0x3900 mm/memory.c:1332 dup_mmap kernel/fork.c:702 [inline] dup_mm kernel/fork.c:1546 [inline] copy_mm+0xec3/0x1690 kernel/fork.c:1595 copy_process+0x1979/0x4030 kernel/fork.c:2356 kernel_clone+0x24b/0x900 kernel/fork.c:2762 __do_sys_clone kernel/fork.c:2903 [inline] __se_sys_clone kernel/fork.c:2887 [inline] __x64_sys_clone+0x1a7/0x220 kernel/fork.c:2887 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:1486 [inline] free_pcp_prepare mm/page_alloc.c:1536 [inline] free_unref_page_prepare+0x8b4/0x9a0 mm/page_alloc.c:3413 free_unref_page_list+0xbb/0x8e0 mm/page_alloc.c:3554 release_pages+0x1fa6/0x2220 mm/swap.c:1035 tlb_batch_pages_flush mm/mmu_gather.c:60 [inline] tlb_flush_mmu_free mm/mmu_gather.c:255 [inline] tlb_flush_mmu+0x105/0x220 mm/mmu_gather.c:262 tlb_finish_mmu+0xf5/0x220 mm/mmu_gather.c:394 exit_mmap+0x384/0x960 mm/mmap.c:3262 __mmput+0x118/0x3c0 kernel/fork.c:1205 exit_mm+0x1fe/0x2d0 kernel/exit.c:565 do_exit+0x905/0x2480 kernel/exit.c:867 do_group_exit+0x217/0x2d0 kernel/exit.c:1022 __do_sys_exit_group kernel/exit.c:1033 [inline] __se_sys_exit_group kernel/exit.c:1031 [inline] __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1031 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: ffff88805ac8df00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88805ac8df80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88805ac8e000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88805ac8e080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88805ac8e100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================