lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Wed,  7 Feb 2024 23:32:39 +0300
From: Maks Mishin <maks.mishinfz@...il.com>
To: Stephen Hemminger <stephen@...workplumber.org>
Cc: Maks Mishin <maks.mishinFZ@...il.com>,
	netdev@...r.kernel.org
Subject: [PATCH] ll_map: Fix descriptor leak in ll_link_get()

Found by RASU JSC

Signed-off-by: Maks Mishin <maks.mishinFZ@...il.com>
---
 lib/ll_map.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/ll_map.c b/lib/ll_map.c
index 8970c20f..711708a5 100644
--- a/lib/ll_map.c
+++ b/lib/ll_map.c
@@ -278,8 +278,10 @@ static int ll_link_get(const char *name, int index)
 	struct nlmsghdr *answer;
 	int rc = 0;
 
-	if (rtnl_open(&rth, 0) < 0)
+	if (rtnl_open(&rth, 0) < 0) {
+		rtnl_close(&rth);
 		return 0;
+	}
 
 	addattr32(&req.n, sizeof(req), IFLA_EXT_MASK, filt_mask);
 	if (name)
-- 
2.30.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ