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]
Message-ID: <1305383610.3120.62.camel@edumazet-laptop>
Date:	Sat, 14 May 2011 16:33:30 +0200
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Maxin B John <maxin.john@...il.com>
Cc:	netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
	kaber@...sh.net, yoshfuji@...ux-ipv6.org, jmorris@...ei.org,
	pekkas@...core.fi, kuznet@....inr.ac.ru, davem@...emloft.net
Subject: Re: [PATCH] net: ipv6: mcast: Removing invalid check

Le samedi 14 mai 2011 à 16:43 +0300, Maxin B John a écrit :
> Since the variable 'first' is assigned to 1, the check
> "if (truncate && !first)" will always be false.
> 
> Thanks to Coverity for spotting this issue.
> 
> Signed-off-by: Maxin B. John <maxin.john@...il.com>
> ---
> diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
> index 76b8937..441c1a4 100644
> --- a/net/ipv6/mcast.c
> +++ b/net/ipv6/mcast.c
> @@ -1536,8 +1536,6 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ifmcaddr6 *pmc,
>  
>  		if (AVAILABLE(skb) < sizeof(*psrc) +
>  		    first*sizeof(struct mld2_grec)) {
> -			if (truncate && !first)
> -				break;	 /* truncate these */
>  			if (pgr)
>  				pgr->grec_nsrcs = htons(scount);
>  			if (skb)

At a first glance, I would say Coverity is wrong, unless you can explain
why it's right ;)

first can be 0 at this point, we are in a loop.

BTW "Removing invalid check" is a really wrong patch title.

Once you can prove your point, you should use "Remove useless check"

Thanks


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ