================================================================== BUG: KASAN: slab-out-of-bounds in ext4_search_dir+0xf2/0x1b0 fs/ext4/namei.c:1543 Read of size 1 at addr ffff88802508a558 by task syz-executor.1/24207 CPU: 1 PID: 24207 Comm: syz-executor.1 Not tainted 6.7.0-rc8-syzkaller-00177-g52b1853b080a #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0x163/0x540 mm/kasan/report.c:475 kasan_report+0x142/0x170 mm/kasan/report.c:588 ext4_search_dir+0xf2/0x1b0 fs/ext4/namei.c:1543 ext4_find_inline_entry+0x4ba/0x5e0 fs/ext4/inline.c:1694 __ext4_find_entry+0x2b4/0x1b30 fs/ext4/namei.c:1616 ext4_lookup_entry fs/ext4/namei.c:1771 [inline] ext4_lookup+0x17a/0x750 fs/ext4/namei.c:1839 lookup_open fs/namei.c:3455 [inline] open_last_lookups fs/namei.c:3546 [inline] path_openat+0x1010/0x3290 fs/namei.c:3776 do_filp_open+0x234/0x490 fs/namei.c:3809 do_sys_openat2+0x13e/0x1d0 fs/open.c:1437 do_sys_open fs/open.c:1452 [inline] __do_sys_creat fs/open.c:1528 [inline] __se_sys_creat fs/open.c:1522 [inline] __x64_sys_creat+0x123/0x160 fs/open.c:1522 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x45/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7fcbbbe7cd29 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fcbbcc2e0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000055 RAX: ffffffffffffffda RBX: 00007fcbbbfac050 RCX: 00007fcbbbe7cd29 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000540 RBP: 00007fcbbbec947a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000006e R14: 00007fcbbbfac050 R15: 00007ffcdb64ccc8 Allocated by task 1: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 __kasan_slab_alloc+0x66/0x70 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook+0x6c/0x3c0 mm/slab.h:763 slab_alloc_node mm/slub.c:3478 [inline] slab_alloc mm/slub.c:3486 [inline] __kmem_cache_alloc_lru mm/slub.c:3493 [inline] kmem_cache_alloc+0x19e/0x2b0 mm/slub.c:3502 kmem_cache_zalloc include/linux/slab.h:711 [inline] __kernfs_new_node+0xd8/0x870 fs/kernfs/dir.c:615 kernfs_new_node+0x99/0x170 fs/kernfs/dir.c:679 __kernfs_create_file+0x49/0x2e0 fs/kernfs/file.c:1025 sysfs_add_file_mode_ns+0x24a/0x310 fs/sysfs/file.c:307 sysfs_merge_group+0x1fd/0x450 fs/sysfs/group.c:346 dpm_sysfs_add+0xd3/0x280 drivers/base/power/sysfs.c:707 device_add+0x5bd/0xc90 drivers/base/core.c:3585 snd_register_device+0x327/0x480 sound/core/sound.c:281 snd_pcm_dev_register+0x130/0x7e0 sound/core/pcm.c:1081 __snd_device_register sound/core/device.c:149 [inline] snd_device_register_all+0xc8/0x190 sound/core/device.c:197 snd_card_register+0x1d9/0x6b0 sound/core/init.c:897 loopback_probe+0xeb6/0x14e0 sound/drivers/aloop.c:1815 platform_probe+0x135/0x1b0 drivers/base/platform.c:1404 really_probe+0x294/0xc30 drivers/base/dd.c:658 __driver_probe_device+0x1a2/0x3d0 drivers/base/dd.c:800 driver_probe_device+0x50/0x420 drivers/base/dd.c:830 __device_attach_driver+0x2d3/0x520 drivers/base/dd.c:958 bus_for_each_drv+0x24a/0x2d0 drivers/base/bus.c:457 __device_attach+0x32f/0x510 drivers/base/dd.c:1030 bus_probe_device+0x185/0x260 drivers/base/bus.c:532 device_add+0x8ef/0xc90 drivers/base/core.c:3625 platform_device_add+0x45d/0x7c0 drivers/base/platform.c:716 platform_device_register_full+0x5eb/0x6f0 drivers/base/platform.c:844 platform_device_register_resndata include/linux/platform_device.h:169 [inline] platform_device_register_simple include/linux/platform_device.h:198 [inline] alsa_card_loopback_init+0x15d/0x2e0 sound/drivers/aloop.c:1878 do_one_initcall+0x234/0x810 init/main.c:1236 do_initcall_level+0x157/0x210 init/main.c:1298 do_initcalls+0x3f/0x80 init/main.c:1314 kernel_init_freeable+0x429/0x5c0 init/main.c:1551 kernel_init+0x1d/0x2a0 init/main.c:1441 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242 The buggy address belongs to the object at ffff88802508a488 which belongs to the cache kernfs_node_cache of size 168 The buggy address is located 40 bytes to the right of allocated 168-byte region [ffff88802508a488, ffff88802508a530) The buggy address belongs to the physical page: page:ffffea0000942280 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2508a flags: 0xfff00000000800(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000800 ffff888015e7b000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000110011 00000001ffffffff 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 1, tgid 1 (swapper/0), ts 10802886808, free_ts 10800714857 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1544 [inline] get_page_from_freelist+0x33ea/0x3570 mm/page_alloc.c:3312 __alloc_pages+0x255/0x680 mm/page_alloc.c:4568 alloc_pages_mpol+0x3de/0x640 mm/mempolicy.c:2133 alloc_slab_page+0x6a/0x170 mm/slub.c:1870 allocate_slab mm/slub.c:2017 [inline] new_slab+0x84/0x2f0 mm/slub.c:2070 ___slab_alloc+0xc8a/0x1330 mm/slub.c:3223 __slab_alloc mm/slub.c:3322 [inline] __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] slab_alloc mm/slub.c:3486 [inline] __kmem_cache_alloc_lru mm/slub.c:3493 [inline] kmem_cache_alloc+0x1e9/0x2b0 mm/slub.c:3502 kmem_cache_zalloc include/linux/slab.h:711 [inline] __kernfs_new_node+0xd8/0x870 fs/kernfs/dir.c:615 kernfs_new_node+0x99/0x170 fs/kernfs/dir.c:679 kernfs_create_link+0xa5/0x1f0 fs/kernfs/symlink.c:39 sysfs_do_create_link_sd+0x85/0x110 fs/sysfs/symlink.c:44 device_add_class_symlinks+0xc2/0x250 drivers/base/core.c:3372 device_add+0x554/0xc90 drivers/base/core.c:3576 snd_register_device+0x327/0x480 sound/core/sound.c:281 snd_pcm_dev_register+0x130/0x7e0 sound/core/pcm.c:1081 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1137 [inline] free_unref_page_prepare+0x931/0xa60 mm/page_alloc.c:2347 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2487 mm_free_pgd kernel/fork.c:803 [inline] __mmdrop+0xb8/0x3d0 kernel/fork.c:919 free_bprm+0x144/0x330 fs/exec.c:1490 kernel_execve+0x8f7/0xa20 fs/exec.c:2024 call_usermodehelper_exec_async+0x233/0x370 kernel/umh.c:110 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242 Memory state around the buggy address: ffff88802508a400: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc ffff88802508a480: fc 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88802508a500: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc 00 00 ^ ffff88802508a580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88802508a600: 00 00 00 fc fc fc fc fc fc fc fc 00 00 00 00 00 ==================================================================