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] [day] [month] [year] [list]
Date:	Tue, 16 Feb 2016 17:33:18 +0100
From:	Arnd Bergmann <arnd@...db.de>
To:	Nikolay Borisov <kernel@...p.com>
Cc:	"David S. Miller" <davem@...emloft.net>,
	Alexey Kuznetsov <kuznet@....inr.ac.ru>,
	James Morris <jmorris@...ei.org>,
	Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
	Patrick McHardy <kaber@...sh.net>,
	linux-arm-kernel@...ts.infradead.org, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: igmp: use IS_ENABLED(CONFIG_IP_MULTICAST) instead of ifdef

On Tuesday 16 February 2016 18:10:52 Nikolay Borisov wrote:
> On 02/16/2016 05:59 PM, Arnd Bergmann wrote:
> > @@ -1821,17 +1807,15 @@ static int ip_mc_del_src(struct in_device *in_dev, __be32 *pmca, int sfmode,
> >  		if (!err && rv < 0)
> >  			err = rv;
> >  	}
> > -	if (pmc->sfmode == MCAST_EXCLUDE &&
> > +	if (IS_ENABLED(CONFIG_IP_MULTICAST) &&
> > +	    pmc->sfmode == MCAST_EXCLUDE &&
> >  	    pmc->sfcount[MCAST_EXCLUDE] == 0 &&
> >  	    pmc->sfcount[MCAST_INCLUDE]) {
> > -#ifdef CONFIG_IP_MULTICAST
> >  		struct ip_sf_list *psf;
> >  		struct net *net = dev_net(in_dev->dev);
> > -#endif
> >  
> >  		/* filter mode change */
> >  		pmc->sfmode = MCAST_INCLUDE;
> 
> The above line was always executed, whereas now it wouldn't execute
> unless IS_ENABLED passes.

This was not intentional, I've sent a v2 patch to fix it up now, and
tried to simplify it a little further, making the logic the
same for  ip_mc_del_src and ip_mc_add_src.

> >  /*
> >   * Add multicast source filter list to the interface list
> > @@ -1977,9 +1961,7 @@ static int ip_mc_add_src(struct in_device *in_dev, __be32 *pmca, int sfmode,
> >  	spin_lock_bh(&pmc->lock);
> >  	rcu_read_unlock();
> >  
> > -#ifdef CONFIG_IP_MULTICAST
> >  	sf_markstate(pmc);
> > -#endif
> 
> This would be executed unconditionally, which is contrary to the
> original intention. Dunno if it makes a difference though.

This was intentional, I have changed sf_markstate() to do nothing when
IP_MULTICAST is disabled. However, there was another caller where
I should have done the same thing rather than adding an if().

> Reviewed-by: Nikolay Borisov <kernel@...p.com>

Thanks!

	Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ