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: <7d33d634-a6ba-e189-b2a0-77cfcd3a8643@pensando.io>
Date:   Wed, 6 Oct 2021 09:55:59 -0700
From:   Shannon Nelson <snelson@...sando.io>
To:     Jakub Kicinski <kuba@...nel.org>, Andrew Lunn <andrew@...n.ch>
Cc:     netdev@...r.kernel.org, gregkh@...uxfoundation.org,
        rafael@...nel.org, saravanak@...gle.com, mw@...ihalf.com,
        jeremy.linton@....com
Subject: Re: [RFC] fwnode: change the return type of mac address helpers

On 10/6/21 8:49 AM, Jakub Kicinski wrote:
> On Wed, 6 Oct 2021 16:49:36 +0200 Andrew Lunn wrote:
>>> --- a/drivers/net/ethernet/apm/xgene-v2/main.c
>>> +++ b/drivers/net/ethernet/apm/xgene-v2/main.c
>>> @@ -36,7 +36,7 @@ static int xge_get_resources(struct xge_pdata *pdata)
>>>   		return -ENOMEM;
>>>   	}
>>>   
>>> -	if (!device_get_ethdev_addr(dev, ndev))
>>> +	if (device_get_ethdev_addr(dev, ndev))
>>>   		eth_hw_addr_random(ndev);
>> That is going to be interesting for out of tree drivers.
> Indeed :(  But I think it's worth it - I thought it's only device tree
> that has the usual errno return code but inside eth.c there are also
> helpers for platform and nvmem mac retrieval which also return errno.

As the maintainer of an out-of-tree driver, this kind of change with 
little warning really can ruin my day.

I understand that as Linux kernel developers we really can't spend much 
time coddling the outer fringe, but we can at least give them hints.  
Changing the sense of the non-zero return from good to bad in several 
functions without something else that the compiler can warn on 
needlessly sets up time bombs for the unsuspecting.  Can we find a way 
to break their compile rather than surprise them with a broken runtime?

sln

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ