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 9DE8BA04DD 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 8A362C8B0; Tue, 17 Nov 2020 12:15:54 +0100 (CET) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by dpdk.org (Postfix) with ESMTP id 77F955913 for ; Tue, 17 Nov 2020 12:15:53 +0100 (CET) Received: by mail-wr1-f46.google.com with SMTP id u12so15548284wrt.0 for ; Tue, 17 Nov 2020 03:15:53 -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=QX6Scv5yTvBWsc/LeSDTdhpYyQpmUlOeHlDgN/PP7IU=; b=QrhybSOwaQRt5gpbKRgJ9CGLDAawHE/3Awt+1tD81PwVEkMbeKzedaGI6M6XFh/6oE XVvg0JV6wxNy0SaeeO8fyFJ6QSStvd+43tAn4oqpom8jPwYqbrT4sFPHEk3hjtfwrmBe bjv4w6hw4zApth/qEs8DLqPdDglUB6wJvBFajlSkGEUl+kTwJQ3QfuUUPjFuvWqWrv+q UXtKkIMfGSC4hX3dDJTyggOM/ab0eTx1xjYRvybYJ1nZqllhaTTgA+9wIzGXM8+03dlS VD/h1JRBM8oCD17k8ahKscynd18X9EOQnUbI65EAr/LcmUhTr3Vhwc3aqSL9DfmLlm4o o2yA== 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=QX6Scv5yTvBWsc/LeSDTdhpYyQpmUlOeHlDgN/PP7IU=; b=Lpm4n4lAJHVUs6W/e2W+5pT03g6U9AR0k9XMHzzfEmwoA8SuvZMj48tWQximy31r9C JPGZJHNanY1hjqKhQA6r5DhoZrI69oOQ75GCUWTk0xsg0jIlErxUIVcPZ/Ww4MRZZIQe HUthNXMXOj85npQoKNdr+e9JwCOWc68rv5VS79karXDZod4/cPv9ZpaBPMTttN8shC2c hFGeEcrdcdpY55rjKm8ITtcRi07VajBPA28AkqMJbHL4Ka5J0eu6ShGDAuywjXeqwveY LjGfkY2FTSTMut5eJhPPvYCxzlcCZtkf6VkNInRiiHPkw+OK/Eemy/gZYk9Ymz69eHGA 90qA== X-Gm-Message-State: AOAM531aYeULwRZT4vrrqPHG2JqiNRndcyez1igtu9D5Qcw/ofMKrjGE d7UzXHo2TwVkUXnhkFYV/rwbaRnMPt6+oCea X-Google-Smtp-Source: ABdhPJyhWd9zjJy3+bWKct1N4Lc0dXlfY6ASXlMgJXJ28epptM+7DYa/VISXfiOgtB53f04gjo16Mw== X-Received: by 2002:adf:f3d1:: with SMTP id g17mr25716508wrp.156.1605611752269; Tue, 17 Nov 2020 03:15:52 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id b14sm26613292wrs.46.2020.11.17.03.15.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 03:15:51 -0800 (PST) From: luca.boccassi@gmail.com To: Maxime Coquelin Cc: Chenbo Xia , Xueming Li , dpdk stable Date: Tue, 17 Nov 2020 11:14:04 +0000 Message-Id: <20201117111416.1961049-30-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 kick 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/4089c1d4be34ed396c4c99eac15d2d1bb8b465d4 Thanks. Luca Boccassi --- >From 4089c1d4be34ed396c4c99eac15d2d1bb8b465d4 Mon Sep 17 00:00:00 2001 From: Maxime Coquelin Date: Thu, 12 Nov 2020 18:10:29 +0100 Subject: [PATCH] vhost: fix fd leak in kick setup [ upstream commit bc900f86aa943006b9f97f3297aeed5ef3caaf5e ] This patch fixes a file descriptor leak which happens in the error path of vhost_user_set_vring_kick(). Fixes: 4796ad63ba1f ("examples/vhost: import userspace vhost application") Signed-off-by: Maxime Coquelin Reviewed-by: Chenbo Xia Reviewed-by: Xueming Li --- lib/librte_vhost/vhost_user.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index 4647ba64f0..dc1e312d84 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -1844,8 +1844,12 @@ vhost_user_set_vring_kick(struct virtio_net **pdev, struct VhostUserMsg *msg, /* Interpret ring addresses only when ring is started. */ dev = translate_ring_addresses(dev, file.index); - if (!dev) + if (!dev) { + if (file.fd != VIRTIO_INVALID_EVENTFD) + close(file.fd); + return RTE_VHOST_MSG_RESULT_ERR; + } *pdev = dev; -- 2.27.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-11-17 11:13:14.251629916 +0000 +++ 0030-vhost-fix-fd-leak-in-kick-setup.patch 2020-11-17 11:13:12.937116931 +0000 @@ -1 +1 @@ -From bc900f86aa943006b9f97f3297aeed5ef3caaf5e Mon Sep 17 00:00:00 2001 +From 4089c1d4be34ed396c4c99eac15d2d1bb8b465d4 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit bc900f86aa943006b9f97f3297aeed5ef3caaf5e ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -20 +21 @@ -index 23c115f994..45c8ac09da 100644 +index 4647ba64f0..dc1e312d84 100644 @@ -23 +24 @@ -@@ -1858,8 +1858,12 @@ vhost_user_set_vring_kick(struct virtio_net **pdev, struct VhostUserMsg *msg, +@@ -1844,8 +1844,12 @@ vhost_user_set_vring_kick(struct virtio_net **pdev, struct VhostUserMsg *msg,