================================================================== 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 512 at addr ffff8880894fc680 by task rs:main Q:Reg/7604 CPU: 0 PID: 7604 Comm: rs:main Q:Reg Not tainted 5.0.0+ #21 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_dirty_inode+0x8f/0xc0 fs/ext4/inode.c:6076 __mark_inode_dirty+0x919/0x1290 fs/fs-writeback.c:2155 mark_inode_dirty include/linux/fs.h:2125 [inline] __generic_write_end+0x1b9/0x240 fs/buffer.c:2118 generic_write_end+0x6c/0x90 fs/buffer.c:2163 ext4_da_write_end+0x3c8/0xa50 fs/ext4/inode.c:3197 generic_perform_write+0x2f0/0x530 mm/filemap.c:3252 __generic_file_write_iter+0x25e/0x630 mm/filemap.c:3370 ext4_file_write_iter+0x346/0x11a0 fs/ext4/file.c:266 call_write_iter include/linux/fs.h:1863 [inline] new_sync_write+0x4c7/0x760 fs/read_write.c:474 __vfs_write+0xe4/0x110 fs/read_write.c:487 vfs_write+0x20c/0x580 fs/read_write.c:549 ksys_write+0xea/0x1f0 fs/read_write.c:598 __do_sys_write fs/read_write.c:610 [inline] __se_sys_write fs/read_write.c:607 [inline] __x64_sys_write+0x73/0xb0 fs/read_write.c:607 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f7a9b48e19d Code: d1 20 00 00 75 10 b8 01 00 00 00 0f 05 48 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 be fa ff ff 48 89 04 24 b8 01 00 00 00 0f 05 <48> 8b 3c 24 48 89 c2 e8 07 fb ff ff 48 89 d0 48 83 c4 08 48 3d 01 RSP: 002b:00007f7a99a2f000 EFLAGS: 00000293 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000105 RCX: 00007f7a9b48e19d RDX: 0000000000000105 RSI: 00000000007df090 RDI: 0000000000000001 RBP: 00000000007df090 R08: 00000000007df185 R09: 00007f7a9ae0be77 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000 R13: 00007f7a99a2f480 R14: 0000000000000002 R15: 00000000007dee90 The buggy address belongs to the page: page:ffffea0002253f00 count:0 mapcount:-128 mapping:0000000000000000 index:0x1 flags: 0x1fffc0000000000() raw: 01fffc0000000000 ffffea000164bc08 ffffea0001373a08 0000000000000000 raw: 0000000000000001 0000000000000000 00000000ffffff7f 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880894fc580: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8880894fc600: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff8880894fc680: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8880894fc700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8880894fc780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================