================================================================== BUG: KASAN: use-after-free in ext4_htree_fill_tree+0x1316/0x13e0 fs/ext4/namei.c:1220 Read of size 1 at addr ffff88810e868a67 by task syz-executor/481 CPU: 0 PID: 481 Comm: syz-executor Not tainted 5.10.222-syzkaller-1003210-gfd58936f3c1f #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 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_load1_noabort+0x14/0x20 mm/kasan/report_generic.c:306 ext4_htree_fill_tree+0x1316/0x13e0 fs/ext4/namei.c:1220 ext4_dx_readdir fs/ext4/dir.c:598 [inline] ext4_readdir+0x2dde/0x37c0 fs/ext4/dir.c:142 iterate_dir+0x265/0x580 __do_sys_getdents64 fs/readdir.c:369 [inline] __se_sys_getdents64+0x1c1/0x460 fs/readdir.c:354 __x64_sys_getdents64+0x7b/0x90 fs/readdir.c:354 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7f92d7c3cbf3 Code: c1 66 0f 1f 44 00 00 48 83 c4 08 48 89 ef 5b 5d e9 f2 44 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:00007ffc4fe84908 EFLAGS: 00000293 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 0000555556cc44e0 RCX: 00007f92d7c3cbf3 RDX: 0000000000008000 RSI: 0000555556cc44e0 RDI: 0000000000000005 RBP: 0000555556cc44b4 R08: 0000000000028b61 R09: 0000000000000000 R10: 00007f92d7d69ca0 R11: 0000000000000293 R12: ffffffffffffffa8 R13: 0000000000000010 R14: 0000555556cc44b0 R15: 000000000000b5bc Allocated by task 7: 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_kmalloc+0xdb/0x110 mm/kasan/common.c:509 __kasan_kmalloc+0x9/0x10 mm/kasan/common.c:518 kasan_kmalloc include/linux/kasan.h:254 [inline] kmem_cache_alloc_trace+0x18a/0x2e0 mm/slub.c:2974 kmalloc include/linux/slab.h:552 [inline] kzalloc include/linux/slab.h:664 [inline] mld_add_delrec net/ipv6/mcast.c:734 [inline] igmp6_leave_group net/ipv6/mcast.c:2453 [inline] igmp6_group_dropped+0x431/0x9d0 net/ipv6/mcast.c:713 __ipv6_dev_mc_dec+0x2f9/0x4e0 net/ipv6/mcast.c:955 addrconf_leave_solict net/ipv6/addrconf.c:2207 [inline] __ipv6_ifa_notify+0x905/0x11c0 net/ipv6/addrconf.c:6160 addrconf_ifdown+0xe14/0x1a60 net/ipv6/addrconf.c:3907 addrconf_notify+0x378/0xe90 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0x8c/0xf0 kernel/notifier.c:410 call_netdevice_notifiers_info net/core/dev.c:2054 [inline] call_netdevice_notifiers_extack net/core/dev.c:2066 [inline] call_netdevice_notifiers net/core/dev.c:2080 [inline] dev_close_many+0x37f/0x530 net/core/dev.c:1655 unregister_netdevice_many+0x492/0x17d0 net/core/dev.c:10724 default_device_exit_batch+0x38a/0x3f0 net/core/dev.c:11267 ops_exit_list net/core/net_namespace.c:190 [inline] cleanup_net+0x6e9/0xcb0 net/core/net_namespace.c:609 process_one_work+0x6dc/0xbd0 kernel/workqueue.c:2301 worker_thread+0xaea/0x1510 kernel/workqueue.c:2447 kthread+0x34b/0x3d0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 Freed by task 7: 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] kfree+0xc3/0x270 mm/slub.c:4191 mld_clear_delrec+0x271/0x3e0 net/ipv6/mcast.c:814 ipv6_mc_destroy_dev+0x33/0x300 net/ipv6/mcast.c:2598 addrconf_ifdown+0x1652/0x1a60 net/ipv6/addrconf.c:3926 addrconf_notify+0x378/0xe90 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0x8c/0xf0 kernel/notifier.c:410 call_netdevice_notifiers_info net/core/dev.c:2054 [inline] call_netdevice_notifiers_extack net/core/dev.c:2066 [inline] call_netdevice_notifiers net/core/dev.c:2080 [inline] unregister_netdevice_many+0xde7/0x17d0 net/core/dev.c:10747 default_device_exit_batch+0x38a/0x3f0 net/core/dev.c:11267 ops_exit_list net/core/net_namespace.c:190 [inline] cleanup_net+0x6e9/0xcb0 net/core/net_namespace.c:609 process_one_work+0x6dc/0xbd0 kernel/workqueue.c:2301 worker_thread+0xaea/0x1510 kernel/workqueue.c:2447 kthread+0x34b/0x3d0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 The buggy address belongs to the object at ffff88810e868a00 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 103 bytes inside of 192-byte region [ffff88810e868a00, ffff88810e868ac0) The buggy address belongs to the page: page:ffffea00043a1a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10e868 flags: 0x4000000000000200(slab) raw: 4000000000000200 ffffea00043a18c0 0000000700000007 ffff888100043380 raw: 0000000000000000 0000000000100010 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 96, ts 4476305627, free_ts 4476282032 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2456 [inline] prep_new_page+0x166/0x180 mm/page_alloc.c:2462 get_page_from_freelist+0x2d8c/0x2f30 mm/page_alloc.c:4254 __alloc_pages_nodemask+0x435/0xaf0 mm/page_alloc.c:5348 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_trace+0x1bd/0x2e0 mm/slub.c:2972 kmalloc include/linux/slab.h:552 [inline] kzalloc include/linux/slab.h:664 [inline] kernfs_fop_open+0x324/0xab0 fs/kernfs/file.c:628 do_dentry_open+0x7c1/0x10d0 fs/open.c:819 vfs_open+0x73/0x80 fs/open.c:942 do_open fs/namei.c:3391 [inline] path_openat+0x2660/0x3000 fs/namei.c:3509 do_filp_open+0x21c/0x460 fs/namei.c:3536 do_sys_openat2+0x13f/0x710 fs/open.c:1217 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/0xcb page last free stack trace: reset_page_owner include/linux/page_owner.h:28 [inline] free_pages_prepare mm/page_alloc.c:1349 [inline] free_pcp_prepare mm/page_alloc.c:1421 [inline] free_unref_page_prepare+0x2ae/0x2d0 mm/page_alloc.c:3336 free_unref_page mm/page_alloc.c:3391 [inline] free_the_page+0x9e/0x370 mm/page_alloc.c:5407 __free_pages+0x67/0xc0 mm/page_alloc.c:5418 free_pages+0x7c/0x90 mm/page_alloc.c:5429 selinux_genfs_get_sid+0x24d/0x2a0 security/selinux/hooks.c:1326 inode_doinit_with_dentry+0x86f/0x1050 security/selinux/hooks.c:1523 selinux_d_instantiate+0x27/0x40 security/selinux/hooks.c:6389 security_d_instantiate+0x9f/0x100 security/security.c:1980 d_splice_alias+0x6d/0x390 fs/dcache.c:3036 kernfs_iop_lookup+0x2a4/0x2f0 fs/kernfs/dir.c:1178 lookup_open fs/namei.c:3226 [inline] open_last_lookups fs/namei.c:3317 [inline] path_openat+0x11ab/0x3000 fs/namei.c:3506 do_filp_open+0x21c/0x460 fs/namei.c:3536 do_sys_openat2+0x13f/0x710 fs/open.c:1217 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/0xcb Memory state around the buggy address: ffff88810e868900: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88810e868980: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88810e868a00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88810e868a80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88810e868b00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================