===================================================== BUG: KMSAN: use-after-free in do_slab_free mm/slub.c:3018 [inline] BUG: KMSAN: use-after-free in slab_free mm/slub.c:3041 [inline] BUG: KMSAN: use-after-free in kmem_cache_free+0x3df/0x2b70 mm/slub.c:3056 CPU: 0 PID: 12143 Comm: syz-fuzzer Not tainted 5.4.0-rc3+ #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x191/0x1f0 lib/dump_stack.c:113 kmsan_report+0x14a/0x2f0 mm/kmsan/kmsan_report.c:110 __msan_warning+0x73/0xf0 mm/kmsan/kmsan_instr.c:245 do_slab_free mm/slub.c:3018 [inline] slab_free mm/slub.c:3041 [inline] kmem_cache_free+0x3df/0x2b70 mm/slub.c:3056 kfree_skbmem net/core/skbuff.c:644 [inline] __kfree_skb net/core/skbuff.c:680 [inline] kfree_skb+0x473/0x4c0 net/core/skbuff.c:697 packet_rcv_spkt+0x68d/0x7c0 net/packet/af_packet.c:1847 dev_queue_xmit_nit+0x1125/0x1200 net/core/dev.c:2077 xmit_one net/core/dev.c:3276 [inline] dev_hard_start_xmit+0x21e/0xab0 net/core/dev.c:3296 sch_direct_xmit+0x56c/0x18c0 net/sched/sch_generic.c:314 __dev_xmit_skb net/core/dev.c:3481 [inline] __dev_queue_xmit+0x212d/0x4200 net/core/dev.c:3842 dev_queue_xmit+0x4b/0x60 net/core/dev.c:3906 neigh_hh_output include/net/neighbour.h:500 [inline] neigh_output include/net/neighbour.h:509 [inline] ip_finish_output2+0x20d6/0x25d0 net/ipv4/ip_output.c:228 __ip_finish_output+0xaf8/0xda0 net/ipv4/ip_output.c:308 ip_finish_output+0x2db/0x420 net/ipv4/ip_output.c:318 NF_HOOK_COND include/linux/netfilter.h:294 [inline] ip_output+0x541/0x610 net/ipv4/ip_output.c:432 dst_output include/net/dst.h:436 [inline] ip_local_out net/ipv4/ip_output.c:125 [inline] __ip_queue_xmit+0x1caf/0x21f0 net/ipv4/ip_output.c:532 ip_queue_xmit+0xcc/0xf0 include/net/ip.h:237 __tcp_transmit_skb+0x40e3/0x5d90 net/ipv4/tcp_output.c:1169 __tcp_send_ack+0x701/0x840 net/ipv4/tcp_output.c:3696 tcp_send_ack+0x68/0x90 net/ipv4/tcp_output.c:3702 __tcp_ack_snd_check+0x643/0xb40 net/ipv4/tcp_input.c:5241 tcp_rcv_established+0x2d7b/0x31f0 net/ipv4/tcp_input.c:5672 tcp_v4_do_rcv+0x684/0xd70 net/ipv4/tcp_ipv4.c:1561 tcp_v4_rcv+0x647b/0x6a70 net/ipv4/tcp_ipv4.c:1942 ip_protocol_deliver_rcu+0x4c7/0xbd0 net/ipv4/ip_input.c:204 ip_local_deliver_finish net/ipv4/ip_input.c:231 [inline] NF_HOOK include/linux/netfilter.h:305 [inline] ip_local_deliver+0x62a/0x7c0 net/ipv4/ip_input.c:252 dst_input include/net/dst.h:442 [inline] ip_rcv_finish net/ipv4/ip_input.c:413 [inline] NF_HOOK include/linux/netfilter.h:305 [inline] ip_rcv+0x6c5/0x740 net/ipv4/ip_input.c:523 __netif_receive_skb_one_core net/core/dev.c:5010 [inline] __netif_receive_skb net/core/dev.c:5124 [inline] netif_receive_skb_internal+0x8f4/0xc20 net/core/dev.c:5214 napi_skb_finish net/core/dev.c:5677 [inline] napi_gro_receive+0x67f/0xbb0 net/core/dev.c:5710 receive_buf+0x653b/0x8810 drivers/net/virtio_net.c:1061 virtnet_receive drivers/net/virtio_net.c:1323 [inline] virtnet_poll+0x666/0x1a10 drivers/net/virtio_net.c:1428 napi_poll net/core/dev.c:6392 [inline] net_rx_action+0x7a6/0x1aa0 net/core/dev.c:6460 __do_softirq+0x4a1/0x83a kernel/softirq.c:293 invoke_softirq kernel/softirq.c:375 [inline] irq_exit+0x230/0x280 kernel/softirq.c:416 exiting_irq arch/x86/include/asm/apic.h:536 [inline] do_IRQ+0x123/0x360 arch/x86/kernel/irq.c:263 common_interrupt+0x2e/0x2e arch/x86/entry/entry_64.S:612 RIP: 0010:finish_lock_switch+0x2b/0x40 kernel/sched/core.c:3126 Code: 48 89 e5 53 48 89 fb e8 a3 1d 9d 00 8b b8 88 0c 00 00 48 8b 00 48 85 c0 75 12 48 89 df e8 dd 14 9d 00 c6 00 00 c6 03 00 fb 5b <5d> c3 e8 8e 1c 9d 00 eb e7 66 90 66 2e 0f 1f 84 00 00 00 00 00 55 RSP: 0018:ffff8880b2e6f7c8 EFLAGS: 00000286 ORIG_RAX: ffffffffffffffda RAX: ffff88821feee840 RBX: ffff888113875ac0 RCX: ccccccccccccd000 RDX: ffff88821fe0e840 RSI: ffffea000a9faa60 RDI: 000000012fcd5840 RBP: ffff8880b2e6f7c8 R08: 0000000000000002 R09: ffff888124689e41 R10: 0000000000000004 R11: 0000000000000000 R12: 0000000000000001 R13: ffff8881246827e8 R14: ffff888124681e40 R15: ffff88812fcd5840 finish_task_switch+0xfa/0x2d0 kernel/sched/core.c:3227 context_switch kernel/sched/core.c:3391 [inline] __schedule+0x71b/0x800 kernel/sched/core.c:4075 schedule+0x19b/0x2d0 kernel/sched/core.c:4142 freezable_schedule include/linux/freezer.h:172 [inline] futex_wait_queue_me+0x506/0x6a0 kernel/futex.c:2627 futex_wait+0x3e9/0xbf0 kernel/futex.c:2733 do_futex+0x8d8/0x6490 kernel/futex.c:3644 __do_sys_futex kernel/futex.c:3705 [inline] __se_sys_futex+0x43c/0x7f0 kernel/futex.c:3673 __x64_sys_futex+0x6e/0x90 kernel/futex.c:3673 do_syscall_64+0xb6/0x160 arch/x86/entry/common.c:291 entry_SYSCALL_64_after_hwframe+0x63/0xe7 RIP: 0033:0x45ddf3 Code: cc cc cc cc cc cc cc 48 8b 7c 24 08 8b 74 24 10 8b 54 24 14 4c 8b 54 24 18 4c 8b 44 24 20 44 8b 4c 24 28 b8 ca 00 00 00 0f 05 <89> 44 24 30 c3 cc cc cc cc cc cc cc cc 8b 7c 24 08 48 8b 74 24 10 RSP: 002b:000000c420033de8 EFLAGS: 00000286 ORIG_RAX: 00000000000000ca RAX: ffffffffffffffda RBX: 000000c42008ae00 RCX: 000000000045ddf3 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 000000c42008af10 RBP: 000000c420033e30 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000286 R12: 000000c42df4eff8 R13: 000000000000000f R14: 0000000000c2bd80 R15: 0000000000008aec Uninit was stored to memory at: kmsan_save_stack_with_flags mm/kmsan/kmsan.c:151 [inline] kmsan_internal_chain_origin+0xbd/0x170 mm/kmsan/kmsan.c:319 __msan_chain_origin+0x6b/0xe0 mm/kmsan/kmsan_instr.c:179 ___slab_alloc+0x1dbc/0x1fb0 mm/slub.c:2636 __slab_alloc mm/slub.c:2689 [inline] slab_alloc_node mm/slub.c:2752 [inline] slab_alloc mm/slub.c:2801 [inline] kmem_cache_alloc+0xade/0xd10 mm/slub.c:2806 skb_clone+0x326/0x5d0 net/core/skbuff.c:1448 dev_queue_xmit_nit+0x539/0x1200 net/core/dev.c:2045 xmit_one net/core/dev.c:3276 [inline] dev_hard_start_xmit+0x21e/0xab0 net/core/dev.c:3296 sch_direct_xmit+0x56c/0x18c0 net/sched/sch_generic.c:314 __dev_xmit_skb net/core/dev.c:3481 [inline] __dev_queue_xmit+0x212d/0x4200 net/core/dev.c:3842 dev_queue_xmit+0x4b/0x60 net/core/dev.c:3906 neigh_hh_output include/net/neighbour.h:500 [inline] neigh_output include/net/neighbour.h:509 [inline] ip_finish_output2+0x20d6/0x25d0 net/ipv4/ip_output.c:228 __ip_finish_output+0xaf8/0xda0 net/ipv4/ip_output.c:308 ip_finish_output+0x2db/0x420 net/ipv4/ip_output.c:318 NF_HOOK_COND include/linux/netfilter.h:294 [inline] ip_output+0x541/0x610 net/ipv4/ip_output.c:432 dst_output include/net/dst.h:436 [inline] ip_local_out net/ipv4/ip_output.c:125 [inline] __ip_queue_xmit+0x1caf/0x21f0 net/ipv4/ip_output.c:532 ip_queue_xmit+0xcc/0xf0 include/net/ip.h:237 __tcp_transmit_skb+0x40e3/0x5d90 net/ipv4/tcp_output.c:1169 __tcp_send_ack+0x701/0x840 net/ipv4/tcp_output.c:3696 tcp_send_ack+0x68/0x90 net/ipv4/tcp_output.c:3702 __tcp_ack_snd_check+0x643/0xb40 net/ipv4/tcp_input.c:5241 tcp_rcv_established+0x2d7b/0x31f0 net/ipv4/tcp_input.c:5672 tcp_v4_do_rcv+0x684/0xd70 net/ipv4/tcp_ipv4.c:1561 tcp_v4_rcv+0x647b/0x6a70 net/ipv4/tcp_ipv4.c:1942 ip_protocol_deliver_rcu+0x4c7/0xbd0 net/ipv4/ip_input.c:204 ip_local_deliver_finish net/ipv4/ip_input.c:231 [inline] NF_HOOK include/linux/netfilter.h:305 [inline] ip_local_deliver+0x62a/0x7c0 net/ipv4/ip_input.c:252 dst_input include/net/dst.h:442 [inline] ip_rcv_finish net/ipv4/ip_input.c:413 [inline] NF_HOOK include/linux/netfilter.h:305 [inline] ip_rcv+0x6c5/0x740 net/ipv4/ip_input.c:523 __netif_receive_skb_one_core net/core/dev.c:5010 [inline] __netif_receive_skb net/core/dev.c:5124 [inline] netif_receive_skb_internal+0x8f4/0xc20 net/core/dev.c:5214 napi_skb_finish net/core/dev.c:5677 [inline] napi_gro_receive+0x67f/0xbb0 net/core/dev.c:5710 receive_buf+0x653b/0x8810 drivers/net/virtio_net.c:1061 virtnet_receive drivers/net/virtio_net.c:1323 [inline] virtnet_poll+0x666/0x1a10 drivers/net/virtio_net.c:1428 napi_poll net/core/dev.c:6392 [inline] net_rx_action+0x7a6/0x1aa0 net/core/dev.c:6460 __do_softirq+0x4a1/0x83a kernel/softirq.c:293 invoke_softirq kernel/softirq.c:375 [inline] irq_exit+0x230/0x280 kernel/softirq.c:416 exiting_irq arch/x86/include/asm/apic.h:536 [inline] do_IRQ+0x123/0x360 arch/x86/kernel/irq.c:263 ret_from_intr+0x0/0x33 finish_lock_switch+0x2b/0x40 kernel/sched/core.c:3126 finish_task_switch+0xfa/0x2d0 kernel/sched/core.c:3227 context_switch kernel/sched/core.c:3391 [inline] __schedule+0x71b/0x800 kernel/sched/core.c:4075 schedule+0x19b/0x2d0 kernel/sched/core.c:4142 freezable_schedule include/linux/freezer.h:172 [inline] futex_wait_queue_me+0x506/0x6a0 kernel/futex.c:2627 futex_wait+0x3e9/0xbf0 kernel/futex.c:2733 do_futex+0x8d8/0x6490 kernel/futex.c:3644 __do_sys_futex kernel/futex.c:3705 [inline] __se_sys_futex+0x43c/0x7f0 kernel/futex.c:3673 __x64_sys_futex+0x6e/0x90 kernel/futex.c:3673 do_syscall_64+0xb6/0x160 arch/x86/entry/common.c:291 entry_SYSCALL_64_after_hwframe+0x63/0xe7 Uninit was created at: kmsan_save_stack_with_flags mm/kmsan/kmsan.c:151 [inline] kmsan_internal_poison_shadow+0x60/0x110 mm/kmsan/kmsan.c:134 kmsan_slab_free+0x8d/0x100 mm/kmsan/kmsan_hooks.c:108 slab_free_freelist_hook mm/slub.c:1473 [inline] slab_free mm/slub.c:3040 [inline] kmem_cache_free_bulk+0x3ad9/0x3f10 mm/slub.c:3165 __kfree_skb_flush+0xb0/0x100 net/core/skbuff.c:862 net_rx_action+0x1a5e/0x1aa0 net/core/dev.c:6483 __do_softirq+0x4a1/0x83a kernel/softirq.c:293 run_ksoftirqd+0x25/0x40 kernel/softirq.c:607 smpboot_thread_fn+0x4a3/0x990 kernel/smpboot.c:165 kthread+0x4b5/0x4f0 kernel/kthread.c:256 ret_from_fork+0x35/0x40 arch/x86/entry/entry_64.S:355 =====================================================