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 F2EA6A0032 for ; Fri, 18 Feb 2022 13:41:35 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EDFA040141; Fri, 18 Feb 2022 13:41:35 +0100 (CET) Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by mails.dpdk.org (Postfix) with ESMTP id 9DE0E40E2D for ; Fri, 18 Feb 2022 13:41:34 +0100 (CET) Received: by mail-wm1-f52.google.com with SMTP id bg21-20020a05600c3c9500b0035283e7a012so6352378wmb.0 for ; Fri, 18 Feb 2022 04:41:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kk3o0WyMCFOyhxmA5CW7xVBgBrziy6wYmdz76YD0hVo=; b=JbwuoUFV0i3PGMBHZMZTUa4Z9ErwS8IDrRnkGfKQV1P+wjxlQACXGWm7wHpD75Xikc pNOHV05S9xpiSObu8FnyiwzKMGaOFb66251DlPrCotx6k4dSCcV5UHD6d8o3BBLQCzz9 7KRGggBGNL+Uor5etn4Z6h2QDOoQy7flOpx2RVxUU/Ak91GzapDbjB2RSVOFKvWEcXdJ LRc4HKjVPsQpT4svNDtL5TLpaqsy8AM8WoGW+NVucvg2ncNcFOZgzXkv4XFV5N1QSlwp t1V1jgVKVeBtw90q6niuH6dscGnmESyyVGI7cjLD2/gHzJuIQ8yd4DOZYVh6NV6VbTyw 2ZHw== 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=kk3o0WyMCFOyhxmA5CW7xVBgBrziy6wYmdz76YD0hVo=; b=6u8hQURbz2K2CTPv/T7uc/lIDfwXlPzO7aZiyIxw3y2PM2fL1lKrTq2qJ30sRk3ptQ VRbtTefTxMyYe5DXTJkid0kQnHW2PNidXmAqzM6QB7kD1MfclUYPzMddX0oIus5sr2hA ur30EdnDRBJriSqli1gIfX0dq5dZPQuzvP3Zr/xXUrgSj4TXLHLA/mDJxnP+Wq+A0dfS cK0Iay5iYGqqEevdzBMdVv0Myn8W1829Mr//obHdMDpWUjI0Q720yT+0aTW4YZmxY+Dw O0tBcNeP8dWObXquXUP75zDY1zFhF/SX4JiJmh7oGm5uTCDLjcUFwn5S842vsvzmihtq J/vQ== X-Gm-Message-State: AOAM533Gu21R7VgOI6I29ojZrdBU+54x8XNzX3rRjOpLFH6yo64tBDhl OfFU7pkvJ6Kwutd9ZF+bxK7IR45Bd0GmTxkW X-Google-Smtp-Source: ABdhPJxNdkXr/0iO323YTdIj1UU0PQKnNjOHQEPuqS2Xpq3aWGkAoFbMoI6OkjDogbBhcJbR133MqQ== X-Received: by 2002:a05:600c:348a:b0:37b:ecb3:a249 with SMTP id a10-20020a05600c348a00b0037becb3a249mr10555245wmq.33.1645188094320; Fri, 18 Feb 2022 04:41:34 -0800 (PST) Received: from localhost ([2a01:4b00:f41a:3600:360b:9754:2e3a:c344]) by smtp.gmail.com with ESMTPSA id z17sm4223429wmf.11.2022.02.18.04.41.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Feb 2022 04:41:33 -0800 (PST) From: luca.boccassi@gmail.com To: Sean Morrissey Cc: Ferruh Yigit , dpdk stable Subject: patch 'app/testpmd: fix dereference before null check' has been queued to stable release 20.11.5 Date: Fri, 18 Feb 2022 12:38:09 +0000 Message-Id: <20220218123931.1749595-40-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220218123931.1749595-1-luca.boccassi@gmail.com> References: <20220218123931.1749595-1-luca.boccassi@gmail.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 20.11.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/20/22. 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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/a2f86fa32fc49cd5fb8b2163b13dec38d6a5a195 Thanks. Luca Boccassi --- >From a2f86fa32fc49cd5fb8b2163b13dec38d6a5a195 Mon Sep 17 00:00:00 2001 From: Sean Morrissey Date: Tue, 18 Jan 2022 10:53:09 +0000 Subject: [PATCH] app/testpmd: fix dereference before null check [ upstream commit f924a8d3bb838bffbaf2c2d47bada952e45b475f ] Assign 'left' variable only after null check on 'size' as function returns if 'size' is null. Coverity issue: 374381 Fixes: 169a9fed1f4c ("app/testpmd: fix hex string parser support for flow API") Signed-off-by: Sean Morrissey Reviewed-by: Ferruh Yigit --- app/test-pmd/cmdline_flow.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index b932d096c4..c80be57bfe 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -6411,8 +6411,8 @@ error: static int parse_hex_string(const char *src, uint8_t *dst, uint32_t *size) { - uint32_t left = *size; const uint8_t *head = dst; + uint32_t left; /* Check input parameters */ if ((src == NULL) || @@ -6421,6 +6421,8 @@ parse_hex_string(const char *src, uint8_t *dst, uint32_t *size) (*size == 0)) return -1; + left = *size; + /* Convert chars to bytes */ while (left) { char tmp[3], *end = tmp; -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-02-18 12:37:39.635231631 +0000 +++ 0040-app-testpmd-fix-dereference-before-null-check.patch 2022-02-18 12:37:37.638790759 +0000 @@ -1 +1 @@ -From f924a8d3bb838bffbaf2c2d47bada952e45b475f Mon Sep 17 00:00:00 2001 +From a2f86fa32fc49cd5fb8b2163b13dec38d6a5a195 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit f924a8d3bb838bffbaf2c2d47bada952e45b475f ] + @@ -11 +12,0 @@ -Cc: stable@dpdk.org @@ -20 +21 @@ -index 5c2bba48ad..bbaf18d76e 100644 +index b932d096c4..c80be57bfe 100644 @@ -23 +24 @@ -@@ -7702,8 +7702,8 @@ error: +@@ -6411,8 +6411,8 @@ error: @@ -33 +34 @@ -@@ -7712,6 +7712,8 @@ parse_hex_string(const char *src, uint8_t *dst, uint32_t *size) +@@ -6421,6 +6421,8 @@ parse_hex_string(const char *src, uint8_t *dst, uint32_t *size)