From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 5D7DA1B432 for ; Fri, 23 Nov 2018 11:30:53 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C26233091D52; Fri, 23 Nov 2018 10:30:52 +0000 (UTC) Received: from ktraynor.remote.csb (unknown [10.36.118.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id 99F8E413C; Fri, 23 Nov 2018 10:30:51 +0000 (UTC) From: Kevin Traynor To: Stephen Hemminger Cc: Keith Wiles , dpdk stable Date: Fri, 23 Nov 2018 10:27:09 +0000 Message-Id: <20181123102713.17309-65-ktraynor@redhat.com> In-Reply-To: <20181123102713.17309-1-ktraynor@redhat.com> References: <20181123102713.17309-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Fri, 23 Nov 2018 10:30:52 +0000 (UTC) Subject: [dpdk-stable] patch 'net/tap: fix file descriptor leak on error' has been queued to stable release 18.08.1 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: , X-List-Received-Date: Fri, 23 Nov 2018 10:30:53 -0000 Hi, FYI, your patch has been queued to stable release 18.08.1 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/29/18. 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. If the code is different (ie: not only metadata diffs), due for example to a change in context or macro names, please double check it. Thanks. Kevin Traynor --- >>From 43927b903f18c48b10d69c74345edb22fa87710c Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 6 Nov 2018 11:30:04 -0800 Subject: [PATCH] net/tap: fix file descriptor leak on error [ upstream commit cc02c977189c46f0fa7de4e25f5f79c9a92cd052 ] If netlink socket setup fails the file descriptor was leaked. Coverity issue: 257040 Fixes: 7c25284e30c2 ("net/tap: add netlink back-end for flow API") Signed-off-by: Stephen Hemminger Acked-by: Keith Wiles --- drivers/net/tap/tap_netlink.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/tap/tap_netlink.c b/drivers/net/tap/tap_netlink.c index 6cb510092..14bbbec75 100644 --- a/drivers/net/tap/tap_netlink.c +++ b/drivers/net/tap/tap_netlink.c @@ -52,12 +52,15 @@ tap_nl_init(uint32_t nl_groups) if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &sndbuf_size, sizeof(int))) { TAP_LOG(ERR, "Unable to set socket buffer send size"); + close(fd); return -1; } if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &rcvbuf_size, sizeof(int))) { TAP_LOG(ERR, "Unable to set socket buffer receive size"); + close(fd); return -1; } if (bind(fd, (struct sockaddr *)&local, sizeof(local)) < 0) { TAP_LOG(ERR, "Unable to bind to the netlink socket"); + close(fd); return -1; } -- 2.19.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-23 10:22:55.926772033 +0000 +++ 0065-net-tap-fix-file-descriptor-leak-on-error.patch 2018-11-23 10:22:54.000000000 +0000 @@ -1,13 +1,14 @@ -From cc02c977189c46f0fa7de4e25f5f79c9a92cd052 Mon Sep 17 00:00:00 2001 +From 43927b903f18c48b10d69c74345edb22fa87710c Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 6 Nov 2018 11:30:04 -0800 Subject: [PATCH] net/tap: fix file descriptor leak on error +[ upstream commit cc02c977189c46f0fa7de4e25f5f79c9a92cd052 ] + If netlink socket setup fails the file descriptor was leaked. Coverity issue: 257040 Fixes: 7c25284e30c2 ("net/tap: add netlink back-end for flow API") -Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger Acked-by: Keith Wiles