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  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:   Thu, 10 Sep 2020 12:34:34 -0500
From:   Dan Murphy <dmurphy@...com>
To:     Jakub Kicinski <kuba@...nel.org>
CC:     <davem@...emloft.net>, <andrew@...n.ch>, <f.fainelli@...il.com>,
        <hkallweit1@...il.com>, <netdev@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next v3 3/3] net: dp83869: Add speed optimization
 feature

Jakub

On 9/8/20 12:47 PM, Jakub Kicinski wrote:
> On Tue, 8 Sep 2020 09:07:22 -0500 Dan Murphy wrote:
>> On 9/5/20 1:38 PM, Jakub Kicinski wrote:
>>> On Thu, 3 Sep 2020 06:42:59 -0500 Dan Murphy wrote:
>>>> +static int dp83869_set_downshift(struct phy_device *phydev, u8 cnt)
>>>> +{
>>>> +	int val, count;
>>>> +
>>>> +	if (cnt > DP83869_DOWNSHIFT_8_COUNT)
>>>> +		return -E2BIG;
>>> ERANGE
>> This is not checking a range but making sure it is not bigger then 8.
>>
>> IMO I would use ERANGE if the check was a boundary check for upper and
>> lower bounds.
> Yeah, ERANGE is not perfect, but the strerror for E2BIG is
> "Argument list too long" - IDK if users seeing that will know that it
> means the value is too large. Perhaps we should stick to EINVAL?

EINVAL works for me to.

Dan

Powered by blists - more mailing lists