From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A6CAFA0518 for ; Fri, 24 Jul 2020 14:09:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 985B41C039; Fri, 24 Jul 2020 14:09:42 +0200 (CEST) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by dpdk.org (Postfix) with ESMTP id 552061C039 for ; Fri, 24 Jul 2020 14:09:41 +0200 (CEST) Received: by mail-wm1-f66.google.com with SMTP id 9so7740271wmj.5 for ; Fri, 24 Jul 2020 05:09:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NoZ9E58EFMjXqYMkl7VYjutAfn5K4uBpj8i3tA2NMTE=; b=XMLx5IrKvMKna6B16csQAeFMRqoxRaLoRKSRnxywRznuvbTvcxq7UrHg12WGB6+EoA gX/zQHlKWgeLiE73qudqStPfnyRr6Am963fD9NjaX2zCGozQV7g350jwEPn81B8ZBn8M O/rSzu2abja5emGiZobxsMXbnk5yOBVPK2S9JL17PqRhJKfprAdI8RKS64GFsoV7CJF/ LlUjM5oiAQp0AH7vLjNEKB2XaegIb21UcgOwswH5UMIV2W6aO8Ufj4F4ideC15UPDCKA Hgvi/84j3sy8GDyP80vqgBIbaiQl9tz7zZGH2dkahZsyK2wUdduqbJwOwJT7mi6xLha8 gJPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NoZ9E58EFMjXqYMkl7VYjutAfn5K4uBpj8i3tA2NMTE=; b=JJq3igMEgH9Kiri866adIZKKJgrkTlvdJzCo3Fbel+bDCjnXZCT6tBHWwAdJ8T/3Kb ScJCkOJv4XWNfGpzKI0vJOH1B90jSSxkEhHDdon0ODOE21nLjwhiBPTN3kLRjzurB0HJ lOZH8TdOmDfieXXUVS++bzC+8gewnCIjAIKApsxoeGnc8O2BVVrPVYTd2yeqHVNJYboC 1h/oWYWnPZ8JC/jtl4hwmodcHv37pzBNiLlB0zicsCOiK3kCC2LcVuxJv9Bsgx6rjjMV wRitNNyfzEQOnJgxqZj/4Pom5dSMM1/k6SfWuGWxoQ0MMOMQufKF0rW1axGRiOwy10EU Xr/g== X-Gm-Message-State: AOAM530lQK4LgP6Kt7alOF95Q/mmMzBgJn2ly0RGNM99SEbCSRZF7G0W 0E+PLZGtRzmTQnOt1GjSoXo= X-Google-Smtp-Source: ABdhPJzKHuM2s5AOBOlPWzgI4pDIhrBUw00ym2KFmbMZp8RkdVQi22kcIqhjEd9n+D/1/f+Q1fpqew== X-Received: by 2002:a1c:9994:: with SMTP id b142mr8175768wme.141.1595592581083; Fri, 24 Jul 2020 05:09:41 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id o2sm1171681wrj.21.2020.07.24.05.09.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jul 2020 05:09:40 -0700 (PDT) From: luca.boccassi@gmail.com To: "Wei Hu (Xavier)" Cc: Chengchang Tang , Andrew Rybchenko , Sachin Saxena , Viacheslav Ovsiienko , dpdk stable Date: Fri, 24 Jul 2020 12:59:36 +0100 Message-Id: <20200724120030.1863487-138-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724120030.1863487-1-luca.boccassi@gmail.com> References: <20200724120030.1863487-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'ethdev: fix data room size verification in Rx queue setup' has been queued to stable release 19.11.4 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/26/20. 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. Thanks. Luca Boccassi --- >From 7819e32c5b5c908d1bd5cabc530291a307a5c9b2 Mon Sep 17 00:00:00 2001 From: "Wei Hu (Xavier)" Date: Thu, 9 Jul 2020 18:43:13 +0800 Subject: [PATCH] ethdev: fix data room size verification in Rx queue setup [ upstream commit 36fbaaf30d6ae5b3734c9b31a2dcd33695b09ef2 ] In the rte_eth_rx_queue_setup API function, the local variable named mbp_buf_size, which is the data room size of the input parameter mp, is checked to guarantee that each memory chunk used for net device in the mbuf is bigger than the min_rx_bufsize. But if mbp_buf_size is less than RTE_PKTMBUF_HEADROOM, the value of the following statement will be a large number since the mbp_buf_size is a unsigned value. mbp_buf_size - RTE_PKTMBUF_HEADROOM As a result, it will cause a segment fault in this situation. This patch fixes it by modify the check condition to guarantee that the local variable named mbp_buf_size is bigger than RTE_PKTMBUF_HEADROOM. Fixes: af75078fece3 ("first public release") Signed-off-by: Chengchang Tang Signed-off-by: Wei Hu (Xavier) Reviewed-by: Andrew Rybchenko Acked-by: Sachin Saxena Acked-by: Viacheslav Ovsiienko --- lib/librte_ethdev/rte_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index d245cfcea..5f1fc4842 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -1814,7 +1814,7 @@ rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id, } mbp_buf_size = rte_pktmbuf_data_room_size(mp); - if ((mbp_buf_size - RTE_PKTMBUF_HEADROOM) < dev_info.min_rx_bufsize) { + if (mbp_buf_size < dev_info.min_rx_bufsize + RTE_PKTMBUF_HEADROOM) { RTE_ETHDEV_LOG(ERR, "%s mbuf_data_room_size %d < %d (RTE_PKTMBUF_HEADROOM=%d + min_rx_bufsize(dev)=%d)\n", mp->name, (int)mbp_buf_size, -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-07-24 12:53:53.855689391 +0100 +++ 0138-ethdev-fix-data-room-size-verification-in-Rx-queue-s.patch 2020-07-24 12:53:48.447009441 +0100 @@ -1,8 +1,10 @@ -From 36fbaaf30d6ae5b3734c9b31a2dcd33695b09ef2 Mon Sep 17 00:00:00 2001 +From 7819e32c5b5c908d1bd5cabc530291a307a5c9b2 Mon Sep 17 00:00:00 2001 From: "Wei Hu (Xavier)" Date: Thu, 9 Jul 2020 18:43:13 +0800 Subject: [PATCH] ethdev: fix data room size verification in Rx queue setup +[ upstream commit 36fbaaf30d6ae5b3734c9b31a2dcd33695b09ef2 ] + In the rte_eth_rx_queue_setup API function, the local variable named mbp_buf_size, which is the data room size of the input parameter mp, is checked to guarantee that each memory chunk used for net device @@ -16,7 +18,6 @@ local variable named mbp_buf_size is bigger than RTE_PKTMBUF_HEADROOM. Fixes: af75078fece3 ("first public release") -Cc: stable@dpdk.org Signed-off-by: Chengchang Tang Signed-off-by: Wei Hu (Xavier) @@ -28,10 +29,10 @@ 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c -index 7022bd7f5..e3b2a0976 100644 +index d245cfcea..5f1fc4842 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c -@@ -1820,7 +1820,7 @@ rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id, +@@ -1814,7 +1814,7 @@ rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id, } mbp_buf_size = rte_pktmbuf_data_room_size(mp);