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 1E3B141EA5 for ; Wed, 15 Mar 2023 23:47:25 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1AC69427F5; Wed, 15 Mar 2023 23:47:25 +0100 (CET) Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by mails.dpdk.org (Postfix) with ESMTP id 16400427F2 for ; Wed, 15 Mar 2023 23:47:23 +0100 (CET) Received: by mail-wr1-f44.google.com with SMTP id t15so18687497wrz.7 for ; Wed, 15 Mar 2023 15:47:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678920443; 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=07z2beWJU2YcTXTCghJgDvhimSjlJ6r+wtL2dNwo6s0=; b=IcVXV7UrsPU/K8HVuJaUvQ0ecDAtkrom86U3OnmrJtxqAikLPLEvGCOTWMCL709jjB ZYwvBQ8IVZb1jplYBKvc+fNNmMjOPcx//aIAdj8hsnMAEUF6tcPVxd/0p3nuUk2b6t+t ta216iix0s07oN+3Yn841HtyYUrq0MLSJFj2yIZtlsI2RAmyav/vMcrU6tPGTOUoVD8/ eFTJ+KvrK+DH0zxTHBqPgQdm/aKTvFp6w+ZgMaZkgXCx11VF+bUG2/AIuFbQGuF+RnO4 MUx/vCExaHOsJjLdrd1EdCbQn4omIo7eFW8Jkq08o5vIrOU5Vhf0P1odfQptTgOPtAcA HCeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678920443; 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=07z2beWJU2YcTXTCghJgDvhimSjlJ6r+wtL2dNwo6s0=; b=3rtvupTcEkJWGggYzal0qYAJ9zoEBQMpOa7o4BnPjOOKDwbR6QlwJd1SqXMVbDeqtI oWHWf9krPE3X6uFM3Y+cLNCMLxLqcSFiu2bPBC0l+5VRVKshrUO5EU5XskPQSAAMVD+E iK8U9XBInFyB30CmeYiJLWm3osR28Du9IK9kfVXoDMzS6kqV7j88QKUXlQ772cZ9AiUz xfIs7Yt/SwKHit77qZ7y5qJmck1CQvzPTzBlI7V+n5qSIYWBtdNZAt+8N/lVZqjpmsuO fql4pJ7q5xbwzMAsLACaZ0+n6cutBkg0mBj2CqVXd/HTlXPwJ9XyzRtT1awqPQl2aOwl teRg== X-Gm-Message-State: AO0yUKXcmMmpFoqstKRN7vDRWZGSkc+oVzbaoqqTziqKIlOlU8TJ5a+7 YX/A1vmurlfLbjRkosqpktc= X-Google-Smtp-Source: AK7set8TtZKnf/yU2Kr4p0MiPQNHl/+g4GWj9uHOazw4iOaDOkTqhcFxwrRvhGji8cXrT5MN83hSZg== X-Received: by 2002:adf:ecc5:0:b0:2cf:f0c3:79c1 with SMTP id s5-20020adfecc5000000b002cff0c379c1mr3043609wro.67.1678920442783; Wed, 15 Mar 2023 15:47:22 -0700 (PDT) Received: from localhost ([2a01:4b00:d307:1000:f1d3:eb5e:11f4:a7d9]) by smtp.gmail.com with ESMTPSA id q6-20020a7bce86000000b003daf672a616sm3177261wmj.22.2023.03.15.15.47.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 15:47:22 -0700 (PDT) From: luca.boccassi@gmail.com To: Chengwen Feng Cc: Maxime Coquelin , dpdk stable Subject: patch 'net/virtio: fix empty devargs parsing' has been queued to stable release 20.11.8 Date: Wed, 15 Mar 2023 22:46:10 +0000 Message-Id: <20230315224631.1025649-19-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/279024fc7c8b73769f52ae0735cd2db24714aef3 Thanks. Luca Boccassi --- >From 279024fc7c8b73769f52ae0735cd2db24714aef3 Mon Sep 17 00:00:00 2001 From: Chengwen Feng Date: Thu, 2 Mar 2023 07:50:10 +0000 Subject: [PATCH] net/virtio: fix empty devargs parsing [ upstream commit 1c1b35b59b4cee8836f34498b7c55b49de39d7b3 ] 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 when parse input args with 'only keys' (e.g. vectorized,vdpa). Fixes: 4710e16a4a7b ("net/virtio: add parameter to enable vectorized path") Fixes: 44d7b2e87b69 ("net/virtio: refactor devargs parsing") Fixes: 440f03c25378 ("net/virtio: skip device probe in vDPA mode") Signed-off-by: Chengwen Feng Reviewed-by: Maxime Coquelin --- drivers/net/virtio/virtio_ethdev.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index ce612f7400..011130c61f 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -2097,6 +2097,9 @@ eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev) static int vdpa_check_handler(__rte_unused const char *key, const char *value, void *ret_val) { + if (value == NULL || ret_val == NULL) + return -EINVAL; + if (strcmp(value, "1") == 0) *(int *)ret_val = 1; else @@ -2134,6 +2137,9 @@ virtio_dev_speed_capa_get(uint32_t speed) static int vectorized_check_handler(__rte_unused const char *key, const char *value, void *ret_val) { + if (value == NULL || ret_val == NULL) + return -EINVAL; + if (strcmp(value, "1") == 0) *(int *)ret_val = 1; else -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-03-15 22:44:50.713282199 +0000 +++ 0019-net-virtio-fix-empty-devargs-parsing.patch 2023-03-15 22:44:49.575850093 +0000 @@ -1 +1 @@ -From 1c1b35b59b4cee8836f34498b7c55b49de39d7b3 Mon Sep 17 00:00:00 2001 +From 279024fc7c8b73769f52ae0735cd2db24714aef3 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 1c1b35b59b4cee8836f34498b7c55b49de39d7b3 ] + @@ -16 +17,0 @@ -Cc: stable@dpdk.org @@ -21,3 +22,2 @@ - drivers/net/virtio/virtio_ethdev.c | 3 +++ - drivers/net/virtio/virtio_pci_ethdev.c | 3 +++ - 2 files changed, 6 insertions(+) + drivers/net/virtio/virtio_ethdev.c | 6 ++++++ + 1 file changed, 6 insertions(+) @@ -26 +26 @@ -index dc6856d749..ae84d313be 100644 +index ce612f7400..011130c61f 100644 @@ -29,2 +29,2 @@ -@@ -2056,6 +2056,9 @@ virtio_dev_speed_capa_get(uint32_t speed) - static int vectorized_check_handler(__rte_unused const char *key, +@@ -2097,6 +2097,9 @@ eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev) + static int vdpa_check_handler(__rte_unused const char *key, @@ -39,6 +39,2 @@ -diff --git a/drivers/net/virtio/virtio_pci_ethdev.c b/drivers/net/virtio/virtio_pci_ethdev.c -index abc63b0935..9b4b846f8a 100644 ---- a/drivers/net/virtio/virtio_pci_ethdev.c -+++ b/drivers/net/virtio/virtio_pci_ethdev.c -@@ -148,6 +148,9 @@ eth_virtio_pci_uninit(struct rte_eth_dev *eth_dev) - static int vdpa_check_handler(__rte_unused const char *key, +@@ -2134,6 +2137,9 @@ virtio_dev_speed_capa_get(uint32_t speed) + static int vectorized_check_handler(__rte_unused const char *key,