================================================================== BUG: KASAN: use-after-free in ext4_ext_binsearch fs/ext4/extents.c:827 [inline] BUG: KASAN: use-after-free in ext4_find_extent+0xbab/0xdb0 fs/ext4/extents.c:946 Read of size 4 at addr ffff888125206064 by task kworker/u4:2/45 CPU: 1 PID: 45 Comm: kworker/u4:2 Not tainted 5.15.161-syzkaller-1074726-gb92c0d35d015 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Workqueue: writeback wb_workfn (flush-7:0) Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1c0 lib/dump_stack.c:106 print_address_description+0x87/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:427 [inline] kasan_report+0x179/0x1c0 mm/kasan/report.c:444 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308 ext4_ext_binsearch fs/ext4/extents.c:827 [inline] ext4_find_extent+0xbab/0xdb0 fs/ext4/extents.c:946 ext4_ext_map_blocks+0x269/0x74a0 fs/ext4/extents.c:4142 ext4_map_blocks+0xaa7/0x1e00 fs/ext4/inode.c:646 mpage_map_one_extent fs/ext4/inode.c:2409 [inline] mpage_map_and_submit_extent fs/ext4/inode.c:2462 [inline] ext4_writepages+0x1628/0x4000 fs/ext4/inode.c:2830 do_writepages+0x40e/0x670 mm/page-writeback.c:2366 __writeback_single_inode+0xdf/0xa70 fs/fs-writeback.c:1647 writeback_sb_inodes+0xb2a/0x1920 fs/fs-writeback.c:1930 wb_writeback+0x3b9/0x9e0 fs/fs-writeback.c:2104 wb_do_writeback fs/fs-writeback.c:2247 [inline] wb_workfn+0x3d9/0x1110 fs/fs-writeback.c:2288 process_one_work+0x6bb/0xc10 kernel/workqueue.c:2325 worker_thread+0xad5/0x12a0 kernel/workqueue.c:2472 kthread+0x421/0x510 kernel/kthread.c:337 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:300 The buggy address belongs to the page: page:ffffea0004948180 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x125206 flags: 0x4000000000000000(zone=1) raw: 4000000000000000 ffffea0004948188 ffffea0004948188 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: ffff888125205f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888125205f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888125206000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888125206080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888125206100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== ------------[ cut here ]------------ kernel BUG at fs/ext4/inode.c:2421! invalid opcode: 0000 [#1] PREEMPT SMP KASAN CPU: 1 PID: 45 Comm: kworker/u4:2 Tainted: G B 5.15.161-syzkaller-1074726-gb92c0d35d015 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Workqueue: writeback wb_workfn (flush-7:0) RIP: 0010:mpage_map_one_extent fs/ext4/inode.c:2421 [inline] RIP: 0010:mpage_map_and_submit_extent fs/ext4/inode.c:2462 [inline] RIP: 0010:ext4_writepages+0x3f4b/0x4000 fs/ext4/inode.c:2830 Code: 00 74 08 48 89 df e8 c4 cf c9 ff 48 8b 3b 48 8b 74 24 48 48 8b 54 24 28 44 89 e9 45 89 f8 e8 ac 3a 08 00 eb 58 e8 75 9c 87 ff <0f> 0b e8 6e 9c 87 ff eb 3b e8 67 9c 87 ff eb 72 e8 60 9c 87 ff 31 RSP: 0018:ffffc900002ef000 EFLAGS: 00010293 RAX: ffffffff81e8c15b RBX: dffffc0000000000 RCX: ffff8881055c4f00 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc900002ef410 R08: ffffffff81e89b1b R09: ffffed102125de05 R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000000 R13: ffffc900002ef2e0 R14: 0000000000000000 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000c0012c7000 CR3: 0000000119f41000 CR4: 00000000003506a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: do_writepages+0x40e/0x670 mm/page-writeback.c:2366 __writeback_single_inode+0xdf/0xa70 fs/fs-writeback.c:1647 writeback_sb_inodes+0xb2a/0x1920 fs/fs-writeback.c:1930 wb_writeback+0x3b9/0x9e0 fs/fs-writeback.c:2104 wb_do_writeback fs/fs-writeback.c:2247 [inline] wb_workfn+0x3d9/0x1110 fs/fs-writeback.c:2288 process_one_work+0x6bb/0xc10 kernel/workqueue.c:2325 worker_thread+0xad5/0x12a0 kernel/workqueue.c:2472 kthread+0x421/0x510 kernel/kthread.c:337 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:300 Modules linked in: ---[ end trace 294465e61f2986af ]--- RIP: 0010:mpage_map_one_extent fs/ext4/inode.c:2421 [inline] RIP: 0010:mpage_map_and_submit_extent fs/ext4/inode.c:2462 [inline] RIP: 0010:ext4_writepages+0x3f4b/0x4000 fs/ext4/inode.c:2830 Code: 00 74 08 48 89 df e8 c4 cf c9 ff 48 8b 3b 48 8b 74 24 48 48 8b 54 24 28 44 89 e9 45 89 f8 e8 ac 3a 08 00 eb 58 e8 75 9c 87 ff <0f> 0b e8 6e 9c 87 ff eb 3b e8 67 9c 87 ff eb 72 e8 60 9c 87 ff 31 RSP: 0018:ffffc900002ef000 EFLAGS: 00010293 RAX: ffffffff81e8c15b RBX: dffffc0000000000 RCX: ffff8881055c4f00 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc900002ef410 R08: ffffffff81e89b1b R09: ffffed102125de05 R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000000 R13: ffffc900002ef2e0 R14: 0000000000000000 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000c0012c7000 CR3: 000000010c903000 CR4: 00000000003506a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400