EXT4-fs warning (device loop3): ext4_convert_unwritten_extents:4817: inode #19: block 19: len 1: ext4_ext_map_blocks returned -117 EXT4-fs (loop3): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) ================================================================== BUG: KASAN: use-after-free in ext4_ext_binsearch fs/ext4/extents.c:826 [inline] BUG: KASAN: use-after-free in ext4_find_extent+0xba3/0xd80 fs/ext4/extents.c:945 Read of size 4 at addr ffff88812215b75c by task kworker/u4:1/9 CPU: 1 PID: 9 Comm: kworker/u4:1 Not tainted 5.10.155-syzkaller-00790-g25af5a11f1da #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Workqueue: ext4-rsv-conversion ext4_end_io_rsv_work Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack_lvl+0x1e2/0x24b lib/dump_stack.c:118 print_address_description+0x81/0x3c0 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report+0x1a4/0x1f0 mm/kasan/report.c:436 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308 ext4_ext_binsearch fs/ext4/extents.c:826 [inline] ext4_find_extent+0xba3/0xd80 fs/ext4/extents.c:945 ext4_ext_map_blocks+0x219/0x3a30 fs/ext4/extents.c:4097 ext4_map_blocks+0xa93/0x1ee0 fs/ext4/inode.c:638 ext4_convert_unwritten_extents+0x2ad/0x5d0 fs/ext4/extents.c:4810 ext4_convert_unwritten_io_end_vec+0x11d/0x1d0 fs/ext4/extents.c:4849 ext4_end_io_end fs/ext4/page-io.c:189 [inline] ext4_do_flush_completed_IO fs/ext4/page-io.c:262 [inline] ext4_end_io_rsv_work+0x3a0/0x710 fs/ext4/page-io.c:276 process_one_work+0x726/0xc10 kernel/workqueue.c:2296 worker_thread+0xb27/0x1550 kernel/workqueue.c:2442 kthread+0x349/0x3d0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:299 The buggy address belongs to the page: page:ffffea00048856c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x7f1407f4b pfn:0x12215b anon flags: 0x8000000000080014(uptodate|lru|swapbacked) raw: 8000000000080014 ffffea0004871408 ffffea00047ec508 ffff88810da427e1 raw: 00000007f1407f4b 0000000000000000 00000001ffffffff ffff8881148a8000 page dumped because: kasan: bad access detected page->mem_cgroup:ffff8881148a8000 page_owner tracks the page as allocated page last allocated via order 0, migratetype Movable, gfp_mask 0x3100dca(GFP_HIGHUSER_MOVABLE|__GFP_ZERO|0x2000000), pid 621, ts 27327062512, free_ts 27244258908 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2386 [inline] prep_new_page mm/page_alloc.c:2392 [inline] get_page_from_freelist+0x755/0x810 mm/page_alloc.c:4073 __alloc_pages_nodemask+0x3b6/0x890 mm/page_alloc.c:5160 __alloc_pages include/linux/gfp.h:529 [inline] __alloc_pages_node include/linux/gfp.h:542 [inline] alloc_pages_node include/linux/gfp.h:556 [inline] alloc_pages include/linux/gfp.h:575 [inline] do_anonymous_page+0x307/0x1050 mm/memory.c:3922 handle_pte_fault+0x4cd/0x9d0 mm/memory.c:4735 ___handle_speculative_fault+0xfca/0x1470 mm/memory.c:5149 __handle_speculative_fault+0xc3/0x2b0 mm/memory.c:5192 handle_speculative_fault include/linux/mm.h:1817 [inline] do_user_addr_fault+0x885/0xce0 arch/x86/mm/fault.c:1319 handle_page_fault arch/x86/mm/fault.c:1462 [inline] exc_page_fault+0x71/0x1b0 arch/x86/mm/fault.c:1518 asm_exc_page_fault+0x1e/0x30 arch/x86/include/asm/idtentry.h:571 page last free stack trace: reset_page_owner include/linux/page_owner.h:28 [inline] free_pages_prepare mm/page_alloc.c:1332 [inline] free_pcp_prepare+0x18c/0x1c0 mm/page_alloc.c:1406 free_unref_page_prepare mm/page_alloc.c:3293 [inline] free_unref_page_list+0x11d/0x660 mm/page_alloc.c:3367 release_pages+0xc24/0xc60 mm/swap.c:1082 free_pages_and_swap_cache+0x97/0xb0 mm/swap_state.c:356 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:242 [inline] tlb_flush_mmu+0x8a0/0xa80 mm/mmu_gather.c:249 tlb_finish_mmu+0xd2/0x1f0 mm/mmu_gather.c:328 exit_mmap+0x319/0x5c0 mm/mmap.c:3343 __mmput+0x95/0x2c0 kernel/fork.c:1133 mmput+0x4b/0x50 kernel/fork.c:1154 exit_mm+0x5cd/0x790 kernel/exit.c:489 do_exit+0x5f2/0x2340 kernel/exit.c:800 do_group_exit+0x13a/0x300 kernel/exit.c:910 __do_sys_exit_group kernel/exit.c:921 [inline] __se_sys_exit_group kernel/exit.c:919 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:919 do_syscall_64+0x34/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xc6 Memory state around the buggy address: ffff88812215b600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88812215b680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88812215b700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff88812215b780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88812215b800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== EXT4-fs warning (device loop3): ext4_convert_unwritten_extents:4817: inode #19: block 20: len 1: ext4_ext_map_blocks returned -117 EXT4-fs (loop3): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs warning (device loop3): ext4_convert_unwritten_extents:4817: inode #19: block 21: len 1: ext4_ext_map_blocks returned -117 EXT4-fs (loop3): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs warning (device loop3): ext4_convert_unwritten_extents:4817: inode #19: block 22: len 1: ext4_ext_map_blocks returned -117 EXT4-fs (loop3): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs warning (device loop3): ext4_convert_unwritten_extents:4817: inode #19: block 23: len 1: ext4_ext_map_blocks returned -117 EXT4-fs (loop3): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs warning (device loop3): ext4_convert_unwritten_extents:4817: inode #19: block 24: len 1: ext4_ext_map_blocks returned -117 EXT4-fs (loop3): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs warning (device loop3): ext4_convert_unwritten_extents:4817: inode #19: block 25: len 1: ext4_ext_map_blocks returned -117 EXT4-fs (loop3): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs error (device loop0): ext4_map_blocks:718: inode #19: block 237: comm kworker/u4:1: lblock 29 mapped to illegal pblock 237 (length 1) EXT4-fs warning (device loop0): ext4_convert_unwritten_extents:4817: inode #19: block 29: len 1: ext4_ext_map_blocks returned -117 EXT4-fs error (device loop0) in ext4_reserve_inode_write:5851: Out of memory EXT4-fs error (device loop0): ext4_convert_unwritten_extents:4818: inode #19: comm kworker/u4:1: mark_inode_dirty error EXT4-fs (loop0): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs error (device loop1): ext4_map_blocks:718: inode #19: block 224: comm kworker/u4:1: lblock 16 mapped to illegal pblock 224 (length 1) EXT4-fs warning (device loop1): ext4_convert_unwritten_extents:4817: inode #19: block 16: len 1: ext4_ext_map_blocks returned -117 EXT4-fs error (device loop1) in ext4_reserve_inode_write:5851: Out of memory EXT4-fs error (device loop1): ext4_convert_unwritten_extents:4818: inode #19: comm kworker/u4:1: mark_inode_dirty error EXT4-fs (loop1): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) ------------[ cut here ]------------ kernel BUG at fs/ext4/extents.c:3199! invalid opcode: 0000 [#1] PREEMPT SMP KASAN CPU: 1 PID: 9 Comm: kworker/u4:1 Tainted: G B 5.10.155-syzkaller-00790-g25af5a11f1da #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Workqueue: ext4-rsv-conversion ext4_end_io_rsv_work RIP: 0010:ext4_split_extent_at+0xd0c/0x12c0 fs/ext4/extents.c:3199 Code: ff e8 f8 14 96 ff 4c 89 f7 48 8d b4 24 00 01 00 00 e8 f8 06 00 00 e9 8a f9 ff ff b0 01 84 c0 0f 84 71 f5 ff ff e8 d4 14 96 ff <0f> 0b 89 d9 80 e1 07 fe c1 38 c1 0f 8c 1b f4 ff ff 48 89 df e8 eb RSP: 0018:ffffc90000097400 EFLAGS: 00010293 RAX: ffffffff81d706ec RBX: 0000000000000000 RCX: ffff88810023e2c0 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc90000097568 R08: ffffffff81d6fc41 R09: ffffc90000097500 R10: fffff52000012ea2 R11: 1ffff92000012ea0 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000030 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000002001e03f CR3: 000000010a103000 CR4: 00000000003506a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: ext4_split_extent+0x369/0x4d0 fs/ext4/extents.c:3380 ext4_split_convert_extents fs/ext4/extents.c:3708 [inline] ext4_convert_unwritten_extents_endio fs/ext4/extents.c:3744 [inline] ext4_ext_handle_unwritten_extents+0x673/0x1170 fs/ext4/extents.c:3892 ext4_ext_map_blocks+0xc06/0x3a30 fs/ext4/extents.c:4162 ext4_map_blocks+0xa93/0x1ee0 fs/ext4/inode.c:638 ext4_convert_unwritten_extents+0x2ad/0x5d0 fs/ext4/extents.c:4810 ext4_convert_unwritten_io_end_vec+0x11d/0x1d0 fs/ext4/extents.c:4849 ext4_end_io_end fs/ext4/page-io.c:189 [inline] ext4_do_flush_completed_IO fs/ext4/page-io.c:262 [inline] ext4_end_io_rsv_work+0x3a0/0x710 fs/ext4/page-io.c:276 process_one_work+0x726/0xc10 kernel/workqueue.c:2296 worker_thread+0xb27/0x1550 kernel/workqueue.c:2442 kthread+0x349/0x3d0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:299 Modules linked in: ---[ end trace 06d74acd3a9f1779 ]--- RIP: 0010:ext4_split_extent_at+0xd0c/0x12c0 fs/ext4/extents.c:3199 Code: ff e8 f8 14 96 ff 4c 89 f7 48 8d b4 24 00 01 00 00 e8 f8 06 00 00 e9 8a f9 ff ff b0 01 84 c0 0f 84 71 f5 ff ff e8 d4 14 96 ff <0f> 0b 89 d9 80 e1 07 fe c1 38 c1 0f 8c 1b f4 ff ff 48 89 df e8 eb RSP: 0018:ffffc90000097400 EFLAGS: 00010293 RAX: ffffffff81d706ec RBX: 0000000000000000 RCX: ffff88810023e2c0 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc90000097568 R08: ffffffff81d6fc41 R09: ffffc90000097500 R10: fffff52000012ea2 R11: 1ffff92000012ea0 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000030 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000555555d05728 CR3: 000000011b228000 CR4: 00000000003506a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400