syzbot


KASAN: use-after-free Read in ext4_find_extent

Status: upstream: reported C repro on 2025/02/13 21:05
Reported-by: syzbot+b951e8947d1ece5cb2e9@syzkaller.appspotmail.com
First crash: 123d, last: 25d
Similar bugs (11)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-5-10 KASAN: use-after-free Read in ext4_find_extent ext4 C error inconclusive 36 12d 903d 0/2 upstream: reported C repro on 2022/12/26 07:59
android-6-1 KASAN: use-after-free Read in ext4_find_extent missing-backport C error done 3 232d 729d 0/2 auto-obsoleted due to no activity on 2025/02/04 04:57
linux-5.15 KASAN: use-after-free Read in ext4_find_extent origin:lts-only C inconclusive 7 22d 698d 0/3 upstream: reported C repro on 2023/07/19 14:49
upstream KASAN: use-after-free Read in ext4_find_extent ext4 2 1335d 1396d 0/28 auto-closed as invalid on 2022/02/17 05:19
android-6-1 KASAN: use-after-free Read in ext4_find_extent (2) origin:lts C 2 16d 16d 0/2 upstream: reported C repro on 2025/05/31 08:45
linux-6.1 KASAN: use-after-free Read in ext4_find_extent origin:upstream missing-backport C done 40 1d04h 636d 0/3 upstream: reported C repro on 2023/09/19 00:11
android-5-15 KASAN: use-after-free Read in ext4_find_extent ext4 origin:lts C error 13 16h25m 903d 0/2 upstream: reported C repro on 2022/12/26 07:59
upstream KASAN: use-after-free Read in ext4_find_extent (2) ext4 C error 2 773d 898d 22/28 fixed on 2023/06/08 14:41
upstream KASAN: use-after-free Read in ext4_find_extent (4) ext4 C done 58 1d04h 168d 0/28 upstream: reported C repro on 2024/12/30 20:06
upstream KASAN: use-after-free Read in ext4_find_extent (3) prio:low ext4 C error done 31 538d 720d 25/28 fixed on 2024/01/30 23:26
android-54 KASAN: slab-out-of-bounds Read in ext4_find_extent ext4 C 1 717d 903d 0/2 auto-obsoleted due to no activity on 2023/10/08 03:20
Last patch testing requests (3)
Created Duration User Patch Repo Result
2025/06/06 01:35 18m retest repro android12-5.4 error
2025/05/12 01:54 13m retest repro android12-5.4 error
2025/02/27 21:07 14m retest repro android12-5.4 report log

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in ext4_ext_binsearch fs/ext4/extents.c:871 [inline]
BUG: KASAN: use-after-free in ext4_find_extent+0xc0e/0xe00 fs/ext4/extents.c:991
Read of size 4 at addr ffff8881d8cbedf0 by task syz-executor142/342

CPU: 1 PID: 342 Comm: syz-executor142 Not tainted 5.4.292-syzkaller-00021-gcd8e74fa0fa3 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
Call Trace:
 __dump_stack+0x1e/0x20 lib/dump_stack.c:77
 dump_stack+0x15b/0x1b8 lib/dump_stack.c:118
 print_address_description+0x8d/0x4c0 mm/kasan/report.c:384
 __kasan_report+0xef/0x120 mm/kasan/report.c:516
 kasan_report+0x30/0x60 mm/kasan/common.c:653
 __asan_report_load4_noabort+0x14/0x20 mm/kasan/generic_report.c:131
 ext4_ext_binsearch fs/ext4/extents.c:871 [inline]
 ext4_find_extent+0xc0e/0xe00 fs/ext4/extents.c:991
 ext4_ext_remove_space+0x2de/0x5850 fs/ext4/extents.c:3036
 ext4_punch_hole+0x6b4/0xae0 fs/ext4/inode.c:4492
 ext4_fallocate+0x25d/0x540 fs/ext4/extents.c:4991
 vfs_fallocate+0x587/0x700 fs/open.c:309
 madvise_remove mm/madvise.c:867 [inline]
 madvise_vma mm/madvise.c:950 [inline]
 do_madvise+0xd44/0x1ea0 mm/madvise.c:1172
 __do_sys_madvise mm/madvise.c:1198 [inline]
 __se_sys_madvise mm/madvise.c:1196 [inline]
 __x64_sys_madvise+0xa9/0xc0 mm/madvise.c:1196
 do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x5c/0xc1
RIP: 0033:0x7f3e4c6b7569
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 17 00 00 90 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 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f3e4c675218 EFLAGS: 00000246 ORIG_RAX: 000000000000001c
RAX: ffffffffffffffda RBX: 00007f3e4c73e6c8 RCX: 00007f3e4c6b7569
RDX: 0000000000000009 RSI: 0000000000600002 RDI: 0000200000000000
RBP: 00007f3e4c73e6c0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f3e4c70b554
R13: 0000200000000000 R14: 0000200000000180 R15: 0000200000000080

The buggy address belongs to the page:
page:ffffea0007632f80 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0
flags: 0x8000000000000000()
raw: 8000000000000000 ffffea0007632f88 ffffea0007632f88 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner info is not present (never set?)

Memory state around the buggy address:
 ffff8881d8cbec80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff8881d8cbed00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff8881d8cbed80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                                                             ^
 ffff8881d8cbee00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff8881d8cbee80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
------------[ cut here ]------------
kernel BUG at fs/ext4/extents.c:3390!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 342 Comm: syz-executor142 Tainted: G    B             5.4.292-syzkaller-00021-gcd8e74fa0fa3 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
RIP: 0010:ext4_split_extent_at+0xe85/0xea0 fs/ext4/extents.c:3390
Code: 76 fb ff ff 48 89 df 49 89 f7 e8 46 a2 d4 ff 4c 89 fe e9 63 fb ff ff e8 49 a8 a6 ff 0f 0b e8 42 a8 a6 ff 0f 0b e8 3b a8 a6 ff <0f> 0b e8 34 a8 a6 ff 0f 0b e8 2d a8 a6 ff 0f 0b e8 26 a8 a6 ff 0f
RSP: 0018:ffff8881ee54f520 EFLAGS: 00010293
RAX: ffffffff81b8d6a5 RBX: 000000000000002a RCX: ffff8881f30cbf00
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 000000000000002a
RBP: ffff8881ee54f690 R08: 0000000000000000 R09: 0000000050000028
R10: fffffbfff0ca7a5c R11: 1ffffffff0ca7a5c R12: 0000000000000000
R13: 0000000000000030 R14: 0000000000000030 R15: 0000000000000000
FS:  00007f3e4c6756c0(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055e95b32a00e CR3: 00000001ef623000 CR4: 00000000003406a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 ext4_force_split_extent_at fs/ext4/extents.c:312 [inline]
 ext4_ext_remove_space+0x614/0x5850 fs/ext4/extents.c:3083
 ext4_punch_hole+0x6b4/0xae0 fs/ext4/inode.c:4492
 ext4_fallocate+0x25d/0x540 fs/ext4/extents.c:4991
 vfs_fallocate+0x587/0x700 fs/open.c:309
 madvise_remove mm/madvise.c:867 [inline]
 madvise_vma mm/madvise.c:950 [inline]
 do_madvise+0xd44/0x1ea0 mm/madvise.c:1172
 __do_sys_madvise mm/madvise.c:1198 [inline]
 __se_sys_madvise mm/madvise.c:1196 [inline]
 __x64_sys_madvise+0xa9/0xc0 mm/madvise.c:1196
 do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x5c/0xc1
RIP: 0033:0x7f3e4c6b7569
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 17 00 00 90 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 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f3e4c675218 EFLAGS: 00000246 ORIG_RAX: 000000000000001c
RAX: ffffffffffffffda RBX: 00007f3e4c73e6c8 RCX: 00007f3e4c6b7569
RDX: 0000000000000009 RSI: 0000000000600002 RDI: 0000200000000000
RBP: 00007f3e4c73e6c0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f3e4c70b554
R13: 0000200000000000 R14: 0000200000000180 R15: 0000200000000080
Modules linked in:
---[ end trace cc2a6e4b0b553253 ]---
RIP: 0010:ext4_split_extent_at+0xe85/0xea0 fs/ext4/extents.c:3390
Code: 76 fb ff ff 48 89 df 49 89 f7 e8 46 a2 d4 ff 4c 89 fe e9 63 fb ff ff e8 49 a8 a6 ff 0f 0b e8 42 a8 a6 ff 0f 0b e8 3b a8 a6 ff <0f> 0b e8 34 a8 a6 ff 0f 0b e8 2d a8 a6 ff 0f 0b e8 26 a8 a6 ff 0f
RSP: 0018:ffff8881ee54f520 EFLAGS: 00010293
RAX: ffffffff81b8d6a5 RBX: 000000000000002a RCX: ffff8881f30cbf00
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 000000000000002a
RBP: ffff8881ee54f690 R08: 0000000000000000 R09: 0000000050000028
R10: fffffbfff0ca7a5c R11: 1ffffffff0ca7a5c R12: 0000000000000000
R13: 0000000000000030 R14: 0000000000000030 R15: 0000000000000000
FS:  00007f3e4c6756c0(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055e95b32a00e CR3: 00000001ef623000 CR4: 00000000003406a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/05/22 21:21 android12-5.4 cd8e74fa0fa3 0919b50b .config strace log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] ci2-android-5-4-kasan KASAN: use-after-free Read in ext4_find_extent
2025/02/13 21:03 android12-5.4 39762b7a60e9 a98a8417 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] ci2-android-5-4-kasan KASAN: use-after-free Read in ext4_find_extent
* Struck through repros no longer work on HEAD.