EXT4-fs error (device loop4): htree_dirblock_to_tree:1112: inode #2: block 21: comm syz-executor242: bad entry in directory: directory entry overrun - offset=1004, inode=0, rec_len=1000, 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_inlinedir_to_tree+0x57a/0x11d0 fs/ext4/inline.c:1365 Read of size 324 at addr ffff88801f0c3c05 by task syz-executor242/5219 CPU: 1 UID: 0 PID: 5219 Comm: syz-executor242 Not tainted 6.11.0-rc4-syzkaller-00255-gd2bafcf224f3 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call Trace: __dump_stack lib/dump_stack.c:93 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:119 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_inlinedir_to_tree+0x57a/0x11d0 fs/ext4/inline.c:1365 ext4_htree_fill_tree+0x5d8/0x1400 fs/ext4/namei.c:1211 ext4_dx_readdir fs/ext4/dir.c:597 [inline] ext4_readdir+0x2b1c/0x3500 fs/ext4/dir.c:142 iterate_dir+0x57a/0x810 fs/readdir.c:108 __do_sys_getdents64 fs/readdir.c:407 [inline] __se_sys_getdents64+0x20d/0x4f0 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:0x7f9958524233 Code: c1 66 0f 1f 44 00 00 48 83 c4 08 48 89 ef 5b 5d e9 52 47 fb 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 b8 ff ff ff f7 d8 RSP: 002b:00007fff6deca968 EFLAGS: 00000293 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 0000555574b92770 RCX: 00007f9958524233 RDX: 0000000000008000 RSI: 0000555574b92770 RDI: 0000000000000005 RBP: 0000555574b92744 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000001000 R11: 0000000000000293 R12: ffffffffffffffb8 R13: 0000000000000016 R14: 0000555574b92740 R15: 00007fff6decdcd0 Allocated by task 1: 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:312 [inline] __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3988 [inline] slab_alloc_node mm/slub.c:4037 [inline] kmem_cache_alloc_noprof+0x135/0x2a0 mm/slub.c:4044 __kernfs_new_node+0xd8/0x870 fs/kernfs/dir.c:624 kernfs_new_node+0x137/0x240 fs/kernfs/dir.c:700 __kernfs_create_file+0x49/0x2e0 fs/kernfs/file.c:1034 sysfs_add_file_mode_ns+0x24a/0x310 fs/sysfs/file.c:307 sysfs_merge_group+0x1fd/0x450 fs/sysfs/group.c:373 dpm_sysfs_add+0xd3/0x280 drivers/base/power/sysfs.c:707 device_add+0x5bc/0xbf0 drivers/base/core.c:3642 tty_register_device_attr+0x437/0x960 drivers/tty/tty_io.c:3275 tty_register_device drivers/tty/tty_io.c:3210 [inline] tty_register_driver+0x5f6/0xc30 drivers/tty/tty_io.c:3473 legacy_pty_init+0x3c7/0x610 drivers/tty/pty.c:581 pty_init+0xe/0x20 drivers/tty/pty.c:943 do_one_initcall+0x248/0x880 init/main.c:1267 do_initcall_level+0x157/0x210 init/main.c:1329 do_initcalls+0x3f/0x80 init/main.c:1345 kernel_init_freeable+0x435/0x5d0 init/main.c:1578 kernel_init+0x1d/0x2b0 init/main.c:1467 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the object at ffff88801f0c3b40 which belongs to the cache kernfs_node_cache of size 176 The buggy address is located 21 bytes to the right of allocated 176-byte region [ffff88801f0c3b40, ffff88801f0c3bf0) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1f0c3 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 00fff00000000000 ffff888016ee5000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000110011 00000001fdffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x52cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 1, tgid 1 (swapper/0), ts 6740143553, free_ts 6726213725 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1493 prep_new_page mm/page_alloc.c:1501 [inline] get_page_from_freelist+0x2e4c/0x2f10 mm/page_alloc.c:3439 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4695 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x5f/0x120 mm/slub.c:2321 allocate_slab+0x5a/0x2f0 mm/slub.c:2484 new_slab mm/slub.c:2537 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3723 __slab_alloc+0x58/0xa0 mm/slub.c:3813 __slab_alloc_node mm/slub.c:3866 [inline] slab_alloc_node mm/slub.c:4025 [inline] kmem_cache_alloc_noprof+0x1c1/0x2a0 mm/slub.c:4044 __kernfs_new_node+0xd8/0x870 fs/kernfs/dir.c:624 kernfs_new_node+0x137/0x240 fs/kernfs/dir.c:700 __kernfs_create_file+0x49/0x2e0 fs/kernfs/file.c:1034 sysfs_add_file_mode_ns+0x24a/0x310 fs/sysfs/file.c:307 sysfs_merge_group+0x1fd/0x450 fs/sysfs/group.c:373 dpm_sysfs_add+0xd3/0x280 drivers/base/power/sysfs.c:707 device_add+0x5bc/0xbf0 drivers/base/core.c:3642 tty_register_device_attr+0x437/0x960 drivers/tty/tty_io.c:3275 page last free pid 46 tgid 46 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1094 [inline] free_unref_page+0xd19/0xea0 mm/page_alloc.c:2612 vfree+0x186/0x2e0 mm/vmalloc.c:3364 delayed_vfree_work+0x56/0x80 mm/vmalloc.c:3285 process_one_work kernel/workqueue.c:3231 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312 worker_thread+0x86d/0xd10 kernel/workqueue.c:3389 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff88801f0c3b00: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 ffff88801f0c3b80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc >ffff88801f0c3c00: fc fc fc fc fc fc 00 00 00 00 00 00 00 00 00 00 ^ ffff88801f0c3c80: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ffff88801f0c3d00: fc fc fc fc 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================