===================================================== BUG: KMSAN: use-after-free in kfree_skbmem net/core/skbuff.c:644 [inline] BUG: KMSAN: use-after-free in __kfree_skb net/core/skbuff.c:680 [inline] BUG: KMSAN: use-after-free in kfree_skb+0x473/0x4c0 net/core/skbuff.c:697 CPU: 1 PID: 11078 Comm: syz-fuzzer Not tainted 5.3.0-rc7+ #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+0x17d/0x2f0 mm/kmsan/kmsan_report.c:114 __msan_warning+0x73/0xe0 mm/kmsan/kmsan_instr.c:250 do_slab_free mm/slub.c:3016 [inline] slab_free mm/slub.c:3039 [inline] kmem_cache_free+0x3df/0x2b70 mm/slub.c:3054 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+0x719/0x840 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:309 __dev_xmit_skb net/core/dev.c:3477 [inline] __dev_queue_xmit+0x1e53/0x4270 net/core/dev.c:3838 dev_queue_xmit+0x4b/0x60 net/core/dev.c:3902 neigh_hh_output include/net/neighbour.h:500 [inline] neigh_output include/net/neighbour.h:509 [inline] ip_finish_output2+0x20c6/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:236 __tcp_transmit_skb+0x409e/0x5c60 net/ipv4/tcp_output.c:1158 __tcp_send_ack+0x701/0x840 net/ipv4/tcp_output.c:3685 tcp_send_ack+0x68/0x90 net/ipv4/tcp_output.c:3691 tcp_cleanup_rbuf+0x764/0x800 net/ipv4/tcp.c:1575 tcp_recvmsg+0x334d/0x4ff0 net/ipv4/tcp.c:2179 inet_recvmsg+0x237/0x7d0 net/ipv4/af_inet.c:838 sock_recvmsg_nosec net/socket.c:871 [inline] sock_recvmsg net/socket.c:889 [inline] sock_read_iter+0x5be/0x660 net/socket.c:967 call_read_iter include/linux/fs.h:1864 [inline] new_sync_read fs/read_write.c:414 [inline] __vfs_read+0xa67/0xc90 fs/read_write.c:427 vfs_read+0x359/0x6f0 fs/read_write.c:461 ksys_read+0x265/0x430 fs/read_write.c:587 __do_sys_read fs/read_write.c:597 [inline] __se_sys_read+0x92/0xb0 fs/read_write.c:595 __x64_sys_read+0x4a/0x70 fs/read_write.c:595 do_syscall_64+0xbc/0xf0 arch/x86/entry/common.c:297 entry_SYSCALL_64_after_hwframe+0x63/0xe7 RIP: 0033:0x47fd44 Code: ff ff cc cc cc cc e8 9b 40 fb ff 48 8b 7c 24 10 48 8b 74 24 18 48 8b 54 24 20 45 31 d2 45 31 c0 45 31 c9 48 8b 44 24 08 0f 05 <48> 3d 01 f0 ff ff 76 20 48 c7 44 24 28 ff ff ff ff 48 c7 44 24 30 RSP: 002b:000000c4203d1710 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000047fd44 RDX: 0000000000001000 RSI: 000000c420378000 RDI: 0000000000000003 RBP: 000000c4203d1760 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000008 R13: 0000000000000008 R14: 0000000000000002 R15: ffffffffffffffff Uninit was stored to memory at: kmsan_save_stack_with_flags mm/kmsan/kmsan.c:154 [inline] kmsan_internal_chain_origin+0xde/0x190 mm/kmsan/kmsan.c:325 __msan_chain_origin+0x6b/0xe0 mm/kmsan/kmsan_instr.c:184 ___slab_alloc+0x1dbc/0x1fb0 mm/slub.c:2634 __slab_alloc mm/slub.c:2687 [inline] slab_alloc_node mm/slub.c:2750 [inline] slab_alloc mm/slub.c:2799 [inline] kmem_cache_alloc+0xade/0xd10 mm/slub.c:2804 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:309 __dev_xmit_skb net/core/dev.c:3477 [inline] __dev_queue_xmit+0x1e53/0x4270 net/core/dev.c:3838 dev_queue_xmit+0x4b/0x60 net/core/dev.c:3902 neigh_hh_output include/net/neighbour.h:500 [inline] neigh_output include/net/neighbour.h:509 [inline] ip_finish_output2+0x20c6/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:236 __tcp_transmit_skb+0x409e/0x5c60 net/ipv4/tcp_output.c:1158 __tcp_send_ack+0x701/0x840 net/ipv4/tcp_output.c:3685 tcp_send_ack+0x68/0x90 net/ipv4/tcp_output.c:3691 tcp_cleanup_rbuf+0x764/0x800 net/ipv4/tcp.c:1575 tcp_recvmsg+0x334d/0x4ff0 net/ipv4/tcp.c:2179 inet_recvmsg+0x237/0x7d0 net/ipv4/af_inet.c:838 sock_recvmsg_nosec net/socket.c:871 [inline] sock_recvmsg net/socket.c:889 [inline] sock_read_iter+0x5be/0x660 net/socket.c:967 call_read_iter include/linux/fs.h:1864 [inline] new_sync_read fs/read_write.c:414 [inline] __vfs_read+0xa67/0xc90 fs/read_write.c:427 vfs_read+0x359/0x6f0 fs/read_write.c:461 ksys_read+0x265/0x430 fs/read_write.c:587 __do_sys_read fs/read_write.c:597 [inline] __se_sys_read+0x92/0xb0 fs/read_write.c:595 __x64_sys_read+0x4a/0x70 fs/read_write.c:595 do_syscall_64+0xbc/0xf0 arch/x86/entry/common.c:297 entry_SYSCALL_64_after_hwframe+0x63/0xe7 Uninit was created at: kmsan_save_stack_with_flags mm/kmsan/kmsan.c:154 [inline] kmsan_internal_poison_shadow+0x60/0x120 mm/kmsan/kmsan.c:137 kmsan_slab_free+0x8d/0x100 mm/kmsan/kmsan_hooks.c:123 slab_free_freelist_hook mm/slub.c:1472 [inline] slab_free mm/slub.c:3038 [inline] kmem_cache_free_bulk+0x3ad9/0x3f50 mm/slub.c:3163 __kfree_skb_flush+0xb0/0x100 net/core/skbuff.c:862 net_rx_action+0x1908/0x1950 net/core/dev.c:6441 __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:537 [inline] do_IRQ+0x20d/0x3a0 arch/x86/kernel/irq.c:259 ret_from_intr+0x0/0x33 native_restore_fl arch/x86/include/asm/irqflags.h:41 [inline] arch_local_irq_restore arch/x86/include/asm/irqflags.h:84 [inline] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline] _raw_spin_unlock_irqrestore+0x4b/0x70 kernel/locking/spinlock.c:191 unlock_hrtimer_base kernel/time/hrtimer.c:877 [inline] hrtimer_start_range_ns+0x1570/0x16b0 kernel/time/hrtimer.c:1108 hrtimer_start_expires include/linux/hrtimer.h:395 [inline] schedule_hrtimeout_range_clock+0x2e2/0x560 kernel/time/hrtimer.c:1935 schedule_hrtimeout_range+0x97/0xb0 kernel/time/hrtimer.c:1983 poll_schedule_timeout fs/select.c:243 [inline] do_select+0x2c3c/0x2df0 fs/select.c:603 core_sys_select+0x949/0xe90 fs/select.c:677 do_pselect fs/select.c:759 [inline] __do_sys_pselect6 fs/select.c:784 [inline] __se_sys_pselect6+0x741/0x8e0 fs/select.c:769 __x64_sys_pselect6+0x6e/0x90 fs/select.c:769 do_syscall_64+0xbc/0xf0 arch/x86/entry/common.c:297 entry_SYSCALL_64_after_hwframe+0x63/0xe7 =====================================================