From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 715BDA04DB for ; Tue, 17 Nov 2020 12:15:55 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6A5DD5913; Tue, 17 Nov 2020 12:15:54 +0100 (CET) Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by dpdk.org (Postfix) with ESMTP id 40E1F5913 for ; Tue, 17 Nov 2020 12:15:51 +0100 (CET) Received: by mail-wm1-f41.google.com with SMTP id w24so2866893wmi.0 for ; Tue, 17 Nov 2020 03:15:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=U45nBqkUgNYFD/Q9iyg74z3LZRGXMI+vne+kUiQfS4E=; b=o8yYKx+8tDs0FjosM1DOPyUwaSkV3un9kPKVZwMcwLu59NfqDIDwdtQmlt6qnsp1Z3 LaySuWFQhCDv9Gki/JGolMIpKf4GqHjlrYUXadpRiSOOSEb3iWSfAH2DzHPp3/H90dJB atReZ38675PSCidph8Nh9RFp7L2u66DKBxKVtmZRFBhetznh2lGKsA+bTMHBoogbG1c1 9j/zK1Tr94SmuJVZakjRlVMtSUVmRqbBfgeFN93A+yXCxIeaadAVYtjEZOLK2UFaAYkK k4gAm8QFBr06nuvJh0mnZtlRK2wVQWalYTGrWR3IKzyJpSu8oezH3USWIw1PR1ZedRAq gsyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=U45nBqkUgNYFD/Q9iyg74z3LZRGXMI+vne+kUiQfS4E=; b=n2VaHed9ieZjLZgXuSrDqbFJCiUmOH2pLwy2nnkfqOICmqM/u33qSunO4EbuUaSNns ZSxPpuDxmxcQsLzOD/o73DMA7TIk/1aeavC7Fzyht7yJvsxol/8qhz1/20yEBWrSIAme MXsHokD8Lc6+EhTfK+eHVRet3VKX7mlGWuMcaI3Y+IdZs11jrpHgpwOVaLGQQh6yIyLf f7468eeHZ1YV8YN1FT5ZnxOJe0g2jRTzNqLiJcKIEpFEh7yDEdHMWTlg602Kaweb8321 wBCkEw5hwhico9AalriALnwh5KGcTOzFR9MmTXMb+tEO7XlkiKBc97FjFY+lCT/pDAPV W/hQ== X-Gm-Message-State: AOAM5309e1Y5aPnoR9tpaPWnNzBNxloL0agLHa6GEdLqsUjuxWupsk3m aax4sXyyok/b8A0eoCkHEdY= X-Google-Smtp-Source: ABdhPJy0OCsvRE35D0LlIPPX8RHRo1KwW/aP84n085l6JwGaExQ+++I1fMUV2/2aveZNBYq1DgyB3g== X-Received: by 2002:a1c:f20e:: with SMTP id s14mr2851913wmc.126.1605611750974; Tue, 17 Nov 2020 03:15:50 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id c187sm3546212wmd.23.2020.11.17.03.15.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 03:15:50 -0800 (PST) From: luca.boccassi@gmail.com To: Maxime Coquelin Cc: Xuan Ding , Chenbo Xia , Xueming Li , dpdk stable Date: Tue, 17 Nov 2020 11:14:03 +0000 Message-Id: <20201117111416.1961049-29-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201117111416.1961049-1-luca.boccassi@gmail.com> References: <20201109185030.3478760-2-luca.boccassi@gmail.com> <20201117111416.1961049-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'vhost: fix fd leak in dirty logging setup' has been queued to stable release 19.11.6 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/19/20. 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/98e192abb017789d216e138dd6e6f09548b5e24a Thanks. Luca Boccassi --- >From 98e192abb017789d216e138dd6e6f09548b5e24a Mon Sep 17 00:00:00 2001 From: Maxime Coquelin Date: Thu, 12 Nov 2020 18:10:28 +0100 Subject: [PATCH] vhost: fix fd leak in dirty logging setup [ upstream commit 6dc3f119ce7310e4e473e5759885ac773dbb12ef ] This patch fixes a file descriptor leak which happens in the error path of vhost_user_set_log_base(). Fixes: 4796ad63ba1f ("examples/vhost: import userspace vhost application") Reported-by: Xuan Ding Signed-off-by: Maxime Coquelin Reviewed-by: Chenbo Xia Reviewed-by: Xueming Li --- lib/librte_vhost/vhost_user.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index f8366c9be2..4647ba64f0 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -2088,7 +2088,7 @@ vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg, RTE_LOG(ERR, VHOST_CONFIG, "invalid log base msg size: %"PRId32" != %d\n", msg->size, (int)sizeof(VhostUserLog)); - return RTE_VHOST_MSG_RESULT_ERR; + goto close_msg_fds; } size = msg->payload.log.mmap_size; @@ -2099,7 +2099,7 @@ vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg, RTE_LOG(ERR, VHOST_CONFIG, "log offset %#"PRIx64" and log size %#"PRIx64" overflow\n", off, size); - return RTE_VHOST_MSG_RESULT_ERR; + goto close_msg_fds; } RTE_LOG(INFO, VHOST_CONFIG, @@ -2136,6 +2136,10 @@ vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg, msg->fd_num = 0; return RTE_VHOST_MSG_RESULT_REPLY; + +close_msg_fds: + close_msg_fds(msg); + return RTE_VHOST_MSG_RESULT_ERR; } static int vhost_user_set_log_fd(struct virtio_net **pdev __rte_unused, -- 2.27.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-11-17 11:13:14.210330472 +0000 +++ 0029-vhost-fix-fd-leak-in-dirty-logging-setup.patch 2020-11-17 11:13:12.937116931 +0000 @@ -1 +1 @@ -From 6dc3f119ce7310e4e473e5759885ac773dbb12ef Mon Sep 17 00:00:00 2001 +From 98e192abb017789d216e138dd6e6f09548b5e24a Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 6dc3f119ce7310e4e473e5759885ac773dbb12ef ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -21 +22 @@ -index 3898c93d1f..23c115f994 100644 +index f8366c9be2..4647ba64f0 100644 @@ -24,2 +25,2 @@ -@@ -2086,7 +2086,7 @@ vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg, - VHOST_LOG_CONFIG(ERR, +@@ -2088,7 +2088,7 @@ vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg, + RTE_LOG(ERR, VHOST_CONFIG, @@ -33,2 +34,2 @@ -@@ -2097,7 +2097,7 @@ vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg, - VHOST_LOG_CONFIG(ERR, +@@ -2099,7 +2099,7 @@ vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg, + RTE_LOG(ERR, VHOST_CONFIG, @@ -41,2 +42,2 @@ - VHOST_LOG_CONFIG(INFO, -@@ -2134,6 +2134,10 @@ vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg, + RTE_LOG(INFO, VHOST_CONFIG, +@@ -2136,6 +2136,10 @@ vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg,