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-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 08 Feb 2024 13:33:14 +0000
From: Donald Hunter <donald.hunter@...il.com>
To: Maks Mishin <maks.mishinfz@...il.com>
Cc: Stephen Hemminger <stephen@...workplumber.org>,  netdev@...r.kernel.org
Subject: Re: [PATCH] ll_map: Fix descriptor leak in ll_link_get()

Maks Mishin <maks.mishinfz@...il.com> writes:

> 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);

There's no need to call rtnl_close() if the call to rtnl_open() just
failed.

>  		return 0;
> +	}
>  
>  	addattr32(&req.n, sizeof(req), IFLA_EXT_MASK, filt_mask);
>  	if (name)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ