Re: [syzbot] KMSAN: uninit-value in ax88179_led_setting
From: Pavel Skripkin
Date: Sat Mar 26 2022 - 08:43:56 EST
Hi David,
On 3/26/22 14:47, David Kahurani wrote:
Signed-off-by: David Kahurani <k.kahurani@xxxxxxxxx>
Reported-by: syzbot+d3dbdf31fbe9d8f5f311@xxxxxxxxxxxxxxxxxxxxxxxxx
---
drivers/net/usb/ax88179_178a.c | 181 +++++++++++++++++++++++++++------
1 file changed, 152 insertions(+), 29 deletions(-)
diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c
index a31098981..932e21a65 100644
--- a/drivers/net/usb/ax88179_178a.c
+++ b/drivers/net/usb/ax88179_178a.c
@@ -224,9 +224,12 @@ static int __ax88179_write_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
ret = fn(dev, cmd, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
value, index, data, size);
You've changed __ax88179_write_cmd(), but not __ax88179_read_cmd(). I've
missed it. Changing __ax88179_write_cmd() does not help with uninit
value bugs
Also I believe, __ax88179_read_cmd() should have __must_check annotation
too, since problem came from it in the first place (I mean after added
sane error handling inside it)
Next thing is ax88179_read_cmd_nopm() still prone to uninit value bugs,
since it touches uninitialized `buf` in case of __ax88179_read_cmd()
error...
I remembered why I gave up on fixing this driver... I hope, you have
more free time and motivation :)
With regards,
Pavel Skripkin