Skip to content

Commit a9a51bd

Browse files
oneukumdavem330
authored andcommitted
ax88172a: fix information leak on short answers
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: [email protected] Signed-off-by: Oliver Neukum <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4d189c1 commit a9a51bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/usb/ax88172a.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ static int ax88172a_bind(struct usbnet *dev, struct usb_interface *intf)
196196

197197
/* Get the MAC address */
198198
ret = asix_read_cmd(dev, AX_CMD_READ_NODE_ID, 0, 0, ETH_ALEN, buf, 0);
199-
if (ret < 0) {
199+
if (ret < ETH_ALEN) {
200200
netdev_err(dev->net, "Failed to read MAC address: %d\n", ret);
201201
goto free;
202202
}

0 commit comments

Comments
 (0)