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] [day] [month] [year] [list]
Message-ID: <BN3PR0301MB121924A55380E144466B0790F5510@BN3PR0301MB1219.namprd03.prod.outlook.com>
Date:	Thu, 10 Sep 2015 01:05:00 +0000
From:	Duan Andy <fugang.duan@...escale.com>
To:	Lucas Stach <l.stach@...gutronix.de>
CC:	"davem@...emloft.net" <davem@...emloft.net>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"bhutchings@...arflare.com" <bhutchings@...arflare.com>
Subject: RE: [PATCH net-next 1/1] net: fec: add netif status check before set
 mac address

From: Lucas Stach <l.stach@...gutronix.de> Sent: Wednesday, September 09, 2015 5:14 PM
> To: Duan Fugang-B38611
> Cc: davem@...emloft.net; netdev@...r.kernel.org;
> bhutchings@...arflare.com
> Subject: Re: [PATCH net-next 1/1] net: fec: add netif status check before
> set mac address
> 
> Am Mittwoch, den 09.09.2015, 10:42 +0800 schrieb Fugang Duan:
> > There exist one issue by below case that case system hang:
> > ifconfig eth0 down
> > ifconfig eth0 hw ether 00:10:19:19:81:19
> >
> > After eth0 down, all fec clocks are gated off. In the
> > .fec_set_mac_address() function, it will set new MAC address to
> registers, which causes system hang.
> >
> > So it needs to add netif status check to avoid registers access when
> > clocks are gated off. Until eth0 up the new MAC address are wrote into
> related registers.
> >
> > Signed-off-by: Fugang Duan <B38611@...escale.com>
> > ---
> >  drivers/net/ethernet/freescale/fec_main.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/net/ethernet/freescale/fec_main.c
> > b/drivers/net/ethernet/freescale/fec_main.c
> > index 91925e3..cd09dbb 100644
> > --- a/drivers/net/ethernet/freescale/fec_main.c
> > +++ b/drivers/net/ethernet/freescale/fec_main.c
> > @@ -3029,6 +3029,9 @@ fec_set_mac_address(struct net_device *ndev, void
> *p)
> >  		memcpy(ndev->dev_addr, addr->sa_data, ndev->addr_len);
> >  	}
> >
> > +	if (!netif_running(ndev))
> > +		return 0;
> This deserves a comment in the code as to why it is needed and how it
> still works.
> 
> Regards,
> Lucas
> > +

Ok, I will add comment on here in next version.

Thanks.
> >  	writel(ndev->dev_addr[3] | (ndev->dev_addr[2] << 8) |
> >  		(ndev->dev_addr[1] << 16) | (ndev->dev_addr[0] << 24),
> >  		fep->hwp + FEC_ADDR_LOW);
> 
> --
> Pengutronix e.K.             | Lucas Stach                 |
> Industrial Linux Solutions   | http://www.pengutronix.de/  |

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ