From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B89E9A0C41 for ; Tue, 30 Nov 2021 17:36:55 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AF83A410F7; Tue, 30 Nov 2021 17:36:55 +0100 (CET) Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by mails.dpdk.org (Postfix) with ESMTP id 86A6C41170 for ; Tue, 30 Nov 2021 17:36:54 +0100 (CET) Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 2D00D3FFE1 for ; Tue, 30 Nov 2021 16:36:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1638290214; bh=oMLYEI5bHeTyPTeqshBkwaT1x55S1hRPYJE613Z7y94=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=npRrXHzkU+Wv/CMvWnL/qFwLzZ5ebuKrLSlT0moTbvkzbbXhckFcgxcy20ordaz7J 8Tz+5Ml8oVjLSGKh2XIXg91FWia/VUWaPu7Xx5b9P2pE8ByZqD6lIKDO7Yx5c2mXzd NEtNU+4sz1NYvpBQXvobky7XYvC2bq6hRCZB82ERu/cW62nuzYEyypc6XJst4ngqmV orYfGlwn/KWdOISa3ACPPzA/lrRrUxek69dCIaoIiL1yrsmUk26TgiQBWK+2MsVFkx nkzAcbu6fUplj+t+FyLZ1lCViSfSZRTrLzMvNveOF11QAXVwkD4FgPzcJqxy1D+pdg KNOT/U/qLjJ2Q== Received: by mail-ed1-f69.google.com with SMTP id v22-20020a50a456000000b003e7cbfe3dfeso17439046edb.11 for ; Tue, 30 Nov 2021 08:36:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oMLYEI5bHeTyPTeqshBkwaT1x55S1hRPYJE613Z7y94=; b=joYyHmUlncvorFmHozkWyl+XWUz9Gw9H4MmxDHgcxW5sKzdWUWplqMm6SFEoJsn8ea zB1ziY2HXSELw8yzBrM+k2piiZhSJYxa4nDduescigsSLl0B6MR5eOVudJDrwve70Ggx 5IEQaA+JTzsEFi7611y9RPioSZ5iVcXrxNQp1cxecWX7XW0R6m0tbahKI003PCSFjOTL ydBKn9B65MRTMFqQLGnfmzLbyr5vjQydu4dHyZJEL6M/1LfcShARn5SX2TwxF1IdiI9/ JL93xX4wjLinJcfxEXfLxeCOE9L9HTh7UnWfxfyxTwEixHhmaWEXiIBZeF+EMcBUrQ21 BHCg== X-Gm-Message-State: AOAM531+gVU3PRtFFVnxxKATooASPNMMYd1q/ZFUk7y8WexQxuPgIoEi ZnXNXhhjIdb9HDwB7Fgog662PRkXIYJVkGO4JE832+JPlvy3TQvhnv6NT9HLplJpoZwzMlHf55m /nWhXDky3MRgWoVB3jzjDE6eO X-Received: by 2002:aa7:db8d:: with SMTP id u13mr28626edt.111.1638290212526; Tue, 30 Nov 2021 08:36:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJyr2BKgR7LKfEMue15mHU3urnR2gy7OR4E4bK6BP5EhWubRNeU9kcasIK247aK0lThkEbKJIA== X-Received: by 2002:aa7:db8d:: with SMTP id u13mr28603edt.111.1638290212385; Tue, 30 Nov 2021 08:36:52 -0800 (PST) Received: from localhost.localdomain ([2001:67c:1560:8007::aac:c4ad]) by smtp.gmail.com with ESMTPSA id sg39sm9057251ejc.66.2021.11.30.08.36.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Nov 2021 08:36:51 -0800 (PST) From: christian.ehrhardt@canonical.com To: Tudor Cornea Cc: Qi Zhang , dpdk stable Subject: patch 'net/iavf: fix overflow in maximum packet length config' has been queued to stable release 19.11.11 Date: Tue, 30 Nov 2021 17:33:39 +0100 Message-Id: <20211130163605.2460997-15-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211130163605.2460997-1-christian.ehrhardt@canonical.com> References: <20211130163605.2460997-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 19.11.11 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before December 10th 2021. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/01b2a53e25b9eb73cc86492681c232f81dcedd49 Thanks. Christian Ehrhardt --- >From 01b2a53e25b9eb73cc86492681c232f81dcedd49 Mon Sep 17 00:00:00 2001 From: Tudor Cornea Date: Thu, 5 Aug 2021 14:35:23 +0300 Subject: [PATCH] net/iavf: fix overflow in maximum packet length config [ upstream commit 7fe741821337f3cbeecac768b8ef3a16bf21c938 ] The len variable, used in the computation of max_pkt_len could overflow, if used to store the result of the following computation: rxq->rx_buf_len * IAVF_MAX_CHAINED_RX_BUFFERS Since, we could define the mbuf size to have a large value (i.e 13312), and IAVF_MAX_CHAINED_RX_BUFFERS is defined as 5, the computation mentioned above could potentially result in a value which might be bigger than MAX_USHORT. The result will be that Jumbo Frames will not work properly Fixes: 69dd4c3d0898 ("net/avf: enable queue and device") Signed-off-by: Tudor Cornea Acked-by: Qi Zhang --- drivers/net/iavf/iavf_ethdev.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index 7d4b6b915c..583a8be760 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -263,13 +263,14 @@ iavf_init_rxq(struct rte_eth_dev *dev, struct iavf_rx_queue *rxq) { struct iavf_hw *hw = IAVF_DEV_PRIVATE_TO_HW(dev->data->dev_private); struct rte_eth_dev_data *dev_data = dev->data; - uint16_t buf_size, max_pkt_len, len; + uint16_t buf_size, max_pkt_len; buf_size = rte_pktmbuf_data_room_size(rxq->mp) - RTE_PKTMBUF_HEADROOM; /* Calculate the maximum packet length allowed */ - len = rxq->rx_buf_len * IAVF_MAX_CHAINED_RX_BUFFERS; - max_pkt_len = RTE_MIN(len, dev->data->dev_conf.rxmode.max_rx_pkt_len); + max_pkt_len = RTE_MIN((uint32_t) + rxq->rx_buf_len * IAVF_MAX_CHAINED_RX_BUFFERS, + dev->data->dev_conf.rxmode.max_rx_pkt_len); /* Check if the jumbo frame and maximum packet length are set * correctly. -- 2.34.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-30 16:50:07.017293357 +0100 +++ 0015-net-iavf-fix-overflow-in-maximum-packet-length-confi.patch 2021-11-30 16:50:05.530871622 +0100 @@ -1 +1 @@ -From 7fe741821337f3cbeecac768b8ef3a16bf21c938 Mon Sep 17 00:00:00 2001 +From 01b2a53e25b9eb73cc86492681c232f81dcedd49 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 7fe741821337f3cbeecac768b8ef3a16bf21c938 ] + @@ -19 +20,0 @@ -Cc: stable@dpdk.org @@ -28 +29 @@ -index 574cfe055e..dc5cbc22f5 100644 +index 7d4b6b915c..583a8be760 100644 @@ -31 +32 @@ -@@ -574,13 +574,14 @@ iavf_init_rxq(struct rte_eth_dev *dev, struct iavf_rx_queue *rxq) +@@ -263,13 +263,14 @@ iavf_init_rxq(struct rte_eth_dev *dev, struct iavf_rx_queue *rxq)