syzbot


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

Status: fixed on 2022/03/28 10:17
Subsystems: ext4
[Documentation on labels]
Reported-by: syzbot+4cb1e27475bf90a9b926@syzkaller.appspotmail.com
Fix commit: 6e47a3cc68fc ext4: get rid of super block and sbi from handle_mount_ops()
First crash: 1179d, last: 788d
Cause bisection: failed (error log, bisect log)
  
Fix bisection: fixed by (bisect log) :
commit 6e47a3cc68fc525428297a00524833361ebbb0e9
Author: Lukas Czerner <lczerner@redhat.com>
Date: Wed Oct 27 14:18:52 2021 +0000

  ext4: get rid of super block and sbi from handle_mount_ops()

  
Discussions (1)
Title Replies (including bot) Last reply
KASAN: use-after-free Read in ext4_xattr_set_entry (4) 3 (5) 2022/03/29 12:01
Similar bugs (23)
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 784d 1269d 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 1632d 1688d 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 1488d 1488d 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 950d 1408d 1/1 fixed on 2021/10/13 07:23
upstream KASAN: use-after-free Read in ext4_xattr_set_entry ext4 1 2093d 2093d 0/26 closed as invalid on 2018/07/29 11:55
android-414 KASAN: use-after-free Read in ext4_xattr_set_entry 4 1939d 1832d 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 634d 692d 0/26 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 1384d 1502d 0/26 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 1511d 1760d 1/1 fixed on 2020/03/30 09:03
upstream KASAN: use-after-free Read in ext4_xattr_set_entry (2) ext4 C done 19 1586d 1995d 15/26 fixed on 2020/02/14 01:19
android-54 KASAN: use-after-free Read in ext4_xattr_set_entry 6 1352d 1533d 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 1540d 1632d 1/1 fixed on 2020/03/01 21:06
android-5-15 general protection fault in ext4_xattr_set_entry C error 1 414d 494d 2/2 fixed on 2023/03/28 12:29
android-5-15 KASAN: out-of-bounds Read in ext4_xattr_set_entry 1 305d 305d 0/2 auto-obsoleted due to no activity on 2023/09/17 07:02
android-5-10 general protection fault in ext4_xattr_set_entry (4) C error 62 317d 346d 2/2 fixed on 2023/06/07 17:22
android-5-10 general protection fault in ext4_xattr_set_entry (2) ext4 C error 423 352d 552d 2/2 fixed on 2023/05/03 13:06
android-54 KASAN: out-of-bounds Read in ext4_xattr_set_entry ext4 C 14 359d 1125d 0/2 auto-obsoleted due to no activity on 2023/08/23 09:06
android-5-10 general protection fault in ext4_xattr_set_entry (3) C error 9 348d 351d 2/2 fixed on 2023/05/08 19:06
linux-6.1 KASAN: out-of-bounds Read in ext4_xattr_set_entry origin:upstream missing-backport syz unreliable 1 305d 336d 0/3 upstream: reported syz repro on 2023/05/19 08:42
android-5-10 general protection fault in ext4_xattr_set_entry C error 2 575d 589d 0/2 closed as invalid on 2022/09/26 18:30
android-5-10 KASAN: out-of-bounds Read in ext4_xattr_set_entry C 1 2d23h 212d 0/2 upstream: reported C repro on 2023/09/20 02:40
linux-4.14 KASAN: out-of-bounds Read in ext4_xattr_set_entry C error 2 589d 1103d 0/1 upstream: reported C repro on 2021/04/12 14:20
android-5-10 general protection fault in ext4_xattr_set_entry (5) C done 11 314d 316d 2/2 fixed on 2023/06/13 02:27
Last patch testing requests (1)
Created Duration User Patch Repo Result
2021/06/30 07:46 9m wanjiabing@vivo.com linux-next report log
Fix bisection attempts (9)
Created Duration User Patch Repo Result
2022/03/23 10:03 5h02m bisect fix upstream job log (1)
2021/12/11 20:29 33m bisect fix upstream job log (0) log
2021/10/05 04:01 18m bisect fix upstream job log (0) log
2021/08/23 02:38 18m bisect fix upstream job log (0) log
2021/07/24 02:19 18m bisect fix upstream job log (0) log
2021/06/23 20:18 19m bisect fix upstream job log (0) log
2021/05/24 19:24 19m bisect fix upstream job log (0) log
2021/04/24 18:46 20m bisect fix upstream job log (0) log
2021/03/03 17:51 35m bisect fix upstream job log (0) log

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in ext4_xattr_set_entry+0x3151/0x3780 fs/ext4/xattr.c:1586
Read of size 4 at addr ffff888030c00004 by task syz-executor392/11280

CPU: 0 PID: 11280 Comm: syz-executor392 Not tainted 5.11.0-rc5-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:79 [inline]
 dump_stack+0x107/0x163 lib/dump_stack.c:120
 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:230
 __kasan_report mm/kasan/report.c:396 [inline]
 kasan_report.cold+0x79/0xd5 mm/kasan/report.c:413
 ext4_xattr_set_entry+0x3151/0x3780 fs/ext4/xattr.c:1586
 ext4_xattr_ibody_set+0x78/0x2b0 fs/ext4/xattr.c:2224
 ext4_xattr_set_handle+0x8f4/0x13e0 fs/ext4/xattr.c:2380
 ext4_xattr_set+0x13a/0x340 fs/ext4/xattr.c:2493
 __vfs_setxattr+0x10e/0x170 fs/xattr.c:177
 __vfs_setxattr_noperm+0x11a/0x4c0 fs/xattr.c:208
 __vfs_setxattr_locked+0x1bf/0x250 fs/xattr.c:266
 vfs_setxattr+0x135/0x320 fs/xattr.c:291
 setxattr+0x1ff/0x290 fs/xattr.c:553
 path_setxattr+0x170/0x190 fs/xattr.c:572
 __do_sys_setxattr fs/xattr.c:587 [inline]
 __se_sys_setxattr fs/xattr.c:583 [inline]
 __x64_sys_setxattr+0xc0/0x160 fs/xattr.c:583
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x445589
Code: e8 4c b3 02 00 48 83 c4 18 c3 0f 1f 80 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 0b cc fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fffdf5f9b28 EFLAGS: 00000246 ORIG_RAX: 00000000000000bc
RAX: ffffffffffffffda RBX: 0000000000000016 RCX: 0000000000445589
RDX: 0000000000000000 RSI: 0000000020000140 RDI: 0000000020000100
RBP: 0000000001a18c30 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000000073d
R13: 00007fffdf5f9ba0 R14: 0000000000000000 R15: 0000000000000000

The buggy address belongs to the page:
page:00000000f7ed6945 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x1 pfn:0x30c00
flags: 0xfff00000000000()
raw: 00fff00000000000 ffffea0000c56508 ffffea0000c17d88 0000000000000000
raw: 0000000000000001 0000000000000001 00000000ffffff7f 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888030bfff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff888030bfff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff888030c00000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                   ^
 ffff888030c00080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff888030c00100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (21):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/01/26 10:55 upstream f8ad8187c3b5 52e37319 .config console log report syz C ci-upstream-kasan-gce-root KASAN: use-after-free Read in ext4_xattr_set_entry
2021/03/25 13:43 linux-next 20f1b5f9c07c 607e3baf .config console log report syz C ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in ext4_xattr_set_entry
2022/02/21 10:03 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 64a19591a293 3cd800e4 .config console log report info ci-qemu2-riscv64 KASAN: use-after-free Read in ext4_xattr_set_entry
2022/01/20 17:43 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 64a19591a293 b838eb76 .config console log report info ci-qemu2-riscv64 KASAN: use-after-free Read in ext4_xattr_set_entry
2022/01/19 13:50 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 64a19591a293 0620189b .config console log report info ci-qemu2-riscv64 KASAN: use-after-free Read in ext4_xattr_set_entry
2022/01/11 04:15 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 64a19591a293 ddb0ab8c .config console log report info ci-qemu2-riscv64 KASAN: use-after-free Read in ext4_xattr_set_entry
2022/01/08 03:21 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 64a19591a293 2ca0d385 .config console log report info ci-qemu2-riscv64 KASAN: use-after-free Read in ext4_xattr_set_entry
2022/01/04 09:07 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 64a19591a293 7f723fbe .config console log report info ci-qemu2-riscv64 KASAN: use-after-free Read in ext4_xattr_set_entry
2021/12/31 22:30 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 64a19591a293 e1768e9c .config console log report info ci-qemu2-riscv64 KASAN: use-after-free Read in ext4_xattr_set_entry
2021/12/31 08:45 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 64a19591a293 36bd2e48 .config console log report info ci-qemu2-riscv64 KASAN: use-after-free Read in ext4_xattr_set_entry
2021/12/26 11:57 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 64a19591a293 e4f103c4 .config console log report info ci-qemu2-riscv64 KASAN: use-after-free Read in ext4_xattr_set_entry
2021/12/15 21:18 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 64a19591a293 572bcb40 .config console log report info ci-qemu2-riscv64 KASAN: use-after-free Read in ext4_xattr_set_entry
2021/11/10 22:26 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 64a19591a293 75b04091 .config console log report info ci-qemu2-riscv64 KASAN: use-after-free Read in ext4_xattr_set_entry
2021/10/26 19:12 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 3ef6ca4f354c d50eb50a .config console log report info ci-qemu2-riscv64 KASAN: use-after-free Read in ext4_xattr_set_entry
2022/02/21 09:42 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 64a19591a293 3cd800e4 .config console log report info ci-qemu2-riscv64 KASAN: slab-out-of-bounds Write in ext4_xattr_set_entry
2022/01/28 11:55 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 64a19591a293 495e00c5 .config console log report info ci-qemu2-riscv64 KASAN: slab-out-of-bounds Write in ext4_xattr_set_entry
2021/12/17 03:48 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 64a19591a293 44068e19 .config console log report info ci-qemu2-riscv64 KASAN: slab-out-of-bounds Write in ext4_xattr_set_entry
2021/12/15 21:22 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 64a19591a293 572bcb40 .config console log report info ci-qemu2-riscv64 KASAN: use-after-free Write in ext4_xattr_set_entry
2021/10/26 23:32 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 3ef6ca4f354c d50eb50a .config console log report info ci-qemu2-riscv64 KASAN: slab-out-of-bounds Write in ext4_xattr_set_entry
2021/09/05 03:58 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 7d2a07b76933 d236a457 .config console log report info ci-qemu2-riscv64 KASAN: slab-out-of-bounds Write in ext4_xattr_set_entry
2021/08/29 02:31 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 417166ddec02 be2c130d .config console log report info ci-qemu2-riscv64 KASAN: slab-out-of-bounds Write in ext4_xattr_set_entry
* Struck through repros no longer work on HEAD.