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: Tue, 18 Jun 2024 17:02:30 +0800
From: Jiawen Wu <jiawenwu@...stnetic.com>
To: "'Simon Horman'" <horms@...nel.org>
Cc: <davem@...emloft.net>,
	<edumazet@...gle.com>,
	<kuba@...nel.org>,
	<pabeni@...hat.com>,
	<linux@...linux.org.uk>,
	<andrew@...n.ch>,
	<netdev@...r.kernel.org>,
	<mengyuanlou@...-swift.com>
Subject: RE: [PATCH net-next v2 2/3] net: txgbe: support Flow Director perfect filters

> > +	/* only program filters to hardware if the net device is running, as
> > +	 * we store the filters in the Rx buffer which is not allocated when
> > +	 * the device is down
> > +	 */
> > +	if (netif_running(wx->netdev)) {
> > +		err = txgbe_fdir_write_perfect_filter(wx, &input->filter,
> > +						      input->sw_idx, queue);
> > +		if (err)
> > +			goto err_unlock;
> > +	}
> > +
> > +	txgbe_update_ethtool_fdir_entry(txgbe, input, input->sw_idx);
> > +
> > +	spin_unlock(&txgbe->fdir_perfect_lock);
> > +
> > +	return err;
> 
> Hi Jiawen Wu,
> 
> Smatch flags that err may be used uninitialised here.
> I'm unsure if that can occur in practice, but perhaps it
> would be nicer to simply return 0 here.
> 
> > +err_unlock:
> > +	spin_unlock(&txgbe->fdir_perfect_lock);
> > +err_out:
> > +	kfree(input);
> > +	return -EINVAL;
> 
> And conversely, perhaps it would be nicer to return err here - ensuring is
> it always set.  F.e. this would propagate the error code returned by
> txgbe_fdir_write_perfect_filter().

I think it can be changed to initialize err = 0, and return err in these two places.



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ