In the Linux kernel, the following vulnerability has been resolved:
net: hsr: avoid potential out-of-bound access in fill_frame_info()
syzbot is able to feed a packet with 14 bytes, pretending
it is a vlan one.
Since fill_frame_info() is relying on skb->mac_len already,
extend the check to cover this case.
BUG: KMSAN: uninit-value in fill_frame_info net/hsr/hsr_forward.c:709[inline]BUG: KMSAN: uninit-value in hsr_forward_skb+0x9ee/0x3b10net/hsr/hsr_forward.c:724fill_frame_infonet/hsr/hsr_forward.c:709[inline]hsr_forward_skb+0x9ee/0x3b10net/hsr/hsr_forward.c:724hsr_dev_xmit+0x2f0/0x350net/hsr/hsr_device.c:235__netdev_start_xmitinclude/linux/netdevice.h:5002[inline]netdev_start_xmitinclude/linux/netdevice.h:5011[inline]xmit_onenet/core/dev.c:3590[inline]dev_hard_start_xmit+0x247/0xa20net/core/dev.c:3606__dev_queue_xmit+0x366a/0x57d0net/core/dev.c:4434dev_queue_xmitinclude/linux/netdevice.h:3168[inline]packet_xmit+0x9c/0x6c0net/packet/af_packet.c:276packet_sndnet/packet/af_packet.c:3146[inline]packet_sendmsg+0x91ae/0xa6f0net/packet/af_packet.c:3178sock_sendmsg_nosecnet/socket.c:711[inline]__sock_sendmsg+0x30f/0x380net/socket.c:726__sys_sendto+0x594/0x750net/socket.c:2197__do_sys_sendtonet/socket.c:2204[inline]__se_sys_sendtonet/socket.c:2200[inline]__x64_sys_sendto+0x125/0x1d0net/socket.c:2200x64_sys_call+0x346a/0x3c30arch/x86/include/generated/asm/syscalls_64.h:45do_syscall_x64arch/x86/entry/common.c:52[inline]do_syscall_64+0xcd/0x1e0arch/x86/entry/common.c:83entry_SYSCALL_64_after_hwframe+0x77/0x7fUninit was created at:slab_post_alloc_hookmm/slub.c:4091[inline]slab_alloc_nodemm/slub.c:4134[inline]kmem_cache_alloc_node_noprof+0x6bf/0xb80mm/slub.c:4186kmalloc_reserve+0x13d/0x4a0net/core/skbuff.c:587__alloc_skb+0x363/0x7b0net/core/skbuff.c:678alloc_skbinclude/linux/skbuff.h:1323[inline]alloc_skb_with_frags+0xc8/0xd00net/core/skbuff.c:6612sock_alloc_send_pskb+0xa81/0xbf0net/core/sock.c:2881packet_alloc_skbnet/packet/af_packet.c:2995[inline]packet_sndnet/packet/af_packet.c:3089[inline]packet_sendmsg+0x74c6/0xa6f0net/packet/af_packet.c:3178sock_sendmsg_nosecnet/socket.c:711[inline]__sock_sendmsg+0x30f/0x380net/socket.c:726__sys_sendto+0x594/0x750net/socket.c:2197__do_sys_sendtonet/socket.c:2204[inline]__se_sys_sendtonet/socket.c:2200[inline]__x64_sys_sendto+0x125/0x1d0net/socket.c:2200x64_sys_call+0x346a/0x3c30arch/x86/include/generated/asm/syscalls_64.h:45do_syscall_x64arch/x86/entry/common.c:52[inline]do_syscall_64+0xcd/0x1e0arch/x86/entry/common.c:83entry_SYSCALL_64_after_hwframe+0x77/0x7f