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: <1330624289.2609.36.camel@bwh-desktop>
Date:	Thu, 1 Mar 2012 17:51:29 +0000
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	Danny Kukawka <danny.kukawka@...ect.de>
CC:	"David S. Miller" <davem@...emloft.net>,
	Eilon Greenstein <eilong@...adcom.com>,
	Danny Kukawka <dkukawka@...e.de>,
	Eric Dumazet <eric.dumazet@...il.com>,
	Michał Mirosław <mirq-linux@...e.qmqm.pl>,
	Jiri Pirko <jpirko@...hat.com>,
	Neil Horman <nhorman@...driver.com>,
	Randy Dunlap <rdunlap@...otime.net>, <netdev@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 1/7] net: validate MAC address directly in
 dev_set_mac_address()

On Thu, 2012-03-01 at 17:52 +0100, Danny Kukawka wrote:
> Validate the given MAC address directly in dev_set_mac_address()
> if a .ndo_validate_addr function is available before calling
> the .ndo_set_mac_address function.
> 
> Changed .ndo_validate_addr to take a second parameter containing
> a sockaddr struct to be checked instead of the net_device dev_addr.
> The behaviour of .ndo_validate_addr is now: if the second parameter
> is NULL the net_device->dev_addr gets validate, if != NULL
> the given parameter/sockaddr gets validated instead.
[...]

The caller is assumed to have validated the address family, so why not
just pass a pointer to the hardware address (u8 *), and get rid of the
special case for NULL?

That is, dev_set_mac_address would call:
	ops->ndo_validate_addr(dev, sa->sa_data);
and dev_open would call:
	ops->ndo_validate_addr(dev, dev->dev_addr);

Ben.

-- 
Ben Hutchings, Staff 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