================================================================== BUG: KASAN: use-after-free in ext4_ext_rm_leaf fs/ext4/extents.c:2627 [inline] BUG: KASAN: use-after-free in ext4_ext_remove_space+0x276c/0x37c8 fs/ext4/extents.c:2965 Read of size 4 at addr ffff0000e86e7c18 by task syz-executor/6521 CPU: 1 UID: 0 PID: 6521 Comm: syz-executor Not tainted 6.16.0-rc2-syzkaller-g9aa9b43d689e #0 PREEMPT Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call trace: show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:501 (C) __dump_stack+0x30/0x40 lib/dump_stack.c:94 dump_stack_lvl+0xd8/0x12c lib/dump_stack.c:120 print_address_description+0xa8/0x254 mm/kasan/report.c:408 print_report+0x68/0x84 mm/kasan/report.c:521 kasan_report+0xb0/0x110 mm/kasan/report.c:634 __asan_report_load4_noabort+0x20/0x2c mm/kasan/report_generic.c:380 ext4_ext_rm_leaf fs/ext4/extents.c:2627 [inline] ext4_ext_remove_space+0x276c/0x37c8 fs/ext4/extents.c:2965 ext4_ext_truncate+0x134/0x1d0 fs/ext4/extents.c:4484 ext4_truncate+0x9c4/0xfe0 fs/ext4/inode.c:4574 ext4_evict_inode+0x9b4/0x104c fs/ext4/inode.c:261 evict+0x414/0x928 fs/inode.c:810 iput_final fs/inode.c:1898 [inline] iput+0x6e4/0x83c fs/inode.c:1924 do_unlinkat+0x338/0x4dc fs/namei.c:4657 __do_sys_unlinkat fs/namei.c:4691 [inline] __se_sys_unlinkat fs/namei.c:4684 [inline] __arm64_sys_unlinkat+0xdc/0xf8 fs/namei.c:4684 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x58/0x17c arch/arm64/kernel/entry-common.c:767 el0t_64_sync_handler+0x78/0x108 arch/arm64/kernel/entry-common.c:786 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xab pfn:0x1286e7 flags: 0x5ffc00000000000(node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000000000 fffffdffc3a1ba08 fffffdffc3a1b988 0000000000000000 raw: 00000000000000ab 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000e86e7b00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff0000e86e7b80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff0000e86e7c00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff0000e86e7c80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff0000e86e7d00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== EXT4-fs (loop2): unmounting filesystem 00000000-0000-0000-0000-000000000000. bcachefs (loop2): shutting down bcachefs (loop2): going read-only bcachefs (loop2): finished waiting for writes to stop bcachefs (loop2): flushing journal and stopping allocators, journal seq 2 bcachefs (loop2): flushing journal and stopping allocators complete, journal seq 3 bcachefs (loop2): clean shutdown complete, journal seq 4 bcachefs (loop2): marking filesystem clean bcachefs (loop2): shutdown complete