================================================================== BUG: KASAN: slab-out-of-bounds in ext4_ext_binsearch fs/ext4/extents.c:826 [inline] BUG: KASAN: slab-out-of-bounds in ext4_find_extent+0xbab/0xdb0 fs/ext4/extents.c:945 Read of size 4 at addr ffff88810f351000 by task kworker/u4:1/9 CPU: 0 PID: 9 Comm: kworker/u4:1 Not tainted 5.10.184-syzkaller-989153-g28cc6246b5e7 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023 Workqueue: writeback wb_workfn (flush-7:4) 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+0x26d/0x6be0 fs/ext4/extents.c:4097 ext4_map_blocks+0xaa7/0x1f00 fs/ext4/inode.c:646 mpage_map_one_extent fs/ext4/inode.c:2450 [inline] mpage_map_and_submit_extent fs/ext4/inode.c:2503 [inline] ext4_writepages+0x148b/0x3c00 fs/ext4/inode.c:2871 do_writepages+0x12e/0x270 mm/page-writeback.c:2358 __writeback_single_inode+0xd7/0xac0 fs/fs-writeback.c:1470 writeback_sb_inodes+0x99c/0x16b0 fs/fs-writeback.c:1733 wb_writeback+0x404/0xc60 fs/fs-writeback.c:1908 wb_do_writeback fs/fs-writeback.c:2053 [inline] wb_workfn+0x3d9/0x1110 fs/fs-writeback.c:2094 process_one_work+0x6dc/0xbd0 kernel/workqueue.c:2298 worker_thread+0xaea/0x1510 kernel/workqueue.c:2444 kthread+0x34b/0x3d0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 :299 Allocated by task 400: 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 getname fs/namei.c:212 [inline] __do_sys_rename fs/namei.c:4652 [inline] __se_sys_rename fs/namei.c:4649 [inline] __x64_sys_rename+0x6e/0x90 fs/namei.c:4649 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xc6 Freed by task 400: 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] do_renameat2+0x1056/0x1130 fs/namei.c:4631 __do_sys_rename fs/namei.c:4651 [inline] __se_sys_rename fs/namei.c:4649 [inline] __x64_sys_rename+0x86/0x90 fs/namei.c:4649 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xc6 The buggy address belongs to the object at ffff88810f350000 which belongs to the cache names_cache of size 4096 The buggy address is located 0 bytes to the right of 4096-byte region [ffff88810f350000, ffff88810f351000) The buggy address belongs to the page: page:ffffea00043cd400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10f350 head:ffffea00043cd400 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head) raw: 4000000000010200 dead000000000100 dead000000000122 ffff88810018ac00 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 400, ts 63379451852, free_ts 63369279057 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2455 [inline] prep_new_page+0x166/0x180 mm/page_alloc.c:2461 get_page_from_freelist+0x2d8c/0x2f30 mm/page_alloc.c:4253 __alloc_pages_nodemask+0x435/0xaf0 mm/page_alloc.c:5345 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 getname+0x19/0x20 fs/namei.c:212 do_sys_openat2+0xd7/0x6f0 fs/open.c:1211 do_sys_open fs/open.c:1233 [inline] __do_sys_openat fs/open.c:1249 [inline] __se_sys_openat fs/open.c:1244 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1244 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xc6 page last free stack trace: reset_page_owner include/linux/page_owner.h:28 [inline] free_pages_prepare mm/page_alloc.c:1348 [inline] __free_pages_ok+0x82c/0x850 mm/page_alloc.c:1628 free_the_page+0x76/0x370 mm/page_alloc.c:5406 __free_pages+0x67/0xc0 mm/page_alloc.c:5415 __free_slab+0xcf/0x190 mm/slub.c:1894 free_slab mm/slub.c:1909 [inline] discard_slab mm/slub.c:1915 [inline] unfreeze_partials+0x15e/0x190 mm/slub.c:2410 put_cpu_partial+0xbf/0x180 mm/slub.c:2446 __slab_free+0x2c8/0x3a0 mm/slub.c:3095 do_slab_free mm/slub.c:3191 [inline] ___cache_free+0x111/0x130 mm/slub.c:3210 qlink_free+0x50/0x90 mm/kasan/quarantine.c:157 qlist_free_all+0x47/0xb0 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x15a/0x170 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x2f/0xe0 mm/kasan/common.c:440 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] __kmalloc+0x183/0x330 mm/slub.c:4029 kmalloc include/linux/slab.h:557 [inline] shmem_initxattrs+0xd2/0x200 mm/shmem.c:3219 security_inode_init_security+0x252/0x390 security/security.c:1033 Memory state around the buggy address: ffff88810f350f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88810f350f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88810f351000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88810f351080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88810f351100: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== EXT4-fs error (device loop4): ext4_map_blocks:726: inode #19: block 16711717718145: comm kworker/u4:1: lblock 0 mapped to illegal pblock 16711717718145 (length 16) EXT4-fs (loop4): Delayed block allocation failed for inode 19 at logical offset 0 with max blocks 16 with error 117 EXT4-fs (loop4): This should not happen!! Data will be lost EXT4-fs error (device loop1): ext4_ext_map_blocks:4115: inode #19: comm kworker/u4:1: bad extent address lblock: 0, depth: 1 pblock 0 EXT4-fs (loop1): Delayed block allocation failed for inode 19 at logical offset 0 with max blocks 16 with error 117 EXT4-fs (loop1): This should not happen!! Data will be lost EXT4-fs error (device loop2): ext4_ext_map_blocks:4115: inode #19: comm kworker/u4:1: bad extent address lblock: 0, depth: 1 pblock 0 EXT4-fs (loop2): Delayed block allocation failed for inode 19 at logical offset 0 with max blocks 16 with error 117 EXT4-fs (loop2): This should not happen!! Data will be lost EXT4-fs error (device loop3): ext4_ext_map_blocks:4115: inode #19: comm kworker/u4:1: bad extent address lblock: 0, depth: 1 pblock 0 EXT4-fs (loop3): Delayed block allocation failed for inode 19 at logical offset 0 with max blocks 16 with error 117 EXT4-fs (loop3): This should not happen!! Data will be lost EXT4-fs error (device loop2): ext4_ext_map_blocks:4115: inode #19: comm kworker/u4:1: bad extent address lblock: 0, depth: 1 pblock 0 EXT4-fs (loop2): Delayed block allocation failed for inode 19 at logical offset 0 with max blocks 16 with error 117 EXT4-fs (loop2): This should not happen!! Data will be lost EXT4-fs error (device loop1): ext4_ext_map_blocks:4115: inode #19: comm kworker/u4:1: bad extent address lblock: 0, depth: 1 pblock 0 EXT4-fs (loop1): Delayed block allocation failed for inode 19 at logical offset 0 with max blocks 16 with error 117 EXT4-fs (loop1): This should not happen!! Data will be lost EXT4-fs error (device loop0): ext4_ext_map_blocks:4115: inode #19: comm kworker/u4:1: bad extent address lblock: 0, depth: 1 pblock 0 EXT4-fs (loop0): Delayed block allocation failed for inode 19 at logical offset 0 with max blocks 16 with error 117 EXT4-fs (loop0): This should not happen!! Data will be lost