netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: George Kennedy <george.kennedy@oracle.com>
To: george.kennedy@oracle.com, davem@davemloft.net, kuba@kernel.org,
	dan.carpenter@oracle.com, dhaval.giani@oracle.com,
	netdev@vger.kernel.org
Subject: [PATCH 1/1] ax88172a: fix ax88172a_unbind() failures
Date: Mon, 13 Jul 2020 07:58:57 -0400	[thread overview]
Message-ID: <1594641537-1288-1-git-send-email-george.kennedy@oracle.com> (raw)

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


             reply	other threads:[~2020-07-13 11:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-13 11:58 George Kennedy [this message]
2020-07-14  0:08 ` [PATCH 1/1] ax88172a: fix ax88172a_unbind() failures 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1594641537-1288-1-git-send-email-george.kennedy@oracle.com \
    --to=george.kennedy@oracle.com \
    --cc=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=dhaval.giani@oracle.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).