EXT4-fs error (device loop0): ext4_readdir:261: inode #2: block 16: comm syz-executor: path /0/bus: bad entry in directory: rec_len is smaller than minimal - offset=980, inode=0, rec_len=0, size=1024 fake=0 ================================================================== BUG: KASAN: slab-out-of-bounds in ext4_read_inline_data fs/ext4/inline.c:209 [inline] BUG: KASAN: slab-out-of-bounds in ext4_read_inline_dir+0x567/0xe60 fs/ext4/inline.c:1485 Read of size 68 at addr ffff8880274cb51a by task syz-executor/5931 CPU: 1 UID: 0 PID: 5931 Comm: syz-executor Not tainted 6.12.0-rc3-syzkaller-g6485cf5ea253 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 kasan_check_range+0x282/0x290 mm/kasan/generic.c:189 __asan_memcpy+0x29/0x70 mm/kasan/shadow.c:105 ext4_read_inline_data fs/ext4/inline.c:209 [inline] ext4_read_inline_dir+0x567/0xe60 fs/ext4/inline.c:1485 ext4_readdir+0x475/0x3a60 fs/ext4/dir.c:159 iterate_dir+0x571/0x800 fs/readdir.c:108 __do_sys_getdents64 fs/readdir.c:407 [inline] __se_sys_getdents64+0x1d3/0x4a0 fs/readdir.c:392 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f61863a9333 Code: c1 66 0f 1f 44 00 00 48 83 c4 08 48 89 ef 5b 5d e9 02 45 f8 ff 66 90 b8 ff ff ff 7f 48 39 c2 48 0f 47 d0 b8 d9 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 05 c3 0f 1f 40 00 48 c7 c2 a8 ff ff ff f7 d8 RSP: 002b:00007ffd8dc68ce8 EFLAGS: 00000293 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 000055555752d640 RCX: 00007f61863a9333 RDX: 0000000000008000 RSI: 000055555752d640 RDI: 0000000000000006 RBP: 000055555752d614 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000001000 R11: 0000000000000293 R12: ffffffffffffffa8 R13: 0000000000000016 R14: 000055555752d610 R15: 00007ffd8dc6c080 Allocated by task 5902: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:319 [inline] __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:345 kasan_slab_alloc include/linux/kasan.h:247 [inline] slab_post_alloc_hook mm/slub.c:4085 [inline] kmem_cache_alloc_bulk_noprof+0x4fa/0x7c0 mm/slub.c:4975 mt_alloc_bulk lib/maple_tree.c:167 [inline] mas_alloc_nodes+0x3d5/0x840 lib/maple_tree.c:1263 mas_node_count_gfp lib/maple_tree.c:1321 [inline] mas_preallocate+0x554/0x8c0 lib/maple_tree.c:5546 vma_iter_prealloc mm/vma.h:432 [inline] mmap_region+0x1ea1/0x2990 mm/mmap.c:1508 do_mmap+0x8f0/0x1000 mm/mmap.c:496 vm_mmap_pgoff+0x1dd/0x3d0 mm/util.c:588 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 5906: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:579 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x59/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:2342 [inline] slab_free mm/slub.c:4579 [inline] kmem_cache_free+0x1a2/0x420 mm/slub.c:4681 rcu_do_batch kernel/rcu/tree.c:2567 [inline] rcu_core+0xaaa/0x17a0 kernel/rcu/tree.c:2823 handle_softirqs+0x2c5/0x980 kernel/softirq.c:554 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu+0xf4/0x1c0 kernel/softirq.c:637 irq_exit_rcu+0x9/0x30 kernel/softirq.c:649 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1037 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1037 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 Last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xac/0xc0 mm/kasan/generic.c:541 __call_rcu_common kernel/rcu/tree.c:3086 [inline] call_rcu+0x167/0xa70 kernel/rcu/tree.c:3190 ma_free_rcu lib/maple_tree.c:197 [inline] mas_topiary_node lib/maple_tree.c:2521 [inline] mas_topiary_replace lib/maple_tree.c:2621 [inline] mas_wmb_replace+0x1483/0x2860 lib/maple_tree.c:2643 mas_split lib/maple_tree.c:3373 [inline] mas_commit_b_node+0x1190/0x1af0 lib/maple_tree.c:3393 mas_wr_bnode lib/maple_tree.c:4044 [inline] mas_wr_store_entry+0x4ea/0x2380 lib/maple_tree.c:4085 mas_store_prealloc+0xcbb/0x1390 lib/maple_tree.c:5520 vma_complete+0x21d/0xb50 mm/vma.c:226 __split_vma+0xaa6/0xc50 mm/vma.c:430 vms_gather_munmap_vmas+0x4b2/0x15d0 mm/vma.c:1226 mmap_region+0x817/0x2990 mm/mmap.c:1387 do_mmap+0x8f0/0x1000 mm/mmap.c:496 vm_mmap_pgoff+0x1dd/0x3d0 mm/util.c:588 ksys_mmap_pgoff+0x4eb/0x720 mm/mmap.c:542 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff8880274cb400 which belongs to the cache maple_node of size 256 The buggy address is located 26 bytes to the right of allocated 256-byte region [ffff8880274cb400, ffff8880274cb500) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x274ca head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801ac91000 0000000000000000 0000000000000001 raw: 0000000000000000 0000000000100010 00000001f5000000 0000000000000000 head: 00fff00000000040 ffff88801ac91000 0000000000000000 0000000000000001 head: 0000000000000000 0000000000100010 00000001f5000000 0000000000000000 head: 00fff00000000001 ffffea00009d3281 ffffffffffffffff 0000000000000000 head: ffff888000000002 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5556, tgid 5556 (sh), ts 80282771041, free_ts 78405897746 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1545 [inline] get_page_from_freelist+0x3039/0x3180 mm/page_alloc.c:3457 __alloc_pages_noprof+0x292/0x710 mm/page_alloc.c:4733 alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2265 alloc_slab_page+0x6a/0x120 mm/slub.c:2412 allocate_slab+0x5a/0x2f0 mm/slub.c:2578 new_slab mm/slub.c:2631 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3818 __slab_alloc+0x58/0xa0 mm/slub.c:3908 __slab_alloc_node mm/slub.c:3961 [inline] slab_alloc_node mm/slub.c:4122 [inline] kmem_cache_alloc_noprof+0x1c1/0x2a0 mm/slub.c:4141 mt_alloc_one lib/maple_tree.c:162 [inline] mas_alloc_nodes+0x26c/0x840 lib/maple_tree.c:1241 mas_node_count_gfp lib/maple_tree.c:1321 [inline] mas_preallocate+0x554/0x8c0 lib/maple_tree.c:5546 vma_iter_prealloc mm/vma.h:432 [inline] __split_vma+0x302/0xc50 mm/vma.c:397 vms_gather_munmap_vmas+0x2ee/0x15d0 mm/vma.c:1205 mmap_region+0x817/0x2990 mm/mmap.c:1387 do_mmap+0x8f0/0x1000 mm/mmap.c:496 vm_mmap_pgoff+0x1dd/0x3d0 mm/util.c:588 page last free pid 5541 tgid 5541 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1108 [inline] free_unref_page+0xcd0/0xf00 mm/page_alloc.c:2638 __folio_put+0x2c7/0x440 mm/swap.c:126 pipe_buf_release include/linux/pipe_fs_i.h:219 [inline] pipe_update_tail fs/pipe.c:224 [inline] pipe_read+0x6ed/0x13e0 fs/pipe.c:344 new_sync_read fs/read_write.c:488 [inline] vfs_read+0x9bb/0xbc0 fs/read_write.c:569 ksys_read+0x183/0x2b0 fs/read_write.c:712 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff8880274cb400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880274cb480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880274cb500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8880274cb580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880274cb600: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================