All of lore.kernel.org
 help / color / mirror / Atom feed
* memory leak in __usbhid_submit_report
@ 2020-11-11 13:55 syzbot
  2020-11-13  8:35 ` 回复: " Zhang, Qiang
  0 siblings, 1 reply; 2+ messages in thread
From: syzbot @ 2020-11-11 13:55 UTC (permalink / raw)
  To: benjamin.tissoires, jikos, linux-input, linux-kernel, linux-usb,
	syzkaller-bugs

Hello,

syzbot found the following issue on:

HEAD commit:    f8394f23 Linux 5.10-rc3
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=12ebbdc6500000
kernel config:  https://syzkaller.appspot.com/x/.config?x=a3f13716fa0212fd
dashboard link: https://syzkaller.appspot.com/bug?extid=47b26cd837ececfc666d
compiler:       gcc (GCC) 10.1.0-syz 20200507
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=14497b82500000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=1586ff14500000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+47b26cd837ececfc666d@syzkaller.appspotmail.com

BUG: memory leak
unreferenced object 0xffff8881097e5ec0 (size 32):
  comm "kworker/0:1", pid 7, jiffies 4294949214 (age 33.520s)
  hex dump (first 32 bytes):
    04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<000000008296eaa1>] __usbhid_submit_report+0x116/0x490 drivers/hid/usbhid/hid-core.c:588
    [<00000000fe39f007>] usbhid_submit_report drivers/hid/usbhid/hid-core.c:638 [inline]
    [<00000000fe39f007>] usbhid_request+0x59/0xa0 drivers/hid/usbhid/hid-core.c:1272
    [<00000000428a854b>] hidinput_led_worker+0x59/0x160 drivers/hid/hid-input.c:1507
    [<000000001bb8d86d>] process_one_work+0x27d/0x590 kernel/workqueue.c:2272
    [<000000005d9a2f9c>] worker_thread+0x59/0x5d0 kernel/workqueue.c:2418
    [<00000000dc999b29>] kthread+0x178/0x1b0 kernel/kthread.c:292
    [<0000000099d5a9ee>] ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296

BUG: memory leak
unreferenced object 0xffff8881120200c0 (size 32):
  comm "kworker/0:1", pid 7, jiffies 4294949214 (age 33.520s)
  hex dump (first 32 bytes):
    04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<000000008296eaa1>] __usbhid_submit_report+0x116/0x490 drivers/hid/usbhid/hid-core.c:588
    [<00000000fe39f007>] usbhid_submit_report drivers/hid/usbhid/hid-core.c:638 [inline]
    [<00000000fe39f007>] usbhid_request+0x59/0xa0 drivers/hid/usbhid/hid-core.c:1272
    [<00000000428a854b>] hidinput_led_worker+0x59/0x160 drivers/hid/hid-input.c:1507
    [<000000001bb8d86d>] process_one_work+0x27d/0x590 kernel/workqueue.c:2272
    [<000000005d9a2f9c>] worker_thread+0x59/0x5d0 kernel/workqueue.c:2418
    [<00000000dc999b29>] kthread+0x178/0x1b0 kernel/kthread.c:292
    [<0000000099d5a9ee>] ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296

BUG: memory leak
unreferenced object 0xffff888107fa9420 (size 32):
  comm "kworker/0:1", pid 7, jiffies 4294949214 (age 33.520s)
  hex dump (first 32 bytes):
    04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<000000008296eaa1>] __usbhid_submit_report+0x116/0x490 drivers/hid/usbhid/hid-core.c:588
    [<00000000fe39f007>] usbhid_submit_report drivers/hid/usbhid/hid-core.c:638 [inline]
    [<00000000fe39f007>] usbhid_request+0x59/0xa0 drivers/hid/usbhid/hid-core.c:1272
    [<00000000428a854b>] hidinput_led_worker+0x59/0x160 drivers/hid/hid-input.c:1507
    [<000000001bb8d86d>] process_one_work+0x27d/0x590 kernel/workqueue.c:2272
    [<000000005d9a2f9c>] worker_thread+0x59/0x5d0 kernel/workqueue.c:2418
    [<00000000dc999b29>] kthread+0x178/0x1b0 kernel/kthread.c:292
    [<0000000099d5a9ee>] ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296

BUG: memory leak
unreferenced object 0xffff888112020b60 (size 32):
  comm "kworker/1:4", pid 8569, jiffies 4294949237 (age 33.290s)
  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 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<000000008296eaa1>] __usbhid_submit_report+0x116/0x490 drivers/hid/usbhid/hid-core.c:588
    [<00000000fe39f007>] usbhid_submit_report drivers/hid/usbhid/hid-core.c:638 [inline]
    [<00000000fe39f007>] usbhid_request+0x59/0xa0 drivers/hid/usbhid/hid-core.c:1272
    [<00000000428a854b>] hidinput_led_worker+0x59/0x160 drivers/hid/hid-input.c:1507
    [<000000001bb8d86d>] process_one_work+0x27d/0x590 kernel/workqueue.c:2272
    [<000000005d9a2f9c>] worker_thread+0x59/0x5d0 kernel/workqueue.c:2418
    [<00000000dc999b29>] kthread+0x178/0x1b0 kernel/kthread.c:292
    [<0000000099d5a9ee>] ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296

BUG: memory leak
unreferenced object 0xffff888107fa9a20 (size 32):
  comm "kworker/1:3", pid 8559, jiffies 4294949241 (age 33.250s)
  hex dump (first 32 bytes):
    04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<000000008296eaa1>] __usbhid_submit_report+0x116/0x490 drivers/hid/usbhid/hid-core.c:588
    [<00000000fe39f007>] usbhid_submit_report drivers/hid/usbhid/hid-core.c:638 [inline]
    [<00000000fe39f007>] usbhid_request+0x59/0xa0 drivers/hid/usbhid/hid-core.c:1272
    [<00000000428a854b>] hidinput_led_worker+0x59/0x160 drivers/hid/hid-input.c:1507
    [<000000001bb8d86d>] process_one_work+0x27d/0x590 kernel/workqueue.c:2272
    [<000000005d9a2f9c>] worker_thread+0x59/0x5d0 kernel/workqueue.c:2418
    [<00000000dc999b29>] kthread+0x178/0x1b0 kernel/kthread.c:292
    [<0000000099d5a9ee>] ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296

BUG: memory leak
unreferenced object 0xffff888112020940 (size 32):
  comm "kworker/1:3", pid 8559, jiffies 4294949241 (age 33.250s)
  hex dump (first 32 bytes):
    04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<000000008296eaa1>] __usbhid_submit_report+0x116/0x490 drivers/hid/usbhid/hid-core.c:588
    [<00000000fe39f007>] usbhid_submit_report drivers/hid/usbhid/hid-core.c:638 [inline]
    [<00000000fe39f007>] usbhid_request+0x59/0xa0 drivers/hid/usbhid/hid-core.c:1272
    [<00000000428a854b>] hidinput_led_worker+0x59/0x160 drivers/hid/hid-input.c:1507
    [<000000001bb8d86d>] process_one_work+0x27d/0x590 kernel/workqueue.c:2272
    [<000000005d9a2f9c>] worker_thread+0x59/0x5d0 kernel/workqueue.c:2418
    [<00000000dc999b29>] kthread+0x178/0x1b0 kernel/kthread.c:292
    [<0000000099d5a9ee>] ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296

executing program
executing program
executing program
executing program
executing program
executing program
executing program


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches

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

* 回复: memory leak in __usbhid_submit_report
  2020-11-11 13:55 memory leak in __usbhid_submit_report syzbot
@ 2020-11-13  8:35 ` Zhang, Qiang
  0 siblings, 0 replies; 2+ messages in thread
From: Zhang, Qiang @ 2020-11-13  8:35 UTC (permalink / raw)
  To: syzbot, benjamin.tissoires, jikos, linux-input, linux-kernel,
	linux-usb, syzkaller-bugs



________________________________________
发件人: syzbot <syzbot+47b26cd837ececfc666d@syzkaller.appspotmail.com>
发送时间: 2020年11月11日 21:55
收件人: benjamin.tissoires@redhat.com; jikos@kernel.org; linux-input@vger.kernel.org; linux-kernel@vger.kernel.org; linux-usb@vger.kernel.org; syzkaller-bugs@googlegroups.com
主题: memory leak in __usbhid_submit_report

[Please note this e-mail is from an EXTERNAL e-mail address]

Hello,

syzbot found the following issue on:

HEAD commit:    f8394f23 Linux 5.10-rc3
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=12ebbdc6500000
kernel config:  https://syzkaller.appspot.com/x/.config?x=a3f13716fa0212fd
dashboard link: https://syzkaller.appspot.com/bug?extid=47b26cd837ececfc666d
compiler:       gcc (GCC) 10.1.0-syz 20200507
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=14497b82500000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=1586ff14500000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+47b26cd837ececfc666d@syzkaller.appspotmail.com

BUG: memory leak
unreferenced object 0xffff8881097e5ec0 (size 32):
  comm "kworker/0:1", pid 7, jiffies 4294949214 (age 33.520s)
  hex dump (first 32 bytes):
    04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<000000008296eaa1>] __usbhid_submit_report+0x116/0x490 drivers/hid/usbhid/hid-core.c:588
    [<00000000fe39f007>] usbhid_submit_report drivers/hid/usbhid/hid-core.c:638 [inline]
    [<00000000fe39f007>] usbhid_request+0x59/0xa0 drivers/hid/usbhid/hid-core.c:1272
    [<00000000428a854b>] hidinput_led_worker+0x59/0x160 drivers/hid/hid-input.c:1507
    [<000000001bb8d86d>] process_one_work+0x27d/0x590 kernel/workqueue.c:2272
    [<000000005d9a2f9c>] worker_thread+0x59/0x5d0 kernel/workqueue.c:2418
    [<00000000dc999b29>] kthread+0x178/0x1b0 kernel/kthread.c:292
    [<0000000099d5a9ee>] ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296



   When usb device disconnect  the "raw_report" should be free in usbhid_stop.
   can we release it in this function, as shown below:

  usbhid_stop(struct hid_device *hid) {
            ........
             for (index = 0; index < HID_CONTROL_FIFO_SIZE; index++) {
                          if (usbhid->ctrl[index].raw_report)
                                   kfree(usbhid->ctrl[index].raw_report);
                          if (usbhid->out[index].raw_report)
                                   kfree(usbhid->out[index].raw_report);
              }
...............
}




BUG: memory leak
unreferenced object 0xffff8881120200c0 (size 32):
  comm "kworker/0:1", pid 7, jiffies 4294949214 (age 33.520s)
  hex dump (first 32 bytes):
    04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<000000008296eaa1>] __usbhid_submit_report+0x116/0x490 drivers/hid/usbhid/hid-core.c:588
    [<00000000fe39f007>] usbhid_submit_report drivers/hid/usbhid/hid-core.c:638 [inline]
    [<00000000fe39f007>] usbhid_request+0x59/0xa0 drivers/hid/usbhid/hid-core.c:1272
    [<00000000428a854b>] hidinput_led_worker+0x59/0x160 drivers/hid/hid-input.c:1507
    [<000000001bb8d86d>] process_one_work+0x27d/0x590 kernel/workqueue.c:2272
    [<000000005d9a2f9c>] worker_thread+0x59/0x5d0 kernel/workqueue.c:2418
    [<00000000dc999b29>] kthread+0x178/0x1b0 kernel/kthread.c:292
    [<0000000099d5a9ee>] ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296

BUG: memory leak
unreferenced object 0xffff888107fa9420 (size 32):
  comm "kworker/0:1", pid 7, jiffies 4294949214 (age 33.520s)
  hex dump (first 32 bytes):
    04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<000000008296eaa1>] __usbhid_submit_report+0x116/0x490 drivers/hid/usbhid/hid-core.c:588
    [<00000000fe39f007>] usbhid_submit_report drivers/hid/usbhid/hid-core.c:638 [inline]
    [<00000000fe39f007>] usbhid_request+0x59/0xa0 drivers/hid/usbhid/hid-core.c:1272
    [<00000000428a854b>] hidinput_led_worker+0x59/0x160 drivers/hid/hid-input.c:1507
    [<000000001bb8d86d>] process_one_work+0x27d/0x590 kernel/workqueue.c:2272
    [<000000005d9a2f9c>] worker_thread+0x59/0x5d0 kernel/workqueue.c:2418
    [<00000000dc999b29>] kthread+0x178/0x1b0 kernel/kthread.c:292
    [<0000000099d5a9ee>] ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296

BUG: memory leak
unreferenced object 0xffff888112020b60 (size 32):
  comm "kworker/1:4", pid 8569, jiffies 4294949237 (age 33.290s)
  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 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<000000008296eaa1>] __usbhid_submit_report+0x116/0x490 drivers/hid/usbhid/hid-core.c:588
    [<00000000fe39f007>] usbhid_submit_report drivers/hid/usbhid/hid-core.c:638 [inline]
    [<00000000fe39f007>] usbhid_request+0x59/0xa0 drivers/hid/usbhid/hid-core.c:1272
    [<00000000428a854b>] hidinput_led_worker+0x59/0x160 drivers/hid/hid-input.c:1507
    [<000000001bb8d86d>] process_one_work+0x27d/0x590 kernel/workqueue.c:2272
    [<000000005d9a2f9c>] worker_thread+0x59/0x5d0 kernel/workqueue.c:2418
    [<00000000dc999b29>] kthread+0x178/0x1b0 kernel/kthread.c:292
    [<0000000099d5a9ee>] ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296

BUG: memory leak
unreferenced object 0xffff888107fa9a20 (size 32):
  comm "kworker/1:3", pid 8559, jiffies 4294949241 (age 33.250s)
  hex dump (first 32 bytes):
    04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<000000008296eaa1>] __usbhid_submit_report+0x116/0x490 drivers/hid/usbhid/hid-core.c:588
    [<00000000fe39f007>] usbhid_submit_report drivers/hid/usbhid/hid-core.c:638 [inline]
    [<00000000fe39f007>] usbhid_request+0x59/0xa0 drivers/hid/usbhid/hid-core.c:1272
    [<00000000428a854b>] hidinput_led_worker+0x59/0x160 drivers/hid/hid-input.c:1507
    [<000000001bb8d86d>] process_one_work+0x27d/0x590 kernel/workqueue.c:2272
    [<000000005d9a2f9c>] worker_thread+0x59/0x5d0 kernel/workqueue.c:2418
    [<00000000dc999b29>] kthread+0x178/0x1b0 kernel/kthread.c:292
    [<0000000099d5a9ee>] ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296

BUG: memory leak
unreferenced object 0xffff888112020940 (size 32):
  comm "kworker/1:3", pid 8559, jiffies 4294949241 (age 33.250s)
  hex dump (first 32 bytes):
    04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<000000008296eaa1>] __usbhid_submit_report+0x116/0x490 drivers/hid/usbhid/hid-core.c:588
    [<00000000fe39f007>] usbhid_submit_report drivers/hid/usbhid/hid-core.c:638 [inline]
    [<00000000fe39f007>] usbhid_request+0x59/0xa0 drivers/hid/usbhid/hid-core.c:1272
    [<00000000428a854b>] hidinput_led_worker+0x59/0x160 drivers/hid/hid-input.c:1507
    [<000000001bb8d86d>] process_one_work+0x27d/0x590 kernel/workqueue.c:2272
    [<000000005d9a2f9c>] worker_thread+0x59/0x5d0 kernel/workqueue.c:2418
    [<00000000dc999b29>] kthread+0x178/0x1b0 kernel/kthread.c:292
    [<0000000099d5a9ee>] ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296

executing program
executing program
executing program
executing program
executing program
executing program
executing program


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches

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

end of thread, other threads:[~2020-11-13  8:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-11 13:55 memory leak in __usbhid_submit_report syzbot
2020-11-13  8:35 ` 回复: " Zhang, Qiang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.