syzbot
KASAN: use-after-free Read in ext4_ext_remove_space
Status:
upstream: reported C repro on 2025/07/20 13:48
Bug presence:
origin:upstream
[Documentation on labels]
Reported-by: syzbot+8ecc8500ff5712c63801@syzkaller.appspotmail.com
First crash: 462d, last: 1d18h
▶
▼
Bug presence (2)
| Date |
Name |
Commit |
Repro |
Result |
| 2026/10/08 |
lts (merge base) |
090666d3cc90 |
C
|
[report] KASAN: use-after-free Read in ext4_ext_remove_space
|
| 2026/10/08 |
upstream (ToT) |
0c2669a9f4a1 |
C
|
[report] KASAN: use-after-free Read in ext4_ext_remove_space
|
▶
▼
Last patch testing requests (1)
▶
▼
Fix bisection attempts (2)
Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in ext4_ext_rm_leaf fs/ext4/extents.c:2602 [inline]
BUG: KASAN: slab-out-of-bounds in ext4_ext_remove_space+0x348b/0x40d0 fs/ext4/extents.c:2940
Read of size 4 at addr ffff888109a1b69c by task syz.3.380/1526
CPU: 0 PID: 1526 Comm: syz.3.380 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/09/2026
Call Trace:
<TASK>
__dump_stack+0x21/0x24 lib/dump_stack.c:88
dump_stack_lvl+0x110/0x170 lib/dump_stack.c:106
print_address_description+0x71/0x200 mm/kasan/report.c:316
print_report+0x4a/0x60 mm/kasan/report.c:420
kasan_report+0x122/0x150 mm/kasan/report.c:524
__asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:350
ext4_ext_rm_leaf fs/ext4/extents.c:2602 [inline]
ext4_ext_remove_space+0x348b/0x40d0 fs/ext4/extents.c:2940
ext4_ext_truncate+0x200/0x320 fs/ext4/extents.c:4476
ext4_truncate+0x9be/0xfb0 fs/ext4/inode.c:4304
ext4_setattr+0x1249/0x1bb0 fs/ext4/inode.c:5670
notify_change+0xcc3/0xf80 fs/attr.c:499
do_truncate+0x1ac/0x240 fs/open.c:66
handle_truncate fs/namei.c:3292 [inline]
do_open fs/namei.c:3637 [inline]
path_openat+0x28f0/0x2f80 fs/namei.c:3790
do_filp_open+0x1f1/0x430 fs/namei.c:3817
do_sys_openat2+0x15e/0x810 fs/open.c:1343
do_sys_open fs/open.c:1359 [inline]
__do_sys_creat fs/open.c:1437 [inline]
__se_sys_creat fs/open.c:1431 [inline]
__x64_sys_creat+0x8e/0xb0 fs/open.c:1431
x64_sys_call+0x116/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:86
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7fef1399ce59
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 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 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fef14917028 EFLAGS: 00000246
ORIG_RAX: 0000000000000055
RAX: ffffffffffffffda RBX: 00007fef13c15fa0 RCX: 00007fef1399ce59
RDX: 0000000000000000 RSI: 0000000000000100 RDI: 0000200000000100
RBP: 00007fef13a32d6f R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fef13c16038 R14: 00007fef13c15fa0 R15: 00007ffc501c6818
</TASK>
Allocated by task 1:
kasan_save_stack mm/kasan/common.c:46 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:53
kasan_save_alloc_info+0x25/0x30 mm/kasan/generic.c:505
____kasan_kmalloc mm/kasan/common.c:380 [inline]
__kasan_kmalloc+0x95/0xb0 mm/kasan/common.c:389
kasan_kmalloc include/linux/kasan.h:212 [inline]
__do_kmalloc_node mm/slab_common.c:938 [inline]
__kmalloc_node_track_caller+0xb1/0x1e0 mm/slab_common.c:958
kstrdup mm/util.c:66 [inline]
kstrdup_const+0x5a/0xa0 mm/util.c:89
kvasprintf_const+0xd7/0x240 lib/kasprintf.c:-1
kobject_set_name_vargs+0x61/0x110 lib/kobject.c:265
dev_set_name+0xdf/0x130 drivers/base/core.c:3486
tty_register_device_attr+0x3c7/0x990 drivers/tty/tty_io.c:3244
tty_register_device drivers/tty/tty_io.c:3185 [inline]
tty_register_driver+0x59a/0xb20 drivers/tty/tty_io.c:3449
vty_init+0x23a/0x33c drivers/tty/vt/vt.c:3615
tty_init+0x138/0x178 drivers/tty/tty_io.c:3604
chr_dev_init+0x145/0x14c drivers/char/mem.c:784
do_one_initcall+0x1d6/0x580 init/main.c:1433
do_initcall_level+0x16f/0x2d0 init/main.c:1506
do_initcalls+0x50/0x92 init/main.c:1522
do_basic_setup+0x92/0x99 init/main.c:1541
kernel_init_freeable+0x2d1/0x424 init/main.c:1761
kernel_init+0x1d/0x1c0 init/main.c:1649
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
The buggy address belongs to the object at ffff888109a1b690
which belongs to the cache kmalloc-8 of size 8
The buggy address is located 4 bytes to the right of
8-byte region [ffff888109a1b690, ffff888109a1b698)
The buggy address belongs to the physical page:
page:ffffea00042686c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888109a1bc58 pfn:0x109a1b
flags: 0x4000000000000200(slab|zone=1)
raw: 4000000000000200 ffffea0004c5c7c8 ffffea000489f908 ffff888100042300
raw: ffff888109a1bc58 000000000066005d 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 1, tgid 1 (swapper/0), ts 1640206480, free_ts 0
set_page_owner include/linux/page_owner.h:33 [inline]
post_alloc_hook+0x1f5/0x210 mm/page_alloc.c:2672
prep_new_page+0x1c/0x110 mm/page_alloc.c:2679
get_page_from_freelist+0x2d12/0x2d80 mm/page_alloc.c:4585
__alloc_pages+0x1fa/0x610 mm/page_alloc.c:5929
alloc_slab_page+0x6e/0xf0 include/linux/gfp.h:-1
allocate_slab mm/slub.c:1967 [inline]
new_slab+0x98/0x3d0 mm/slub.c:2020
___slab_alloc+0x6bd/0xb20 mm/slub.c:3177
__slab_alloc+0x5e/0xa0 mm/slub.c:3263
slab_alloc_node mm/slub.c:3348 [inline]
__kmem_cache_alloc_node+0x203/0x2c0 mm/slub.c:3423
__do_kmalloc_node mm/slab_common.c:937 [inline]
__kmalloc_node_track_caller+0xa0/0x1e0 mm/slab_common.c:958
kstrdup mm/util.c:66 [inline]
kstrdup_const+0x5a/0xa0 mm/util.c:89
__kernfs_new_node+0xa8/0x6b0 fs/kernfs/dir.c:610
kernfs_new_node+0x150/0x260 fs/kernfs/dir.c:690
kernfs_create_link+0xa4/0x200 fs/kernfs/symlink.c:39
sysfs_do_create_link_sd+0x8a/0x110 fs/sysfs/symlink.c:44
sysfs_do_create_link fs/sysfs/symlink.c:80 [inline]
sysfs_create_link+0x68/0x80 fs/sysfs/symlink.c:92
page_owner free stack trace missing
Memory state around the buggy address:
ffff888109a1b580: fc fc fc fc 06 fc fc fc fc 06 fc fc fc fc fa fc
ffff888109a1b600: fc fc fc 06 fc fc fc fc 03 fc fc fc fc 06 fc fc
>ffff888109a1b680: fc fc 06 fc fc fc fc fa fc fc fc fc 05 fc fc fc
^
ffff888109a1b700: fc fb fc fc fc fc fa fc fc fc fc 05 fc fc fc fc
ffff888109a1b780: 06 fc fc fc fc 05 fc fc fc fc 04 fc fc fc fc 04
==================================================================
EXT4-fs error (device loop3): ext4_free_blocks:6220: comm syz.3.380: Freeing blocks not in datazone - block = 0, count = 0
EXT4-fs error (device loop3): ext4_free_blocks:6220: comm syz.3.380: Freeing blocks not in datazone - block = 1, count = 55
* Struck through repros no longer work on HEAD.