EXT4-fs error (device sda1): ext4_xattr_set_entry:1605: inode #16977: comm syz-executor.2: corrupted xattr entries EXT4-fs error (device sda1): ext4_xattr_set_entry:1605: inode #17009: comm syz-executor.3: corrupted xattr entries ================================================================== BUG: KASAN: use-after-free in memset include/linux/string.h:332 [inline] BUG: KASAN: use-after-free in __ext4_expand_extra_isize.isra.0+0x10b/0x1c0 fs/ext4/inode.c:5832 Write of size 3586 at addr ffff8881a6c0f3a0 by task syz-executor.5/16923 EXT4-fs error (device sda1): ext4_xattr_set_entry:1605: inode #17026: comm syz-executor.1: corrupted xattr entries CPU: 1 PID: 16923 Comm: syz-executor.5 Not tainted 4.14.151+ #0 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0xca/0x134 lib/dump_stack.c:53 print_address_description+0x60/0x226 mm/kasan/report.c:187 __kasan_report.cold+0x1a/0x41 mm/kasan/report.c:316 memset+0x20/0x40 mm/kasan/common.c:113 memset include/linux/string.h:332 [inline] __ext4_expand_extra_isize.isra.0+0x10b/0x1c0 fs/ext4/inode.c:5832 ext4_try_to_expand_extra_isize fs/ext4/inode.c:5884 [inline] ext4_mark_inode_dirty+0x471/0x7f0 fs/ext4/inode.c:5960 __ext4_ext_dirty+0x11e/0x170 fs/ext4/extents.c:177 ext4_ext_remove_space+0x1773/0x3820 fs/ext4/extents.c:3077 ext4_ext_truncate+0x19b/0x1e0 fs/ext4/extents.c:4669 ext4_truncate+0xa21/0x1220 fs/ext4/inode.c:4491 ext4_setattr+0x134c/0x2340 fs/ext4/inode.c:5574 notify_change2+0xab8/0xd80 fs/attr.c:315 do_truncate2+0x11e/0x1e0 fs/open.c:63 handle_truncate fs/namei.c:3123 [inline] do_last fs/namei.c:3548 [inline] path_openat+0x1227/0x2be0 fs/namei.c:3681 do_filp_open+0x1a1/0x280 fs/namei.c:3715 do_sys_open+0x2ca/0x590 fs/open.c:1096 do_syscall_64+0x19b/0x520 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x459f49 RSP: 002b:00007f932805cc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000055 RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 0000000000459f49 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000040 RBP: 000000000075bfc8 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f932805d6d4 R13: 00000000004c0784 R14: 00000000004d2ef0 R15: 00000000ffffffff The buggy address belongs to the page: page:ffffea00069b03c0 count:2 mapcount:0 mapping:ffff8881d56b8950 index:0x43a flags: 0x400000000000203a(referenced|dirty|lru|active|private) raw: 400000000000203a ffff8881d56b8950 000000000000043a 00000002ffffffff raw: ffffea0006391ba0 ffffea0006407ba0 ffff8881d0fbbd20 ffff8881d641aa80 page dumped because: kasan: bad access detected page->mem_cgroup:ffff8881d641aa80 Memory state around the buggy address: ffff8881a6c0ff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881a6c0ff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8881a6c10000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8881a6c10080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881a6c10100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================