================================================================== BUG: KASAN: use-after-free in ext4_search_dir+0xf7/0x1b0 fs/ext4/namei.c:1516 Read of size 1 at addr ffff8881127d5504 by task syz-executor375/357 CPU: 0 PID: 357 Comm: syz-executor375 Not tainted 5.10.226-syzkaller-00709-ge5e5644ea27f #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/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_search_dir+0xf7/0x1b0 fs/ext4/namei.c:1516 ext4_find_inline_entry+0x4b6/0x5e0 fs/ext4/inline.c:1700 __ext4_find_entry+0x2b0/0x1990 fs/ext4/namei.c:1589 ext4_lookup_entry fs/ext4/namei.c:1744 [inline] ext4_lookup+0x3c6/0xaa0 fs/ext4/namei.c:1812 __lookup_slow+0x2b9/0x400 fs/namei.c:1640 lookup_slow+0x5a/0x80 fs/namei.c:1657 walk_component+0x48c/0x610 fs/namei.c:1952 lookup_last fs/namei.c:2403 [inline] path_lookupat+0x16d/0x450 fs/namei.c:2427 filename_lookup+0x26a/0x6f0 fs/namei.c:2460 user_path_at_empty+0x40/0x50 fs/namei.c:2740 user_path_at include/linux/namei.h:60 [inline] do_mount fs/namespace.c:3250 [inline] __do_sys_mount fs/namespace.c:3461 [inline] __se_sys_mount+0x285/0x3b0 fs/namespace.c:3438 __x64_sys_mount+0xbf/0xd0 fs/namespace.c:3438 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7feaa8c6fdf9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 b1 1f 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fff54f1a478 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007feaa8c6fdf9 RDX: 0000000000000000 RSI: 00000000200002c0 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007feaa8ce64a8 R13: 0000000000000000 R14: 00007fff54f1a4e0 R15: 431bde82d7b634db Allocated by task 314: 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] call_modprobe kernel/kmod.c:79 [inline] __request_module+0x28c/0x8d0 kernel/kmod.c:170 sock_load_diag_module+0xd6/0x130 net/core/sock.c:3618 __sock_diag_cmd net/core/sock_diag.c:227 [inline] sock_diag_rcv_msg+0x205/0x400 net/core/sock_diag.c:265 netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2499 sock_diag_rcv+0x28/0x40 net/core/sock_diag.c:276 netlink_unicast_kernel net/netlink/af_netlink.c:1322 [inline] netlink_unicast+0x8df/0xac0 net/netlink/af_netlink.c:1348 netlink_sendmsg+0xa46/0xd00 net/netlink/af_netlink.c:1916 sock_sendmsg_nosec net/socket.c:652 [inline] __sock_sendmsg net/socket.c:664 [inline] ____sys_sendmsg+0x59e/0x8f0 net/socket.c:2376 ___sys_sendmsg+0x252/0x2e0 net/socket.c:2430 __sys_sendmsg net/socket.c:2459 [inline] __do_sys_sendmsg net/socket.c:2468 [inline] __se_sys_sendmsg+0x1b1/0x280 net/socket.c:2466 __x64_sys_sendmsg+0x7b/0x90 net/socket.c:2466 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb Freed by task 314: 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 free_modprobe_argv+0x73/0x80 kernel/kmod.c:66 call_usermodehelper_freeinfo kernel/umh.c:44 [inline] call_usermodehelper_exec+0x161/0x470 kernel/umh.c:452 call_modprobe kernel/kmod.c:98 [inline] __request_module+0x39e/0x8d0 kernel/kmod.c:170 sock_load_diag_module+0xd6/0x130 net/core/sock.c:3618 __sock_diag_cmd net/core/sock_diag.c:227 [inline] sock_diag_rcv_msg+0x205/0x400 net/core/sock_diag.c:265 netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2499 sock_diag_rcv+0x28/0x40 net/core/sock_diag.c:276 netlink_unicast_kernel net/netlink/af_netlink.c:1322 [inline] netlink_unicast+0x8df/0xac0 net/netlink/af_netlink.c:1348 netlink_sendmsg+0xa46/0xd00 net/netlink/af_netlink.c:1916 sock_sendmsg_nosec net/socket.c:652 [inline] __sock_sendmsg net/socket.c:664 [inline] ____sys_sendmsg+0x59e/0x8f0 net/socket.c:2376 ___sys_sendmsg+0x252/0x2e0 net/socket.c:2430 __sys_sendmsg net/socket.c:2459 [inline] __do_sys_sendmsg net/socket.c:2468 [inline] __se_sys_sendmsg+0x1b1/0x280 net/socket.c:2466 __x64_sys_sendmsg+0x7b/0x90 net/socket.c:2466 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb The buggy address belongs to the object at ffff8881127d5500 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 4 bytes inside of 64-byte region [ffff8881127d5500, ffff8881127d5540) The buggy address belongs to the page: page:ffffea000449f540 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1127d5 flags: 0x4000000000000200(slab) raw: 4000000000000200 ffffea000449e700 0000000c0000000c ffff888100043800 raw: 0000000000000000 0000000000200020 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 109, ts 3563672278, free_ts 0 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] kernfs_get_open_node fs/kernfs/file.c:552 [inline] kernfs_fop_open+0x7fa/0xab0 fs/kernfs/file.c:698 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_owner free stack trace missing Memory state around the buggy address: ffff8881127d5400: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8881127d5480: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff8881127d5500: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff8881127d5580: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8881127d5600: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================