syzbot


KASAN: use-after-free Write in ext2_try_to_allocate

Status: upstream: reported C repro on 2026/02/21 21:48
Reported-by: syzbot+8a47e292db85a3b20c76@syzkaller.appspotmail.com
First crash: 9d04h, last: 9d01h
Bug presence (1)
Date Name Commit Repro Result
2026/02/22 upstream (ToT) 32a92f8c8932 C Failed due to an error; will retry later

Sample crash report:
loop0: detected capacity change from 0 to 512
EXT2-fs (loop0): nobh option not supported
EXT2-fs (loop0): warning: mounting ext3 filesystem as ext2
==================================================================
BUG: KASAN: use-after-free in instrument_atomic_read_write include/linux/instrumented.h:102 [inline]
BUG: KASAN: use-after-free in test_and_set_bit include/asm-generic/bitops/instrumented-atomic.h:71 [inline]
BUG: KASAN: use-after-free in test_and_set_bit_le include/asm-generic/bitops/le.h:46 [inline]
BUG: KASAN: use-after-free in ext2_try_to_allocate+0x2ac/0x898 fs/ext2/balloc.c:707
Write of size 8 at addr ffff0000ee8c4000 by task syz.0.19/4505

CPU: 0 PID: 4505 Comm: syz.0.19 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/03/2025
Call trace:
 dump_backtrace+0x1c0/0x1ec arch/arm64/kernel/stacktrace.c:158
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
 __dump_stack+0x30/0x40 lib/dump_stack.c:88
 dump_stack_lvl+0xf4/0x15c lib/dump_stack.c:106
 print_address_description+0x88/0x218 mm/kasan/report.c:316
 print_report+0x50/0x68 mm/kasan/report.c:420
 kasan_report+0xa8/0xfc mm/kasan/report.c:524
 check_region_inline mm/kasan/generic.c:-1 [inline]
 kasan_check_range+0x258/0x290 mm/kasan/generic.c:189
 __kasan_check_write+0x2c/0x3c mm/kasan/shadow.c:37
 instrument_atomic_read_write include/linux/instrumented.h:102 [inline]
 test_and_set_bit include/asm-generic/bitops/instrumented-atomic.h:71 [inline]
 test_and_set_bit_le include/asm-generic/bitops/le.h:46 [inline]
 ext2_try_to_allocate+0x2ac/0x898 fs/ext2/balloc.c:707
 ext2_try_to_allocate_with_rsv+0x178/0x1234 fs/ext2/balloc.c:1089
 ext2_new_blocks+0x61c/0x1114 fs/ext2/balloc.c:1307
 ext2_alloc_blocks fs/ext2/inode.c:418 [inline]
 ext2_alloc_branch fs/ext2/inode.c:487 [inline]
 ext2_get_blocks+0xb30/0x1b64 fs/ext2/inode.c:730
 ext2_get_block+0xc8/0x3e8 fs/ext2/inode.c:787
 __block_write_begin_int+0x350/0x1388 fs/buffer.c:1991
 __block_write_begin+0x7c/0xa0 fs/buffer.c:2041
 ext2_prepare_chunk fs/ext2/dir.c:460 [inline]
 ext2_make_empty+0xdc/0x844 fs/ext2/dir.c:640
 ext2_mkdir+0x130/0x1e4 fs/ext2/namei.c:251
 vfs_mkdir+0x314/0x4d4 fs/namei.c:4114
 do_mkdirat+0x1b8/0x3ec fs/namei.c:4139
 __do_sys_mkdirat fs/namei.c:4154 [inline]
 __se_sys_mkdirat fs/namei.c:4152 [inline]
 __arm64_sys_mkdirat+0x90/0xa8 fs/namei.c:4152
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2b4 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
 do_el0_svc+0x58/0x130 arch/arm64/kernel/syscall.c:204
 el0_svc+0x58/0x128 arch/arm64/kernel/entry-common.c:637
 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

The buggy address belongs to the physical page:
page:000000001c731562 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x12e8c4
flags: 0x5ffc00000000000(node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000000000 fffffc00037ad588 fffffc0003ba3a88 0000000000000000
raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff0000ee8c3f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff0000ee8c3f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff0000ee8c4000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                   ^
 ffff0000ee8c4080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff0000ee8c4100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (11):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/02/22 01:02 linux-6.1.y 779f9571ac3e 6e7b5511 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro #1 (corrupt fs)] [mounted in repro #2] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Write in ext2_try_to_allocate
2026/02/21 23:54 linux-6.1.y 779f9571ac3e 6e7b5511 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro #1 (corrupt fs)] [mounted in repro #2] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Write in ext2_try_to_allocate
2026/02/21 22:43 linux-6.1.y 779f9571ac3e 6e7b5511 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro #1 (corrupt fs)] [mounted in repro #2] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Write in ext2_try_to_allocate
2026/02/21 22:06 linux-6.1.y 779f9571ac3e 6e7b5511 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Write in ext2_try_to_allocate
2026/02/21 22:03 linux-6.1.y 779f9571ac3e 6e7b5511 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Write in ext2_try_to_allocate
2026/02/21 22:02 linux-6.1.y 779f9571ac3e 6e7b5511 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Write in ext2_try_to_allocate
2026/02/21 22:00 linux-6.1.y 779f9571ac3e 6e7b5511 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Write in ext2_try_to_allocate
2026/02/21 21:59 linux-6.1.y 779f9571ac3e 6e7b5511 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Write in ext2_try_to_allocate
2026/02/21 21:58 linux-6.1.y 779f9571ac3e 6e7b5511 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Write in ext2_try_to_allocate
2026/02/21 21:47 linux-6.1.y 779f9571ac3e 6e7b5511 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Write in ext2_try_to_allocate
2026/02/21 21:47 linux-6.1.y 779f9571ac3e 6e7b5511 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Write in ext2_try_to_allocate
* Struck through repros no longer work on HEAD.