[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <13bcf1cc-b75c-93d0-49cc-ecb99e291ee7@gmail.com>
Date: Sat, 16 Apr 2022 14:05:19 +0300
From: Pavel Skripkin <paskripkin@...il.com>
To: David Kahurani <k.kahurani@...il.com>, netdev@...r.kernel.org
Cc: syzbot+d3dbdf31fbe9d8f5f311@...kaller.appspotmail.com,
davem@...emloft.net, jgg@...pe.ca, kuba@...nel.org,
linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org,
phil@...lpotter.co.uk, syzkaller-bugs@...glegroups.com,
arnd@...db.de, dan.carpenter@...cle.com
Subject: Re: [PATCH] net: ax88179: add proper error handling of usb read
errors
Hi David,
Almost perfect, please see one comment inline
On 4/16/22 10:48, David Kahurani wrote:
> Reads that are lesser than the requested size lead to uninit-value bugs.
> In this particular case a variable which was supposed to be initialized
> after a read is left uninitialized after a partial read.
>
> Qualify such reads as errors and handle them correctly and while at it
> convert the reader functions to return zero on success for easier error
> handling.
>
> Fixes: e2ca90c276e1 ("ax88179_178a: ASIX AX88179_178A USB 3.0/2.0 to
> gigabit ethernet adapter driver")
> Signed-off-by: David Kahurani <k.kahurani@...il.com>
> Reported-and-tested-by: syzbot+d3dbdf31fbe9d8f5f311@...kaller.appspotmail.com
> ---
[code snip]
>
> @@ -416,7 +441,7 @@ ax88179_phy_write_mmd_indirect(struct usbnet *dev, u16 prtad, u16 devad,
> ret = ax88179_write_cmd(dev, AX_ACCESS_PHY, AX88179_PHY_ID,
> MII_MMD_DATA, 2, &data);
>
> - if (ret < 0)
> + if (ret)
> return ret;
>
I think, you didn't mean to do so. ax88179_write_cmd() returns number of
bytes written, so you are changing the logic here. And write call is not
related to uninit value bugs
With regards,
Pavel Skripkin
Download attachment "OpenPGP_signature" of type "application/pgp-signature" (841 bytes)
Powered by blists - more mailing lists