[dpdk-stable] patch 'net/tap: fix file descriptor leak on error' has been queued to stable release 18.08.1
Kevin Traynor
ktraynor at redhat.com
Fri Nov 23 11:27:09 CET 2018
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 <stephen at networkplumber.org>
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 <stephen at networkplumber.org>
Acked-by: Keith Wiles <keith.wiles at intel.com>
---
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 <stephen at networkplumber.org>
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 at dpdk.org
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Acked-by: Keith Wiles <keith.wiles at intel.com>
More information about the stable
mailing list