syzbot


KASAN: use-after-free Read in ext4_xattr_set_entry

Status: auto-closed as invalid on 2019/06/26 01:15
Reported-by: syzbot+14d28d8eae5ee1bd6f88@syzkaller.appspotmail.com
First crash: 2230d, last: 2167d
Similar bugs (12)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 KASAN: use-after-free Read in ext4_xattr_set_entry (3) C error 1 1011d 1497d 0/1 upstream: reported C repro on 2020/10/28 15:08
android-414 KASAN: use-after-free Read in ext4_xattr_set_entry (2) 6 1860d 1915d 0/1 auto-closed as invalid on 2020/02/28 13:35
linux-4.14 KASAN: use-after-free Read in ext4_xattr_set_entry (2) 1 1716d 1716d 0/1 auto-closed as invalid on 2020/07/21 03:20
linux-4.19 KASAN: use-after-free Read in ext4_xattr_set_entry (2) C done 7 1177d 1636d 1/1 fixed on 2021/10/13 07:23
upstream KASAN: use-after-free Read in ext4_xattr_set_entry ext4 1 2320d 2320d 0/28 closed as invalid on 2018/07/29 11:55
upstream KASAN: use-after-free Read in ext4_xattr_set_entry (5) ext4 2 861d 920d 0/28 auto-obsoleted due to no activity on 2022/11/22 17:19
upstream KASAN: use-after-free Read in ext4_xattr_set_entry (3) ext4 4 1612d 1730d 0/28 auto-closed as invalid on 2020/11/02 08:32
linux-4.19 KASAN: use-after-free Read in ext4_xattr_set_entry syz done 10 1739d 1987d 1/1 fixed on 2020/03/30 09:03
upstream KASAN: use-after-free Read in ext4_xattr_set_entry (4) ext4 C error done 21 1016d 1403d 20/28 fixed on 2022/03/28 10:17
upstream KASAN: use-after-free Read in ext4_xattr_set_entry (2) ext4 C done 19 1814d 2223d 15/28 fixed on 2020/02/14 01:19
android-54 KASAN: use-after-free Read in ext4_xattr_set_entry 6 1579d 1760d 0/2 auto-closed as invalid on 2020/12/04 21:44
linux-4.14 KASAN: use-after-free Read in ext4_xattr_set_entry C done 9 1767d 1860d 1/1 fixed on 2020/03/01 21:06

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in memmove include/linux/string.h:359 [inline]
BUG: KASAN: use-after-free in ext4_xattr_set_entry+0x92d/0x2e40 fs/ext4/xattr.c:1739
Read of size 4 at addr ffff888190f21ffd by task syz-fuzzer/1792

CPU: 0 PID: 1792 Comm: syz-fuzzer Not tainted 4.14.90+ #29
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0xb9/0x11b lib/dump_stack.c:53
 print_address_description+0x60/0x22b mm/kasan/report.c:252
 kasan_report_error mm/kasan/report.c:351 [inline]
 kasan_report.cold.6+0x11b/0x2dd mm/kasan/report.c:409
 memmove+0x1f/0x50 mm/kasan/kasan.c:293
 memmove include/linux/string.h:359 [inline]
 ext4_xattr_set_entry+0x92d/0x2e40 fs/ext4/xattr.c:1739
 ext4_xattr_ibody_set+0x73/0x280 fs/ext4/xattr.c:2245
 ext4_xattr_set_handle+0x6a6/0xdc0 fs/ext4/xattr.c:2401
 ext4_initxattrs+0xb8/0x110 fs/ext4/xattr_security.c:43
 security_inode_init_security+0x228/0x310 security/security.c:493
 __ext4_new_inode+0x3473/0x48e0 fs/ext4/ialloc.c:1166
 ext4_mkdir+0x234/0xb40 fs/ext4/namei.c:2625
 vfs_mkdir2+0x3cb/0x640 fs/namei.c:3883
 SYSC_mkdirat fs/namei.c:3912 [inline]
 SyS_mkdirat+0x126/0x220 fs/namei.c:3896
 do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x47fc44
RSP: 002b:000000c42013d898 EFLAGS: 00000246 ORIG_RAX: 0000000000000102
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000047fc44
RDX: 00000000000001c0 RSI: 000000c42a04c2c0 RDI: ffffffffffffff9c
RBP: 000000c42013d8f8 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000001000000
R13: 0000000000000020 R14: 0000000000000013 R15: 0000000000000000

The buggy address belongs to the page:
page:ffffea000643c840 count:2 mapcount:0 mapping:ffff8881d9aa8950 index:0x483
flags: 0x4000000000001074(referenced|dirty|lru|active|private)
raw: 4000000000001074 ffff8881d9aa8950 0000000000000483 00000002ffffffff
raw: ffffea00064b1ce0 ffffea000643b4e0 ffff88818fa31498 ffff8881da81aa80
page dumped because: kasan: bad access detected
page->mem_cgroup:ffff8881da81aa80

Memory state around the buggy address:
 ffff888190f21f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff888190f21f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff888190f22000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                   ^
 ffff888190f22080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff888190f22100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/12/28 01:14 android-4.14 815e34f802d8 af317504 .config console log report ci-android-414-kasan-gce-root
2018/12/11 20:44 android-4.14 e525d2cfbe65 7795ae03 .config console log report ci-android-414-kasan-gce-root
2018/11/02 21:33 android-4.14 4ed22187defd 8bd6bd63 .config console log report ci-android-414-kasan-gce-root
2018/10/25 18:06 android-4.14 4ed22187defd a8292de9 .config console log report ci-android-414-kasan-gce-root
* Struck through repros no longer work on HEAD.