netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ax88172a: fix information leak on short answers
@ 2019-11-14 10:16 Oliver Neukum
  2019-11-15 20:19 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Oliver Neukum @ 2019-11-14 10:16 UTC (permalink / raw)
  To: tglx, allison, swinslow, netdev, davem; +Cc: Oliver Neukum

If a malicious device gives a short MAC it can elicit up to
5 bytes of leaked memory out of the driver. We need to check for
ETH_ALEN instead.

Reported-by: syzbot+a8d4acdad35e6bbca308@syzkaller.appspotmail.com
Signed-off-by: Oliver Neukum <oneukum@suse.com>
---
 drivers/net/usb/ax88172a.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/usb/ax88172a.c b/drivers/net/usb/ax88172a.c
index 011bd4cb546e..af3994e0853b 100644
--- a/drivers/net/usb/ax88172a.c
+++ b/drivers/net/usb/ax88172a.c
@@ -196,7 +196,7 @@ 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 < 0) {
+	if (ret < ETH_ALEN) {
 		netdev_err(dev->net, "Failed to read MAC address: %d\n", ret);
 		goto free;
 	}
-- 
2.16.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ax88172a: fix information leak on short answers
  2019-11-14 10:16 [PATCH] ax88172a: fix information leak on short answers Oliver Neukum
@ 2019-11-15 20:19 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-11-15 20:19 UTC (permalink / raw)
  To: oneukum; +Cc: tglx, allison, swinslow, netdev

From: Oliver Neukum <oneukum@suse.com>
Date: Thu, 14 Nov 2019 11:16:01 +0100

> If a malicious device gives a short MAC it can elicit up to
> 5 bytes of leaked memory out of the driver. We need to check for
> ETH_ALEN instead.
> 
> Reported-by: syzbot+a8d4acdad35e6bbca308@syzkaller.appspotmail.com
> Signed-off-by: Oliver Neukum <oneukum@suse.com>

Applied and queued up for -stable.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-11-15 20:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-14 10:16 [PATCH] ax88172a: fix information leak on short answers Oliver Neukum
2019-11-15 20:19 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).