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 A948EA0032 for ; Fri, 18 Feb 2022 13:42:51 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A4BAC41143; Fri, 18 Feb 2022 13:42:50 +0100 (CET) Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by mails.dpdk.org (Postfix) with ESMTP id DC27241140 for ; Fri, 18 Feb 2022 13:42:49 +0100 (CET) Received: by mail-wr1-f48.google.com with SMTP id d27so14405881wrb.5 for ; Fri, 18 Feb 2022 04:42:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=y7sXPdijYhDeEzAAta5nWeMFmxwN43Flce0Fr/JNoDE=; b=GmOiu143jLwX3kWpAIL+9Sdu9Iys1vZq94v0J7s3Ob5JftK64WXUxz1RORdjsXwzwZ ayQYhzju5YjS29BlyUtCKFKzzDjEqvK7CeDRuCY55eMy36lm5ZIVPTgwIktM43er4gbu bw4yOyGKLa6RluaNOzHQLKp2oDJtkTBVm+3xF5Yy0EgkjMzvJ8nzQBrNYi1su/E8bqzD //nqWDxqCdJPb8Fo17Y37udGzqnhPWyPxvjRZEG7szGM71fgCrpQ/GleUtJSik1B/1El LuaP38MLUZwmvOcJwxI4BtWsvCMeGkaPi0C9dGh+GogqZTReuA+HZKO3k+YFo16fp0Us dqDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=y7sXPdijYhDeEzAAta5nWeMFmxwN43Flce0Fr/JNoDE=; b=5nLywiR1BY+yON9nTGwW2plqZzw0jxvnFsEgamaKbZXroYfYk5QH7boDUzzagA2cMM QzmG1j/Qq9qwEGIAIQk4zpQSMuQncUocPsaeFanvrtlLTGNnQC5OCyxlexJq7pferSeJ otuS1vDTPPDy/EE6HwhZdrdZkvhB7v1xaiEoiytNRbrgHcUFB4J7evmYJkwz3pPcxASs nuFVnb7uRNrfqWvwZz4Jbb9tLQNGRNnfCt2KRwPltPSfUKrj2twQLFUa2VAISi3LQ+ew MnC9ezRtntrRGzRryy/vbQHWEIJTTS4h7bCLqaIEuYV6/yUxvSFckKB2pwtP7gXUzv3Z yOMg== X-Gm-Message-State: AOAM533YFCI9rWnMDGNaR0OjSFaNWDol5E4a4m1Sx+9jx8h1uwRJ9UzZ b2fyMpOAuSsIAAdBk2SqOeOwWd8NSBSsKV5a X-Google-Smtp-Source: ABdhPJyRhGRSvw1yL9LoebHygI9D72GyDsn64YDpmPPP3MCBretNJTRi32ti7N0a5GTSV9KC1kfDzw== X-Received: by 2002:adf:9f42:0:b0:1e7:e751:9656 with SMTP id f2-20020adf9f42000000b001e7e7519656mr5853069wrg.590.1645188169651; Fri, 18 Feb 2022 04:42:49 -0800 (PST) Received: from localhost ([2a01:4b00:f41a:3600:360b:9754:2e3a:c344]) by smtp.gmail.com with ESMTPSA id s7sm6791807wri.5.2022.02.18.04.42.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Feb 2022 04:42:49 -0800 (PST) From: luca.boccassi@gmail.com To: Harold Huang Cc: Chenbo Xia , dpdk stable Subject: patch 'net/virtio-user: fix resource leak on probing failure' has been queued to stable release 20.11.5 Date: Fri, 18 Feb 2022 12:38:32 +0000 Message-Id: <20220218123931.1749595-63-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220218123931.1749595-1-luca.boccassi@gmail.com> References: <20220218123931.1749595-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.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/20/22. 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/ac0c52244d8385f60974679742f09c87858b9fbf Thanks. Luca Boccassi --- >From ac0c52244d8385f60974679742f09c87858b9fbf Mon Sep 17 00:00:00 2001 From: Harold Huang Date: Thu, 23 Dec 2021 12:42:37 +0800 Subject: [PATCH] net/virtio-user: fix resource leak on probing failure [ upstream commit edca47a1d9e01cb6f9bd174cc1cbefce1af7fd37 ] When eth_virtio_dev_init is failed, the registered virtio user memory event cb is not released and the backend created tap device is not destroyed. It would cause some residual tap device existed in the host and creating a new vdev could be failed because the new virtio_user_dev could use the same address pointer and register memory event cb to the same address is not allowed. Fixes: ca8326a94365 ("net/virtio_user: fix error management during init") Signed-off-by: Harold Huang Reviewed-by: Chenbo Xia --- drivers/net/virtio/virtio_user_ethdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c index 0906a34799..04d6d7e2f4 100644 --- a/drivers/net/virtio/virtio_user_ethdev.c +++ b/drivers/net/virtio/virtio_user_ethdev.c @@ -887,6 +887,7 @@ virtio_user_pmd_probe(struct rte_vdev_device *dev) /* previously called by pci probing for physical dev */ if (eth_virtio_dev_init(eth_dev) < 0) { PMD_INIT_LOG(ERR, "eth_virtio_dev_init fails"); + virtio_user_dev_uninit(hw->virtio_user_dev); virtio_user_eth_dev_free(eth_dev); goto end; } -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-02-18 12:37:40.405299516 +0000 +++ 0063-net-virtio-user-fix-resource-leak-on-probing-failure.patch 2022-02-18 12:37:37.702792189 +0000 @@ -1 +1 @@ -From edca47a1d9e01cb6f9bd174cc1cbefce1af7fd37 Mon Sep 17 00:00:00 2001 +From ac0c52244d8385f60974679742f09c87858b9fbf Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit edca47a1d9e01cb6f9bd174cc1cbefce1af7fd37 ] + @@ -14 +15,0 @@ -Cc: stable@dpdk.org @@ -23 +24 @@ -index 0271098f0d..16eca2f940 100644 +index 0906a34799..04d6d7e2f4 100644 @@ -26 +27 @@ -@@ -666,6 +666,7 @@ virtio_user_pmd_probe(struct rte_vdev_device *vdev) +@@ -887,6 +887,7 @@ virtio_user_pmd_probe(struct rte_vdev_device *dev) @@ -30 +31 @@ -+ virtio_user_dev_uninit(dev); ++ virtio_user_dev_uninit(hw->virtio_user_dev);