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: <1300720506.2527.1.camel@bwh-desktop>
Date:	Mon, 21 Mar 2011 15:15:06 +0000
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	Stanislaw Gruszka <sgruszka@...hat.com>
Cc:	Amit Salecha <amit.salecha@...gic.com>,
	Eric Dumazet <eric.dumazet@...il.com>,
	Jesper Dangaard Brouer <hawk@...x.dk>,
	Alexander Duyck <alexander.h.duyck@...el.com>,
	netdev <netdev@...r.kernel.org>,
	Neil Horman <nhorman@...driver.com>
Subject: Re: [RFC] net: fix ethtool->set_flags not intended -EINVAL return
 value

On Mon, 2011-03-21 at 16:10 +0100, Stanislaw Gruszka wrote:
> After commit d5dbda23804156ae6f35025ade5307a49d1db6d7 "ethtool: Add
> support for vlan accleration.", drivers that have NETIF_F_HW_VLAN_TX,
> and/or NETIF_F_HW_VLAN_RX feature, but do not allow enable/disable vlan
> acceleration via ethtool set_flags, always return -EINVAL from that
> function. Fix by returning -EINVAL only if requested features do
> not match current settings and can not be changed by driver.
> 
> RFC for now, compile tested only.

This looks good, but:

[...]
> diff --git a/net/core/ethtool.c b/net/core/ethtool.c
> index c1a71bb..514127d 100644
> --- a/net/core/ethtool.c
> +++ b/net/core/ethtool.c
> @@ -141,9 +141,17 @@ u32 ethtool_op_get_flags(struct net_device *dev)
>  }
>  EXPORT_SYMBOL(ethtool_op_get_flags);
>  
> +bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported)
> +{
> +	u32 features = dev->features & flags_dup_features;
> +
> +	return ((features & ~supported) != (data & ~supported));
> +}
> +EXPORT_SYMBOL(ethtool_invalid_flags);
[...]

This needs a comment.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

--
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