DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Joshua Washington <joshwash@google.com>
To: Joshua Washington <joshwash@google.com>,
	Varun Lakkur Ambaji Rao <varun.la@gmail.com>,
	 Rushil Gupta <rushilg@google.com>,
	Tathagat Priyadarshi <tathagat.dpdk@gmail.com>
Cc: dev@dpdk.org, stable@dpdk.org,
	 Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH v4 3/3] net/gve: validate minimum header length for TSO packets
Date: Mon,  9 Nov 2026 11:43:31 -0800	[thread overview]
Message-ID: <20261109194331.393364-4-joshwash@google.com> (raw)
In-Reply-To: <20261109194331.393364-1-joshwash@google.com>

In addition to the limits added in commit
03b62d39c1c8 ("net/gve: enforce DQO TSO header and length limits"), TSO
packets also have a minimum header length of 16B. Enforce this limit as
well.

Fixes: 403c671a46b6 ("net/gve: support TSO in DQO RDA")
Cc: stable@dpdk.org

Signed-off-by: Joshua Washington <joshwash@google.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/gve/base/gve_desc_dqo.h | 1 +
 drivers/net/gve/gve_tx_dqo.c        | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/gve/base/gve_desc_dqo.h b/drivers/net/gve/base/gve_desc_dqo.h
index 53e394f01c..c2f7b0caa6 100644
--- a/drivers/net/gve/base/gve_desc_dqo.h
+++ b/drivers/net/gve/base/gve_desc_dqo.h
@@ -14,6 +14,7 @@
 #define GVE_TX_MIN_TSO_MSS_DQO 88
 #define GVE_TX_MIN_PKT_SIZE_DQO 17
 #define GVE_TX_MAX_PKT_SIZE_DQO 9728
+#define GVE_TX_MIN_TSO_HDR_LEN_DQO 16
 #define GVE_TX_MAX_TSO_LEN_DQO ((256 * 1024) - 1)
 
 /* Basic TX descriptor (DTYPE 0x0C) */
diff --git a/drivers/net/gve/gve_tx_dqo.c b/drivers/net/gve/gve_tx_dqo.c
index 78eaef3e3d..72730eb1c5 100644
--- a/drivers/net/gve/gve_tx_dqo.c
+++ b/drivers/net/gve/gve_tx_dqo.c
@@ -139,8 +139,9 @@ gve_tx_validate_pkt_limits(const struct rte_mbuf *tx_pkt, bool is_tso)
 	 * contained in the first segment; the payload must not be empty.
 	 */
 	headlen = tx_pkt->l2_len + tx_pkt->l3_len + tx_pkt->l4_len;
-	if (tx_pkt->l4_len == 0 || headlen > GVE_TX_MAX_HDR_SIZE_DQO ||
-	    tx_pkt->data_len < headlen || tx_pkt->pkt_len <= headlen)
+	if (tx_pkt->l4_len == 0 || headlen < GVE_TX_MIN_TSO_HDR_LEN_DQO ||
+	    headlen > GVE_TX_MAX_HDR_SIZE_DQO || tx_pkt->data_len < headlen ||
+	    tx_pkt->pkt_len <= headlen)
 		return false;
 
 	return tx_pkt->pkt_len - headlen <= GVE_TX_MAX_TSO_LEN_DQO &&
-- 
2.56.0.542.g3ef89b7020-goog


      parent reply	other threads:[~2026-11-09 19:44 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-30 18:42 [PATCH v2 0/4] net/gve: TSO descriptor count fixes for GVE DQO Joshua Washington
2026-10-30 18:43 ` [PATCH v2 1/4] net/gve: fix TSO segment offset calculation Joshua Washington
2026-10-30 18:43 ` [PATCH v2 2/4] net/gve: account for multi-mbuf headers when validating TSO Joshua Washington
2026-10-30 18:43 ` [PATCH v2 3/4] net/gve: introduce Tx packet preparation for DQO format Joshua Washington
2026-10-30 18:43 ` [PATCH v2 4/4] net/gve: validate minimum header length for TSO packets Joshua Washington
2026-11-02  7:45 ` [PATCH v2 0/4] net/gve: TSO descriptor count fixes for GVE DQO Stephen Hemminger
2026-11-02 19:40   ` Joshua Washington
2026-11-03 18:14 ` [PATCH v3 0/3] " Joshua Washington
2026-11-03 18:14   ` [PATCH v3 1/3] net/gve: fix TSO segment offset calculation Joshua Washington
2026-11-03 18:14   ` [PATCH v3 2/3] net/gve: introduce Tx packet preparation for DQO format Joshua Washington
2026-11-03 18:14   ` [PATCH v3 3/3] net/gve: validate minimum header length for TSO packets Joshua Washington
2026-11-04  9:34   ` [PATCH v3 0/3] net/gve: TSO descriptor count fixes for GVE DQO Stephen Hemminger
2026-11-09 17:57   ` Stephen Hemminger
2026-11-09 19:32     ` Joshua Washington
2026-11-09 19:43   ` [PATCH v4 " Joshua Washington
2026-11-09 19:43     ` [PATCH v4 1/3] net/gve: fix TSO segment offset calculation Joshua Washington
2026-11-09 19:43     ` [PATCH v4 2/3] net/gve: introduce Tx packet preparation for DQO format Joshua Washington
2026-11-09 19:43     ` Joshua Washington [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261109194331.393364-4-joshwash@google.com \
    --to=joshwash@google.com \
    --cc=dev@dpdk.org \
    --cc=rushilg@google.com \
    --cc=stable@dpdk.org \
    --cc=stephen@networkplumber.org \
    --cc=tathagat.dpdk@gmail.com \
    --cc=varun.la@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox