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 B366342CBC for ; Thu, 15 Jun 2023 03:35:28 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AD44E42D55; Thu, 15 Jun 2023 03:35:28 +0200 (CEST) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by mails.dpdk.org (Postfix) with ESMTP id C54FF42D52 for ; Thu, 15 Jun 2023 03:35:27 +0200 (CEST) Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-30fbf253dc7so180472f8f.0 for ; Wed, 14 Jun 2023 18:35:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686792927; x=1689384927; 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=ZiGs2r6jJuzFLatwdT2Kjndr5bQFHybEc9IZT8t9vWk=; b=OT0hzla6Ugl0G8/CBtzqCv0tJmLnpPA43ShBOGBxXKF/4V7n5uj0uYz3hFjd7F0FzN teITmCr177YkhoAGO717Ojg0MbmooiOyaKsIoTB48h4xVln5TX2G+jFq7wOOCAbJ9s69 hQe5NQbC0MP9DWOZxjc18XpcXg7NP2bEwaWEtcLyq9P05YNFiGbgC2pg6gudMv95gZ20 tk/DU96b8s3TfFSJhmY7xwhHPQPqC9mg0Lv430T4Kfr8qIjZ4mXiuOhgcxGSaZTIEzUI pXaJ1YndIPKk3qv9t6bdFkXLOkabjlByo6sIi3wTMuxTZQ0ZjlIo4rZ7jY+7HlcSHg+/ Ps7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686792927; x=1689384927; 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=ZiGs2r6jJuzFLatwdT2Kjndr5bQFHybEc9IZT8t9vWk=; b=HeGcAaBfEMcY3jzxeMuE5SJ3HwFOYTKYcF5YnfDkj0MuQ1RA5+ordQTzUu5pskcD7f Rz/EWP8SkJoeJqv2uUG2n/3Ao9HIk61DmRCbWFdZ+AtQK6RAL89WsaWN8FwBig3TpN/s oDtln249krHok0fJ55eWCOlKdkIyVb01U1Gh5Og2djOhkBj8CeMlloiqPxCTh9nWDeGe yed0i5wobSnLje0pQ9FFl1DjMukgqYlvq+F70aoPf40xcub5lYvZMW9Mj46c1CJkyW1N 4BfLJGXW5mP3LAb+YwCxMHdeMEkjiMiXlJOgGeYjnnRBKbzRDLT5CPKxiSz4T5DcpUQY 9WwQ== X-Gm-Message-State: AC+VfDxtmJOd49AfoUSLiSCfNCbhOl9aM1K4t/4wr4NM7j7iKHiNzEhV 2hZjzy9t1+/nv4fDxPklzQ4= X-Google-Smtp-Source: ACHHUZ6j++p016Igj90zIOfyEm/P/tMsxDqFD3dZM8Aco4M+9DT9FY7dEGy1Rqnc+adG0wv5nzhMeg== X-Received: by 2002:adf:ce8a:0:b0:30a:c681:fd2e with SMTP id r10-20020adfce8a000000b0030ac681fd2emr2815933wrn.22.1686792927447; Wed, 14 Jun 2023 18:35:27 -0700 (PDT) Received: from localhost ([2a01:4b00:d307:1000:f1d3:eb5e:11f4:a7d9]) by smtp.gmail.com with ESMTPSA id l11-20020adfe9cb000000b0030ae54e575csm19696524wrn.59.2023.06.14.18.35.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 18:35:26 -0700 (PDT) From: luca.boccassi@gmail.com 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 20.11.9 Date: Thu, 15 Jun 2023 02:32:41 +0100 Message-Id: <20230615013258.1439718-46-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230615013258.1439718-1-luca.boccassi@gmail.com> References: <20230615013258.1439718-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.9 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/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/1b227ed34a39b5ecd789d19d941a8d91a3cb288b Thanks. Luca Boccassi --- >From 1b227ed34a39b5ecd789d19d941a8d91a3cb288b 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 [ 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 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c index 73f6fd7313..cbcd0fedc0 100644 --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c @@ -475,10 +475,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues, parse_mac(dev, mac); - if (*ifname) { - dev->ifname = *ifname; - *ifname = NULL; - } + dev->ifname = *ifname; if (virtio_user_dev_setup(dev) < 0) { PMD_INIT_LOG(ERR, "backend set up fails"); @@ -592,6 +589,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues, } } + *ifname = NULL; return 0; } -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-06-15 01:56:37.039629787 +0100 +++ 0046-net-virtio-user-fix-leak-when-initialisation-fails.patch 2023-06-15 01:56:34.663543401 +0100 @@ -1 +1 @@ -From c8254ef1a96c4897293b1d1db8c8a786dfb19e9d Mon Sep 17 00:00:00 2001 +From 1b227ed34a39b5ecd789d19d941a8d91a3cb288b Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit c8254ef1a96c4897293b1d1db8c8a786dfb19e9d ] + @@ -11 +12,0 @@ -Cc: stable@dpdk.org @@ -17,2 +18,2 @@ - drivers/net/virtio/virtio_user/virtio_user_dev.c | 7 ++----- - 1 file changed, 2 insertions(+), 5 deletions(-) + drivers/net/virtio/virtio_user/virtio_user_dev.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) @@ -21 +22 @@ -index 2b4607a291..af1f8c8237 100644 +index 73f6fd7313..cbcd0fedc0 100644 @@ -24,5 +25,4 @@ -@@ -696,11 +696,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, uint16_t queues, - dev->frontend_features = 0; - dev->unsupported_features = 0; - dev->backend_type = backend_type; -- +@@ -475,10 +475,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues, + + parse_mac(dev, mac); + @@ -36,2 +36,2 @@ - PMD_INIT_LOG(ERR, "(%s) backend set up fails", dev->path); -@@ -794,6 +790,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, uint16_t queues, + PMD_INIT_LOG(ERR, "backend set up fails"); +@@ -592,6 +589,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues, @@ -42,0 +43 @@ + } @@ -44 +44,0 @@ - notify_uninit: