memory leak in gadget_bind (2)

Status: upstream: reported C repro on 2026/08/14 00:03
Subsystems: usb
Labels: prio:low
[Documentation on labels]
Reported-by: syzbot+d83b3c49738aea97c0e5@syzkaller.appspotmail.com
First crash: 4d14h, last: 4d14h
✨ AI Jobs (1)
ID Workflow Result Correct Bug Created Started Finished Revision
c4ab8244 assessment-security DenialOfService: ✅ Exploitable: ❌ FilesystemTrigger: ❌ NetworkTrigger: ❌ PeripheralTrigger: ❌ RemoteTrigger: ❌ Unprivileged: ❌ UserNamespace: ❌ VMGuestTrigger: ❌ VMHostTrigger: ❌ memory leak in gadget_bind (2) 2026/08/09 16:09 2026/08/09 16:09 2026/08/09 16:22 5d63f80b
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [usb?] memory leak in gadget_bind (2) 0 (1) 2026/08/14 00:03
Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream memory leak in gadget_bind usb 3 syz, C 62 2103d 2120d 15/29 fixed on 2020/11/20 14:54

Sample crash report:
BUG: memory leak
unreferenced object 0xffff88812a3ea300 (size 128):
  comm "syz.0.17", pid 6069, jiffies 4294943967
  hex dump (first 32 bytes):
    00 a3 3e 2a 81 88 ff ff 00 a3 3e 2a 81 88 ff ff  ..>*......>*....
    30 40 49 03 81 88 ff ff 00 00 00 00 00 00 00 00  0@I.............
  backtrace (crc a802af15):
    kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
    slab_post_alloc_hook mm/slub.c:4597 [inline]
    slab_alloc_node mm/slub.c:4917 [inline]
    __kmalloc_cache_noprof+0x356/0x440 mm/slub.c:5485
    _kmalloc_noprof include/linux/slab.h:988 [inline]
    _kzalloc_noprof include/linux/slab.h:1309 [inline]
    dummy_alloc_request+0x65/0xf0 drivers/usb/gadget/udc/dummy_hcd.c:693
    usb_ep_alloc_request+0x2e/0xd0 drivers/usb/gadget/udc/core.c:197
    gadget_bind+0x67/0x230 drivers/usb/gadget/legacy/raw_gadget.c:294
    gadget_bind_driver+0xed/0x390 drivers/usb/gadget/udc/core.c:1662
    call_driver_probe drivers/base/dd.c:628 [inline]
    really_probe+0x12f/0x3a0 drivers/base/dd.c:706
    __driver_probe_device+0xe9/0x1a0 drivers/base/dd.c:868
    driver_probe_device+0x28/0xf0 drivers/base/dd.c:898
    __driver_attach drivers/base/dd.c:1292 [inline]
    __driver_attach+0x10a/0x200 drivers/base/dd.c:1232
    bus_for_each_dev+0xb8/0x120 drivers/base/bus.c:383
    bus_add_driver+0x122/0x280 drivers/base/bus.c:763
    driver_register+0xb1/0x140 drivers/base/driver.c:174
    usb_gadget_register_driver_owner+0x69/0xe0 drivers/usb/gadget/udc/core.c:1752
    raw_ioctl_run drivers/usb/gadget/legacy/raw_gadget.c:596 [inline]
    raw_ioctl+0xad7/0x10c0 drivers/usb/gadget/legacy/raw_gadget.c:1307
    vfs_ioctl fs/ioctl.c:51 [inline]
    __do_sys_ioctl fs/ioctl.c:597 [inline]
    __se_sys_ioctl fs/ioctl.c:583 [inline]
    __x64_sys_ioctl+0xf4/0x140 fs/ioctl.c:583
    do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
    do_syscall_64+0xf8/0x610 arch/x86/entry/syscall_64.c:94

BUG: memory leak
unreferenced object 0xffff888127815480 (size 128):
  comm "syz.6.23", pid 6074, jiffies 4294944011
  hex dump (first 32 bytes):
    80 54 81 27 81 88 ff ff 80 54 81 27 81 88 ff ff  .T.'.....T.'....
    30 40 49 03 81 88 ff ff 00 00 00 00 00 00 00 00  0@I.............
  backtrace (crc fd9d10f8):
    kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
    slab_post_alloc_hook mm/slub.c:4597 [inline]
    slab_alloc_node mm/slub.c:4917 [inline]
    __kmalloc_cache_noprof+0x356/0x440 mm/slub.c:5485
    _kmalloc_noprof include/linux/slab.h:988 [inline]
    _kzalloc_noprof include/linux/slab.h:1309 [inline]
    dummy_alloc_request+0x65/0xf0 drivers/usb/gadget/udc/dummy_hcd.c:693
    usb_ep_alloc_request+0x2e/0xd0 drivers/usb/gadget/udc/core.c:197
    gadget_bind+0x67/0x230 drivers/usb/gadget/legacy/raw_gadget.c:294
    gadget_bind_driver+0xed/0x390 drivers/usb/gadget/udc/core.c:1662
    call_driver_probe drivers/base/dd.c:628 [inline]
    really_probe+0x12f/0x3a0 drivers/base/dd.c:706
    __driver_probe_device+0xe9/0x1a0 drivers/base/dd.c:868
    driver_probe_device+0x28/0xf0 drivers/base/dd.c:898
    __device_attach_driver+0x10f/0x170 drivers/base/dd.c:1026
    bus_for_each_drv+0xd2/0x130 drivers/base/bus.c:500
    __device_attach+0xf9/0x290 drivers/base/dd.c:1098
    device_initial_probe+0x6f/0x80 drivers/base/dd.c:1153
    bus_probe_device+0x3e/0xb0 drivers/base/bus.c:620
    device_add+0x99f/0xc80 drivers/base/core.c:3772
    usb_add_gadget+0x221/0x330 drivers/usb/gadget/udc/core.c:1461
    usb_add_gadget_udc_release drivers/usb/gadget/udc/core.c:1517 [inline]
    usb_add_gadget_udc+0x6e/0xb0 drivers/usb/gadget/udc/core.c:1564

BUG: memory leak
unreferenced object 0xffff88812a6d5600 (size 128):
  comm "syz.5.22", pid 6077, jiffies 4294944018
  hex dump (first 32 bytes):
    00 56 6d 2a 81 88 ff ff 00 56 6d 2a 81 88 ff ff  .Vm*.....Vm*....
    30 40 49 03 81 88 ff ff b8 4c 34 12 81 88 ff ff  0@I......L4.....
  backtrace (crc e492b8c):
    kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
    slab_post_alloc_hook mm/slub.c:4597 [inline]
    slab_alloc_node mm/slub.c:4917 [inline]
    __kmalloc_cache_noprof+0x356/0x440 mm/slub.c:5485
    _kmalloc_noprof include/linux/slab.h:988 [inline]
    _kzalloc_noprof include/linux/slab.h:1309 [inline]
    dummy_alloc_request+0x65/0xf0 drivers/usb/gadget/udc/dummy_hcd.c:693
    usb_ep_alloc_request+0x2e/0xd0 drivers/usb/gadget/udc/core.c:197
    gadget_bind+0x67/0x230 drivers/usb/gadget/legacy/raw_gadget.c:294
    gadget_bind_driver+0xed/0x390 drivers/usb/gadget/udc/core.c:1662
    call_driver_probe drivers/base/dd.c:628 [inline]
    really_probe+0x12f/0x3a0 drivers/base/dd.c:706
    __driver_probe_device+0xe9/0x1a0 drivers/base/dd.c:868
    driver_probe_device+0x28/0xf0 drivers/base/dd.c:898
    __device_attach_driver+0x10f/0x170 drivers/base/dd.c:1026
    bus_for_each_drv+0xd2/0x130 drivers/base/bus.c:500
    __device_attach+0xf9/0x290 drivers/base/dd.c:1098
    device_initial_probe+0x6f/0x80 drivers/base/dd.c:1153
    bus_probe_device+0x3e/0xb0 drivers/base/bus.c:620
    device_add+0x99f/0xc80 drivers/base/core.c:3772
    usb_add_gadget+0x221/0x330 drivers/usb/gadget/udc/core.c:1461
    usb_add_gadget_udc_release drivers/usb/gadget/udc/core.c:1517 [inline]
    usb_add_gadget_udc+0x6e/0xb0 drivers/usb/gadget/udc/core.c:1564

BUG: memory leak
unreferenced object 0xffff88812a6d5080 (size 128):
  comm "syz.0.26", pid 6083, jiffies 4294944267
  hex dump (first 32 bytes):
    80 50 6d 2a 81 88 ff ff 80 50 6d 2a 81 88 ff ff  .Pm*.....Pm*....
    30 40 49 03 81 88 ff ff 00 00 00 00 00 00 00 00  0@I.............
  backtrace (crc b6755c66):
    kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
    slab_post_alloc_hook mm/slub.c:4597 [inline]
    slab_alloc_node mm/slub.c:4917 [inline]
    __kmalloc_cache_noprof+0x356/0x440 mm/slub.c:5485
    _kmalloc_noprof include/linux/slab.h:988 [inline]
    _kzalloc_noprof include/linux/slab.h:1309 [inline]
    dummy_alloc_request+0x65/0xf0 drivers/usb/gadget/udc/dummy_hcd.c:693
    usb_ep_alloc_request+0x2e/0xd0 drivers/usb/gadget/udc/core.c:197
    gadget_bind+0x67/0x230 drivers/usb/gadget/legacy/raw_gadget.c:294
    gadget_bind_driver+0xed/0x390 drivers/usb/gadget/udc/core.c:1662
    call_driver_probe drivers/base/dd.c:628 [inline]
    really_probe+0x12f/0x3a0 drivers/base/dd.c:706
    __driver_probe_device+0xe9/0x1a0 drivers/base/dd.c:868
    driver_probe_device+0x28/0xf0 drivers/base/dd.c:898
    __driver_attach drivers/base/dd.c:1292 [inline]
    __driver_attach+0x10a/0x200 drivers/base/dd.c:1232
    bus_for_each_dev+0xb8/0x120 drivers/base/bus.c:383
    bus_add_driver+0x122/0x280 drivers/base/bus.c:763
    driver_register+0xb1/0x140 drivers/base/driver.c:174
    usb_gadget_register_driver_owner+0x69/0xe0 drivers/usb/gadget/udc/core.c:1752
    raw_ioctl_run drivers/usb/gadget/legacy/raw_gadget.c:596 [inline]
    raw_ioctl+0xad7/0x10c0 drivers/usb/gadget/legacy/raw_gadget.c:1307
    vfs_ioctl fs/ioctl.c:51 [inline]
    __do_sys_ioctl fs/ioctl.c:597 [inline]
    __se_sys_ioctl fs/ioctl.c:583 [inline]
    __x64_sys_ioctl+0xf4/0x140 fs/ioctl.c:583
    do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
    do_syscall_64+0xf8/0x610 arch/x86/entry/syscall_64.c:94

connection error: failed to recv *flatrpc.ExecutorMessageRawT: EOF

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/08/09 13:45 upstream 06cf61899d64 5d63f80b .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-gce-leak memory leak in gadget_bind
* Struck through repros no longer work on HEAD.