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:	Thu, 07 Jan 2016 00:41:29 +0100
From:	Bjørn Mork <bjorn@...k.no>
To:	Joe Perches <joe@...ches.com>
Cc:	David Miller <davem@...emloft.net>, netdev@...r.kernel.org,
	sowmini.varadhan@...cle.com
Subject: Re: [PATCH v2] net: Add eth_platform_get_mac_address() helper.

Joe Perches <joe@...ches.com> writes:
> On Thu, 2016-01-07 at 00:26 +0100, Bjørn Mork wrote:
>> Joe Perches <joe@...ches.com> writes:
>> > On Wed, 2016-01-06 at 16:33 -0500, David Miller wrote:
>> > > A repeating pattern in drivers has become to use OF node information
>> > > and, if not found, platform specific host information to extract the
>> > > ethernet address for a given device.
>> > []
>> > > diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
>> > []
>> > > @@ -485,3 +487,32 @@ static int __init eth_offload_init(void)
>> > >  }
>> > >  
>> > >  fs_initcall(eth_offload_init);
>> > > +
>> > > +unsigned char * __weak arch_get_platform_mac_address(void)
>> > > +{
>> > > +       return NULL;
>> > 
>> > WARN_ON_ONCE ?
>> 
>> That would prevent a driver from using this with additional fallback
>> methods.  For what reason?
>
> It's declared __weak and should be overridden by
> an arch specific function.

"should"?  Why?  Do you have a suggested implementation for - say - x86?

> A NULL address would cause a fault when using
> a function like copy_ether_addr.

You should not do that then :)


Bjørn
--
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