================================================================== BUG: KASAN: use-after-free in ext4_write_inline_data fs/ext4/inline.c:246 [inline] BUG: KASAN: use-after-free in ext4_write_inline_data_end+0x500/0x8c0 fs/ext4/inline.c:768 Write of size 70 at addr ffff8881e60a0016 by task syz-executor.0/1802 CPU: 1 PID: 1802 Comm: syz-executor.0 Not tainted 5.4.116-syzkaller-00003-gdfece79f2f98 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x24e lib/dump_stack.c:118 print_address_description+0x9b/0x650 mm/kasan/report.c:384 __kasan_report+0x182/0x260 mm/kasan/report.c:516 kasan_report+0x30/0x60 mm/kasan/common.c:641 check_memory_region_inline mm/kasan/generic.c:141 [inline] check_memory_region+0x2a5/0x2e0 mm/kasan/generic.c:191 memcpy+0x38/0x50 mm/kasan/common.c:124 ext4_write_inline_data fs/ext4/inline.c:246 [inline] ext4_write_inline_data_end+0x500/0x8c0 fs/ext4/inline.c:768 ext4_write_end+0x1d5/0xe50 fs/ext4/inode.c:1446 generic_perform_write+0x403/0x5a0 mm/filemap.c:3303 __generic_file_write_iter+0x239/0x480 mm/filemap.c:3421 ext4_file_write_iter+0x49e/0x10e0 fs/ext4/file.c:270 call_write_iter include/linux/fs.h:1971 [inline] new_sync_write fs/read_write.c:483 [inline] __vfs_write+0x5ec/0x780 fs/read_write.c:496 vfs_write+0x212/0x4e0 fs/read_write.c:558 ksys_write+0x186/0x2b0 fs/read_write.c:611 do_syscall_64+0xcb/0x1e0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x4665f9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f4efa0c5188 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 000000000056bf60 RCX: 00000000004665f9 RDX: 0000000000000082 RSI: 00000000200000c0 RDI: 0000000000000003 RBP: 00000000004bfce1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf60 R13: 00007ffc26bba0ef R14: 00007f4efa0c5300 R15: 0000000000022000 The buggy address belongs to the page: page:ffffea0007982800 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x0 flags: 0x8000000000000000() raw: 8000000000000000 ffffea00079a4e08 ffffea0007a3ba88 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 0x400dc0(GFP_KERNEL_ACCOUNT|__GFP_ZERO) set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook mm/page_alloc.c:2165 [inline] prep_new_page+0x19a/0x380 mm/page_alloc.c:2171 get_page_from_freelist+0x550/0x8b0 mm/page_alloc.c:3794 __alloc_pages_nodemask+0x3a2/0x880 mm/page_alloc.c:4855 __alloc_pages include/linux/gfp.h:503 [inline] __alloc_pages_node include/linux/gfp.h:516 [inline] alloc_pages_node include/linux/gfp.h:530 [inline] __pte_alloc_one include/asm-generic/pgalloc.h:63 [inline] pte_alloc_one+0x1b/0xb0 arch/x86/mm/pgtable.c:26 __pte_alloc+0x1d/0x1c0 mm/memory.c:439 copy_pte_range mm/memory.c:829 [inline] copy_pmd_range mm/memory.c:905 [inline] copy_pud_range mm/memory.c:939 [inline] copy_p4d_range mm/memory.c:961 [inline] copy_page_range+0x1755/0x1b70 mm/memory.c:1023 dup_mmap+0x850/0xbd0 kernel/fork.c:605 dup_mm+0x8c/0x300 kernel/fork.c:1367 copy_mm kernel/fork.c:1423 [inline] copy_process+0x1f3d/0x5630 kernel/fork.c:2040 _do_fork+0x18f/0x900 kernel/fork.c:2391 __do_sys_clone kernel/fork.c:2549 [inline] __se_sys_clone kernel/fork.c:2530 [inline] __x64_sys_clone+0x25b/0x2c0 kernel/fork.c:2530 do_syscall_64+0xcb/0x1e0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1176 [inline] free_pcp_prepare+0x1a9/0x270 mm/page_alloc.c:1233 free_unref_page_prepare mm/page_alloc.c:3085 [inline] free_unref_page_list+0x115/0x6c0 mm/page_alloc.c:3154 release_pages+0x98f/0x9d0 mm/swap.c:842 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:184 [inline] tlb_flush_mmu+0x77f/0x910 mm/mmu_gather.c:191 tlb_finish_mmu+0xcb/0x200 mm/mmu_gather.c:272 exit_mmap+0x2e8/0x540 mm/mmap.c:3176 __mmput+0x34/0x240 kernel/fork.c:1089 exit_mm kernel/exit.c:489 [inline] do_exit+0xc19/0x2bf0 kernel/exit.c:799 do_group_exit+0x15c/0x2c0 kernel/exit.c:910 get_signal+0x164f/0x1fc0 kernel/signal.c:2745 do_signal+0x8d/0x610 arch/x86/kernel/signal.c:793 exit_to_usermode_loop arch/x86/entry/common.c:159 [inline] prepare_exit_to_usermode+0x207/0x310 arch/x86/entry/common.c:194 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Memory state around the buggy address: ffff8881e609ff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881e609ff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8881e60a0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8881e60a0080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881e60a0100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================