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 E9CDEA034C for ; Fri, 25 Feb 2022 18:16:32 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E4816410FD; Fri, 25 Feb 2022 18:16:32 +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 438F141153 for ; Fri, 25 Feb 2022 18:16:31 +0100 (CET) Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (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 C04E03F1D9 for ; Fri, 25 Feb 2022 17:16:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1645809390; bh=8eiYH6LxEXCoSQmgzXOXIY7KD4TqPD0whNBKwf7o4Z0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=JlkAqlvhKSXgrlKrnM5lE0bsnryttjg/LD1NPqr6kMIgEYngwbtX9/l4vREXhInX4 VZa1m8sQucgtCPWkQ5ClITIGPCo/IE/2LxkKV4upd9MZlfKm4YfdbS5PrFZ0PBBUoe fWqbcqwJSk/D6q9hFhpujnjromFW6UY9d/J+cwFP2hL+DyfPmKHBFbi1TDFH4jX5Gk oUrib/4FTVqIjIDF4w8/qRNm5qZkIMsQft0L+sp8L+2xRmvZFSOyKeFqfgaLExHmCD QvJZR8wr8lT/sg+5zFOyeuLJYbi3lWmIwY0dWhYeGwuVraaB0AHWkTxfCvFPZ14mHM wr3HpIOH2euQQ== Received: by mail-wr1-f70.google.com with SMTP id e26-20020adfa45a000000b001ea860cd35cso1104814wra.4 for ; Fri, 25 Feb 2022 09:16:30 -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=8eiYH6LxEXCoSQmgzXOXIY7KD4TqPD0whNBKwf7o4Z0=; b=SCIuBE9l0U5PYUWzI5tp2ICmDA48nsh3XTZFDk33vHBWoqg7Ox+Ru8ziBsB2poK4mp WUvu9TPVvvu3Hi5wxWO605uTkl04TgeXKj+UN9s50IO06AB8694+RJ6pPdkhakDMbDpS Hu2OH0Wsr01XsgORHLFKgQk8fsS9LbWorkrV7MiU9rPBFveiOMgNqOTfiLY7cyTFUUGt IsWKqptLdV+m9cYrBT45YCMiPxiyDOLXpCiaK/283OQ0/elvNev9G2KWCmnz0sdc4aEk gs+eIgBagOci3UwEZ3S890DVScqaTPzhVjg+0nVfk/gwm8uNwTC0hwBdQk2AVQAvgLR7 0eaQ== X-Gm-Message-State: AOAM533AtHLXFSGfY0j7JOyryAdg1cZgZiI9Hl7NztlWIgTyYjGR6Oek 5WPQKb9WXHNeGeAXO6rAbsw00axyQzhNVB8MB9rkAZWpei75RHBRmIXib+ePb5Ug+LtTqfgF51F mzpiOh0jiUqAUWlpUgy+OWhJe X-Received: by 2002:a05:600c:22c4:b0:381:1e69:efb2 with SMTP id 4-20020a05600c22c400b003811e69efb2mr3548638wmg.27.1645809390505; Fri, 25 Feb 2022 09:16:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJz7iVUJHWViL9aBzJLLcd3UCYhPBMUjEqacJFYdv4zA40lXrwIUH4EuppKzwJlPI85EpsAT8g== X-Received: by 2002:a05:600c:22c4:b0:381:1e69:efb2 with SMTP id 4-20020a05600c22c400b003811e69efb2mr3548619wmg.27.1645809390304; Fri, 25 Feb 2022 09:16:30 -0800 (PST) Received: from Keschdeichel.fritz.box (068-133-067-156.ip-addr.inexio.net. [156.67.133.68]) by smtp.gmail.com with ESMTPSA id g20-20020a05600c4ed400b003811fab7f3esm3466378wmq.30.2022.02.25.09.16.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Feb 2022 09:16:29 -0800 (PST) From: christian.ehrhardt@canonical.com To: Sean Morrissey Cc: Ferruh Yigit , dpdk stable Subject: patch 'app/testpmd: fix dereference before null check' has been queued to stable release 19.11.12 Date: Fri, 25 Feb 2022 18:15:07 +0100 Message-Id: <20220225171550.3499040-14-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.35.0 In-Reply-To: <20220225171550.3499040-1-christian.ehrhardt@canonical.com> References: <20220225171550.3499040-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.12 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/27/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/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/a6dd7ffb5d97d3b9cf77da062e1610d2a6d105e8 Thanks. Christian Ehrhardt --- >From a6dd7ffb5d97d3b9cf77da062e1610d2a6d105e8 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 df9183376c..9f43f6c43f 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -5293,8 +5293,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) || @@ -5303,6 +5303,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.35.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-02-25 16:58:44.828191171 +0100 +++ 0014-app-testpmd-fix-dereference-before-null-check.patch 2022-02-25 16:58:44.208990384 +0100 @@ -1 +1 @@ -From f924a8d3bb838bffbaf2c2d47bada952e45b475f Mon Sep 17 00:00:00 2001 +From a6dd7ffb5d97d3b9cf77da062e1610d2a6d105e8 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 df9183376c..9f43f6c43f 100644 @@ -23 +24 @@ -@@ -7702,8 +7702,8 @@ error: +@@ -5293,8 +5293,8 @@ error: @@ -33 +34 @@ -@@ -7712,6 +7712,8 @@ parse_hex_string(const char *src, uint8_t *dst, uint32_t *size) +@@ -5303,6 +5303,8 @@ parse_hex_string(const char *src, uint8_t *dst, uint32_t *size)