loop2: rw=524288, sector=8, nr_sectors = 16 limit=16 syz.2.12692: 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: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 ffff888053df4000 by task syz.2.12692/474 CPU: 1 PID: 474 Comm: syz.2.12692 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/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:0x7fb5e3b9cdd9 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:00007fb5e4aff028 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007fb5e3e15fa0 RCX: 00007fb5e3b9cdd9 RDX: 0000000000080000 RSI: 0000200000000100 RDI: ffffffffffffff9c RBP: 00007fb5e3c32d69 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fb5e3e16038 R14: 00007fb5e3e15fa0 R15: 00007ffde04c8358 Allocated by task 4398: kasan_save_stack mm/kasan/common.c:46 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:53 __kasan_slab_alloc+0x6b/0x80 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook+0x4b/0x480 mm/slab.h:737 kmem_cache_alloc_bulk+0x3ba/0x4e0 mm/slub.c:3880 mt_alloc_bulk lib/maple_tree.c:159 [inline] mas_alloc_nodes+0x449/0x890 lib/maple_tree.c:1301 mas_node_count_gfp lib/maple_tree.c:1361 [inline] mas_preallocate+0x161/0x3c0 lib/maple_tree.c:5809 do_mas_align_munmap+0x239/0x12b0 mm/mmap.c:2453 do_mas_munmap+0x240/0x2b0 mm/mmap.c:2650 __vm_munmap+0x1ac/0x2d0 mm/mmap.c:2936 __do_sys_munmap mm/mmap.c:2961 [inline] __se_sys_munmap mm/mmap.c:2958 [inline] __x64_sys_munmap+0x5c/0x70 mm/mmap.c:2958 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 Freed by task 21: kasan_save_stack mm/kasan/common.c:46 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:53 kasan_save_free_info+0x2d/0x50 mm/kasan/generic.c:516 ____kasan_slab_free+0x126/0x1e0 mm/kasan/common.c:237 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1729 [inline] slab_free_freelist_hook+0x131/0x1a0 mm/slub.c:1755 slab_free mm/slub.c:3687 [inline] kmem_cache_free+0xf7/0x290 mm/slub.c:3709 rcu_do_batch kernel/rcu/tree.c:2297 [inline] rcu_core+0xa99/0x1740 kernel/rcu/tree.c:2557 handle_softirqs+0x2a1/0x930 kernel/softirq.c:596 run_ksoftirqd+0xa4/0x100 kernel/softirq.c:968 smpboot_thread_fn+0x64a/0xa40 kernel/smpboot.c:164 kthread+0x29d/0x330 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Last potentially related work creation: kasan_save_stack+0x3a/0x60 mm/kasan/common.c:46 __kasan_record_aux_stack+0xb2/0xc0 mm/kasan/generic.c:486 call_rcu+0x14f/0x990 kernel/rcu/tree.c:2849 mas_commit_b_node lib/maple_tree.c:3664 [inline] mas_wr_bnode lib/maple_tree.c:4385 [inline] mas_wr_modify+0x4781/0x55c0 lib/maple_tree.c:4428 mas_store_prealloc+0x2eb/0x440 lib/maple_tree.c:5790 __vma_adjust+0x131e/0x1cd0 mm/mmap.c:832 vma_adjust include/linux/mm.h:2810 [inline] __split_vma+0x3a7/0x500 mm/mmap.c:-1 do_mas_align_munmap+0x397/0x12b0 mm/mmap.c:2480 do_mas_munmap+0x240/0x2b0 mm/mmap.c:2650 __vm_munmap+0x1ac/0x2d0 mm/mmap.c:2936 __do_sys_munmap mm/mmap.c:2961 [inline] __se_sys_munmap mm/mmap.c:2958 [inline] __x64_sys_munmap+0x5c/0x70 mm/mmap.c:2958 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 The buggy address belongs to the object at ffff888053df4000 which belongs to the cache maple_node of size 256 The buggy address is located 0 bytes inside of 256-byte region [ffff888053df4000, ffff888053df4100) The buggy address belongs to the physical page: page:ffffea00014f7d00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x53df4 head:ffffea00014f7d00 order:1 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000122 ffff8880174c5000 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 4398, tgid 4398 (udevd), ts 1124063680425, free_ts 1123457601256 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 alloc_slab_page+0x5d/0x160 mm/slub.c:1799 allocate_slab mm/slub.c:1944 [inline] new_slab+0x87/0x2c0 mm/slub.c:1997 ___slab_alloc+0xbc6/0x1240 mm/slub.c:3154 kmem_cache_alloc_bulk+0x1a3/0x4e0 mm/slub.c:3856 mt_alloc_bulk lib/maple_tree.c:159 [inline] mas_alloc_nodes+0x449/0x890 lib/maple_tree.c:1301 mas_node_count_gfp lib/maple_tree.c:1361 [inline] mas_preallocate+0x161/0x3c0 lib/maple_tree.c:5809 do_mas_align_munmap+0x239/0x12b0 mm/mmap.c:2453 do_mas_munmap+0x240/0x2b0 mm/mmap.c:2650 __vm_munmap+0x1ac/0x2d0 mm/mmap.c:2936 __do_sys_munmap mm/mmap.c:2961 [inline] __se_sys_munmap mm/mmap.c:2958 [inline] __x64_sys_munmap+0x5c/0x70 mm/mmap.c:2958 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+0x2e/0x3f0 mm/page_alloc.c:3508 kasan_depopulate_vmalloc_pte+0x67/0x80 mm/kasan/shadow.c:375 apply_to_pte_range mm/memory.c:2660 [inline] apply_to_pmd_range mm/memory.c:2704 [inline] apply_to_pud_range mm/memory.c:2740 [inline] apply_to_p4d_range mm/memory.c:2776 [inline] __apply_to_page_range+0x989/0xd10 mm/memory.c:2812 kasan_release_vmalloc+0x93/0xb0 mm/kasan/shadow.c:492 __purge_vmap_area_lazy+0xf7e/0x1920 mm/vmalloc.c:1782 drain_vmap_area_work+0x3c/0xd0 mm/vmalloc.c:1811 process_one_work+0x8a2/0x1160 kernel/workqueue.c:2292 worker_thread+0xaa2/0x1270 kernel/workqueue.c:2439 kthread+0x29d/0x330 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Memory state around the buggy address: ffff888053df3f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888053df3f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888053df4000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888053df4080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888053df4100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================