]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
ax88172a: fix information leak on short answers
authorOliver Neukum <oneukum@suse.com>
Thu, 14 Nov 2019 10:16:01 +0000 (11:16 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 4 Dec 2019 09:29:26 +0000 (10:29 +0100)
BugLink: https://bugs.launchpad.net/bugs/1853475
[ Upstream commit a9a51bd727d141a67b589f375fe69d0e54c4fe22 ]

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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Connor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/net/usb/ax88172a.c

index 011bd4cb546ed48ea45a376467e7cd72b63c2aa8..af3994e0853b54473dd5f0de62f3663b28ab70ec 100644 (file)
@@ -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;
        }