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:   Tue, 7 Jul 2020 14:52:53 +0200
From:   Michal Kubecek <mkubecek@...e.cz>
To:     netdev@...r.kernel.org
Cc:     Andrew Lunn <andrew@...n.ch>, Jakub Kicinski <kuba@...nel.org>,
        Florian Fainelli <f.fainelli@...il.com>,
        Heiner Kallweit <hkallweit1@...il.com>,
        Russell King <linux@...linux.org.uk>,
        "David S. Miller" <davem@...emloft.net>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next v2 3/3] net: ethtool: Remove PHYLIB direct
 dependency

On Mon, Jul 06, 2020 at 09:56:03PM +0200, Andrew Lunn wrote:
> On Mon, Jul 06, 2020 at 11:40:00AM -0700, Jakub Kicinski wrote:
> > On Sun,  5 Jul 2020 21:27:58 -0700 Florian Fainelli wrote:
> > > +	ops = ethtool_phy_ops;
> > > +	if (!ops || !ops->start_cable_test) {
> > 
> > nit: don't think member-by-member checking is necessary. We don't
> > expect there to be any alternative versions of the ops, right?
> 
> I would not like to see anything else registering an ops. So i think
> taking an Opps would be a good indication somebody is doing something
> wrong and needs fixing.
> 
> > We could even risk a direct call:
> > 
> > #if IS_REACHABLE(CONFIG_PHYLIB)
> > static inline int do_x()
> > {
> > 	return __do_x();
> > }
> > #else
> > static inline int do_x()
> > {
> > 	if (!ops)
> > 		return -EOPNOTSUPP;
> > 	return ops->do_x();
> > }
> > #endif
> > 
> > But that's perhaps doing too much...
> 
> I would say it is too far. Two ways of doing the same thing requires
> twice as much testing. And these are not hot paths where we want to
> eliminate as many instructions and trampolines as possible.

Agreed, it seems a bit over the top.

Michal

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ