syzbot


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

Status: upstream: reported C repro on 2020/10/28 15:08
Reported-by: syzbot+4b7d3ef81b4049017236@syzkaller.appspotmail.com
First crash: 759d, last: 274d

Fix bisection: failed (bisect log)
similar bugs (12):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-414 KASAN: use-after-free Read in ext4_xattr_set_entry (2) 6 1122d 1178d 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 979d 979d 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 440d 898d 1/1 fixed on 2021/10/13 07:23
upstream KASAN: use-after-free Read in ext4_xattr_set_entry 1 1583d 1583d 0/24 closed as invalid on 2018/07/29 11:55
android-414 KASAN: use-after-free Read in ext4_xattr_set_entry 4 1430d 1323d 0/1 auto-closed as invalid on 2019/06/26 01:15
upstream KASAN: use-after-free Read in ext4_xattr_set_entry (5) 2 124d 183d 0/24 auto-obsoleted due to no activity on 2022/11/22 17:19
upstream KASAN: use-after-free Read in ext4_xattr_set_entry (3) 4 875d 993d 0/24 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 1002d 1250d 1/1 fixed on 2020/03/30 09:03
upstream KASAN: use-after-free Read in ext4_xattr_set_entry (4) C error done 21 278d 665d 22/24 fixed on 2022/03/28 10:17
upstream KASAN: use-after-free Read in ext4_xattr_set_entry (2) C done 19 1076d 1485d 16/24 fixed on 2020/02/14 01:19
android-54 KASAN: use-after-free Read in ext4_xattr_set_entry 6 842d 1023d 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 1030d 1122d 1/1 fixed on 2020/03/01 21:06
Patch testing requests:
Created Duration User Patch Repo Result
2022/10/02 09:30 9m linux-4.14.y report log

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in ext4_xattr_set_entry+0x30cb/0x30f0 fs/ext4/xattr.c:1603
Read of size 4 at addr ffff88808ba45004 by task syz-executor268/8668

CPU: 0 PID: 8668 Comm: syz-executor268 Not tainted 4.14.202-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+0x1b2/0x283 lib/dump_stack.c:58
 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
 kasan_report_error.cold+0x8a/0x194 mm/kasan/report.c:351
 kasan_report mm/kasan/report.c:409 [inline]
 __asan_report_load4_noabort+0x68/0x70 mm/kasan/report.c:429
 ext4_xattr_set_entry+0x30cb/0x30f0 fs/ext4/xattr.c:1603
 ext4_xattr_ibody_set+0x73/0x280 fs/ext4/xattr.c:2242
 ext4_xattr_set_handle+0x4d0/0xd20 fs/ext4/xattr.c:2398
 ext4_xattr_set+0x118/0x230 fs/ext4/xattr.c:2510
 __vfs_setxattr+0xdc/0x130 fs/xattr.c:150
 __vfs_setxattr_noperm+0xfd/0x3d0 fs/xattr.c:181
 __vfs_setxattr_locked+0x14d/0x250 fs/xattr.c:239
 vfs_setxattr+0xcf/0x230 fs/xattr.c:256
 setxattr+0x1a9/0x300 fs/xattr.c:523
 path_setxattr+0x118/0x130 fs/xattr.c:542
 SYSC_setxattr fs/xattr.c:557 [inline]
 SyS_setxattr+0x36/0x50 fs/xattr.c:553
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x445ba9
RSP: 002b:00007ffeb05e9d18 EFLAGS: 00000246 ORIG_RAX: 00000000000000bc
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000445ba9
RDX: 0000000000000000 RSI: 0000000020000140 RDI: 0000000020000100
RBP: 0000000001a18c30 R08: 0000000000000001 R09: 0000006e0000005b
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffeb05e9d90
R13: 0000000000000044 R14: 0000000000000000 R15: 0000000000000000

The buggy address belongs to the page:
page:ffffea00022e9140 count:0 mapcount:0 mapping:          (null) index:0x1
flags: 0xfff00000000000()
raw: 00fff00000000000 0000000000000000 0000000000000001 00000000ffffffff
raw: ffffea00022ed960 ffffea00022ea8e0 0000000000000000 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88808ba44f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff88808ba44f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88808ba45000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                   ^
 ffff88808ba45080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88808ba45100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (1):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-linux-4-14 2020/10/28 15:08 linux-4.14.y 5b7a52cd2eef 96e03c1c .config log report syz C
* Struck through repros no longer work on HEAD.