BUG: KASAN: use-after-free in ext4_rename_dir_prepare+0x42e/0x4a0 fs/ext4/namei.c:3704 Read of size 4 at addr ffff888105ddf000 by task syz-executor.1/1392 CPU: 0 PID: 1392 Comm: syz-executor.1 Not tainted 5.10.161-syzkaller-00019-g416c4356f372 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/30/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack_lvl+0x1e2/0x24b lib/dump_stack.c:118 print_address_description+0x81/0x3c0 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report+0x1a4/0x1f0 mm/kasan/report.c:436 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308 ext4_rename_dir_prepare+0x42e/0x4a0 fs/ext4/namei.c:3704 ext4_cross_rename fs/ext4/namei.c:4212 [inline] ext4_rename2+0x1f37/0x45a0 fs/ext4/namei.c:4296 vfs_rename+0x95e/0xde0 fs/namei.c:4389 do_renameat2+0x83e/0x1190 fs/namei.c:4536 __do_sys_renameat2 fs/namei.c:4571 [inline] __se_sys_renameat2 fs/namei.c:4568 [inline] __x64_sys_renameat2+0xbf/0xd0 fs/namei.c:4568 do_syscall_64+0x34/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xc6 RIP: 0033:0x7f3cf9d42169 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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:00007f3cf8ab5168 EFLAGS: 00000246 ORIG_RAX: 000000000000013c RAX: ffffffffffffffda RBX: 00007f3cf9e61f80 RCX: 00007f3cf9d42169 RDX: 0000000000000006 RSI: 0000000020000240 RDI: 0000000000000006 RBP: 00007f3cf9d9dca1 R08: 0000000000000002 R09: 0000000000000000 R10: 0000000020000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffea0a0b80f R14: 00007f3cf8ab5300 R15: 0000000000022000 Allocated by task 1157: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:428 [inline] __kasan_slab_alloc+0xb2/0xe0 mm/kasan/common.c:461 kasan_slab_alloc include/linux/kasan.h:259 [inline] slab_post_alloc_hook include/../mm/slab.h:583 [inline] slab_alloc_node mm/slub.c:2956 [inline] slab_alloc mm/slub.c:2964 [inline] kmem_cache_alloc+0x16c/0x300 mm/slub.c:2969 kmem_cache_alloc_node include/linux/slab.h:423 [inline] __alloc_skb+0x7e/0x580 net/core/skbuff.c:199 alloc_skb include/linux/skbuff.h:1116 [inline] ip6_frag_next+0x127/0xb30 net/ipv6/ip6_output.c:772 ip6_fragment+0x1432/0x2130 net/ipv6/ip6_output.c:983 __ip6_finish_output+0x671/0x810 net/ipv6/ip6_output.c:208 ip6_finish_output+0x1c9/0x1e0 net/ipv6/ip6_output.c:220 NF_HOOK_COND include/linux/netfilter.h:293 [inline] ip6_output+0x211/0x4c0 net/ipv6/ip6_output.c:243 dst_output include/net/dst.h:443 [inline] NF_HOOK include/linux/netfilter.h:304 [inline] ip6_xmit+0xafa/0x1590 net/ipv6/ip6_output.c:347 inet6_csk_xmit+0x261/0x360 net/ipv6/inet6_connection_sock.c:135 l2tp_xmit_queue net/l2tp/l2tp_core.c:1006 [inline] l2tp_xmit_core net/l2tp/l2tp_core.c:1095 [inline] l2tp_xmit_skb+0xb34/0x1020 net/l2tp/l2tp_core.c:1111 pppol2tp_sendmsg+0x40f/0x750 net/l2tp/l2tp_ppp.c:319 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg net/socket.c:672 [inline] kernel_sendmsg+0x109/0x140 net/socket.c:692 sock_no_sendpage+0x13d/0x1a0 net/core/sock.c:2853 kernel_sendpage+0x1db/0x2d0 net/socket.c:3517 sock_sendpage+0x84/0xb0 net/socket.c:945 pipe_to_sendpage+0x24f/0x340 fs/splice.c:364 splice_from_pipe_feed fs/splice.c:418 [inline] __splice_from_pipe+0x34c/0x870 fs/splice.c:562 splice_from_pipe fs/splice.c:597 [inline] generic_splice_sendpage+0x193/0x220 fs/splice.c:743 do_splice_from fs/splice.c:764 [inline] direct_splice_actor+0xfe/0x130 fs/splice.c:933 splice_direct_to_actor+0x4f4/0xbd0 fs/splice.c:888 do_splice_direct+0x2a0/0x3f0 fs/splice.c:976 do_sendfile+0x9c7/0x1150 fs/read_write.c:1257 __do_sys_sendfile64 fs/read_write.c:1318 [inline] __se_sys_sendfile64 fs/read_write.c:1304 [inline] __x64_sys_sendfile64+0x1ce/0x230 fs/read_write.c:1304 do_syscall_64+0x34/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xc6 Freed by task 1157: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4c/0x80 mm/kasan/common.c:46 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:357 ____kasan_slab_free+0x121/0x160 mm/kasan/common.c:360 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:368 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:1604 [inline] slab_free_freelist_hook+0xcc/0x1a0 mm/slub.c:1630 slab_free mm/slub.c:3212 [inline] kmem_cache_free+0xa9/0x1f0 mm/slub.c:3228 kfree_skbmem net/core/skbuff.c:658 [inline] __kfree_skb+0x13e/0x1c0 net/core/skbuff.c:695 kfree_skb+0x7b/0x2e0 net/core/skbuff.c:713 __neigh_event_send+0x956/0x1340 net/core/neighbour.c:1180 neigh_event_send include/net/neighbour.h:453 [inline] neigh_resolve_output+0x1cd/0x780 net/core/neighbour.c:1501 neigh_output include/net/neighbour.h:524 [inline] ip6_finish_output2+0x108d/0x1950 net/ipv6/ip6_output.c:145 ip6_fragment+0x148d/0x2130 net/ipv6/ip6_output.c:993 __ip6_finish_output+0x671/0x810 net/ipv6/ip6_output.c:208 ip6_finish_output+0x1c9/0x1e0 net/ipv6/ip6_output.c:220 NF_HOOK_COND include/linux/netfilter.h:293 [inline] ip6_output+0x211/0x4c0 net/ipv6/ip6_output.c:243 dst_output include/net/dst.h:443 [inline] NF_HOOK include/linux/netfilter.h:304 [inline] ip6_xmit+0xafa/0x1590 net/ipv6/ip6_output.c:347 inet6_csk_xmit+0x261/0x360 net/ipv6/inet6_connection_sock.c:135 l2tp_xmit_queue net/l2tp/l2tp_core.c:1006 [inline] l2tp_xmit_core net/l2tp/l2tp_core.c:1095 [inline] l2tp_xmit_skb+0xb34/0x1020 net/l2tp/l2tp_core.c:1111 pppol2tp_sendmsg+0x40f/0x750 net/l2tp/l2tp_ppp.c:319 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg net/socket.c:672 [inline] kernel_sendmsg+0x109/0x140 net/socket.c:692 sock_no_sendpage+0x13d/0x1a0 net/core/sock.c:2853 kernel_sendpage+0x1db/0x2d0 net/socket.c:3517 sock_sendpage+0x84/0xb0 net/socket.c:945 pipe_to_sendpage+0x24f/0x340 fs/splice.c:364 splice_from_pipe_feed fs/splice.c:418 [inline] __splice_from_pipe+0x34c/0x870 fs/splice.c:562 splice_from_pipe fs/splice.c:597 [inline] generic_splice_sendpage+0x193/0x220 fs/splice.c:743 do_splice_from fs/splice.c:764 [inline] direct_splice_actor+0xfe/0x130 fs/splice.c:933 splice_direct_to_actor+0x4f4/0xbd0 fs/splice.c:888 do_splice_direct+0x2a0/0x3f0 fs/splice.c:976 do_sendfile+0x9c7/0x1150 fs/read_write.c:1257 __do_sys_sendfile64 fs/read_write.c:1318 [inline] __se_sys_sendfile64 fs/read_write.c:1304 [inline] __x64_sys_sendfile64+0x1ce/0x230 fs/read_write.c:1304 do_syscall_64+0x34/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xc6 The buggy address belongs to the object at ffff888105ddf000 which belongs to the cache skbuff_head_cache of size 240 The buggy address is located 0 bytes inside of 240-byte region [ffff888105ddf000, ffff888105ddf0f0) The buggy address belongs to the page: page:ffffea00041777c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105ddf flags: 0x8000000000000200(slab) raw: 8000000000000200 dead000000000100 dead000000000122 ffff888107fe9800 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 1157, ts 161649764889, free_ts 161625103118 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2386 [inline] prep_new_page mm/page_alloc.c:2392 [inline] get_page_from_freelist+0x755/0x810 mm/page_alloc.c:4073 __alloc_pages_nodemask+0x3b6/0x890 mm/page_alloc.c:5160 alloc_slab_page mm/slub.c:1815 [inline] allocate_slab+0x78/0x540 mm/slub.c:1817 new_slab mm/slub.c:1878 [inline] new_slab_objects mm/slub.c:2636 [inline] ___slab_alloc+0x131/0x2e0 mm/slub.c:2800 __slab_alloc+0x63/0xa0 mm/slub.c:2840 slab_alloc_node mm/slub.c:2922 [inline] slab_alloc mm/slub.c:2964 [inline] kmem_cache_alloc+0x1ef/0x300 mm/slub.c:2969 skb_clone+0x1d6/0x3b0 net/core/skbuff.c:1459 skb_realloc_headroom+0x85/0x100 net/core/skbuff.c:1720 ip6_xmit+0xe4a/0x1590 net/ipv6/ip6_output.c:282 inet6_csk_xmit+0x261/0x360 net/ipv6/inet6_connection_sock.c:135 l2tp_xmit_queue net/l2tp/l2tp_core.c:1006 [inline] l2tp_xmit_core net/l2tp/l2tp_core.c:1095 [inline] l2tp_xmit_skb+0xb34/0x1020 net/l2tp/l2tp_core.c:1111 pppol2tp_sendmsg+0x40f/0x750 net/l2tp/l2tp_ppp.c:319 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg net/socket.c:672 [inline] kernel_sendmsg+0x109/0x140 net/socket.c:692 sock_no_sendpage+0x13d/0x1a0 net/core/sock.c:2853 kernel_sendpage+0x1db/0x2d0 net/socket.c:3517 sock_sendpage+0x84/0xb0 net/socket.c:945 page last free stack trace: reset_page_owner include/linux/page_owner.h:28 [inline] free_pages_prepare mm/page_alloc.c:1332 [inline] free_pcp_prepare+0x18c/0x1c0 mm/page_alloc.c:1406 free_unref_page_prepare mm/page_alloc.c:3293 [inline] free_unref_page mm/page_alloc.c:3347 [inline] free_the_page mm/page_alloc.c:5219 [inline] __free_pages+0x390/0x570 mm/page_alloc.c:5228 free_pages+0x7c/0x90 mm/page_alloc.c:5239 kvm_coalesced_mmio_free+0x4a/0x60 arch/x86/kvm/../../../virt/kvm/coalesced_mmio.c:134 kvm_destroy_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:906 [inline] kvm_put_kvm+0x971/0x11b0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:934 kvm_vm_release+0x46/0x50 arch/x86/kvm/../../../virt/kvm/kvm_main.c:957 __fput+0x348/0x7c0 fs/file_table.c:281 ____fput+0x15/0x20 fs/file_table.c:314 task_work_run+0x147/0x1b0 kernel/task_work.c:154 get_signal+0xf9d/0x1440 kernel/signal.c:2584 arch_do_signal+0x8e/0x650 arch/x86/kernel/signal.c:805 exit_to_user_mode_loop+0xa3/0xe0 kernel/entry/common.c:161 exit_to_user_mode_prepare kernel/entry/common.c:191 [inline] syscall_exit_to_user_mode+0x77/0xa0 kernel/entry/common.c:266 do_syscall_64+0x40/0x70 arch/x86/entry/common.c:56 entry_SYSCALL_64_after_hwframe+0x61/0xc6 Memory state around the buggy address: ffff888105ddef00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888105ddef80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888105ddf000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888105ddf080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc ffff888105ddf100: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ==================================================================