================================================================== BUG: KASAN: use-after-free in ext4_search_dir+0xf7/0x1b0 fs/ext4/namei.c:1543 Read of size 1 at addr ffff88810c4bfd23 by task syz-executor.0/360 CPU: 0 PID: 360 Comm: syz-executor.0 Not tainted 5.15.156-syzkaller-1070798-g29d153aabd54 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1c0 lib/dump_stack.c:106 print_address_description+0x87/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:427 [inline] kasan_report+0x179/0x1c0 mm/kasan/report.c:444 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report_generic.c:306 ext4_search_dir+0xf7/0x1b0 fs/ext4/namei.c:1543 ext4_find_inline_entry+0x4b6/0x5e0 fs/ext4/inline.c:1714 __ext4_find_entry+0x2b0/0x1af0 fs/ext4/namei.c:1616 ext4_lookup_entry fs/ext4/namei.c:1771 [inline] ext4_lookup+0x3c6/0xaa0 fs/ext4/namei.c:1839 lookup_one_qstr_excl+0x143/0x290 fs/namei.c:1563 filename_create+0x28e/0x530 fs/namei.c:3836 do_mkdirat+0xbd/0x450 fs/namei.c:4080 __do_sys_mkdirat fs/namei.c:4105 [inline] __se_sys_mkdirat fs/namei.c:4103 [inline] __x64_sys_mkdirat+0x89/0xa0 fs/namei.c:4103 x64_sys_call+0x6c6/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:259 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f4371a60ae9 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:00007f43715e30c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 00007f4371b7ff80 RCX: 00007f4371a60ae9 RDX: 0000000000000000 RSI: 0000000020000040 RDI: ffffffffffffff9c RBP: 00007f4371aac47a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f4371b7ff80 R15: 00007ffcfd6d9b88 Allocated by task 310: 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:433 [inline] __kasan_slab_alloc+0xb1/0xe0 mm/kasan/common.c:466 kasan_slab_alloc include/linux/kasan.h:217 [inline] slab_post_alloc_hook+0x53/0x2c0 mm/slab.h:550 slab_alloc_node mm/slub.c:3240 [inline] slab_alloc mm/slub.c:3248 [inline] kmem_cache_alloc+0xf5/0x200 mm/slub.c:3253 kmem_cache_alloc_node include/linux/slab.h:474 [inline] __alloc_skb+0xbe/0x550 net/core/skbuff.c:416 alloc_skb include/linux/skbuff.h:1183 [inline] nlmsg_new include/net/netlink.h:953 [inline] rtmsg_ifinfo_build_skb+0x7f/0x180 net/core/rtnetlink.c:3863 rtmsg_ifinfo_event net/core/rtnetlink.c:3899 [inline] rtmsg_ifinfo+0x78/0x120 net/core/rtnetlink.c:3908 netdev_state_change+0x1be/0x250 net/core/dev.c:1418 linkwatch_do_dev+0x110/0x160 net/core/link_watch.c:167 __linkwatch_run_queue+0x4ca/0x7f0 net/core/link_watch.c:213 linkwatch_event+0x4c/0x60 net/core/link_watch.c:252 process_one_work+0x6bb/0xc10 kernel/workqueue.c:2325 worker_thread+0xad5/0x12a0 kernel/workqueue.c:2472 kthread+0x421/0x510 kernel/kthread.c:337 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:300 Freed by task 310: 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+0x126/0x160 mm/kasan/common.c:365 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:373 kasan_slab_free include/linux/kasan.h:193 [inline] slab_free_hook mm/slub.c:1723 [inline] slab_free_freelist_hook+0xbd/0x190 mm/slub.c:1749 slab_free mm/slub.c:3519 [inline] kmem_cache_free+0x116/0x2e0 mm/slub.c:3535 kfree_skbmem+0x104/0x170 __kfree_skb net/core/skbuff.c:758 [inline] consume_skb+0xb4/0x250 net/core/skbuff.c:930 netlink_broadcast_filtered+0x10f4/0x1220 net/netlink/af_netlink.c:1540 netlink_broadcast net/netlink/af_netlink.c:1562 [inline] nlmsg_multicast include/net/netlink.h:1033 [inline] nlmsg_notify+0x101/0x1c0 net/netlink/af_netlink.c:2548 rtnl_notify net/core/rtnetlink.c:730 [inline] rtmsg_ifinfo_send net/core/rtnetlink.c:3887 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:3902 [inline] rtmsg_ifinfo+0xe7/0x120 net/core/rtnetlink.c:3908 netdev_state_change+0x1be/0x250 net/core/dev.c:1418 linkwatch_do_dev+0x110/0x160 net/core/link_watch.c:167 __linkwatch_run_queue+0x4ca/0x7f0 net/core/link_watch.c:213 linkwatch_event+0x4c/0x60 net/core/link_watch.c:252 process_one_work+0x6bb/0xc10 kernel/workqueue.c:2325 worker_thread+0xad5/0x12a0 kernel/workqueue.c:2472 kthread+0x421/0x510 kernel/kthread.c:337 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:300 The buggy address belongs to the object at ffff88810c4bfc80 which belongs to the cache skbuff_head_cache of size 248 The buggy address is located 163 bytes inside of 248-byte region [ffff88810c4bfc80, ffff88810c4bfd78) The buggy address belongs to the page: page:ffffea0004312fc0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10c4bf flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 0000000000000000 dead000000000122 ffff8881081b2780 raw: 0000000000000000 00000000000c000c 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 0x112a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL), pid 354, ts 46907399764, free_ts 46888327562 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2605 prep_new_page+0x1b/0x110 mm/page_alloc.c:2611 get_page_from_freelist+0x3550/0x35d0 mm/page_alloc.c:4485 __alloc_pages+0x27e/0x8f0 mm/page_alloc.c:5779 allocate_slab mm/slub.c:1932 [inline] new_slab+0x9a/0x4e0 mm/slub.c:1995 ___slab_alloc+0x39e/0x830 mm/slub.c:3028 __slab_alloc+0x4a/0x90 mm/slub.c:3115 slab_alloc_node mm/slub.c:3206 [inline] slab_alloc mm/slub.c:3248 [inline] kmem_cache_alloc+0x134/0x200 mm/slub.c:3253 kmem_cache_alloc_node include/linux/slab.h:474 [inline] __alloc_skb+0xbe/0x550 net/core/skbuff.c:416 alloc_skb include/linux/skbuff.h:1183 [inline] nlmsg_new include/net/netlink.h:953 [inline] rtmsg_ifinfo_build_skb+0x7f/0x180 net/core/rtnetlink.c:3863 rtmsg_ifinfo_event net/core/rtnetlink.c:3899 [inline] rtmsg_ifinfo+0x78/0x120 net/core/rtnetlink.c:3908 __dev_notify_flags+0xdd/0x610 net/core/dev.c:8854 dev_change_flags+0xf0/0x1a0 net/core/dev.c:8896 do_setlink+0xcd1/0x3ae0 net/core/rtnetlink.c:2741 __rtnl_newlink net/core/rtnetlink.c:3429 [inline] rtnl_newlink+0x1779/0x2050 net/core/rtnetlink.c:3549 rtnetlink_rcv_msg+0x951/0xc40 net/core/rtnetlink.c:5629 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1472 [inline] free_pcp_prepare mm/page_alloc.c:1544 [inline] free_unref_page_prepare+0x7c8/0x7d0 mm/page_alloc.c:3534 free_unref_page+0xe8/0x750 mm/page_alloc.c:3616 free_the_page mm/page_alloc.c:805 [inline] __free_pages+0x61/0xf0 mm/page_alloc.c:5855 __free_slab+0xec/0x1d0 mm/slub.c:2020 free_slab mm/slub.c:2035 [inline] discard_slab mm/slub.c:2041 [inline] __unfreeze_partials+0x165/0x1a0 mm/slub.c:2527 put_cpu_partial+0xc4/0x120 mm/slub.c:2607 __slab_free+0x1c8/0x290 mm/slub.c:3388 do_slab_free mm/slub.c:3507 [inline] ___cache_free+0x109/0x120 mm/slub.c:3526 qlink_free+0x4d/0x90 mm/kasan/quarantine.c:157 qlist_free_all+0x44/0xb0 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x15a/0x180 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x2f/0xe0 mm/kasan/common.c:443 kasan_slab_alloc include/linux/kasan.h:217 [inline] slab_post_alloc_hook+0x53/0x2c0 mm/slab.h:550 slab_alloc_node mm/slub.c:3240 [inline] slab_alloc mm/slub.c:3248 [inline] kmem_cache_alloc+0xf5/0x200 mm/slub.c:3253 kmem_cache_alloc_node include/linux/slab.h:474 [inline] __alloc_skb+0xbe/0x550 net/core/skbuff.c:416 alloc_skb include/linux/skbuff.h:1183 [inline] alloc_skb_with_frags+0xa6/0x680 net/core/skbuff.c:6159 Memory state around the buggy address: ffff88810c4bfc00: fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc ffff88810c4bfc80: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88810c4bfd00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc ^ ffff88810c4bfd80: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ffff88810c4bfe00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== EXT4-fs error (device loop0): ext4_find_dest_de:2112: inode #12: block 7: comm syz-executor.0: bad entry in directory: rec_len % 4 != 0 - offset=0, inode=3089191003, rec_len=43069, size=56 fake=0