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: <DB8PR04MB698525B2380A452FADDF9D81ECFE0@DB8PR04MB6985.eurprd04.prod.outlook.com>
Date:   Mon, 9 Mar 2020 13:21:16 +0000
From:   "Madalin Bucur (OSS)" <madalin.bucur@....nxp.com>
To:     Sascha Hauer <s.hauer@...gutronix.de>,
        "Madalin Bucur (OSS)" <madalin.bucur@....nxp.com>
CC:     "davem@...emloft.net" <davem@...emloft.net>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [PATCH net-next v3 2/3] fsl/fman: tolerate missing MAC address in
 device tree

> -----Original Message-----
> From: Sascha Hauer <s.hauer@...gutronix.de>
> Sent: Monday, March 9, 2020 3:10 PM
> To: Madalin Bucur (OSS) <madalin.bucur@....nxp.com>
> Cc: davem@...emloft.net; netdev@...r.kernel.org
> Subject: Re: [PATCH net-next v3 2/3] fsl/fman: tolerate missing MAC
> address in device tree
> 
> On Mon, Mar 09, 2020 at 10:17:36AM +0000, Madalin Bucur (OSS) wrote:
> > > -----Original Message-----
> > > From: Sascha Hauer <s.hauer@...gutronix.de>
> > > Sent: Monday, March 9, 2020 8:47 AM
> > > To: Madalin Bucur (OSS) <madalin.bucur@....nxp.com>
> > > Cc: davem@...emloft.net; netdev@...r.kernel.org
> > > Subject: Re: [PATCH net-next v3 2/3] fsl/fman: tolerate missing MAC
> > > address in device tree
> > >
> > > On Thu, Mar 05, 2020 at 07:08:57PM +0200, Madalin Bucur wrote:
> > > > Allow the initialization of the MAC to be performed even if the
> > > > device tree does not provide a valid MAC address. Later a random
> > > > MAC address should be assigned by the Ethernet driver.
> > > >
> > > > Signed-off-by: Sascha Hauer <s.hauer@...gutronix.de>
> > > > Signed-off-by: Madalin Bucur <madalin.bucur@....nxp.com>
> > > > ---
> > > >  drivers/net/ethernet/freescale/fman/fman_dtsec.c | 10 ++++------
> > > >  drivers/net/ethernet/freescale/fman/fman_memac.c | 10 ++++------
> > > >  drivers/net/ethernet/freescale/fman/fman_tgec.c  | 10 ++++------
> > > >  drivers/net/ethernet/freescale/fman/mac.c        | 13 ++++++------
> -
> > > >  4 files changed, 18 insertions(+), 25 deletions(-)
> > > >
> > <snip>
> > > >  	/* Get the MAC address */
> > > >  	mac_addr = of_get_mac_address(mac_node);
> > > > -	if (IS_ERR(mac_addr)) {
> > > > -		dev_err(dev, "of_get_mac_address(%pOF) failed\n",
> mac_node);
> > > > -		err = -EINVAL;
> > > > -		goto _return_of_get_parent;
> > > > -	}
> > > > -	ether_addr_copy(mac_dev->addr, mac_addr);
> > > > +	if (IS_ERR(mac_addr))
> > > > +		dev_warn(dev, "of_get_mac_address(%pOF) failed\n",
> mac_node);
> > >
> > > Why this warning? There's nothing wrong with not providing the MAC in
> > > the device tree.
> > >
> > > Sascha
> >
> > Actually, there is, most likely it's the result of misconfiguration so
> one
> > must be made aware of it.
> 
> In my case it's not, that's why I wanted to allow random MACs in the
> first place ;)
> 
> On our hardware the MAC addresses are stored in some flash in a special
> format. There's no need to port parsing of that format into the
> bootloader, the existing userspace code does that well and sets the
> desired MAC addresses, but only if the devices do not fail during probe
> due to the lack of valid MAC addresses.
> 
> Sascha

What MAC address does the bootloader use then?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ