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] [day] [month] [year] [list]
Message-ID: <ae864b48-ac8f-68cc-ea03-047d0235239f@oracle.com>
Date:   Fri, 17 Mar 2023 00:32:28 +0530
From:   Harshit Mogalapalli <harshit.m.mogalapalli@...cle.com>
To:     Stefan Schmidt <stefan@...enfreihafen.org>
Cc:     error27@...il.com, Alexander Aring <alex.aring@...il.com>,
        Miquel Raynal <miquel.raynal@...tlin.com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Marcel Holtmann <marcel@...tmann.org>,
        Harry Morris <harrymorris12@...il.com>,
        linux-wpan@...r.kernel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH next] ca8210: Fix unsigned mac_len comparison with zero in
 ca8210_skb_tx()

Hi Stefan,

On 16/03/23 10:01 pm, Stefan Schmidt wrote:
> Hello Harshit.
> 
> On 06.03.23 20:18, Harshit Mogalapalli wrote:
>> mac_len is of type unsigned, which can never be less than zero.
>>
>>     mac_len = ieee802154_hdr_peek_addrs(skb, &header);
>>     if (mac_len < 0)
>>         return mac_len;
>>
>> Change this to type int as ieee802154_hdr_peek_addrs() can return 
>> negative
>> integers, this is found by static analysis with smatch.
>>
>> Fixes: ded845a781a5 ("ieee802154: Add CA8210 IEEE 802.15.4 device 
>> driver")
>> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@...cle.com>
>> ---
>> Only compile tested.
>> ---
>>   drivers/net/ieee802154/ca8210.c | 3 +--
>>   1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/ieee802154/ca8210.c 
>> b/drivers/net/ieee802154/ca8210.c
>> index 0b0c6c0764fe..d0b5129439ed 100644
>> --- a/drivers/net/ieee802154/ca8210.c
>> +++ b/drivers/net/ieee802154/ca8210.c
>> @@ -1902,10 +1902,9 @@ static int ca8210_skb_tx(
>>       struct ca8210_priv  *priv
>>   )
>>   {
>> -    int status;
>>       struct ieee802154_hdr header = { };
>>       struct secspec secspec;
>> -    unsigned int mac_len;
>> +    int mac_len, status;
>>       dev_dbg(&priv->spi->dev, "%s called\n", __func__);
> 
> This patch has been applied to the wpan tree and will be
> part of the next pull request to net. Thanks!
> 
> I took the liberty and changed the fixes tag to the change that 
> introduced the resaon for the mismatch recently. As suggested by Simon.
> 

Thanks for doing this, I wasn't very clear whether to change the Fixes 
tag and send a v2.

Regards,
Harshit

> regards
> Stefan Schmidt

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ