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 6F97B42D46 for ; Sun, 25 Jun 2023 08:43:41 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6AF1140ED8; Sun, 25 Jun 2023 08:43:41 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2044.outbound.protection.outlook.com [40.107.92.44]) by mails.dpdk.org (Postfix) with ESMTP id 4628F40A7F for ; Sun, 25 Jun 2023 08:43:40 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h9X6xAe+7wTY9xmiGXBTzxHeB7PEfr4OiB6Yx/bN43UBAsfH7N3iQrTsGqThE0n16SxmBnVa/lvdNAEY84anOvwo24nxOBK/YAyp+OIUoMFO1JPV/1IMRpsnwNljc5KC6rBXq1+NzBTWVkTDj2LuGOIFD22pRwaookEO7r5xgsvuRNqqv+Z/3WfX+0uGJJjlGhdglxdwP2+oVJikkIjb9NEHyT8GNzzu7/HlVJcVFuVdLMuIZlejZJFKr1S3XsSppAblMwtjVz+KEFJZ/KAyNyV7AdUVUMj51LfjbMMPNbu9viJ1+qP7dDKemJaqdG7BCgHuFtVw0yrzrbw8LSYpVg== 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=3Wac57F9SMrPWYA+SDE5ANc+fL0MXy5IHlffNmjmGUg=; b=hvZ5rkFJoHLwOquOY5FbxQF+jNp8PlrhTU6pYavCyxoSPmk8CgnQJsnZ+XAfc4NwDV0nzvDXtGy4EeW/iTop3aeNK+uH0hLBaOCEacxJzGxSgefbPKJxjUVMKiweLqBsIPwH9a6fQN8ZqKGCxqiaD0ob9Gdxr1IubN1RISt6OWzrX3g17HPizrPw1GKJkh7KGkuIzukiyRLSxd8SIX5m5KG+Y8iquIP7e67Bh+OXnSXtkmxC875IBNZ5SY5Hf9KwuUjafyan/4EXtbcRM8+UTJK2SsflJZ39iDlTvNKD8EXhTyDg1HEBvRkWcICnPNGs9hUXG7xO9JueGfSVEsn/CQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=redhat.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=3Wac57F9SMrPWYA+SDE5ANc+fL0MXy5IHlffNmjmGUg=; b=K9Z1/KbDZyMGu67EYtqOSckRD6TAzZ6dWSS8JFJLLt6b5qNllY1Q1XxFO2smGsLRmI6MoTFF3HkAObLegDeJvI2+VJLQvLQNKvbXQPvGbivloOWAd5/eNaCtVuFk3ZrU6PD3HJ9JshRNhCSpZ2HTsTjFiHV6Yt1ndYqGyJs5rbeCtX6xL3ladYlNO9GNS9MrR8CccC8BgqSvDRq49MFYClzsZ1JjetQI5m5pSPNbJ/8v/kdKwFVTbUHunm5fBeVfmGm76TFPE1Zsl0zPNAZ+oAm113bTLrSb1REr0NhBLI5hDpRfrqZ7iE/Zm1zGH5PQ6KKnMwNqfYUPAp91nSbR3Q== Received: from BN8PR12CA0025.namprd12.prod.outlook.com (2603:10b6:408:60::38) by CH2PR12MB4085.namprd12.prod.outlook.com (2603:10b6:610:79::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.26; Sun, 25 Jun 2023 06:43:38 +0000 Received: from BN8NAM11FT112.eop-nam11.prod.protection.outlook.com (2603:10b6:408:60:cafe::bd) by BN8PR12CA0025.outlook.office365.com (2603:10b6:408:60::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.33 via Frontend Transport; Sun, 25 Jun 2023 06:43:38 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BN8NAM11FT112.mail.protection.outlook.com (10.13.176.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.46 via Frontend Transport; Sun, 25 Jun 2023 06:43:38 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Sat, 24 Jun 2023 23:43:24 -0700 Received: from nvidia.com (10.126.230.35) 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; Sat, 24 Jun 2023 23:43:22 -0700 From: Xueming Li To: David Marchand CC: Maxime Coquelin , Tyler Retzlaff , dpdk stable Subject: patch 'net/virtio-user: fix leak when initialisation fails' has been queued to stable release 22.11.3 Date: Sun, 25 Jun 2023 14:35:04 +0800 Message-ID: <20230625063544.11183-87-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230625063544.11183-1-xuemingl@nvidia.com> References: <20230625063544.11183-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT112:EE_|CH2PR12MB4085:EE_ X-MS-Office365-Filtering-Correlation-Id: e9aa1c35-8f0a-4069-87be-08db754781e9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qRn6sb4A7mQ3eEGieJYFmNERyXLJEyIjwwRDGdlkt9UGI9w//r7dJ7u49H/Jp+4Tscn5QIoVRfEtmkLWPrNeadt+xXtK6byic5QJubOuf/TWAbcSI56XZoDYgcI0eZTxJG0xm9VV0+IGXJYkZn4bCk8HBqAZbhcjZakfcgiDuruxw7MTXNELGA6FP0bRNWgPM4mos/87a1HRAuE2nS4NZeYPFW4mEOI3qhDoCg8eTfs8vJBRD3Q3WJX5vXrjcxur1AOPfffb8pIAHWDGgtQn6IkT8JHL02FBd0cVv6oQ4BjQlainfH+bDCP/j7n69CiuHOWNlq8pjIaoP0I6WWZIsKFFiLyI51TEw8Ghd3SotbkXjpt04pS1nmvhXYFUPt97dMvTyu1hlZSkFHtG1oEHcDBDr0EUJahIrjf5T1z8ZZWar4VGGWcPXec+cC78oY9WBRfvv07lzGzUTdA+AOJs5tiNd0KnO+5+CkrKaxP5Pbm2uMK9JSfwFQuDHrMvS6zP2NUDe/e+JMbCHUpRmLwBjCHew7l59Gm1c0/s/pcvN68NW1rrThTLeGDUS6x5jQK1vKn3ZVQV9a88qbEfP9h9x6aL3PdgNuyNIDEMRNkdK2FeGP29QS5tR0i3LoV2gMnvGy+pprMarTHCCD1nfKnSvQW3FVZ0oB3rg2yP5UFKhx98To7KK7S/vvu9wYw8a3zLGuZjN4GpXhAqongnXGS1t6fcjA6oq8SRqHCTL2Hr2Q0ADdnnsYwhCL1hNqJHbFFTBDZlEgdvNfEtxm8jtiUddQ== X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230028)(4636009)(346002)(376002)(39860400002)(396003)(136003)(451199021)(46966006)(40470700004)(36840700001)(36860700001)(82310400005)(47076005)(966005)(478600001)(6666004)(7696005)(2616005)(54906003)(83380400001)(336012)(426003)(26005)(53546011)(1076003)(6286002)(186003)(16526019)(2906002)(5660300002)(40460700003)(36756003)(70206006)(356005)(4326008)(70586007)(82740400003)(7636003)(40480700001)(316002)(55016003)(8936002)(8676002)(41300700001)(86362001)(6916009); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jun 2023 06:43:38.3875 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e9aa1c35-8f0a-4069-87be-08db754781e9 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.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT112.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4085 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.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/27/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/commit/?h=22.11-staging&id=2a45186cf44c51ad11e6a8f3d08a0a78a10da952 Thanks. Xueming Li --- >From 2a45186cf44c51ad11e6a8f3d08a0a78a10da952 Mon Sep 17 00:00:00 2001 From: David Marchand Date: Thu, 13 Apr 2023 12:10:41 +0200 Subject: [PATCH] net/virtio-user: fix leak when initialisation fails Cc: Xueming Li [ upstream commit c8254ef1a96c4897293b1d1db8c8a786dfb19e9d ] Caught with ASan. If initialising a virtio_user port fails, we may leak the ifname passed via a devargs. Fixes: 4214a1b493f2 ("net/virtio-user: support changing tap interface name") Signed-off-by: David Marchand Reviewed-by: Maxime Coquelin Acked-by: Tyler Retzlaff --- drivers/net/virtio/virtio_user/virtio_user_dev.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c index 19599aa3f6..697a8dcd6b 100644 --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c @@ -586,11 +586,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues, dev->frontend_features = 0; dev->unsupported_features = 0; dev->backend_type = backend_type; - - if (*ifname) { - dev->ifname = *ifname; - *ifname = NULL; - } + dev->ifname = *ifname; if (virtio_user_dev_setup(dev) < 0) { PMD_INIT_LOG(ERR, "(%s) backend set up fails", dev->path); @@ -663,6 +659,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues, } } + *ifname = NULL; return 0; } -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-06-25 14:32:00.793771600 +0800 +++ 0086-net-virtio-user-fix-leak-when-initialisation-fails.patch 2023-06-25 14:31:58.465773900 +0800 @@ -1 +1 @@ -From c8254ef1a96c4897293b1d1db8c8a786dfb19e9d Mon Sep 17 00:00:00 2001 +From 2a45186cf44c51ad11e6a8f3d08a0a78a10da952 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit c8254ef1a96c4897293b1d1db8c8a786dfb19e9d ] @@ -11 +13,0 @@ -Cc: stable@dpdk.org @@ -21 +23 @@ -index 2b4607a291..af1f8c8237 100644 +index 19599aa3f6..697a8dcd6b 100644 @@ -24 +26 @@ -@@ -696,11 +696,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, uint16_t queues, +@@ -586,11 +586,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues, @@ -37 +39 @@ -@@ -794,6 +790,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, uint16_t queues, +@@ -663,6 +659,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues, @@ -42,0 +45 @@ + } @@ -44 +46,0 @@ - notify_uninit: