Skip to content

Commit 63a4473

Browse files
oneukumgregkh
authored andcommitted
ax88172a: fix information leak on short answers
[ Upstream commit a9a51bd ] 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]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent eda6c45 commit 63a4473

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
@@ -208,7 +208,7 @@ static int ax88172a_bind(struct usbnet *dev, struct usb_interface *intf)
208208

209209
/* Get the MAC address */
210210
ret = asix_read_cmd(dev, AX_CMD_READ_NODE_ID, 0, 0, ETH_ALEN, buf, 0);
211-
if (ret < 0) {
211+
if (ret < ETH_ALEN) {
212212
netdev_err(dev->net, "Failed to read MAC address: %d\n", ret);
213213
goto free;
214214
}

0 commit comments

Comments
 (0)