From: Greg KH <gregkh@linuxfoundation.org>
To: Kyungtae Kim <kt0755@gmail.com>
Cc: Felipe Balbi <balbi@kernel.org>,
USB list <linux-usb@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
syzkaller <syzkaller@googlegroups.com>,
Dave Tian <dave.jing.tian@gmail.com>
Subject: Re: memory leak in hidg_set_alt
Date: Sun, 31 May 2020 08:39:36 +0200 [thread overview]
Message-ID: <20200531063936.GB1082896@kroah.com> (raw)
In-Reply-To: <20200530171759.GA37895@pizza01>
On Sat, May 30, 2020 at 05:18:06PM +0000, Kyungtae Kim wrote:
> We report a bug (in linux-5.6.11) found by FuzzUSB (a modified version
> of syzkaller)
>
> kernel config: https://kt0755.github.io/etc/config_v5.6.11
>
> An usb_request instance allocated for report in hidg_set_alt() leaked.
>
> ==================================================================
> BUG: memory leak
> unreferenced object 0xffff88803af68400 (size 128):
> comm "softirq", pid 0, jiffies 4294942450 (age 189.010s)
> hex dump (first 32 bytes):
> 00 84 f6 3a 80 88 ff ff 00 84 f6 3a 80 88 ff ff ...:.......:....
> a8 83 3c 5e 80 88 ff ff 01 00 00 00 00 00 00 00 ..<^............
> backtrace:
> [<00000000c77ea9d0>] kmemleak_alloc_recursive include/linux/kmemleak.h:43 [inline]
> [<00000000c77ea9d0>] slab_post_alloc_hook mm/slab.h:586 [inline]
> [<00000000c77ea9d0>] slab_alloc_node mm/slub.c:2786 [inline]
> [<00000000c77ea9d0>] slab_alloc mm/slub.c:2794 [inline]
> [<00000000c77ea9d0>] kmem_cache_alloc_trace+0x15e/0x2d0 mm/slub.c:2811
> [<0000000021977c74>] kmalloc include/linux/slab.h:555 [inline]
> [<0000000021977c74>] kzalloc include/linux/slab.h:669 [inline]
> [<0000000021977c74>] dummy_alloc_request+0xb4/0x1a0 drivers/usb/gadget/udc/dummy_hcd.c:662
> [<0000000065bac76c>] usb_ep_alloc_request+0x69/0x2e0 drivers/usb/gadget/udc/core.c:178
> [<00000000916a7f5e>] alloc_ep_req+0x27/0x1d0 drivers/usb/gadget/u_f.c:18
> [<00000000a697106a>] hidg_alloc_ep_req drivers/usb/gadget/function/f_hid.c:458 [inline]
> [<00000000a697106a>] hidg_set_alt+0x1ff/0xbe0 drivers/usb/gadget/function/f_hid.c:662
> [<000000006a6a3007>] set_config drivers/usb/gadget/composite.c:838 [inline]
> [<000000006a6a3007>] composite_setup+0x4231/0x6f10 drivers/usb/gadget/composite.c:1717
> [<000000000c47b49d>] configfs_composite_setup+0x11a/0x170 drivers/usb/gadget/configfs.c:1466
> [<00000000850a3c44>] dummy_timer+0xda5/0x33f0 drivers/usb/gadget/udc/dummy_hcd.c:1898
> [<00000000aaf23b82>] call_timer_fn+0x20e/0x770 kernel/time/timer.c:1404
> [<00000000e04e8038>] expire_timers kernel/time/timer.c:1449 [inline]
> [<00000000e04e8038>] __run_timers kernel/time/timer.c:1773 [inline]
> [<00000000e04e8038>] run_timer_softirq+0x63f/0x13c0 kernel/time/timer.c:1786
> [<00000000deb0ec70>] __do_softirq+0x262/0xb46 kernel/softirq.c:292
> [<00000000c245a5cd>] invoke_softirq kernel/softirq.c:373 [inline]
> [<00000000c245a5cd>] irq_exit+0x161/0x1b0 kernel/softirq.c:413
> [<00000000bacb5a5b>] exiting_irq arch/x86/include/asm/apic.h:546 [inline]
> [<00000000bacb5a5b>] smp_apic_timer_interrupt+0x137/0x500 arch/x86/kernel/apic/apic.c:1146
> [<000000001988f5a4>] apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829
> ==================================================================
Great, can you send a patch fixing this please so you can get the proper
credit for finding and fixing the issue?
thanks,
greg k-h
parent reply other threads:[~2020-05-31 6:39 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20200530171759.GA37895@pizza01>]
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=20200531063936.GB1082896@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=balbi@kernel.org \
--cc=dave.jing.tian@gmail.com \
--cc=kt0755@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=syzkaller@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
all inboxes | Powered by JetHome®