================================================================== BUG: KASAN: use-after-free in ext4_ext_binsearch fs/ext4/extents.c:826 [inline] BUG: KASAN: use-after-free in ext4_find_extent+0xbab/0xdb0 fs/ext4/extents.c:945 Read of size 4 at addr ffff88812240aa58 by task kworker/u4:5/420 CPU: 0 PID: 420 Comm: kworker/u4:5 Not tainted 5.10.214-syzkaller-1001996-ga8e7f812fbc1 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 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/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:435 [inline] kasan_report+0x179/0x1c0 mm/kasan/report.c:452 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308 ext4_ext_binsearch fs/ext4/extents.c:826 [inline] ext4_find_extent+0xbab/0xdb0 fs/ext4/extents.c:945 ext4_ext_map_blocks+0x26a/0x6ee0 fs/ext4/extents.c:4137 ext4_map_blocks+0xa65/0x1d10 fs/ext4/inode.c:644 ext4_convert_unwritten_extents+0x2a3/0x5a0 fs/ext4/extents.c:4838 ext4_convert_unwritten_io_end_vec+0x104/0x180 fs/ext4/extents.c:4877 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+0x358/0x690 fs/ext4/page-io.c:276 process_one_work+0x6dc/0xbd0 kernel/workqueue.c:2301 worker_thread+0xaea/0x1510 kernel/workqueue.c:2447 kthread+0x34b/0x3d0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:299 Allocated by task 382: 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:430 [inline] __kasan_slab_alloc+0xb1/0xe0 mm/kasan/common.c:463 kasan_slab_alloc include/linux/kasan.h:244 [inline] slab_post_alloc_hook+0x61/0x2f0 mm/slab.h:583 slab_alloc_node mm/slub.c:2947 [inline] slab_alloc mm/slub.c:2955 [inline] kmem_cache_alloc+0x168/0x2e0 mm/slub.c:2960 getname_flags+0xba/0x520 fs/namei.c:141 user_path_at_empty+0x2d/0x50 fs/namei.c:2740 user_path_at include/linux/namei.h:60 [inline] vfs_statx+0x106/0x3b0 fs/stat.c:193 vfs_fstatat fs/stat.c:215 [inline] __do_sys_newfstatat fs/stat.c:383 [inline] __se_sys_newfstatat+0xc8/0x760 fs/stat.c:377 __x64_sys_newfstatat+0x9b/0xb0 fs/stat.c:377 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xc6 Freed by task 382: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x121/0x160 mm/kasan/common.c:362 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:370 kasan_slab_free include/linux/kasan.h:220 [inline] slab_free_hook mm/slub.c:1595 [inline] slab_free_freelist_hook+0xc0/0x190 mm/slub.c:1621 slab_free mm/slub.c:3203 [inline] kmem_cache_free+0xa9/0x1e0 mm/slub.c:3219 putname fs/namei.c:262 [inline] filename_lookup+0x515/0x6f0 fs/namei.c:2470 user_path_at_empty+0x40/0x50 fs/namei.c:2740 user_path_at include/linux/namei.h:60 [inline] vfs_statx+0x106/0x3b0 fs/stat.c:193 vfs_fstatat fs/stat.c:215 [inline] __do_sys_newfstatat fs/stat.c:383 [inline] __se_sys_newfstatat+0xc8/0x760 fs/stat.c:377 __x64_sys_newfstatat+0x9b/0xb0 fs/stat.c:377 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xc6 The buggy address belongs to the object at ffff88812240a200 which belongs to the cache names_cache of size 4096 The buggy address is located 2136 bytes inside of 4096-byte region [ffff88812240a200, ffff88812240b200) The buggy address belongs to the page: page:ffffea0004890200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x122408 head:ffffea0004890200 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head) raw: 4000000000010200 dead000000000100 dead000000000122 ffff888100192d80 raw: 0000000000000000 0000000000070007 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 382, ts 43202767269, free_ts 0 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2456 [inline] prep_new_page+0x166/0x180 mm/page_alloc.c:2462 get_page_from_freelist+0x2d8c/0x2f30 mm/page_alloc.c:4254 __alloc_pages_nodemask+0x435/0xaf0 mm/page_alloc.c:5346 allocate_slab mm/slub.c:1808 [inline] new_slab+0x80/0x400 mm/slub.c:1869 new_slab_objects mm/slub.c:2627 [inline] ___slab_alloc+0x302/0x4b0 mm/slub.c:2791 __slab_alloc+0x63/0xa0 mm/slub.c:2831 slab_alloc_node mm/slub.c:2913 [inline] slab_alloc mm/slub.c:2955 [inline] kmem_cache_alloc+0x1b9/0x2e0 mm/slub.c:2960 getname_flags+0xba/0x520 fs/namei.c:141 user_path_at_empty+0x2d/0x50 fs/namei.c:2740 user_path_at include/linux/namei.h:60 [inline] vfs_statx+0x106/0x3b0 fs/stat.c:193 vfs_fstatat fs/stat.c:215 [inline] __do_sys_newfstatat fs/stat.c:383 [inline] __se_sys_newfstatat+0xc8/0x760 fs/stat.c:377 __x64_sys_newfstatat+0x9b/0xb0 fs/stat.c:377 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xc6 page_owner free stack trace missing Memory state around the buggy address: ffff88812240a900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88812240a980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88812240aa00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88812240aa80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88812240ab00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== EXT4-fs error (device loop4): ext4_map_blocks:710: inode #19: block 23: comm kworker/u4:5: lblock 23 mapped to illegal pblock 23 (length 1) EXT4-fs warning (device loop4): ext4_convert_unwritten_extents:4845: inode #19: block 23: len 1: ext4_ext_map_blocks returned -117 EXT4-fs error (device loop4): __ext4_get_inode_loc:4409: comm kworker/u4:5: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop4) in ext4_reserve_inode_write:5869: Corrupt filesystem EXT4-fs error (device loop4): ext4_convert_unwritten_extents:4846: inode #19: comm kworker/u4:5: mark_inode_dirty error EXT4-fs (loop4): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs error (device loop2): __ext4_get_inode_loc:4409: comm kworker/u4:5: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop4): __ext4_get_inode_loc:4409: comm kworker/u4:5: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop5): __ext4_get_inode_loc:4409: comm kworker/u4:5: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop4): __ext4_get_inode_loc:4409: comm kworker/u4:5: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop3): __ext4_get_inode_loc:4409: comm kworker/u4:5: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop3): __ext4_get_inode_loc:4409: comm kworker/u4:5: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop4): ext4_map_blocks:710: inode #19: block 199: comm kworker/u4:5: lblock 7 mapped to illegal pblock 199 (length 1) EXT4-fs warning (device loop4): ext4_convert_unwritten_extents:4845: inode #19: block 7: len 1: ext4_ext_map_blocks returned -117 EXT4-fs error (device loop4): __ext4_get_inode_loc:4409: comm kworker/u4:5: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop4) in ext4_reserve_inode_write:5869: Corrupt filesystem EXT4-fs error (device loop4): ext4_convert_unwritten_extents:4846: inode #19: comm kworker/u4:5: mark_inode_dirty error EXT4-fs (loop4): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs error (device loop4): ext4_find_extent:928: inode #19: comm kworker/u4:5: pblk 208 bad header/extent: invalid magic - magic 6f69, entries 29795, max 9324(0), depth 20297(0) EXT4-fs warning (device loop4): ext4_convert_unwritten_extents:4845: inode #19: block 8: len 1: ext4_ext_map_blocks returned -117 EXT4-fs error (device loop4): __ext4_get_inode_loc:4409: comm kworker/u4:5: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop4) in ext4_reserve_inode_write:5869: Corrupt filesystem EXT4-fs error (device loop4): ext4_convert_unwritten_extents:4846: inode #19: comm kworker/u4:5: mark_inode_dirty error EXT4-fs (loop4): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs error (device loop4): ext4_find_extent:928: inode #19: comm kworker/u4:5: pblk 208 bad header/extent: invalid magic - magic 6f69, entries 29795, max 9324(0), depth 20297(0) EXT4-fs warning (device loop4): ext4_convert_unwritten_extents:4845: inode #19: block 9: len 1: ext4_ext_map_blocks returned -117 EXT4-fs (loop4): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs error (device loop1): ext4_map_blocks:710: inode #19: block 247: comm kworker/u4:5: lblock 39 mapped to illegal pblock 247 (length 1) EXT4-fs warning (device loop1): ext4_convert_unwritten_extents:4845: inode #19: block 39: len 1: ext4_ext_map_blocks returned -117 EXT4-fs error (device loop1): __ext4_get_inode_loc:4409: comm kworker/u4:5: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop1) in ext4_reserve_inode_write:5869: Corrupt filesystem EXT4-fs error (device loop1): ext4_convert_unwritten_extents:4846: inode #19: comm kworker/u4:5: mark_inode_dirty error EXT4-fs (loop1): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs error (device loop3): __ext4_get_inode_loc:4409: comm kworker/u4:5: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop3): __ext4_get_inode_loc:4409: comm kworker/u4:5: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop5): __ext4_get_inode_loc:4409: comm kworker/u4:5: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop0): ext4_map_blocks:710: inode #19: block 204: comm kworker/u4:5: lblock 12 mapped to illegal pblock 204 (length 1) EXT4-fs warning (device loop0): ext4_convert_unwritten_extents:4845: inode #19: block 12: len 1: ext4_ext_map_blocks returned -117 EXT4-fs error (device loop0): __ext4_get_inode_loc:4409: comm kworker/u4:5: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop0) in ext4_reserve_inode_write:5869: Corrupt filesystem EXT4-fs error (device loop0): ext4_convert_unwritten_extents:4846: inode #19: comm kworker/u4:5: 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 loop3): __ext4_get_inode_loc:4409: comm kworker/u4:5: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop2): __ext4_get_inode_loc:4409: comm kworker/u4:5: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop4): __ext4_get_inode_loc:4409: comm kworker/u4:5: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop4): __ext4_get_inode_loc:4409: comm kworker/u4:5: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop5): __ext4_get_inode_loc:4409: comm kworker/u4:5: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop5): __ext4_get_inode_loc:4409: comm kworker/u4:5: Invalid inode table block 34360905424 in block_group 0 EXT4-fs warning (device loop1): ext4_convert_unwritten_extents:4845: inode #19: block 47: len 1: ext4_ext_map_blocks returned -117 EXT4-fs (loop1): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs error (device loop0): __ext4_get_inode_loc:4409: comm kworker/u4:5: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop0): __ext4_get_inode_loc:4409: comm kworker/u4:5: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop1): ext4_map_blocks:710: inode #19: block 32: comm kworker/u4:5: lblock 32 mapped to illegal pblock 32 (length 1) EXT4-fs warning (device loop1): ext4_convert_unwritten_extents:4845: inode #19: block 32: len 1: ext4_ext_map_blocks returned -117 EXT4-fs error (device loop1): __ext4_get_inode_loc:4409: comm kworker/u4:5: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop1) in ext4_reserve_inode_write:5869: Corrupt filesystem