syzbot


KASAN: use-after-free Read in ext4_xattr_set_entry (3)

Status: auto-closed as invalid on 2020/11/02 08:32
Subsystems: ext4
[Documentation on labels]
Reported-by: syzbot+15fbdaa8666ea08754f4@syzkaller.appspotmail.com
First crash: 1510d, last: 1391d
Discussions (1)
Title Replies (including bot) Last reply
KASAN: use-after-free Read in ext4_xattr_set_entry (3) 0 (1) 2020/03/09 05:43
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 791d 1276d 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 1639d 1695d 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 1496d 1496d 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 957d 1415d 1/1 fixed on 2021/10/13 07:23
upstream KASAN: use-after-free Read in ext4_xattr_set_entry ext4 1 2100d 2100d 0/26 closed as invalid on 2018/07/29 11:55
android-414 KASAN: use-after-free Read in ext4_xattr_set_entry 4 1947d 1840d 0/1 auto-closed as invalid on 2019/06/26 01:15
upstream KASAN: use-after-free Read in ext4_xattr_set_entry (5) ext4 2 641d 699d 0/26 auto-obsoleted due to no activity on 2022/11/22 17:19
linux-4.19 KASAN: use-after-free Read in ext4_xattr_set_entry syz done 10 1519d 1767d 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 795d 1182d 20/26 fixed on 2022/03/28 10:17
upstream KASAN: use-after-free Read in ext4_xattr_set_entry (2) ext4 C done 19 1593d 2002d 15/26 fixed on 2020/02/14 01:19
android-54 KASAN: use-after-free Read in ext4_xattr_set_entry 6 1359d 1540d 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 1547d 1639d 1/1 fixed on 2020/03/01 21:06

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in memmove include/linux/string.h:421 [inline]
BUG: KASAN: use-after-free in ext4_xattr_set_entry+0xb72/0x37b0 fs/ext4/xattr.c:1718
Read of size 4 at addr ffff888077fd6ffe by task syz-executor.2/24792

CPU: 0 PID: 24792 Comm: syz-executor.2 Not tainted 5.8.0-rc3-syzkaller #0
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+0x18f/0x20d lib/dump_stack.c:118
 print_address_description.constprop.0.cold+0xae/0x436 mm/kasan/report.c:383
 __kasan_report mm/kasan/report.c:513 [inline]
 kasan_report.cold+0x1f/0x37 mm/kasan/report.c:530
 check_memory_region_inline mm/kasan/generic.c:186 [inline]
 check_memory_region+0x13d/0x180 mm/kasan/generic.c:192
 memmove+0x20/0x60 mm/kasan/common.c:94
 memmove include/linux/string.h:421 [inline]
 ext4_xattr_set_entry+0xb72/0x37b0 fs/ext4/xattr.c:1718
 ext4_xattr_ibody_set+0x78/0x2b0 fs/ext4/xattr.c:2223
 ext4_xattr_set_handle+0x8f9/0x1140 fs/ext4/xattr.c:2379
 ext4_initxattrs+0xb5/0x120 fs/ext4/xattr_security.c:43
 security_inode_init_security+0x1c4/0x370 security/security.c:1052
 __ext4_new_inode+0x43bb/0x5390 fs/ext4/ialloc.c:1175
 ext4_symlink+0x4b0/0xe10 fs/ext4/namei.c:3303
 vfs_symlink fs/namei.c:3953 [inline]
 vfs_symlink+0x453/0x6a0 fs/namei.c:3939
 do_symlinkat+0x258/0x2c0 fs/namei.c:3980
 do_syscall_64+0x60/0xe0 arch/x86/entry/common.c:359
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x45c8b7
Code: Bad RIP value.
RSP: 002b:00007ffd455ab9f8 EFLAGS: 00000202 ORIG_RAX: 0000000000000058
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000045c8b7
RDX: 00007ffd455aba97 RSI: 00000000004c268b RDI: 00007ffd455aba80
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000017
R10: 0000000000000075 R11: 0000000000000202 R12: 0000000000000001
R13: 00007ffd455aba30 R14: 0000000000000000 R15: 00007ffd455aba40

The buggy address belongs to the page:
page:ffffea0001dff580 refcount:2 mapcount:0 mapping:0000000091409f46 index:0x421
mapping->a_ops:def_blk_aops
flags: 0xfffe000000203a(referenced|dirty|lru|active|private)
raw: 00fffe000000203a ffffea000198e508 ffffea00016b3ac8 ffff888217d0aba0
raw: 0000000000000421 ffff888047e20868 00000002ffffffff ffff88821bbbc000
page dumped because: kasan: bad access detected
page->mem_cgroup:ffff88821bbbc000

Memory state around the buggy address:
 ffff888077fd6f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff888077fd6f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff888077fd7000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                   ^
 ffff888077fd7080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff888077fd7100: 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
2020/07/05 08:31 upstream 7cc2a8ea1048 51095195 .config console log report ci-upstream-kasan-gce-selinux-root
2020/06/29 19:26 upstream 4e99b32169e8 a2cdad9d .config console log report ci-upstream-kasan-gce-selinux-root
2020/04/28 06:57 upstream 51184ae37e05 0ce7569e .config console log report ci-upstream-kasan-gce-smack-root
2020/03/08 14:27 upstream c20037652700 2e9971bb .config console log report ci-upstream-kasan-gce-root
* Struck through repros no longer work on HEAD.