diff options
| author | George Kennedy <george.kennedy@oracle.com> | 2020-07-15 09:59:31 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-07-31 16:44:03 +0200 |
| commit | 041aff4ad9470c328b50c5be10e49270913d5041 (patch) | |
| tree | 46d8806b8067f3ac906b66edd7805cb48d3a1bda | |
| parent | 7a1d03dead97e35a2e2fb25d0d5c35dd1324e818 (diff) | |
| download | linux-041aff4ad9470c328b50c5be10e49270913d5041.tar.gz linux-041aff4ad9470c328b50c5be10e49270913d5041.tar.bz2 linux-041aff4ad9470c328b50c5be10e49270913d5041.zip | |
ax88172a: fix ax88172a_unbind() failures
[ Upstream commit c28d9a285668c799eeae2f7f93e929a6028a4d6d ]
If ax88172a_unbind() fails, make sure that the return code is
less than zero so that cleanup is done properly and avoid UAF.
Fixes: a9a51bd727d1 ("ax88172a: fix information leak on short answers")
Signed-off-by: George Kennedy <george.kennedy@oracle.com>
Reported-by: syzbot+4cd84f527bf4a10fc9c1@syzkaller.appspotmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
| -rw-r--r-- | drivers/net/usb/ax88172a.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/usb/ax88172a.c b/drivers/net/usb/ax88172a.c index 2c50497cc4ed..7ec8992401fb 100644 --- a/drivers/net/usb/ax88172a.c +++ b/drivers/net/usb/ax88172a.c @@ -217,6 +217,7 @@ static int ax88172a_bind(struct usbnet *dev, struct usb_interface *intf) ret = asix_read_cmd(dev, AX_CMD_READ_NODE_ID, 0, 0, ETH_ALEN, buf, 0); if (ret < ETH_ALEN) { netdev_err(dev->net, "Failed to read MAC address: %d\n", ret); + ret = -EIO; goto free; } memcpy(dev->net->dev_addr, buf, ETH_ALEN); |
