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:   Wed, 22 Apr 2020 16:44:36 +0200
From:   Dominique Martinet <asmadeus@...ewreck.org>
To:     Jamal Hadi Salim <jhs@...atatu.com>
Cc:     stephen@...workplumber.org, netdev@...r.kernel.org,
        dsahern@...il.com, aclaudi@...hat.com, daniel@...earbox.net,
        Jamal Hadi Salim <hadi@...atatu.com>
Subject: Re: [PATCH iproute2 v2 2/2] bpf: Fix mem leak and extraneous free()
 in error path

Jamal Hadi Salim wrote on Wed, Apr 22, 2020:
>  	sub = strtok(rem, "/");
>  	while (sub) {
> -		if (strlen(tmp) + strlen(sub) + 2 > PATH_MAX)
> -			return -EINVAL;
> +		if (strlen(tmp) + strlen(sub) + 2 > PATH_MAX) {
> +			ret = -EINVAL;
> +			goto out;
> +		}

Now I'm looking at this we're a bit inconsistent with return values in
this function, other error paths return negative value + errno set,
and this only returns -errno.

Digging a bit into callers it looks like errno is the way to go, so
while you're modifying this it might be worth setting errno to EINVAL as
well here?


Cheers & sorry for nitpicking,
-- 
Dominique

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ