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:	Sun, 12 Jan 2014 21:39:21 +0000
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	Florian Fainelli <f.fainelli@...il.com>
CC:	Sabrina Dubroca <sd@...asysnail.net>, <netdev@...r.kernel.org>
Subject: Re: Use of ENOTSUPP in drivers?

On Sun, 2014-01-12 at 13:19 -0800, Florian Fainelli wrote:
> Le dimanche 12 janvier 2014, 20:47:02 Ben Hutchings a écrit :
> > On Sun, 2014-01-12 at 19:57 +0100, Sabrina Dubroca wrote:
> > > Thu, 2 Jan 2014 12:01:31 +0000, Ben Hutchings wrote:
> > > > Never return error code ENOTSUPP; it's *not* the same thing as ENOTSUP
> > > > in userland and is not part of the userland ABI.  I would use EINVAL
> > > > here.
> > > 
> > > I've found a few ethernet drivers that return -ENOTSUPP in various
> > > functions. In particular, some ethtool functions or ioctl's.
> > > Ben's message makes me think that the ethtool functions and ioctl's
> > > should be modified.
> > > 
> > > There are other occurences, mostly in functions related to device
> > > initialization. I didn't manage to track down exactly from where some
> > > of them are called, and I don't know if ENOTSUPP is okay in these.
> > > 
> > > I've included the complete list of occurences (based on net-next) from
> > > drivers/net/ethernet in patch form at the end, if that's more
> > > convenient than the file/function list. This is not meant to be
> > > applied.
> > > 
> > > 
> > > Do these (or part of them) need to be patched? Or is there something
> > > I'm missing?
> > 
> > [...]
> > 
> > I believe they should all be patched.  According to
> > include/linux/errno.h, ENOTSUPP is meant for use in the NFSv3 code only.
> > (But it's apparently erroneously used *all over* the tree, not just in
> > net drivers!)
> 
> Most other drivers use -EOPNOTSUPP, which is arguably as bad as -ENOTSUPP, 
> since the comment about it says:
> 
> * Operation not supported on transport endpoint *
> 
> But at least changing -ENOTSUPP to -EOPNOTSUPP until something better which is 
> not protocol/endpoint specific is agreed on might be better for consistency?

It is not as bad, because EOPNOTSUPP is actually named in userland (in
fact it has two names, the other being ENOTSUP spelt with *one* P).

glibc's strerror() returns these strings for ENOTSUPP and EOPNOTSUPP
respectively:

"Unknown error 524"
"Operation not supported"

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

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