================================================================== BUG: KASAN: use-after-free in ext4_ext_rm_leaf fs/ext4/extents.c:2601 [inline] BUG: KASAN: use-after-free in ext4_ext_remove_space+0x3496/0x40d0 fs/ext4/extents.c:2939 Read of size 4 at addr ffff88811646e69c by task syz.2.39/462 CPU: 0 PID: 462 Comm: syz.2.39 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/18/2026 Call Trace: __dump_stack+0x21/0x30 lib/dump_stack.c:88 dump_stack_lvl+0x110/0x170 lib/dump_stack.c:106 print_address_description+0x7f/0x2c0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:427 [inline] kasan_report+0xf1/0x140 mm/kasan/report.c:444 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308 ext4_ext_rm_leaf fs/ext4/extents.c:2601 [inline] ext4_ext_remove_space+0x3496/0x40d0 fs/ext4/extents.c:2939 ext4_ext_truncate+0x1a3/0x250 fs/ext4/extents.c:4489 ext4_truncate+0x9be/0xfb0 fs/ext4/inode.c:4294 ext4_setattr+0x10cc/0x1ac0 fs/ext4/inode.c:5651 notify_change+0xbca/0xe90 fs/attr.c:505 do_truncate+0x1ac/0x240 fs/open.c:66 handle_truncate fs/namei.c:3273 [inline] do_open fs/namei.c:3620 [inline] path_openat+0x2895/0x2f20 fs/namei.c:3750 do_filp_open+0x1e2/0x410 fs/namei.c:3777 do_sys_openat2+0x15e/0x7f0 fs/open.c:1236 do_sys_open fs/open.c:1252 [inline] __do_sys_creat fs/open.c:1328 [inline] __se_sys_creat fs/open.c:1322 [inline] __x64_sys_creat+0x8e/0xb0 fs/open.c:1322 x64_sys_call+0x94a/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:86 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7ff251503e59 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:00007ff251366028 EFLAGS: 00000246 ORIG_RAX: 0000000000000055 RAX: ffffffffffffffda RBX: 00007ff25177cfa0 RCX: 00007ff251503e59 RDX: 0000000000000000 RSI: 0000000000000100 RDI: 0000200000000100 RBP: 00007ff251599d6f R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ff25177d038 R14: 00007ff25177cfa0 R15: 00007fffd77f69d8 Allocated by task 101: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:433 [inline] ____kasan_kmalloc mm/kasan/common.c:512 [inline] __kasan_kmalloc+0xda/0x110 mm/kasan/common.c:521 kasan_kmalloc include/linux/kasan.h:227 [inline] __kmalloc+0x13d/0x2c0 mm/slub.c:4436 __kmalloc_node include/linux/slab.h:487 [inline] kmalloc_node include/linux/slab.h:642 [inline] kvmalloc_node+0x211/0x320 mm/util.c:621 kvmalloc include/linux/mm.h:862 [inline] seq_buf_alloc fs/seq_file.c:38 [inline] seq_read_iter+0x1fc/0xd30 fs/seq_file.c:210 kernfs_fop_read_iter+0x147/0x470 fs/kernfs/file.c:241 call_read_iter include/linux/fs.h:2206 [inline] new_sync_read fs/read_write.c:404 [inline] vfs_read+0x6c9/0xc40 fs/read_write.c:485 ksys_read+0x149/0x250 fs/read_write.c:623 __do_sys_read fs/read_write.c:633 [inline] __se_sys_read fs/read_write.c:631 [inline] __x64_sys_read+0x7b/0x90 fs/read_write.c:631 x64_sys_call+0x96d/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:1 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Freed by task 101: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4a/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x125/0x160 mm/kasan/common.c:365 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:373 kasan_slab_free include/linux/kasan.h:193 [inline] slab_free_hook mm/slub.c:1728 [inline] slab_free_freelist_hook+0xc2/0x190 mm/slub.c:1754 slab_free mm/slub.c:3526 [inline] kfree+0xc4/0x270 mm/slub.c:4588 kvfree+0x35/0x40 mm/util.c:661 seq_release+0x57/0x70 fs/seq_file.c:355 kernfs_fop_release+0x1af/0x250 fs/kernfs/file.c:761 __fput+0x20b/0x8b0 fs/file_table.c:311 ____fput+0x15/0x20 fs/file_table.c:339 task_work_run+0x127/0x190 kernel/task_work.c:188 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0xd0/0xe0 kernel/entry/common.c:181 exit_to_user_mode_prepare+0x87/0xd0 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x1a/0x30 kernel/entry/common.c:307 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 The buggy address belongs to the object at ffff88811646e000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 1692 bytes inside of 4096-byte region [ffff88811646e000, ffff88811646f000) The buggy address belongs to the page: page:ffffea0004591a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x116468 head:ffffea0004591a00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head|zone=1) raw: 4000000000010200 dead000000000100 dead000000000122 ffff888100043380 raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 113, ts 4515699435, free_ts 0 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x192/0x1b0 mm/page_alloc.c:2605 prep_new_page+0x1c/0x110 mm/page_alloc.c:2611 get_page_from_freelist+0x2d3a/0x2dc0 mm/page_alloc.c:4485 __alloc_pages+0x1a2/0x460 mm/page_alloc.c:5822 alloc_slab_page mm/slub.c:-1 [inline] allocate_slab mm/slub.c:1937 [inline] new_slab+0xa1/0x4d0 mm/slub.c:2000 ___slab_alloc+0x381/0x810 mm/slub.c:3033 __slab_alloc+0x49/0x90 mm/slub.c:3120 slab_alloc_node mm/slub.c:3211 [inline] slab_alloc mm/slub.c:3255 [inline] kmem_cache_alloc_trace+0x146/0x270 mm/slub.c:3272 kmalloc include/linux/slab.h:619 [inline] kzalloc include/linux/slab.h:750 [inline] kobject_uevent_env+0x272/0x700 lib/kobject_uevent.c:539 kobject_synth_uevent+0x57e/0xbc0 lib/kobject_uevent.c:208 uevent_store+0x25/0x60 drivers/base/core.c:2438 dev_attr_store+0x5e/0x80 drivers/base/core.c:2136 sysfs_kf_write+0x129/0x150 fs/sysfs/file.c:139 kernfs_fop_write_iter+0x2c5/0x400 fs/kernfs/file.c:296 call_write_iter include/linux/fs.h:2212 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0x835/0xfd0 fs/read_write.c:594 ksys_write+0x149/0x250 fs/read_write.c:647 page_owner free stack trace missing Memory state around the buggy address: ffff88811646e580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88811646e600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88811646e680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88811646e700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88811646e780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================