================================================================== BUG: KASAN: use-after-free in memset include/linux/string.h:332 [inline] BUG: KASAN: use-after-free in __ext4_expand_extra_isize+0x14f/0x220 fs/ext4/inode.c:5763 Write of size 736 at addr ffff88820ffc2ea0 by task syz-executor.4/22679 CPU: 0 PID: 22679 Comm: syz-executor.4 Not tainted 4.14.152 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x138/0x197 lib/dump_stack.c:53 print_address_description.cold+0x7c/0x1dc mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report mm/kasan/report.c:409 [inline] kasan_report.cold+0xa9/0x2af mm/kasan/report.c:393 check_memory_region_inline mm/kasan/kasan.c:260 [inline] check_memory_region+0x123/0x190 mm/kasan/kasan.c:267 memset+0x24/0x40 mm/kasan/kasan.c:285 memset include/linux/string.h:332 [inline] __ext4_expand_extra_isize+0x14f/0x220 fs/ext4/inode.c:5763 ext4_try_to_expand_extra_isize fs/ext4/inode.c:5815 [inline] ext4_mark_inode_dirty+0x664/0x860 fs/ext4/inode.c:5891 ext4_ext_truncate+0x96/0x1f0 fs/ext4/extents.c:4653 ext4_truncate+0xbab/0x11f0 fs/ext4/inode.c:4432 ext4_evict_inode+0x8be/0x15c0 fs/ext4/inode.c:288 evict+0x2e6/0x630 fs/inode.c:554 iput_final fs/inode.c:1516 [inline] iput fs/inode.c:1543 [inline] iput+0x471/0x900 fs/inode.c:1528 dentry_unlink_inode+0x286/0x340 fs/dcache.c:387 __dentry_kill+0x32e/0x580 fs/dcache.c:591 dentry_kill fs/dcache.c:632 [inline] dput.part.0+0x4e3/0x750 fs/dcache.c:847 dput+0x20/0x30 fs/dcache.c:811 path_put+0x31/0x70 fs/namei.c:501 free_fs_struct+0x25/0x70 fs/fs_struct.c:90 exit_fs+0xe7/0x120 fs/fs_struct.c:107 do_exit+0x7b9/0x2c10 kernel/exit.c:870 do_group_exit+0x111/0x330 kernel/exit.c:977 get_signal+0x381/0x1cd0 kernel/signal.c:2409 do_signal+0x86/0x19a0 arch/x86/kernel/signal.c:814 exit_to_usermode_loop+0x15c/0x220 arch/x86/entry/common.c:160 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline] syscall_return_slowpath arch/x86/entry/common.c:270 [inline] do_syscall_64+0x4bc/0x640 arch/x86/entry/common.c:297 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x45a219 RSP: 002b:00007fb31179bcf8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffe00 RBX: 000000000075c1c8 RCX: 000000000045a219 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 000000000075c1c8 RBP: 000000000075c1c0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000075c1cc R13: 00007fff6de4c50f R14: 00007fb31179c9c0 R15: 000000000075c1cc The buggy address belongs to the page: page:ffffea00083ff080 count:2 mapcount:0 mapping:ffff88821844b520 index:0x46a flags: 0x6fffc0000001074(referenced|dirty|lru|active|private) raw: 06fffc0000001074 ffff88821844b520 000000000000046a 00000002ffffffff raw: ffffea000838a460 ffffea000847f3a0 ffff88807a7f42a0 ffff88821b7321c0 page dumped because: kasan: bad access detected page->mem_cgroup:ffff88821b7321c0 Memory state around the buggy address: ffff88820ffc2f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88820ffc2f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88820ffc3000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88820ffc3080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88820ffc3100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================