From: Alan Stern <stern@rowland.harvard.edu>
To: syzbot <syzbot+44e64397bd81d5e84cba@syzkaller.appspotmail.com>
Cc: linux-usb@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: memory leak in hub_event
Date: Mon, 23 Nov 2020 14:53:07 -0500 [thread overview]
Message-ID: <20201123195307.GA720000@rowland.harvard.edu> (raw)
In-Reply-To: <000000000000e9843a05b4cb6330@google.com>
On Mon, Nov 23, 2020 at 11:42:11AM -0800, syzbot wrote:
> Hello,
>
> syzbot has tested the proposed patch but the reproducer is still triggering an issue:
> memory leak in usb_set_configuration
>
> BUG: memory leak
> unreferenced object 0xffff888125a13400 (size 1024):
> comm "kworker/0:3", pid 8164, jiffies 4294944436 (age 13.610s)
> hex dump (first 32 bytes):
> 08 c7 84 25 81 88 ff ff 08 c7 84 25 81 88 ff ff ...%.......%....
> 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
> backtrace:
> [<0000000042c26fbc>] kmalloc include/linux/slab.h:552 [inline]
> [<0000000042c26fbc>] kzalloc include/linux/slab.h:664 [inline]
> [<0000000042c26fbc>] usb_set_configuration+0x18c/0xb90 drivers/usb/core/message.c:1987
> [<00000000df7c22fc>] usb_generic_driver_probe+0x8c/0xc0 drivers/usb/core/generic.c:238
> [<00000000dbc03c2e>] usb_probe_device+0x5c/0x140 drivers/usb/core/driver.c:293
Okay, that looks like the original bug report, so this spot was bad.
Here's another try, about halfway between the first two.
Alan Stern
#syz test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 4d02da97
Index: usb-devel/drivers/media/usb/gspca/gspca.c
===================================================================
--- usb-devel.orig/drivers/media/usb/gspca/gspca.c
+++ usb-devel/drivers/media/usb/gspca/gspca.c
@@ -1489,6 +1489,7 @@ int gspca_dev_probe2(struct usb_interfac
}
gspca_dev->v4l2_dev.release = gspca_release;
+// Good
ret = v4l2_device_register(&intf->dev, &gspca_dev->v4l2_dev);
if (ret)
goto out;
@@ -1518,6 +1519,7 @@ int gspca_dev_probe2(struct usb_interfac
q->min_buffers_needed = 2;
q->lock = &gspca_dev->usb_lock;
ret = vb2_queue_init(q);
+ ret = -EIO;
if (ret)
goto out;
gspca_dev->vdev.queue = q;
@@ -1530,6 +1532,7 @@ int gspca_dev_probe2(struct usb_interfac
if (ret < 0)
goto out;
ret = sd_desc->init(gspca_dev);
+// Bad
if (ret < 0)
goto out;
if (sd_desc->init_controls)
next prev parent reply other threads:[~2020-11-23 19:53 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-20 15:15 memory leak in hub_event syzbot
2020-11-20 16:56 ` Alan Stern
2020-11-20 16:56 ` syzbot
2020-11-20 17:00 ` Alan Stern
2020-11-23 18:29 ` Andrey Konovalov
2020-11-23 18:44 ` syzbot
2020-11-23 19:32 ` Alan Stern
2020-11-23 19:42 ` syzbot
2020-11-23 19:53 ` Alan Stern [this message]
2020-11-23 20:01 ` syzbot
2020-11-23 20:38 ` Alan Stern
2020-11-23 20:48 ` syzbot
2020-11-23 21:53 ` Alan Stern
2020-11-23 22:09 ` syzbot
2020-11-23 22:24 ` Alan Stern
2020-11-24 11:38 ` Hans Verkuil
2020-11-24 16:00 ` [PATCH] media: gspca: Fix memory leak in probe Alan Stern
2020-12-02 8:58 ` Hans Verkuil
2020-12-02 17:20 ` [PATCH v2] " Alan Stern
2020-12-02 16:22 ` memory leak in hub_event Alan Stern
2020-12-02 16:37 ` syzbot
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=20201123195307.GA720000@rowland.harvard.edu \
--to=stern@rowland.harvard.edu \
--cc=linux-usb@vger.kernel.org \
--cc=syzbot+44e64397bd81d5e84cba@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
/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).