================================================================== BUG: KASAN: slab-use-after-free in ocfs2_find_victim_chain fs/ocfs2/suballoc.c:1445 [inline] BUG: KASAN: slab-use-after-free in ocfs2_claim_suballoc_bits+0x10d3/0x2560 fs/ocfs2/suballoc.c:1982 Read of size 4 at addr ffff88806c27e000 by task syz.0.194/7662 CPU: 1 UID: 0 PID: 7662 Comm: syz.0.194 Not tainted 6.13.0-rc1-syzkaller-00025-gfeffde684ac2 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x169/0x550 mm/kasan/report.c:489 kasan_report+0x143/0x180 mm/kasan/report.c:602 ocfs2_find_victim_chain fs/ocfs2/suballoc.c:1445 [inline] ocfs2_claim_suballoc_bits+0x10d3/0x2560 fs/ocfs2/suballoc.c:1982 ocfs2_claim_metadata+0x16d/0x580 fs/ocfs2/suballoc.c:2057 ocfs2_dx_dir_attach_index+0x231/0xf90 fs/ocfs2/dir.c:2308 ocfs2_expand_inline_dir fs/ocfs2/dir.c:3000 [inline] ocfs2_extend_dir+0x439f/0x53c0 fs/ocfs2/dir.c:3182 ocfs2_prepare_dir_for_insert+0x33b5/0x5c40 fs/ocfs2/dir.c:4287 ocfs2_mknod+0xcaf/0x2b30 fs/ocfs2/namei.c:292 ocfs2_create+0x1ab/0x470 fs/ocfs2/namei.c:672 lookup_open fs/namei.c:3649 [inline] open_last_lookups fs/namei.c:3748 [inline] path_openat+0x1c03/0x3590 fs/namei.c:3984 do_filp_open+0x27f/0x4e0 fs/namei.c:4014 do_sys_openat2+0x13e/0x1d0 fs/open.c:1402 do_sys_open fs/open.c:1417 [inline] __do_sys_openat fs/open.c:1433 [inline] __se_sys_openat fs/open.c:1428 [inline] __x64_sys_openat+0x247/0x2a0 fs/open.c:1428 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fcac3b7ff19 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fcac48f4058 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007fcac3d45fa0 RCX: 00007fcac3b7ff19 RDX: 0000000000101242 RSI: 0000000020000240 RDI: ffffffffffffff9c RBP: 00007fcac3bf3986 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000008 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fcac3d45fa0 R15: 00007ffd65bb9f68 Allocated by task 5806: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:319 [inline] __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:345 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4104 [inline] slab_alloc_node mm/slub.c:4153 [inline] kmem_cache_alloc_node_noprof+0x1d9/0x380 mm/slub.c:4205 __alloc_skb+0x1c3/0x440 net/core/skbuff.c:668 alloc_skb include/linux/skbuff.h:1323 [inline] __tcp_send_ack+0xa2/0x600 net/ipv4/tcp_output.c:4244 tcp_ack_snd_check net/ipv4/tcp_input.c:5821 [inline] tcp_rcv_established+0xf93/0x1f20 net/ipv4/tcp_input.c:6267 tcp_v4_do_rcv+0x96d/0xc70 net/ipv4/tcp_ipv4.c:1916 tcp_v4_rcv+0x2dc0/0x37f0 net/ipv4/tcp_ipv4.c:2351 ip_protocol_deliver_rcu+0x22e/0x440 net/ipv4/ip_input.c:205 ip_local_deliver_finish+0x341/0x5f0 net/ipv4/ip_input.c:233 NF_HOOK+0x3a4/0x450 include/linux/netfilter.h:314 ip_local_deliver net/ipv4/ip_input.c:254 [inline] dst_input include/net/dst.h:460 [inline] ip_sublist_rcv_finish+0x3be/0x4f0 net/ipv4/ip_input.c:578 ip_list_rcv_finish net/ipv4/ip_input.c:628 [inline] ip_sublist_rcv+0x75d/0xab0 net/ipv4/ip_input.c:636 ip_list_rcv+0x42b/0x480 net/ipv4/ip_input.c:670 __netif_receive_skb_list_ptype net/core/dev.c:5715 [inline] __netif_receive_skb_list_core+0x94e/0x980 net/core/dev.c:5762 __netif_receive_skb_list net/core/dev.c:5814 [inline] netif_receive_skb_list_internal+0xa51/0xe30 net/core/dev.c:5905 gro_normal_list include/net/gro.h:515 [inline] napi_complete_done+0x2b5/0x870 net/core/dev.c:6256 virtqueue_napi_complete drivers/net/virtio_net.c:758 [inline] virtnet_poll+0x2de9/0x39b0 drivers/net/virtio_net.c:3013 __napi_poll+0xcb/0x490 net/core/dev.c:6877 napi_poll net/core/dev.c:6946 [inline] net_rx_action+0x89b/0x1240 net/core/dev.c:7068 handle_softirqs+0x2d4/0x9b0 kernel/softirq.c:554 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu+0xf7/0x220 kernel/softirq.c:655 irq_exit_rcu+0x9/0x30 kernel/softirq.c:671 common_interrupt+0xb9/0xd0 arch/x86/kernel/irq.c:278 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693 Freed by task 5806: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:582 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x59/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2338 [inline] slab_free mm/slub.c:4598 [inline] kmem_cache_free+0x195/0x410 mm/slub.c:4700 kfree_skb_reason include/linux/skbuff.h:1263 [inline] dev_kfree_skb_any_reason+0x153/0x170 net/core/dev.c:3205 __free_old_xmit+0x2f4/0x6f0 virtnet_free_old_xmit drivers/net/virtio_net.c:631 [inline] free_old_xmit drivers/net/virtio_net.c:1066 [inline] start_xmit+0x278/0x23d0 drivers/net/virtio_net.c:3261 __netdev_start_xmit include/linux/netdevice.h:5002 [inline] netdev_start_xmit include/linux/netdevice.h:5011 [inline] xmit_one net/core/dev.c:3590 [inline] dev_hard_start_xmit+0x27a/0x7d0 net/core/dev.c:3606 sch_direct_xmit+0x29c/0x5d0 net/sched/sch_generic.c:343 __dev_xmit_skb net/core/dev.c:3827 [inline] __dev_queue_xmit+0x1a8f/0x3f50 net/core/dev.c:4400 dev_queue_xmit include/linux/netdevice.h:3168 [inline] neigh_hh_output include/net/neighbour.h:523 [inline] neigh_output include/net/neighbour.h:537 [inline] ip_finish_output2+0xd41/0x1390 net/ipv4/ip_output.c:236 ip_local_out net/ipv4/ip_output.c:130 [inline] __ip_queue_xmit+0x12ca/0x1ef0 net/ipv4/ip_output.c:536 __tcp_transmit_skb+0x2582/0x3ba0 net/ipv4/tcp_output.c:1466 tcp_ack_snd_check net/ipv4/tcp_input.c:5821 [inline] tcp_rcv_established+0xf93/0x1f20 net/ipv4/tcp_input.c:6267 tcp_v4_do_rcv+0x96d/0xc70 net/ipv4/tcp_ipv4.c:1916 tcp_v4_rcv+0x2dc0/0x37f0 net/ipv4/tcp_ipv4.c:2351 ip_protocol_deliver_rcu+0x22e/0x440 net/ipv4/ip_input.c:205 ip_local_deliver_finish+0x341/0x5f0 net/ipv4/ip_input.c:233 NF_HOOK+0x3a4/0x450 include/linux/netfilter.h:314 ip_local_deliver net/ipv4/ip_input.c:254 [inline] dst_input include/net/dst.h:460 [inline] ip_sublist_rcv_finish+0x3be/0x4f0 net/ipv4/ip_input.c:578 ip_list_rcv_finish net/ipv4/ip_input.c:628 [inline] ip_sublist_rcv+0x75d/0xab0 net/ipv4/ip_input.c:636 ip_list_rcv+0x42b/0x480 net/ipv4/ip_input.c:670 __netif_receive_skb_list_ptype net/core/dev.c:5715 [inline] __netif_receive_skb_list_core+0x94e/0x980 net/core/dev.c:5762 __netif_receive_skb_list net/core/dev.c:5814 [inline] netif_receive_skb_list_internal+0xa51/0xe30 net/core/dev.c:5905 gro_normal_list include/net/gro.h:515 [inline] napi_complete_done+0x2b5/0x870 net/core/dev.c:6256 virtqueue_napi_complete drivers/net/virtio_net.c:758 [inline] virtnet_poll+0x2de9/0x39b0 drivers/net/virtio_net.c:3013 __napi_poll+0xcb/0x490 net/core/dev.c:6877 napi_poll net/core/dev.c:6946 [inline] net_rx_action+0x89b/0x1240 net/core/dev.c:7068 handle_softirqs+0x2d4/0x9b0 kernel/softirq.c:554 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu+0xf7/0x220 kernel/softirq.c:655 irq_exit_rcu+0x9/0x30 kernel/softirq.c:671 common_interrupt+0xb9/0xd0 arch/x86/kernel/irq.c:278 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693 The buggy address belongs to the object at ffff88806c27e000 which belongs to the cache skbuff_head_cache of size 240 The buggy address is located 0 bytes inside of freed 240-byte region [ffff88806c27e000, ffff88806c27e0f0) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x6c27e flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88801e6d3000 dead000000000122 0000000000000000 raw: 0000000000000000 00000000000c000c 00000001f5000000 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 0x52820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 5806, tgid 5806 (syz-executor), ts 152529662907, free_ts 152529344093 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1556 prep_new_page mm/page_alloc.c:1564 [inline] get_page_from_freelist+0x3651/0x37a0 mm/page_alloc.c:3474 __alloc_pages_noprof+0x292/0x710 mm/page_alloc.c:4751 alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2265 alloc_slab_page+0x6a/0x140 mm/slub.c:2408 allocate_slab+0x5a/0x2f0 mm/slub.c:2574 new_slab mm/slub.c:2627 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3815 __slab_alloc+0x58/0xa0 mm/slub.c:3905 __slab_alloc_node mm/slub.c:3980 [inline] slab_alloc_node mm/slub.c:4141 [inline] kmem_cache_alloc_node_noprof+0x269/0x380 mm/slub.c:4205 __alloc_skb+0x1c3/0x440 net/core/skbuff.c:668 alloc_skb include/linux/skbuff.h:1323 [inline] __tcp_send_ack+0xa2/0x600 net/ipv4/tcp_output.c:4244 tcp_ack_snd_check net/ipv4/tcp_input.c:5821 [inline] tcp_rcv_established+0xf93/0x1f20 net/ipv4/tcp_input.c:6267 tcp_v4_do_rcv+0x96d/0xc70 net/ipv4/tcp_ipv4.c:1916 tcp_v4_rcv+0x2dc0/0x37f0 net/ipv4/tcp_ipv4.c:2351 ip_protocol_deliver_rcu+0x22e/0x440 net/ipv4/ip_input.c:205 ip_local_deliver_finish+0x341/0x5f0 net/ipv4/ip_input.c:233 page last free pid 5806 tgid 5806 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_page+0xde3/0x1130 mm/page_alloc.c:2657 skb_free_frag include/linux/skbuff.h:3437 [inline] skb_free_head net/core/skbuff.c:1096 [inline] skb_release_data+0x6dc/0x8a0 net/core/skbuff.c:1125 skb_release_all net/core/skbuff.c:1190 [inline] __kfree_skb net/core/skbuff.c:1204 [inline] kfree_skb_partial+0x99/0xb0 net/core/skbuff.c:5996 tcp_data_queue+0x1f1a/0x7310 net/ipv4/tcp_input.c:5308 tcp_rcv_established+0xed0/0x1f20 net/ipv4/tcp_input.c:6264 tcp_v4_do_rcv+0x96d/0xc70 net/ipv4/tcp_ipv4.c:1916 tcp_v4_rcv+0x2dc0/0x37f0 net/ipv4/tcp_ipv4.c:2351 ip_protocol_deliver_rcu+0x22e/0x440 net/ipv4/ip_input.c:205 ip_local_deliver_finish+0x341/0x5f0 net/ipv4/ip_input.c:233 NF_HOOK+0x3a4/0x450 include/linux/netfilter.h:314 ip_local_deliver net/ipv4/ip_input.c:254 [inline] dst_input include/net/dst.h:460 [inline] ip_sublist_rcv_finish+0x3be/0x4f0 net/ipv4/ip_input.c:578 ip_list_rcv_finish net/ipv4/ip_input.c:628 [inline] ip_sublist_rcv+0x75d/0xab0 net/ipv4/ip_input.c:636 ip_list_rcv+0x42b/0x480 net/ipv4/ip_input.c:670 __netif_receive_skb_list_ptype net/core/dev.c:5715 [inline] __netif_receive_skb_list_core+0x94e/0x980 net/core/dev.c:5762 __netif_receive_skb_list net/core/dev.c:5814 [inline] netif_receive_skb_list_internal+0xa51/0xe30 net/core/dev.c:5905 gro_normal_list include/net/gro.h:515 [inline] napi_complete_done+0x2b5/0x870 net/core/dev.c:6256 Memory state around the buggy address: ffff88806c27df00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88806c27df80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88806c27e000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88806c27e080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc ffff88806c27e100: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ==================================================================