patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH 1/1] vhost: fix missing gso_size validity check
@ 2024-12-20  3:45 Yunjian Wang
  0 siblings, 0 replies; only message in thread
From: Yunjian Wang @ 2024-12-20  3:45 UTC (permalink / raw)
  To: dev; +Cc: maxime.coquelin, chenbox, jerry.lilijun, Yunjian Wang, stable

The value of tso_segsz cannot be 0, instead check that value of
gso_size was set.

Fixes: d0cf91303d73 ("vhost: add Tx offload capabilities")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
---
 lib/vhost/virtio_net.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c
index 69901ab3b5..2ac5bc29a3 100644
--- a/lib/vhost/virtio_net.c
+++ b/lib/vhost/virtio_net.c
@@ -2733,6 +2733,9 @@ vhost_dequeue_offload_legacy(struct virtio_net *dev, struct virtio_net_hdr *hdr,
 	}
 
 	if (hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) {
+		if (hdr->gso_size == 0)
+			goto error;
+
 		switch (hdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN) {
 		case VIRTIO_NET_HDR_GSO_TCPV4:
 		case VIRTIO_NET_HDR_GSO_TCPV6:
-- 
2.33.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-12-20  3:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-20  3:45 [PATCH 1/1] vhost: fix missing gso_size validity check Yunjian Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).