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 728B6428F8 for ; Sun, 9 Apr 2023 17:30:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6CB434114A; Sun, 9 Apr 2023 17:30:55 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2052.outbound.protection.outlook.com [40.107.223.52]) by mails.dpdk.org (Postfix) with ESMTP id 7388D410EE for ; Sun, 9 Apr 2023 17:30:53 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VQYmA6iidlZkpCaniipginBXrTFC3dZq298Q+foXo78YV0Vg9S2TE8XSPiDvtf5yqOKpBc8qNe4nY1vhoO4KuA3ngf+/nJ4l7fIgISLknB+nVQe3D6Cg7jKF4LZNmT+Fk4fDXvY3HjB1EqR9EuqnFlOjAAFybl6rCRkHfzVmuNRM89h/J39gekkSLNFYIHoKrl5vMU/20f/s6ccbnV5GiUT6lJ/brppXtwNvbvv+1WeDB+vssSwyF21zhUupjq7f69qH3Mh/pMqrUC4LmEknia+Tf1bE6CvhfhcYr9UKrRNt0GZ2znmtN/xV/JagFq4JU27igS+2O+Jl0KbcSTH4rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=56PHMmJnA+5CDF3iNjiGgEBJJagXlXrsLVy2Xe5Qjj0=; b=d9x/YfZFExdFm5xmGexNmb0xYASHuUHDl7BoFuQ0sNpGGb/ycFWK9yvIP5YNmXWtCzZGUjfqmLldKhuhp4oaDOSdbXSklKBRJNO/RTFNk5arAdlZsIfy3nawSpW2qxfEIRN2DIPkg22AmrmjYlxoI7OzbGHNcMrgD0Yu3wkKqLmRAWKeffdvJjBSHsRHgmdeDYs51L39TtT2WJFOgxYnLzwEBN9OrsJVrz+dyj1h1HNyJWpM9KcENPxS8sf5DtHD149uzJPgyuJF3uQ4TrNCv+mF4dSv2CzSyO7JHMyK6VKT6/bvF1DFiI6J+diuTSum4OoX1JotzLmWXoNzUZO2gA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=huawei.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=56PHMmJnA+5CDF3iNjiGgEBJJagXlXrsLVy2Xe5Qjj0=; b=cEWlbUauaiyte8ss6Sh5XJuvnQal9OFlt5Af4sF51o4mqm9KPLdoEUYqXITRbYTaslfo2a3ZaoTFsE+FPj0AQxsG+IKjh4dZRt27EQHGIaxk9v63n9IVqgvJRyXPJ8DuRVusmTnYzpqbgHGKqtb7OJ5ntHNpBurQy8aos80S4K6TDUyga7x/eaRIXsM7V21ZeKIml4gdv42YiMa1+3AEVh4iWKlsPUP47UuT9PwTvJxoAA3Cuivc+r3FXuQaPVq+1s2Ze85F6vrTRdUqvb88RgyjH3kun/Nf18Hyhoi88VsKvCL1PFChdFiPb1rcp4HDtjd5F9micY9ajDe2QLNlCg== Received: from BN9P222CA0017.NAMP222.PROD.OUTLOOK.COM (2603:10b6:408:10c::22) by PH8PR12MB7112.namprd12.prod.outlook.com (2603:10b6:510:22c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.35; Sun, 9 Apr 2023 15:30:49 +0000 Received: from BN8NAM11FT023.eop-nam11.prod.protection.outlook.com (2603:10b6:408:10c:cafe::6d) by BN9P222CA0017.outlook.office365.com (2603:10b6:408:10c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38 via Frontend Transport; Sun, 9 Apr 2023 15:30:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BN8NAM11FT023.mail.protection.outlook.com (10.13.177.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.20 via Frontend Transport; Sun, 9 Apr 2023 15:30:48 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Sun, 9 Apr 2023 08:30:32 -0700 Received: from nvidia.com (10.126.231.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Sun, 9 Apr 2023 08:30:31 -0700 From: Xueming Li To: Chengwen Feng CC: Maxime Coquelin , dpdk stable Subject: patch 'net/virtio: fix empty devargs parsing' has been queued to stable release 22.11.2 Date: Sun, 9 Apr 2023 23:24:07 +0800 Message-ID: <20230409152529.5308-60-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230409152529.5308-1-xuemingl@nvidia.com> References: <20230227062349.13764-1-xuemingl@nvidia.com> <20230409152529.5308-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT023:EE_|PH8PR12MB7112:EE_ X-MS-Office365-Filtering-Correlation-Id: 9fc997d4-4834-42dc-3112-08db390f6554 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: R6wPebZSlsRWNKZncjROiNbo1m9AKp56tI9Do7u8wBiUm+tHy7ScIX0ayOLEiN0s7vQPUIkLColiLgNCj6xvcM5Hz7rrt4amXxL7Q33nE4+dqGOrhBO8jozcnpNe3mZStjvaFYC7Ib+ShV0pPE4kAH98cokwi/eedQ90SOoI499egmCMNIzyHyJ1rApEcGJ2hFg9fcPN7JcZV8nMoJXlL6DT7NoZOLxIeMxQPux8CXQQYA+Q03wytQEGNNhJygI3dyfh0x5y/LbKSGgVectCzs1Hy73ypL+aPVlkbX0XOawq9SxG6G2UHmlaZj5RibLe3UaKj4f/T4vPc1sU8MB3V4j5yg/QAAcp0g+xgn9XIqSBw2O988wbZcSX+u6JBjyHof2ubDuYIqDFr35SQQAiYYI2yJnwBy2u6s7xjE/e3QAiQpAQSDC7QGeOBUoTkuKDMdS4025Hxxy2t09KSwZTEP4Mn97fU7vRhUBD6nHBJYwR+l9HneDXib526d5ABZllPFu20hNwKYF9cN0iv9MGJVh1CTsh0zhMqMOocoL95mSuy3Wo192ZYL7X0jQjnbtm44pu8Y6TC5NNIMUYc4ScFXnKfM/l+kg5NOc4ogLFga3hziQmIvGsZ5AJ+FRz7ZGDCmNV3dA8SSfH1C5ouo0cqIVP8MUJ1K4JaY6co2C64iZZnSt4+ENmkphmaOLxPul5BPbjc595K5odo3wmDd8ymCSORlKmFrrTlingoNsltXRwutkhWU1/mRa4hNTNvS7F0Ef5rWe35jA8/NtI6ZkXgdAf4bV77IbxU+ixB2uX/+lNewTvBdCkB5PbNO4JULzX5FLKj0z8qt2Q4eLgwnp9MQ== X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230028)(4636009)(396003)(376002)(346002)(136003)(39860400002)(451199021)(46966006)(36840700001)(40470700004)(36756003)(40460700003)(82310400005)(2906002)(5660300002)(8936002)(8676002)(55016003)(40480700001)(86362001)(966005)(6666004)(7696005)(1076003)(26005)(54906003)(36860700001)(478600001)(2616005)(47076005)(336012)(426003)(16526019)(6286002)(186003)(53546011)(70586007)(70206006)(82740400003)(356005)(7636003)(41300700001)(6916009)(4326008)(316002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2023 15:30:48.8335 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9fc997d4-4834-42dc-3112-08db390f6554 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT023.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB7112 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 22.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 04/11/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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/ce3c0aa7aa3eb6a29884b0692a9bd49e1ebc683d Thanks. Xueming Li --- >From ce3c0aa7aa3eb6a29884b0692a9bd49e1ebc683d 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 Cc: Xueming Li [ 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 | 3 +++ drivers/net/virtio/virtio_pci_ethdev.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index 760ba4e368..b72334455e 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -2457,6 +2457,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 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, 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.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-04-09 21:45:40.299008500 +0800 +++ 0059-net-virtio-fix-empty-devargs-parsing.patch 2023-04-09 21:45:38.669042200 +0800 @@ -1 +1 @@ -From 1c1b35b59b4cee8836f34498b7c55b49de39d7b3 Mon Sep 17 00:00:00 2001 +From ce3c0aa7aa3eb6a29884b0692a9bd49e1ebc683d Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 1c1b35b59b4cee8836f34498b7c55b49de39d7b3 ] @@ -16 +18,0 @@ -Cc: stable@dpdk.org @@ -26 +28 @@ -index dc6856d749..ae84d313be 100644 +index 760ba4e368..b72334455e 100644 @@ -29 +31 @@ -@@ -2056,6 +2056,9 @@ virtio_dev_speed_capa_get(uint32_t speed) +@@ -2457,6 +2457,9 @@ virtio_dev_speed_capa_get(uint32_t speed)