[syzbot] memory leak in snd_ctl_led_register
From: syzbot
Date: Mon May 17 2021 - 04:52:19 EST
Hello,
syzbot found the following issue on:
HEAD commit: e4866123 Merge tag 's390-5.13-2' of git://git.kernel.org/p..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1052b345d00000
kernel config: https://syzkaller.appspot.com/x/.config?x=2e724a3033c441e3
dashboard link: https://syzkaller.appspot.com/bug?extid=08a7d8b51ea048a74ffb
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=117d4593d00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=100509b3d00000
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+08a7d8b51ea048a74ffb@xxxxxxxxxxxxxxxxxxxxxxxxx
BUG: memory leak
unreferenced object 0xffff888113a0ca00 (size 256):
comm "kworker/1:1", pid 35, jiffies 4294942586 (age 13.780s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 08 ca a0 13 81 88 ff ff ................
08 ca a0 13 81 88 ff ff a0 5c 60 82 ff ff ff ff .........\`.....
backtrace:
[<ffffffff8260b58c>] kmalloc include/linux/slab.h:556 [inline]
[<ffffffff8260b58c>] kzalloc include/linux/slab.h:686 [inline]
[<ffffffff8260b58c>] device_private_init drivers/base/core.c:3161 [inline]
[<ffffffff8260b58c>] device_add+0x85c/0xd70 drivers/base/core.c:3211
[<ffffffff8356aaef>] snd_ctl_led_sysfs_add sound/core/control_led.c:670 [inline]
[<ffffffff8356aaef>] snd_ctl_led_register+0x1af/0x2f0 sound/core/control_led.c:361
[<ffffffff8355e0a8>] snd_ctl_dev_register+0x78/0xb0 sound/core/control.c:2156
[<ffffffff83563fab>] __snd_device_register sound/core/device.c:149 [inline]
[<ffffffff83563fab>] __snd_device_register sound/core/device.c:145 [inline]
[<ffffffff83563fab>] snd_device_register_all+0x7b/0xd0 sound/core/device.c:197
[<ffffffff8355ccc0>] snd_card_register+0x90/0x2b0 sound/core/init.c:773
[<ffffffff83648737>] usX2Y_usb_probe sound/usb/usx2y/usbusx2y.c:382 [inline]
[<ffffffff83648737>] snd_usX2Y_probe+0x277/0x2f0 sound/usb/usx2y/usbusx2y.c:398
[<ffffffff82bcf687>] usb_probe_interface+0x177/0x370 drivers/usb/core/driver.c:396
[<ffffffff82610359>] really_probe+0x159/0x500 drivers/base/dd.c:576
[<ffffffff8261078b>] driver_probe_device+0x8b/0x100 drivers/base/dd.c:763
[<ffffffff82610eb6>] __device_attach_driver+0xf6/0x120 drivers/base/dd.c:870
[<ffffffff8260d247>] bus_for_each_drv+0xb7/0x100 drivers/base/bus.c:431
[<ffffffff82610a32>] __device_attach+0x122/0x260 drivers/base/dd.c:938
[<ffffffff8260eee6>] bus_probe_device+0xc6/0xe0 drivers/base/bus.c:491
[<ffffffff8260b305>] device_add+0x5d5/0xd70 drivers/base/core.c:3319
[<ffffffff82bccc29>] usb_set_configuration+0x9d9/0xb90 drivers/usb/core/message.c:2164
[<ffffffff82bdcfbc>] usb_generic_driver_probe+0x8c/0xc0 drivers/usb/core/generic.c:238
BUG: memory leak
unreferenced object 0xffff888113a0c900 (size 256):
comm "kworker/1:1", pid 35, jiffies 4294942586 (age 13.780s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 08 c9 a0 13 81 88 ff ff ................
08 c9 a0 13 81 88 ff ff a0 5c 60 82 ff ff ff ff .........\`.....
backtrace:
[<ffffffff8260b58c>] kmalloc include/linux/slab.h:556 [inline]
[<ffffffff8260b58c>] kzalloc include/linux/slab.h:686 [inline]
[<ffffffff8260b58c>] device_private_init drivers/base/core.c:3161 [inline]
[<ffffffff8260b58c>] device_add+0x85c/0xd70 drivers/base/core.c:3211
[<ffffffff8356aaef>] snd_ctl_led_sysfs_add sound/core/control_led.c:670 [inline]
[<ffffffff8356aaef>] snd_ctl_led_register+0x1af/0x2f0 sound/core/control_led.c:361
[<ffffffff8355e0a8>] snd_ctl_dev_register+0x78/0xb0 sound/core/control.c:2156
[<ffffffff83563fab>] __snd_device_register sound/core/device.c:149 [inline]
[<ffffffff83563fab>] __snd_device_register sound/core/device.c:145 [inline]
[<ffffffff83563fab>] snd_device_register_all+0x7b/0xd0 sound/core/device.c:197
[<ffffffff8355ccc0>] snd_card_register+0x90/0x2b0 sound/core/init.c:773
[<ffffffff83648737>] usX2Y_usb_probe sound/usb/usx2y/usbusx2y.c:382 [inline]
[<ffffffff83648737>] snd_usX2Y_probe+0x277/0x2f0 sound/usb/usx2y/usbusx2y.c:398
[<ffffffff82bcf687>] usb_probe_interface+0x177/0x370 drivers/usb/core/driver.c:396
[<ffffffff82610359>] really_probe+0x159/0x500 drivers/base/dd.c:576
[<ffffffff8261078b>] driver_probe_device+0x8b/0x100 drivers/base/dd.c:763
[<ffffffff82610eb6>] __device_attach_driver+0xf6/0x120 drivers/base/dd.c:870
[<ffffffff8260d247>] bus_for_each_drv+0xb7/0x100 drivers/base/bus.c:431
[<ffffffff82610a32>] __device_attach+0x122/0x260 drivers/base/dd.c:938
[<ffffffff8260eee6>] bus_probe_device+0xc6/0xe0 drivers/base/bus.c:491
[<ffffffff8260b305>] device_add+0x5d5/0xd70 drivers/base/core.c:3319
[<ffffffff82bccc29>] usb_set_configuration+0x9d9/0xb90 drivers/usb/core/message.c:2164
[<ffffffff82bdcfbc>] usb_generic_driver_probe+0x8c/0xc0 drivers/usb/core/generic.c:238
BUG: memory leak
unreferenced object 0xffff888112c771c0 (size 32):
comm "kworker/1:1", pid 35, jiffies 4294943217 (age 7.470s)
hex dump (first 32 bytes):
63 61 72 64 33 00 00 00 00 00 00 00 00 00 00 00 card3...........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<ffffffff82253d3c>] kvasprintf+0x6c/0xf0 lib/kasprintf.c:25
[<ffffffff82253e18>] kvasprintf_const+0x58/0x110 lib/kasprintf.c:49
[<ffffffff8231b16b>] kobject_set_name_vargs+0x3b/0xe0 lib/kobject.c:289
[<ffffffff82605c03>] dev_set_name+0x63/0x90 drivers/base/core.c:3105
[<ffffffff8356aabe>] snd_ctl_led_sysfs_add sound/core/control_led.c:666 [inline]
[<ffffffff8356aabe>] snd_ctl_led_register+0x17e/0x2f0 sound/core/control_led.c:361
[<ffffffff8355e0a8>] snd_ctl_dev_register+0x78/0xb0 sound/core/control.c:2156
[<ffffffff83563fab>] __snd_device_register sound/core/device.c:149 [inline]
[<ffffffff83563fab>] __snd_device_register sound/core/device.c:145 [inline]
[<ffffffff83563fab>] snd_device_register_all+0x7b/0xd0 sound/core/device.c:197
[<ffffffff8355ccc0>] snd_card_register+0x90/0x2b0 sound/core/init.c:773
[<ffffffff83648737>] usX2Y_usb_probe sound/usb/usx2y/usbusx2y.c:382 [inline]
[<ffffffff83648737>] snd_usX2Y_probe+0x277/0x2f0 sound/usb/usx2y/usbusx2y.c:398
[<ffffffff82bcf687>] usb_probe_interface+0x177/0x370 drivers/usb/core/driver.c:396
[<ffffffff82610359>] really_probe+0x159/0x500 drivers/base/dd.c:576
[<ffffffff8261078b>] driver_probe_device+0x8b/0x100 drivers/base/dd.c:763
[<ffffffff82610eb6>] __device_attach_driver+0xf6/0x120 drivers/base/dd.c:870
[<ffffffff8260d247>] bus_for_each_drv+0xb7/0x100 drivers/base/bus.c:431
[<ffffffff82610a32>] __device_attach+0x122/0x260 drivers/base/dd.c:938
[<ffffffff8260eee6>] bus_probe_device+0xc6/0xe0 drivers/base/bus.c:491
---
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@xxxxxxxxxxxxxxxx.
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