In the Linux kernel, the following vulnerability has been resolved:
hsr: Fix uninit-value access in fill_frame_info()
Syzbot reports the following uninit-value access problem.
=====================================================BUG: KMSAN: uninit-value in fill_frame_info net/hsr/hsr_forward.c:601[inline]BUG: KMSAN: uninit-value in hsr_forward_skb+0x9bd/0x30f0net/hsr/hsr_forward.c:616fill_frame_infonet/hsr/hsr_forward.c:601[inline]hsr_forward_skb+0x9bd/0x30f0net/hsr/hsr_forward.c:616hsr_dev_xmit+0x192/0x330net/hsr/hsr_device.c:223__netdev_start_xmitinclude/linux/netdevice.h:4889[inline]netdev_start_xmitinclude/linux/netdevice.h:4903[inline]xmit_onenet/core/dev.c:3544[inline]dev_hard_start_xmit+0x247/0xa10net/core/dev.c:3560__dev_queue_xmit+0x34d0/0x52a0net/core/dev.c:4340dev_queue_xmitinclude/linux/netdevice.h:3082[inline]packet_xmit+0x9c/0x6b0net/packet/af_packet.c:276packet_sndnet/packet/af_packet.c:3087[inline]packet_sendmsg+0x8b1d/0x9f30net/packet/af_packet.c:3119sock_sendmsg_nosecnet/socket.c:730[inline]sock_sendmsgnet/socket.c:753[inline]__sys_sendto+0x781/0xa30net/socket.c:2176__do_sys_sendtonet/socket.c:2188[inline]__se_sys_sendtonet/socket.c:2184[inline]__ia32_sys_sendto+0x11f/0x1c0net/socket.c:2184do_syscall_32_irqs_onarch/x86/entry/common.c:112[inline]__do_fast_syscall_32+0xa2/0x100arch/x86/entry/common.c:178do_fast_syscall_32+0x37/0x80arch/x86/entry/common.c:203do_SYSENTER_32+0x1f/0x30arch/x86/entry/common.c:246entry_SYSENTER_compat_after_hwframe+0x70/0x82Uninit was created at:slab_post_alloc_hook+0x12f/0xb70mm/slab.h:767slab_alloc_nodemm/slub.c:3478[inline]kmem_cache_alloc_node+0x577/0xa80mm/slub.c:3523kmalloc_reserve+0x148/0x470net/core/skbuff.c:559__alloc_skb+0x318/0x740net/core/skbuff.c:644alloc_skbinclude/linux/skbuff.h:1286[inline]alloc_skb_with_frags+0xc8/0xbd0net/core/skbuff.c:6299sock_alloc_send_pskb+0xa80/0xbf0net/core/sock.c:2794packet_alloc_skbnet/packet/af_packet.c:2936[inline]packet_sndnet/packet/af_packet.c:3030[inline]packet_sendmsg+0x70e8/0x9f30net/packet/af_packet.c:3119sock_sendmsg_nosecnet/socket.c:730[inline]sock_sendmsgnet/socket.c:753[inline]__sys_sendto+0x781/0xa30net/socket.c:2176__do_sys_sendtonet/socket.c:2188[inline]__se_sys_sendtonet/socket.c:2184[inline]__ia32_sys_sendto+0x11f/0x1c0net/socket.c:2184do_syscall_32_irqs_onarch/x86/entry/common.c:112[inline]__do_fast_syscall_32+0xa2/0x100arch/x86/entry/common.c:178do_fast_syscall_32+0x37/0x80arch/x86/entry/common.c:203do_SYSENTER_32+0x1f/0x30arch/x86/entry/common.c:246entry_SYSENTER_compat_after_hwframe+0x70/0x82
It is because VLAN not yet supported in hsr driver. Return error
when protocol is ETH_P_8021Q in fill_frame_info() now to fix it.