================================================================== BUG: KASAN: slab-out-of-bounds in ext4_search_dir+0xf2/0x1b0 fs/ext4/namei.c:1543 Read of size 1 at addr ffff88802190de51 by task syz-executor.1/21757 CPU: 0 PID: 21757 Comm: syz-executor.1 Not tainted 6.7.0-rc2-syzkaller-00014-gc2d5304e6c64 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/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_one_qstr_excl+0x11b/0x250 fs/namei.c:1609 do_renameat2+0x6d1/0x1390 fs/namei.c:4946 __do_sys_rename fs/namei.c:5042 [inline] __se_sys_rename fs/namei.c:5040 [inline] __x64_sys_rename+0x86/0x90 fs/namei.c:5040 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x45/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7f142bc7cae9 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:00007f142c9d80c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000052 RAX: ffffffffffffffda RBX: 00007f142bd9bf80 RCX: 00007f142bc7cae9 RDX: 0000000000000000 RSI: 00000000200000c0 RDI: 0000000020000080 RBP: 00007f142bcc847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f142bd9bf80 R15: 00007ffef512db88 Allocated by task 21566: 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 create_files fs/sysfs/group.c:64 [inline] internal_create_group+0x4ee/0xf10 fs/sysfs/group.c:152 internal_create_groups fs/sysfs/group.c:192 [inline] sysfs_create_groups+0x56/0x110 fs/sysfs/group.c:218 create_dir lib/kobject.c:77 [inline] kobject_add_internal+0x43a/0x890 lib/kobject.c:238 kobject_add_varg lib/kobject.c:372 [inline] kobject_init_and_add+0x124/0x190 lib/kobject.c:455 ext4_register_sysfs+0xb6/0x2b0 fs/ext4/sysfs.c:531 __ext4_fill_super fs/ext4/super.c:5567 [inline] ext4_fill_super+0x602b/0x6d90 fs/ext4/super.c:5712 get_tree_bdev+0x416/0x5b0 fs/super.c:1598 vfs_get_tree+0x8c/0x2a0 fs/super.c:1771 do_new_mount+0x28f/0xae0 fs/namespace.c:3337 do_mount fs/namespace.c:3677 [inline] __do_sys_mount fs/namespace.c:3886 [inline] __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3863 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x45/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b Freed by task 5106: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x28/0x40 mm/kasan/generic.c:522 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook mm/slub.c:1826 [inline] slab_free mm/slub.c:3809 [inline] kmem_cache_free+0x299/0x470 mm/slub.c:3831 kernfs_put+0x2a4/0x420 fs/kernfs/dir.c:569 kernfs_remove_by_name_ns+0xe4/0x150 fs/kernfs/dir.c:1674 kernfs_remove_by_name include/linux/kernfs.h:623 [inline] remove_files fs/sysfs/group.c:28 [inline] sysfs_remove_group+0xfe/0x2a0 fs/sysfs/group.c:292 sysfs_remove_groups+0x54/0xa0 fs/sysfs/group.c:316 __kobject_del+0x7a/0x300 lib/kobject.c:592 kobject_del+0x45/0x60 lib/kobject.c:624 ext4_put_super+0x81/0xcf0 fs/ext4/super.c:1308 generic_shutdown_super+0x13a/0x2c0 fs/super.c:696 kill_block_super+0x44/0x90 fs/super.c:1667 ext4_kill_sb+0x68/0xa0 fs/ext4/super.c:7330 deactivate_locked_super+0xc1/0x130 fs/super.c:484 cleanup_mnt+0x426/0x4c0 fs/namespace.c:1256 task_work_run+0x24a/0x300 kernel/task_work.c:180 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0xde/0x100 kernel/entry/common.c:171 exit_to_user_mode_prepare+0xb1/0x150 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x69/0x2a0 kernel/entry/common.c:296 do_syscall_64+0x52/0x110 arch/x86/entry/common.c:88 entry_SYSCALL_64_after_hwframe+0x63/0x6b The buggy address belongs to the object at ffff88802190dd98 which belongs to the cache kernfs_node_cache of size 168 The buggy address is located 17 bytes to the right of allocated 168-byte region [ffff88802190dd98, ffff88802190de40) The buggy address belongs to the physical page: page:ffffea0000864340 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2190d flags: 0xfff00000000800(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000800 ffff888015e7b000 dead000000000100 dead000000000122 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 5085, tgid 5085 (syz-executor.5), ts 171263860500, free_ts 171209503068 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_file+0x49/0x2e0 fs/kernfs/file.c:1025 sysfs_add_file_mode_ns+0x24a/0x310 fs/sysfs/file.c:307 create_files fs/sysfs/group.c:64 [inline] internal_create_group+0x4ee/0xf10 fs/sysfs/group.c:152 netdev_queue_add_kobject net/core/net-sysfs.c:1701 [inline] netdev_queue_update_kobjects+0x218/0x480 net/core/net-sysfs.c:1747 register_queue_kobjects net/core/net-sysfs.c:1808 [inline] netdev_register_kobject+0x267/0x310 net/core/net-sysfs.c:2048 register_netdevice+0xc72/0x1580 net/core/dev.c:10166 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 discard_slab mm/slub.c:2116 [inline] __unfreeze_partials+0x1e0/0x220 mm/slub.c:2655 put_cpu_partial+0x17b/0x250 mm/slub.c:2731 __slab_free+0x2b6/0x390 mm/slub.c:3679 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x75/0xe0 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x14b/0x160 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x23/0x70 mm/kasan/common.c:305 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] __kmem_cache_alloc_node+0x1d0/0x300 mm/slub.c:3517 kmalloc_trace+0x2a/0x60 mm/slab_common.c:1098 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:721 [inline] ref_tracker_alloc+0x14b/0x480 lib/ref_tracker.c:203 register_netdevice+0xe92/0x1580 net/core/dev.c:10186 rtnl_newlink_create net/core/rtnetlink.c:3523 [inline] __rtnl_newlink net/core/rtnetlink.c:3741 [inline] rtnl_newlink+0x170b/0x2080 net/core/rtnetlink.c:3754 rtnetlink_rcv_msg+0x882/0x1030 net/core/rtnetlink.c:6558 netlink_rcv_skb+0x1df/0x430 net/netlink/af_netlink.c:2545 Memory state around the buggy address: ffff88802190dd00: fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc ffff88802190dd80: fc fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb >ffff88802190de00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff88802190de80: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802190df00: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc ==================================================================