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 C69EF41EA5 for ; Wed, 15 Mar 2023 23:47:22 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C270F410DD; Wed, 15 Mar 2023 23:47:22 +0100 (CET) Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by mails.dpdk.org (Postfix) with ESMTP id EC05340141 for ; Wed, 15 Mar 2023 23:47:20 +0100 (CET) Received: by mail-wm1-f50.google.com with SMTP id az3-20020a05600c600300b003ed2920d585so1998649wmb.2 for ; Wed, 15 Mar 2023 15:47:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678920440; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+Yg8bxPbwslYoWk4Mzt5JklBDgJZI7M5vgVzX4ZCjsI=; b=Qm32pkg4bdnQJm5nUme1hvV58IpfyrvFmeGbqEPQ1wdQBARjWJKeSOqf6edfz3G/dr Xj6/kPrEMIsGRW1a7nAarJq+AHdjDXHL85/ghRXdo3/pO6+GOkP1vjwx9KtGI2k6y8iG Ih5XycTe6h9FeUQMfdO39OvPnGzacbth+solSYNRSMdlbF0aGUar+qTTT0qd08Su1cf3 wDYT0LuAs4X4KIWsHXFw2d4d7uR/NNkRyIoZvSCYjZclCHXPqMCEkOkntPbkxoVyhBCD ezXps6vzOt8gosiu64cJeqssfi/K3RI6TPkMG+QkPR0uTTYZzLndqqKS81sc1/NC3WJb 3R5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678920440; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+Yg8bxPbwslYoWk4Mzt5JklBDgJZI7M5vgVzX4ZCjsI=; b=zdg2BCMq65LlBoQrB4DUJYkHD/o5/Q1K5HeaUhnDv+dY9Ie45RXxMURwHSqDob/7Tq RcrpFeLOmAxhhlYB1r6Gqj9yKsIQGCtUBNLRB7P573X/PoIqRCwPEyru7u5vOZKrIyKF A4RNkpmb/jbt05lvho6j6PjC7ELu3o3LPTFuqoNepOX3WtPUyvdg3ea7h6gsRc/3scso T58ROoJb72InKq8iieCg26XLGNLAIFVe2aUo2YTgQK/p3lCJgF4MxJtWq/GaQmSOfreK kbuvrsQfet3VXI1L8fcQGr7b9xraiqNNf0YDxFnz0pgpHHED9HadjY4omlEYI4ir1DNX 9z/g== X-Gm-Message-State: AO0yUKVk4V5+SdoASHXxFLXHIOVaFh7RV9EcjiCjXAKgllxITE/n4//3 anQtQQY/5YeArE/WnjQ8wXI= X-Google-Smtp-Source: AK7set+4cRKQ39D6cMeIS3Ie+4o93RyIGss6HhfcoMjZta7CVO0mqhSpA5JXOFvOWancr/EhG4ddIw== X-Received: by 2002:a05:600c:45c6:b0:3eb:2e27:2d0c with SMTP id s6-20020a05600c45c600b003eb2e272d0cmr17019854wmo.1.1678920440671; Wed, 15 Mar 2023 15:47:20 -0700 (PDT) Received: from localhost ([2a01:4b00:d307:1000:f1d3:eb5e:11f4:a7d9]) by smtp.gmail.com with ESMTPSA id t16-20020a05600c2f9000b003e1fee8baacsm3026899wmn.25.2023.03.15.15.47.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 15:47:20 -0700 (PDT) From: luca.boccassi@gmail.com To: Chengwen Feng Cc: dpdk stable Subject: patch 'compressdev: fix empty devargs parsing' has been queued to stable release 20.11.8 Date: Wed, 15 Mar 2023 22:46:08 +0000 Message-Id: <20230315224631.1025649-17-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230315224631.1025649-1-luca.boccassi@gmail.com> References: <20230223093715.3926893-71-luca.boccassi@gmail.com> <20230315224631.1025649-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.8 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/17/23. 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/8701203904167e08137f713910b1a2409d6305e8 Thanks. Luca Boccassi --- >From 8701203904167e08137f713910b1a2409d6305e8 Mon Sep 17 00:00:00 2001 From: Chengwen Feng Date: Thu, 2 Mar 2023 07:50:05 +0000 Subject: [PATCH] compressdev: fix empty devargs parsing [ upstream commit bb27182482d61777de6a38b16a1d2c692c2c3f8b ] The rte_kvargs_process() was used to parse KV pairs, it also supports to parse 'only keys' (e.g. socket_id) type. And the callback function parameter 'value' is NULL when parsed 'only keys'. This patch fixes segment fault in rte_compressdev_pmd_parse_uint_arg() when parse input args with 'only keys' (e.g. socket_id). For a similar reason, this patch fixes rte_compressdev_pmd_parse_name_arg(). Fixes: ed7dd94f7f66 ("compressdev: add basic device management") Signed-off-by: Chengwen Feng --- lib/librte_compressdev/rte_compressdev_pmd.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/librte_compressdev/rte_compressdev_pmd.c b/lib/librte_compressdev/rte_compressdev_pmd.c index 7f500d76d4..6a11a396b7 100644 --- a/lib/librte_compressdev/rte_compressdev_pmd.c +++ b/lib/librte_compressdev/rte_compressdev_pmd.c @@ -20,6 +20,9 @@ rte_compressdev_pmd_parse_name_arg(const char *key __rte_unused, struct rte_compressdev_pmd_init_params *params = extra_args; int n; + if (value == NULL || extra_args == NULL) + return -EINVAL; + n = strlcpy(params->name, value, RTE_COMPRESSDEV_NAME_MAX_LEN); if (n >= RTE_COMPRESSDEV_NAME_MAX_LEN) return -EINVAL; @@ -37,6 +40,9 @@ rte_compressdev_pmd_parse_uint_arg(const char *key __rte_unused, int i; char *end; + if (value == NULL || extra_args == NULL) + return -EINVAL; + errno = 0; i = strtol(value, &end, 10); if (*end != 0 || errno != 0 || i < 0) -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-03-15 22:44:50.606620404 +0000 +++ 0017-compressdev-fix-empty-devargs-parsing.patch 2023-03-15 22:44:49.567849926 +0000 @@ -1 +1 @@ -From bb27182482d61777de6a38b16a1d2c692c2c3f8b Mon Sep 17 00:00:00 2001 +From 8701203904167e08137f713910b1a2409d6305e8 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit bb27182482d61777de6a38b16a1d2c692c2c3f8b ] + @@ -17 +18,0 @@ -Cc: stable@dpdk.org @@ -21 +22 @@ - lib/compressdev/rte_compressdev_pmd.c | 6 ++++++ + lib/librte_compressdev/rte_compressdev_pmd.c | 6 ++++++ @@ -24,5 +25,5 @@ -diff --git a/lib/compressdev/rte_compressdev_pmd.c b/lib/compressdev/rte_compressdev_pmd.c -index e139bc86e7..156bccd972 100644 ---- a/lib/compressdev/rte_compressdev_pmd.c -+++ b/lib/compressdev/rte_compressdev_pmd.c -@@ -23,6 +23,9 @@ rte_compressdev_pmd_parse_name_arg(const char *key __rte_unused, +diff --git a/lib/librte_compressdev/rte_compressdev_pmd.c b/lib/librte_compressdev/rte_compressdev_pmd.c +index 7f500d76d4..6a11a396b7 100644 +--- a/lib/librte_compressdev/rte_compressdev_pmd.c ++++ b/lib/librte_compressdev/rte_compressdev_pmd.c +@@ -20,6 +20,9 @@ rte_compressdev_pmd_parse_name_arg(const char *key __rte_unused, @@ -38 +39 @@ -@@ -40,6 +43,9 @@ rte_compressdev_pmd_parse_uint_arg(const char *key __rte_unused, +@@ -37,6 +40,9 @@ rte_compressdev_pmd_parse_uint_arg(const char *key __rte_unused,