================================================================== BUG: KASAN: use-after-free in get_max_inline_xattr_value_size+0x36e/0x510 fs/ext4/inline.c:62 Read of size 4 at addr ffff88813cfad004 by task syz-executor.2/14632 CPU: 1 PID: 14632 Comm: syz-executor.2 Not tainted 6.1.25-syzkaller-00028-gf6707f352b54 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/03/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:316 [inline] print_report+0x158/0x4e0 mm/kasan/report.c:427 kasan_report+0x13c/0x170 mm/kasan/report.c:531 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:350 get_max_inline_xattr_value_size+0x36e/0x510 fs/ext4/inline.c:62 ext4_get_max_inline_size+0x13d/0x1f0 fs/ext4/inline.c:113 ext4_try_to_write_inline_data+0xd3/0x1420 fs/ext4/inline.c:663 ext4_write_begin+0x200/0xfb0 fs/ext4/inode.c:1179 ext4_da_write_begin+0x2ff/0x920 fs/ext4/inode.c:2987 generic_perform_write+0x2f9/0x5c0 mm/filemap.c:3765 ext4_buffered_write_iter+0x360/0x640 fs/ext4/file.c:285 ext4_file_write_iter+0x194/0x1cf0 call_write_iter include/linux/fs.h:2215 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x8d1/0xe80 fs/read_write.c:584 ksys_write+0x199/0x2c0 fs/read_write.c:637 __do_sys_write fs/read_write.c:649 [inline] __se_sys_write fs/read_write.c:646 [inline] __x64_sys_write+0x7b/0x90 fs/read_write.c:646 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fea4a47cb29 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fea4b1ab0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fea4a59bf80 RCX: 00007fea4a47cb29 RDX: 0000000000000001 RSI: 0000000020000280 RDI: 0000000000000004 RBP: 00007fea4a4c847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fea4a59bf80 R15: 00007ffd5e421d08 The buggy address belongs to the physical page: page:ffffea0004f3eb40 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x0 pfn:0x13cfad flags: 0x4000000000000000(zone=1) raw: 4000000000000000 ffffea000455c988 ffffea0004b0ee08 0000000000000000 raw: 0000000000000000 0000000000000000 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 0x100cc0(GFP_USER), pid 9817, tgid 9817 (syz-executor.3), ts 1144613863281, free_ts 1162103889090 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x213/0x220 mm/page_alloc.c:2581 prep_new_page mm/page_alloc.c:2588 [inline] get_page_from_freelist+0x276c/0x2850 mm/page_alloc.c:4385 __alloc_pages+0x3a1/0x780 mm/page_alloc.c:5662 __alloc_pages_node include/linux/gfp.h:236 [inline] alloc_pages_node include/linux/gfp.h:259 [inline] alloc_pages include/linux/gfp.h:270 [inline] __get_free_pages+0xe/0x30 mm/page_alloc.c:5712 kasan_populate_vmalloc_pte+0x39/0x130 mm/kasan/shadow.c:271 apply_to_pte_range mm/memory.c:2643 [inline] apply_to_pmd_range mm/memory.c:2687 [inline] apply_to_pud_range mm/memory.c:2723 [inline] apply_to_p4d_range mm/memory.c:2759 [inline] __apply_to_page_range+0x8dd/0xbe0 mm/memory.c:2793 apply_to_page_range+0x3b/0x50 mm/memory.c:2812 kasan_populate_vmalloc+0x65/0x70 mm/kasan/shadow.c:318 alloc_vmap_area+0x1961/0x1aa0 mm/vmalloc.c:1653 __get_vm_area_node+0x171/0x370 mm/vmalloc.c:2512 __vmalloc_node_range+0x36e/0x1540 mm/vmalloc.c:3190 alloc_thread_stack_node kernel/fork.c:318 [inline] dup_task_struct+0x3d6/0x7d0 kernel/fork.c:1053 copy_process+0x5cd/0x3490 kernel/fork.c:2172 kernel_clone+0x229/0x890 kernel/fork.c:2763 __do_sys_clone3 kernel/fork.c:3064 [inline] __se_sys_clone3 kernel/fork.c:3048 [inline] __x64_sys_clone3+0x35c/0x390 kernel/fork.c:3048 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1493 [inline] free_pcp_prepare mm/page_alloc.c:1567 [inline] free_unref_page_prepare+0x83d/0x850 mm/page_alloc.c:3484 free_unref_page+0x8d/0x480 mm/page_alloc.c:3580 free_the_page mm/page_alloc.c:793 [inline] __free_pages+0x61/0xf0 mm/page_alloc.c:5751 free_pages+0x7c/0x90 mm/page_alloc.c:5762 kasan_depopulate_vmalloc_pte+0x6a/0x90 mm/kasan/shadow.c:375 apply_to_pte_range mm/memory.c:2643 [inline] apply_to_pmd_range mm/memory.c:2687 [inline] apply_to_pud_range mm/memory.c:2723 [inline] apply_to_p4d_range mm/memory.c:2759 [inline] __apply_to_page_range+0x8dd/0xbe0 mm/memory.c:2793 apply_to_existing_page_range+0x38/0x50 mm/memory.c:2826 kasan_release_vmalloc+0x9a/0xb0 mm/kasan/shadow.c:492 __purge_vmap_area_lazy+0x152c/0x1680 mm/vmalloc.c:1781 drain_vmap_area_work+0x3e/0xd0 mm/vmalloc.c:1810 process_one_work+0x73d/0xcb0 kernel/workqueue.c:2296 worker_thread+0xa60/0x1260 kernel/workqueue.c:2443 kthread+0x26d/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Memory state around the buggy address: ffff88813cfacf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88813cfacf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88813cfad000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88813cfad080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88813cfad100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== EXT4-fs error (device loop2): ext4_read_block_bitmap_nowait:438: comm syz-executor.2: Invalid block bitmap block 4294967295 in block_group 0