linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: syzbot <syzbot+44e64397bd81d5e84cba@syzkaller.appspotmail.com>,
	linux-usb@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: memory leak in hub_event
Date: Mon, 23 Nov 2020 14:32:30 -0500	[thread overview]
Message-ID: <20201123193230.GA718753@rowland.harvard.edu> (raw)
In-Reply-To: <00000000000031907005b4ca944b@google.com>

[CC list trimmed.  I assume most people don't care about the boring 
debugging details.]

On Mon, Nov 23, 2020 at 10:44:06AM -0800, syzbot wrote:
> Hello,
> 
> syzbot has tested the proposed patch but the reproducer is still triggering an issue:
> memory leak in rxrpc_lookup_local
> 
> write to /proc/sys/kernel/hung_task_check_interval_secs failed: No such file or directory
> write to /proc/sys/kernel/softlockup_all_cpu_backtrace failed: No such file or directory
> BUG: memory leak
> unreferenced object 0xffff888117824d00 (size 256):
>   comm "syz-executor.6", pid 8896, jiffies 4294943994 (age 432.900s)
>   hex dump (first 32 bytes):
>     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
>     00 00 00 00 0a 00 00 00 00 00 ad 17 81 88 ff ff  ................
>   backtrace:
>     [<0000000069b066ee>] kmalloc include/linux/slab.h:552 [inline]
>     [<0000000069b066ee>] kzalloc include/linux/slab.h:664 [inline]
>     [<0000000069b066ee>] rxrpc_alloc_local net/rxrpc/local_object.c:79 [inline]
>     [<0000000069b066ee>] rxrpc_lookup_local+0x1c1/0x760 net/rxrpc/local_object.c:244
>     [<0000000085db7132>] rxrpc_bind+0x174/0x240 net/rxrpc/af_rxrpc.c:149
>     [<00000000a2a77c59>] afs_open_socket+0xdb/0x200 fs/afs/rxrpc.c:64
>     [<0000000086f4a248>] afs_net_init+0x2b4/0x340 fs/afs/main.c:126

I don't know what all this rxrpc or afs stuff is about, but it doesn't 
seem to have anything to do with gspca.  So it's a good bet that the 
patch bailed out before the unreleased reference was acquired.

Let's try another spot.  Binary search should find the right place 
quickly enough.

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,8 @@ int gspca_dev_probe2(struct usb_interfac
 	}
 
 	gspca_dev->v4l2_dev.release = gspca_release;
+//	ret = -EIO;
+//	goto out;
 	ret = v4l2_device_register(&intf->dev, &gspca_dev->v4l2_dev);
 	if (ret)
 		goto out;
@@ -1530,6 +1532,7 @@ int gspca_dev_probe2(struct usb_interfac
 	if (ret < 0)
 		goto out;
 	ret = sd_desc->init(gspca_dev);
+	ret = -EIO;
 	if (ret < 0)
 		goto out;
 	if (sd_desc->init_controls)


  reply	other threads:[~2020-11-23 19:32 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 [this message]
2020-11-23 19:42             ` syzbot
2020-11-23 19:53               ` Alan Stern
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=20201123193230.GA718753@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).