From: Phong Tran <tranmanphong@gmail.com>
To: syzbot+514595412b80dc817633@syzkaller.appspotmail.com,
davem@davemloft.net, gregkh@linuxfoundation.org,
oneukum@suse.com
Cc: allison@lohutok.net, andreyknvl@google.com,
kstewart@linuxfoundation.org, linux-kernel@vger.kernel.org,
linux-usb@vger.kernel.org, netdev@vger.kernel.org,
swinslow@gmail.com, syzkaller-bugs@googlegroups.com,
tglx@linutronix.de, tranmanphong@gmail.com, zhang.run@zte.com.cn
Subject: [PATCH] ax88172a: fix wrong reading MAC malicious device
Date: Sun, 22 Dec 2019 12:47:13 +0700 [thread overview]
Message-ID: <20191222054713.14887-1-tranmanphong@gmail.com> (raw)
In-Reply-To: <000000000000ab9d07059a410fae@google.com>
Crash log KASAN: use-after-free Read in asix_suspend
https://syzkaller.appspot.com/text?tag=CrashLog&x=1330a2c6e00000
(unnamed net_device) (uninitialized): Failed to read MAC address: 0
asix_read_cmd() with ret = 0 but this is a error. Fix the checking
return value condition.
Reported-by: syzbot+514595412b80dc817633@syzkaller.appspotmail.com
Tested by:
https://groups.google.com/d/msg/syzkaller-bugs/0hHExZ030LI/yge-2Q_9BAAJ
Signed-off-by: Phong Tran <tranmanphong@gmail.com>
---
drivers/net/usb/ax88172a.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/usb/ax88172a.c b/drivers/net/usb/ax88172a.c
index af3994e0853b..525900896ce0 100644
--- a/drivers/net/usb/ax88172a.c
+++ b/drivers/net/usb/ax88172a.c
@@ -197,6 +197,8 @@ static int ax88172a_bind(struct usbnet *dev, struct usb_interface *intf)
/* Get the MAC address */
ret = asix_read_cmd(dev, AX_CMD_READ_NODE_ID, 0, 0, ETH_ALEN, buf, 0);
if (ret < ETH_ALEN) {
+ if (ret >= 0)
+ ret = -ENXIO;
netdev_err(dev->net, "Failed to read MAC address: %d\n", ret);
goto free;
}
--
2.20.1
prev parent reply other threads:[~2019-12-22 5:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-22 1:45 KASAN: use-after-free Read in asix_suspend syzbot
2019-12-22 5:47 ` Phong Tran [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191222054713.14887-1-tranmanphong@gmail.com \
--to=tranmanphong@gmail.com \
--cc=allison@lohutok.net \
--cc=andreyknvl@google.com \
--cc=davem@davemloft.net \
--cc=gregkh@linuxfoundation.org \
--cc=kstewart@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=oneukum@suse.com \
--cc=swinslow@gmail.com \
--cc=syzbot+514595412b80dc817633@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
--cc=tglx@linutronix.de \
--cc=zhang.run@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox