netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] ax88172a: fix ax88172a_unbind() failures
@ 2020-07-13 11:58 George Kennedy
  2020-07-14  0:08 ` David Miller
  0 siblings, 1 reply; 7+ messages in thread
From: George Kennedy @ 2020-07-13 11:58 UTC (permalink / raw)
  To: george.kennedy, davem, kuba, dan.carpenter, dhaval.giani, netdev

If ax88172a_unbind() fails, make sure that the return code is
less than zero so that cleanup is done properly and avoid UAF.

Signed-off-by: George Kennedy <george.kennedy@oracle.com>
Reported-by: syzbot+4cd84f527bf4a10fc9c1@syzkaller.appspotmail.com
---
 drivers/net/usb/ax88172a.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/usb/ax88172a.c b/drivers/net/usb/ax88172a.c
index 4e514f5..fd9faf2 100644
--- a/drivers/net/usb/ax88172a.c
+++ b/drivers/net/usb/ax88172a.c
@@ -237,6 +237,8 @@ static int ax88172a_bind(struct usbnet *dev, struct usb_interface *intf)
 
 free:
 	kfree(priv);
+	if (ret >= 0)
+		ret = -EIO;
 	return ret;
 }
 
-- 
1.8.3.1


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

end of thread, other threads:[~2020-07-15 14:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-13 11:58 [PATCH 1/1] ax88172a: fix ax88172a_unbind() failures George Kennedy
2020-07-14  0:08 ` David Miller
2020-07-14  8:00   ` Dan Carpenter
2020-07-14 21:03     ` David Miller
2020-07-14 21:34       ` George Kennedy
2020-07-14 21:37         ` David Miller
2020-07-15 14:01           ` George Kennedy

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).