EXT4-fs error (device sda1): ext4_xattr_set_entry:1605: inode #16506: comm syz-executor.2: 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 49543 at addr ffff8881a85422a0 by task syz-executor.4/9396 CPU: 0 PID: 9396 Comm: syz-executor.4 Not tainted 4.14.152+ #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_truncate+0x91/0x1e0 fs/ext4/extents.c:4653 ext4_truncate+0xa21/0x1220 fs/ext4/inode.c:4491 ext4_evict_inode+0x6ea/0x1560 fs/ext4/inode.c:289 evict+0x2cb/0x5f0 fs/inode.c:554 iput_final fs/inode.c:1516 [inline] iput fs/inode.c:1543 [inline] iput+0x385/0x7f0 fs/inode.c:1528 dentry_unlink_inode+0x25f/0x320 fs/dcache.c:387 __dentry_kill+0x325/0x560 fs/dcache.c:591 dentry_kill fs/dcache.c:632 [inline] dput.part.0+0x4b5/0x710 fs/dcache.c:847 dput+0x1b/0x30 fs/dcache.c:811 __fput+0x429/0x710 fs/file_table.c:228 task_work_run+0x125/0x1a0 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0x9cb/0x2a20 kernel/exit.c:875 do_group_exit+0x100/0x2e0 kernel/exit.c:978 get_signal+0x39f/0x1cc0 kernel/signal.c:2422 do_signal+0x96/0x15d0 arch/x86/kernel/signal.c:814 exit_to_usermode_loop+0x11d/0x160 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+0x3a3/0x520 arch/x86/entry/common.c:297 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x45a219 RSP: 002b:00007f215cd7ccf8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffe00 RBX: 000000000075bf28 RCX: 000000000045a219 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 000000000075bf28 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000075bf2c R13: 00007ffecea726cf R14: 00007f215cd7d9c0 R15: 000000000075bf2c The buggy address belongs to the page: page:ffffea0006a15080 count:2 mapcount:0 mapping:ffff8881d9ab8950 index:0x440 flags: 0x400000000000203a(referenced|dirty|lru|active|private) raw: 400000000000203a ffff8881d9ab8950 0000000000000440 00000002ffffffff raw: ffffea00064118e0 ffffea0006cea520 ffff8881cf041888 ffff8881da81aa80 page dumped because: kasan: bad access detected page->mem_cgroup:ffff8881da81aa80 Memory state around the buggy address: ffff8881a8543f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881a8543f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff8881a8544000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8881a8544080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881a8544100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================