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: <20151030210146.GD10053@lunn.ch>
Date:	Fri, 30 Oct 2015 22:01:46 +0100
From:	Andrew Lunn <andrew@...n.ch>
To:	Vivien Didelot <vivien.didelot@...oirfairelinux.com>
Cc:	netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
	kernel@...oirfairelinux.com,
	"David S. Miller" <davem@...emloft.net>,
	Florian Fainelli <f.fainelli@...il.com>,
	Guenter Roeck <linux@...ck-us.net>,
	Neil Armstrong <narmstrong@...libre.com>
Subject: Re: [PATCH net-next] net: dsa: mv88e6xxx: assert SMI lock

> > >  static int _mv88e6xxx_reg_read(struct dsa_switch *ds, int addr, int reg)
> > >  {
> > > -	struct mii_bus *bus = dsa_host_dev_to_mii_bus(ds->master_dev);
> > > +	struct mii_bus *bus;
> > >  	int ret;
> > >  
> > > +	assert_smi_lock(ds);
> > > +
> > > +	bus = dsa_host_dev_to_mii_bus(ds->master_dev);
> > 
> > Is this change of when bus is assigned actually required?
> 
> No, but I found not necessary to issue this "mdio_bus" lookup if the
> lock is not held (see net/dsa/dsa.c:555). Do you prefer not to do that?

You are optimising for an error condition. If this optimisation saves
anything, it means we have a locking bug!

As a separate patch, i would do this lookup once in a setup function
and save it away in ps. We just need to watch out for the probe
register accesses.
 
> Also are you OK with removing all the "Must be called with..." comments,

Yes, it will become a lot more clear when the kernel outputs a stack dump!

     Andrew
--
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