================================================================== BUG: KASAN: use-after-free in memset include/linux/string.h:337 [inline] BUG: KASAN: use-after-free in __ext4_expand_extra_isize+0x16c/0x240 fs/ext4/inode.c:5914 Write of size 184 at addr ffff88807591afa0 by task syz-executor.1/11622 CPU: 0 PID: 11622 Comm: syz-executor.1 Not tainted 5.1.0-rc1-next-20190321 #8 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+0x172/0x1f0 lib/dump_stack.c:113 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:187 kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317 check_memory_region_inline mm/kasan/generic.c:185 [inline] check_memory_region+0x123/0x190 mm/kasan/generic.c:191 memset+0x24/0x40 mm/kasan/common.c:115 memset include/linux/string.h:337 [inline] __ext4_expand_extra_isize+0x16c/0x240 fs/ext4/inode.c:5914 ext4_try_to_expand_extra_isize fs/ext4/inode.c:5966 [inline] ext4_mark_inode_dirty+0x6e9/0x940 fs/ext4/inode.c:6042 ext4_evict_inode+0x978/0x18f0 fs/ext4/inode.c:282 evict+0x309/0x680 fs/inode.c:558 iput_final fs/inode.c:1547 [inline] iput+0x530/0x8d0 fs/inode.c:1573 dentry_unlink_inode+0x2dc/0x400 fs/dcache.c:374 __dentry_kill+0x390/0x610 fs/dcache.c:579 dentry_kill+0xd7/0x5e0 fs/dcache.c:698 dput+0x570/0x6a0 fs/dcache.c:859 path_put+0x31/0x70 fs/namei.c:482 free_fs_struct+0x25/0x70 fs/fs_struct.c:90 exit_fs+0xf0/0x130 fs/fs_struct.c:107 do_exit+0x8e0/0x2fa0 kernel/exit.c:872 do_group_exit+0x135/0x370 kernel/exit.c:980 get_signal+0x399/0x1d50 kernel/signal.c:2577 do_signal+0x87/0x1940 arch/x86/kernel/signal.c:816 exit_to_usermode_loop+0x244/0x2c0 arch/x86/entry/common.c:162 prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline] syscall_return_slowpath arch/x86/entry/common.c:268 [inline] do_syscall_64+0x52d/0x610 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x458209 Code: Bad RIP value. RSP: 002b:00007f4cb020ac78 EFLAGS: 00000246 ORIG_RAX: 000000000000010e RAX: fffffffffffffdfe RBX: 0000000000000006 RCX: 0000000000458209 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 000000000073bfa0 R08: 0000000020000240 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f4cb020b6d4 R13: 00000000004c4cc2 R14: 00000000004d8608 R15: 00000000ffffffff The buggy address belongs to the page: page:ffffea0001d64680 count:2 mapcount:0 mapping:ffff8880a113fb18 index:0x446 def_blk_aops flags: 0x1fffc000000203a(referenced|dirty|lru|active|private) raw: 01fffc000000203a ffffea0001c78108 ffffea0001d04ac8 ffff8880a113fb18 raw: 0000000000000446 ffff8880a11ede70 00000002ffffffff ffff88805919e900 page dumped because: kasan: bad access detected page->mem_cgroup:ffff88805919e900 Memory state around the buggy address: ffff88807591af00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88807591af80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88807591b000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88807591b080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88807591b100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================