syzbot


memory leak in gs_usb_probe

Status: upstream: reported C repro on 2022/03/29 15:22
Reported-by: syzbot+4d0ae90a195b269f102d@syzkaller.appspotmail.com
Fix commit: 50d34a0d151d can: gs_usb: gs_make_candev(): fix memory leak for devices with extended bit timing configuration
Patched on: [ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-leak ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce ci-upstream-kmsan-gce-386 ci-upstream-linux-next-kasan-gce-root ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci2-upstream-kcsan-gce ci2-upstream-usb], missing on: [ci-qemu2-riscv64]
First crash: 95d, last: 95d
Patch testing requests:
Created Duration User Patch Repo Result
2022/03/30 02:46 0m qiang1.zhang@intel.com patch linux-next error
2022/03/30 02:37 0m qiang1.zhang@intel.com patch linux-next error
2022/03/30 01:57 0m qiang1.zhang@intel.com patch linux-next error

Sample crash report:
BUG: memory leak
unreferenced object 0xffff88810e4fc300 (size 96):
  comm "kworker/1:1", pid 25, jiffies 4294948102 (age 15.080s)
  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:
    [<ffffffff843fcc08>] kmalloc include/linux/slab.h:581 [inline]
    [<ffffffff843fcc08>] gs_make_candev drivers/net/can/usb/gs_usb.c:1065 [inline]
    [<ffffffff843fcc08>] gs_usb_probe.cold+0x69e/0x8b8 drivers/net/can/usb/gs_usb.c:1191
    [<ffffffff82d0a687>] usb_probe_interface+0x177/0x370 drivers/usb/core/driver.c:396
    [<ffffffff82712d87>] call_driver_probe drivers/base/dd.c:517 [inline]
    [<ffffffff82712d87>] really_probe.part.0+0xe7/0x380 drivers/base/dd.c:596
    [<ffffffff8271312c>] really_probe drivers/base/dd.c:558 [inline]
    [<ffffffff8271312c>] __driver_probe_device+0x10c/0x1e0 drivers/base/dd.c:755
    [<ffffffff8271322a>] driver_probe_device+0x2a/0x120 drivers/base/dd.c:785
    [<ffffffff82713a96>] __device_attach_driver+0xf6/0x140 drivers/base/dd.c:902
    [<ffffffff8270fcf7>] bus_for_each_drv+0xb7/0x100 drivers/base/bus.c:427
    [<ffffffff82713612>] __device_attach+0x122/0x260 drivers/base/dd.c:973
    [<ffffffff82711966>] bus_probe_device+0xc6/0xe0 drivers/base/bus.c:487
    [<ffffffff8270dd4b>] device_add+0x5fb/0xdf0 drivers/base/core.c:3405
    [<ffffffff82d07ac2>] usb_set_configuration+0x8f2/0xb80 drivers/usb/core/message.c:2170
    [<ffffffff82d181ac>] usb_generic_driver_probe+0x8c/0xc0 drivers/usb/core/generic.c:238
    [<ffffffff82d09d5c>] usb_probe_device+0x5c/0x140 drivers/usb/core/driver.c:293
    [<ffffffff82712d87>] call_driver_probe drivers/base/dd.c:517 [inline]
    [<ffffffff82712d87>] really_probe.part.0+0xe7/0x380 drivers/base/dd.c:596
    [<ffffffff8271312c>] really_probe drivers/base/dd.c:558 [inline]
    [<ffffffff8271312c>] __driver_probe_device+0x10c/0x1e0 drivers/base/dd.c:755
    [<ffffffff8271322a>] driver_probe_device+0x2a/0x120 drivers/base/dd.c:785

BUG: memory leak
unreferenced object 0xffff88810e4fc280 (size 96):
  comm "kworker/1:1", pid 25, jiffies 4294948819 (age 7.910s)
  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:
    [<ffffffff843fcc08>] kmalloc include/linux/slab.h:581 [inline]
    [<ffffffff843fcc08>] gs_make_candev drivers/net/can/usb/gs_usb.c:1065 [inline]
    [<ffffffff843fcc08>] gs_usb_probe.cold+0x69e/0x8b8 drivers/net/can/usb/gs_usb.c:1191
    [<ffffffff82d0a687>] usb_probe_interface+0x177/0x370 drivers/usb/core/driver.c:396
    [<ffffffff82712d87>] call_driver_probe drivers/base/dd.c:517 [inline]
    [<ffffffff82712d87>] really_probe.part.0+0xe7/0x380 drivers/base/dd.c:596
    [<ffffffff8271312c>] really_probe drivers/base/dd.c:558 [inline]
    [<ffffffff8271312c>] __driver_probe_device+0x10c/0x1e0 drivers/base/dd.c:755
    [<ffffffff8271322a>] driver_probe_device+0x2a/0x120 drivers/base/dd.c:785
    [<ffffffff82713a96>] __device_attach_driver+0xf6/0x140 drivers/base/dd.c:902
    [<ffffffff8270fcf7>] bus_for_each_drv+0xb7/0x100 drivers/base/bus.c:427
    [<ffffffff82713612>] __device_attach+0x122/0x260 drivers/base/dd.c:973
    [<ffffffff82711966>] bus_probe_device+0xc6/0xe0 drivers/base/bus.c:487
    [<ffffffff8270dd4b>] device_add+0x5fb/0xdf0 drivers/base/core.c:3405
    [<ffffffff82d07ac2>] usb_set_configuration+0x8f2/0xb80 drivers/usb/core/message.c:2170
    [<ffffffff82d181ac>] usb_generic_driver_probe+0x8c/0xc0 drivers/usb/core/generic.c:238
    [<ffffffff82d09d5c>] usb_probe_device+0x5c/0x140 drivers/usb/core/driver.c:293
    [<ffffffff82712d87>] call_driver_probe drivers/base/dd.c:517 [inline]
    [<ffffffff82712d87>] really_probe.part.0+0xe7/0x380 drivers/base/dd.c:596
    [<ffffffff8271312c>] really_probe drivers/base/dd.c:558 [inline]
    [<ffffffff8271312c>] __driver_probe_device+0x10c/0x1e0 drivers/base/dd.c:755
    [<ffffffff8271322a>] driver_probe_device+0x2a/0x120 drivers/base/dd.c:785


Crashes (1):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-gce-leak 2022/03/25 15:12 upstream 52deda9551a0 89bc8608 .config log report syz C memory leak in gs_usb_probe