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: <262CB373A6D1F14F9B81E82F74F77D5A46F54D17@avmb2.qlogic.org>
Date:	Mon, 13 Jan 2014 06:45:41 +0000
From:	Shahed Shaikh <shahed.shaikh@...gic.com>
To:	Sabrina Dubroca <sd@...asysnail.net>,
	netdev <netdev@...r.kernel.org>
CC:	Ben Hutchings <bhutchings@...arflare.com>
Subject: RE: Use of ENOTSUPP in drivers?

> -----Original Message-----
> From: netdev-owner@...r.kernel.org [mailto:netdev-
> owner@...r.kernel.org] On Behalf Of Sabrina Dubroca
> Sent: Monday, January 13, 2014 12:27 AM
> To: netdev
> Cc: Ben Hutchings
> Subject: Use of ENOTSUPP in drivers?
> 
> 
> 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?
> 
> 
> Thanks,
> Sabrina
> 
> 
> ---
> 

Hi Sabrina,

Using -EOPNOTSUPP instead of -ENOTSUPP,  ethtool is giving the expected error message.

# ethtool -w p6p1
Can not get dump level
: Operation not supported

> 
> diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
> b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
> index 03eb2ad..bb9f4ec 100644
> --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
> +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
> @@ -1641,7 +1641,7 @@ int qlcnic_83xx_loopback_test(struct net_device
> *netdev, u8 mode)
>  	if (ahw->op_mode == QLCNIC_NON_PRIV_FUNC) {
>  		netdev_warn(netdev,
>  			    "Loopback test not supported in non privileged
> mode\n");
> -		return -ENOTSUPP;
> +		return -EINVAL;

Please use -EOPNOTSUPP

>  	}
> 
>  	if (test_bit(__QLCNIC_RESETTING, &adapter->state)) { diff --git
> a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
> b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
> index 45fa6ef..727be4e 100644
> --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
> +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
> @@ -1681,7 +1681,7 @@ qlcnic_get_dump_flag(struct net_device *netdev,
> struct ethtool_dump *dump)
> 
>  	if (!fw_dump->tmpl_hdr) {
>  		netdev_err(adapter->netdev, "FW Dump not supported\n");
> -		return -ENOTSUPP;
> +		return -EINVAL;

Please use -EOPNOTSUPP

>  	}
> 
>  	if (fw_dump->clr)
> @@ -1710,7 +1710,7 @@ qlcnic_get_dump_data(struct net_device *netdev,
> struct ethtool_dump *dump,
> 
>  	if (!fw_dump->tmpl_hdr) {
>  		netdev_err(netdev, "FW Dump not supported\n");
> -		return -ENOTSUPP;
> +		return -EINVAL;

Please use -EOPNOTSUPP

>  	}
> 
>  	if (!fw_dump->clr) {
> 

Thanks,
Shahed
  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ