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: <1303930418.2875.106.camel@bwh-desktop>
Date:	Wed, 27 Apr 2011 19:53:38 +0100
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	David Decotigny <decot@...gle.com>
Cc:	"David S. Miller" <davem@...emloft.net>, mirq-linux@...e.qmqm.pl,
	Stanislaw Gruszka <sgruszka@...hat.com>,
	Alexander Duyck <alexander.h.duyck@...el.com>,
	Eilon Greenstein <eilong@...adcom.com>,
	linux-kernel@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCHv2 2/4] ethtool: Call ethtool's get/set_settings
 callbacks with cleaned data

On Wed, 2011-04-27 at 11:34 -0700, David Decotigny wrote:
> This makes sure that when a driver calls the ethtool's
> get/set_settings() callback of another driver, the data passed to it
> is clean. This guarantees that speed_hi will be zeroed correctly if
> the called callback doesn't explicitely set it: we are sure we don't
> get a corrupted speed from the underlying driver. We also take care of
> setting the cmd field appropriately (ETHTOOL_GSET/SSET).
> 
> This applies to dev_ethtool_get_settings(), which now makes sure it
> sets up that ethtool command parameter correctly before passing it to
> drivers. This also means that whoever calls dev_ethtool_get_settings()
> does not have to clean the ethtool command parameter. This function
> also becomes an exported symbol instead of an inline.
> 
> All drivers visible to make allyesconfig under x86_64 have been
> updated.
> 
> Signed-off-by: David Decotigny <decot@...gle.com>
[...]
> diff --git a/drivers/net/mdio.c b/drivers/net/mdio.c
> index e85bf04..2e717a2 100644
> --- a/drivers/net/mdio.c
> +++ b/drivers/net/mdio.c
> @@ -176,6 +176,9 @@ static u32 mdio45_get_an(const struct mdio_if_info *mdio, u16 addr)
>   * @npage_adv: Modes currently advertised on next pages
>   * @npage_lpa: Modes advertised by link partner on next pages
>   *
> + * The @ecmd parameter is expected to have been cleared before calling
> + * mii_ethtool_gset().

Copy-pasta: should say mdio45_get_an() not mii_ethtool_gset().

[...]
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 3bbb4c2..36e57fb 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -4496,6 +4496,30 @@ void dev_set_rx_mode(struct net_device *dev)
>  }
>  
>  /**
> + *	dev_ethtool_get_settings - call device's ethtool::get_settings()
> + *	@dev: device
> + *	@cmd: memory area for ethtool_cmd::get_settings() result
> + *
> + *      The cmd arg is initialized properly (cleared and
> + *      ethtoo_cmd::cmd field set to ETHTOOL_GSET).

Typo: 'ethtoo_cmd' should be 'ethtool_cmd'.

> + *	Return device's ethtool_cmd::get_settings() result value or
> + *	-EOPNOTSUPP when device doesn't expose
> + *	ethtool_cmd::get_settings() operation.
[...]

The operation is ethtool_ops::get_settings, not ethtool::get_settings or
ethtool_cmd::get_settings.

Other than that, this looks fine.

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 linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ