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: <1395082411.22343.4.camel@deadeye.wl.decadent.org.uk>
Date:	Mon, 17 Mar 2014 18:53:31 +0000
From:	Ben Hutchings <ben@...adent.org.uk>
To:	Jeff Kirsher <jeffrey.t.kirsher@...el.com>
Cc:	davem@...emloft.net, Mitch Williams <mitch.a.williams@...el.com>,
	netdev@...r.kernel.org, gospo@...hat.com, sassmann@...hat.com,
	Catherine Sullivan <catherine.sullivan@...el.com>
Subject: Re: [net-next 03/16] i40evf: Support RSS option in ethtool

On Mon, 2014-03-17 at 05:45 -0700, Jeff Kirsher wrote:
> From: Mitch Williams <mitch.a.williams@...el.com>
> 
> Add support for viewing and modifying RSS hash options and RSS hash
> look-up table programming through ethtool. Because the lookup table is
> so small for the VFs (only 16 registers), we don't bother to maintain a
> shadow table in memory, we just read and write the registers directly.
[...]
> +static int i40evf_get_rss_hash_opts(struct i40evf_adapter *adapter,
> +				    struct ethtool_rxnfc *cmd)
> +{
> +	cmd->data = 0;
> +
> +	/* Report default options for RSS on i40e */

But you're allowing them to be changed from the defaults, so this is
wrong.

[...]
> +static int i40evf_set_rxfh_indir(struct net_device *netdev, const u32 *indir)
> +{
> +	struct i40evf_adapter *adapter = netdev_priv(netdev);
> +	struct i40e_hw *hw = &adapter->hw;
> +	u32 hlut_val;
> +	int i, j;
> +
> +	/* Verify user input. */
> +	for (i = 0; i < (I40E_VFQF_HLUT_MAX_INDEX + 1) * 4; i++) {
> +		if (indir[i] >= adapter->vsi_res->num_queue_pairs)
> +			return -EINVAL;
> +	}
[...]

ethtool_set_rxfh_indir() does this validation so you don't have to.
(This wasn't true originally so you'll need to keep it in compatibility
code for your OOT driver.)

Ben.

-- 
Ben Hutchings
I'm always amazed by the number of people who take up solipsism because
they heard someone else explain it. - E*Borg on alt.fan.pratchett

Download attachment "signature.asc" of type "application/pgp-signature" (812 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ