acrn-kernel/include
Balazs Nemeth 924a9bc362 net: check if protocol extracted by virtio_net_hdr_set_proto is correct
For gso packets, virtio_net_hdr_set_proto sets the protocol (if it isn't
set) based on the type in the virtio net hdr, but the skb could contain
anything since it could come from packet_snd through a raw socket. If
there is a mismatch between what virtio_net_hdr_set_proto sets and
the actual protocol, then the skb could be handled incorrectly later
on.

An example where this poses an issue is with the subsequent call to
skb_flow_dissect_flow_keys_basic which relies on skb->protocol being set
correctly. A specially crafted packet could fool
skb_flow_dissect_flow_keys_basic preventing EINVAL to be returned.

Avoid blindly trusting the information provided by the virtio net header
by checking that the protocol in the packet actually matches the
protocol set by virtio_net_hdr_set_proto. Note that since the protocol
is only checked if skb->dev implements header_ops->parse_protocol,
packets from devices without the implementation are not checked at this
stage.

Fixes: 9274124f02 ("net: stricter validation of untrusted gso packets")
Signed-off-by: Balazs Nemeth <bnemeth@redhat.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-03-09 16:12:20 -08:00
..
acpi
asm-generic - added n64 block driver 2021-02-25 12:18:21 -08:00
clocksource
crypto Keyrings miscellany 2021-02-23 16:09:23 -08:00
drm drm/drm_vblank: set the dma-fence timestamp during send_vblank_event 2021-02-24 21:05:54 +05:30
dt-bindings Char/Misc driver patches for 5.12-rc1 2021-02-24 10:25:37 -08:00
keys
kunit
kvm
linux net: check if protocol extracted by virtio_net_hdr_set_proto is correct 2021-03-09 16:12:20 -08:00
math-emu
media
memory
misc
net net: icmp: pass zeroed opts from icmp{,v6}_ndo_send before sending 2021-02-23 11:29:52 -08:00
pcmcia
ras
rdma
scsi
soc
sound
target
trace mm/swap.c: don't pass "enum lru_list" to trace_mm_lru_insertion() 2021-02-24 13:38:33 -08:00
uapi Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf 2021-03-06 17:02:40 -08:00
vdso
video
xen