bisecting fixing commit since 5b7a52cd2eef952cee8a72512ef370bcdef46636 building syzkaller on 96e03c1c31a7f2e7f80b2d8b9f3df117df5030d1 testing commit 5b7a52cd2eef952cee8a72512ef370bcdef46636 with gcc (GCC) 8.4.1 20210217 kernel signature: cc39e5c4e135cf934247907ee2acfbd2fb076f2dfdb56c244d8f6fd333f26375 all runs: crashed: KASAN: use-after-free Read in ext4_xattr_set_entry testing current HEAD 670d6552eda8ff0c5f396d3d6f0174237917c66c testing commit 670d6552eda8ff0c5f396d3d6f0174237917c66c with gcc (GCC) 8.4.1 20210217 kernel signature: 4758baebb532f2eb9b1e31669001ac672e404e72df39ad53567a08b62128603b all runs: crashed: KASAN: use-after-free Read in ext4_xattr_set_entry revisions tested: 2, total time: 22m19.609189781s (build: 14m33.596919769s, test: 7m23.67805362s) the crash still happens on HEAD commit msg: Linux 4.14.227 crash: KASAN: use-after-free Read in ext4_xattr_set_entry EXT4-fs error (device sda1): ext4_xattr_set_entry:1606: inode #14111: comm syz-executor.1: corrupted xattr entries EXT4-fs error (device sda1): ext4_xattr_ibody_find:2195: inode #14059: comm syz-executor.4: corrupted in-inode xattr ================================================================== BUG: KASAN: use-after-free in ext4_xattr_set_entry+0x2713/0x3790 fs/ext4/xattr.c:1603 Read of size 4 at addr ffff8881c8eda004 by task syz-executor.5/11874 CPU: 0 PID: 11874 Comm: syz-executor.5 Not tainted 4.14.227-syzkaller #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+0x14b/0x1e7 lib/dump_stack.c:58 print_address_description.cold.6+0x9/0x1ca 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.7+0x11a/0x2d3 mm/kasan/report.c:393 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:429 ext4_xattr_set_entry+0x2713/0x3790 fs/ext4/xattr.c:1603 ext4_xattr_ibody_set+0x70/0x290 fs/ext4/xattr.c:2242 ext4_xattr_set_handle+0x57c/0xc50 fs/ext4/xattr.c:2398 ext4_xattr_set+0x1b4/0x2e0 fs/ext4/xattr.c:2510 ext4_xattr_trusted_set+0x1e/0x20 fs/ext4/xattr_trusted.c:37 __vfs_setxattr+0xd1/0x130 fs/xattr.c:150 __vfs_setxattr_noperm+0xe9/0x380 fs/xattr.c:181 __vfs_setxattr_locked+0x182/0x200 fs/xattr.c:239 vfs_setxattr+0xf5/0x260 fs/xattr.c:256 setxattr+0x1a0/0x250 fs/xattr.c:523 path_setxattr+0x130/0x150 fs/xattr.c:542 SYSC_setxattr fs/xattr.c:557 [inline] SyS_setxattr+0xf/0x20 fs/xattr.c:553 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x465849 RSP: 002b:00007fc680cb7188 EFLAGS: 00000246 ORIG_RAX: 00000000000000bc RAX: ffffffffffffffda RBX: 000000000055bfa8 RCX: 0000000000465849 RDX: 0000000000000000 RSI: 0000000020000140 RDI: 0000000020000100 RBP: 00000000004af675 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000055bfa8 R13: 00007ffdf80053ff R14: 00007fc680cb7300 R15: 0000000000022000 The buggy address belongs to the page: page:ffffea000723b680 count:0 mapcount:0 mapping: (null) index:0x1 flags: 0x17ff00000000000() raw: 017ff00000000000 0000000000000000 0000000000000001 00000000ffffffff raw: ffffea000723d0e0 ffffea0007241720 0000000000000000 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881c8ed9f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881c8ed9f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8881c8eda000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8881c8eda080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881c8eda100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== EXT4-fs: 122 callbacks suppressed EXT4-fs (sda1): Unrecognized mount option "fscontext=user_u" or missing value EXT4-fs (sda1): Unrecognized mount option "fscontext=user_u" or missing value EXT4-fs (sda1): Unrecognized mount option "fscontext=user_u" or missing value EXT4-fs error: 72 callbacks suppressed EXT4-fs error (device sda1): ext4_xattr_set_entry:1606: inode #14134: comm syz-executor.3: corrupted xattr entries EXT4-fs (sda1): Unrecognized mount option "fscontext=user_u" or missing value EXT4-fs (sda1): Unrecognized mount option "fscontext=user_u" or missing value EXT4-fs error (device sda1): ext4_xattr_set_entry:1606: inode #13968: comm syz-executor.1: corrupted xattr entries EXT4-fs (sda1): Unrecognized mount option "fscontext=user_u" or missing value EXT4-fs (sda1): Unrecognized mount option "fscontext=user_u" or missing value EXT4-fs (sda1): Unrecognized mount option "fscontext=user_u" or missing value EXT4-fs error (device sda1): ext4_xattr_set_entry:1606: inode #14126: comm syz-executor.2: corrupted xattr entries EXT4-fs (sda1): Unrecognized mount option "fscontext=user_u" or missing value EXT4-fs (sda1): Unrecognized mount option "fscontext=user_u" or missing value EXT4-fs error (device sda1): ext4_xattr_set_entry:1606: inode #13968: comm syz-executor.1: corrupted xattr entries EXT4-fs error (device sda1): ext4_xattr_ibody_find:2195: inode #14127: comm syz-executor.4: corrupted in-inode xattr EXT4-fs error (device sda1): ext4_xattr_set_entry:1606: inode #13902: comm syz-executor.0: corrupted xattr entries EXT4-fs error (device sda1): ext4_xattr_ibody_find:2195: inode #14130: comm syz-executor.3: corrupted in-inode xattr EXT4-fs error (device sda1): ext4_xattr_ibody_find:2195: inode #14131: comm syz-executor.5: corrupted in-inode xattr EXT4-fs error (device sda1): ext4_xattr_set_entry:1606: inode #13902: comm syz-executor.0: corrupted xattr entries EXT4-fs error (device sda1): ext4_xattr_set_entry:1606: inode #14144: comm syz-executor.2: corrupted xattr entries EXT4-fs: 129 callbacks suppressed EXT4-fs (sda1): Unrecognized mount option "fscontext=user_u" or missing value EXT4-fs (sda1): Unrecognized mount option "fscontext=user_u" or missing value EXT4-fs error: 86 callbacks suppressed EXT4-fs error (device sda1): ext4_xattr_set_entry:1606: inode #14129: comm syz-executor.3: corrupted xattr entries EXT4-fs (sda1): Unrecognized mount option "fscontext=user_u" or missing value EXT4-fs error (device sda1): ext4_xattr_set_entry:1606: inode #14154: comm syz-executor.5: corrupted xattr entries EXT4-fs (sda1): Unrecognized mount option "fscontext=user_u" or missing value EXT4-fs (sda1): Unrecognized mount option "fscontext=user_u" or missing value EXT4-fs error (device sda1): ext4_xattr_set_entry:1606: inode #14164: comm syz-executor.1: corrupted xattr entries EXT4-fs (sda1): Unrecognized mount option "fscontext=user_u" or missing value EXT4-fs (sda1): Unrecognized mount option "fscontext=user_u" or missing value EXT4-fs error (device sda1): ext4_xattr_set_entry:1606: inode #13860: comm syz-executor.0: corrupted xattr entries EXT4-fs error (device sda1): ext4_xattr_ibody_find:2195: inode #14153: comm syz-executor.4: corrupted in-inode xattr EXT4-fs (sda1): Unrecognized mount option "fscontext=user_u" or missing value EXT4-fs (sda1): Unrecognized mount option "fscontext=user_u" or missing value EXT4-fs error (device sda1): ext4_xattr_set_entry:1606: inode #14130: comm syz-executor.3: corrupted xattr entries EXT4-fs (sda1): Unrecognized mount option "fscontext=user_u" or missing value EXT4-fs error (device sda1): ext4_xattr_set_entry:1606: inode #14164: comm syz-executor.1: corrupted xattr entries EXT4-fs error (device sda1): ext4_xattr_set_entry:1606: inode #13860: comm syz-executor.0: corrupted xattr entries EXT4-fs error (device sda1): ext4_xattr_set_entry:1606: inode #13968: comm syz-executor.2: corrupted xattr entries EXT4-fs error (device sda1): ext4_xattr_set_entry:1606: inode #14130: comm syz-executor.3: corrupted xattr entries