[syzbot] memory leak in snd_ctl_led_register

17 views
Skip to first unread message

syzbot

unread,
May 17, 2021, 4:52:15 AM5/17/21
to gre...@linuxfoundation.org, linux-...@vger.kernel.org, raf...@kernel.org, syzkall...@googlegroups.com
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+08a7d8...@syzkaller.appspotmail.com

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 syzk...@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

syzbot

unread,
May 25, 2021, 2:17:09 AM5/25/21
to mudongl...@gmail.com, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
memory leak in kobject_set_name_vargs

BUG: memory leak
unreferenced object 0xffff8881287aa140 (size 32):
comm "kworker/1:3", pid 4834, jiffies 4294944905 (age 14.900s)
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:
[<ffffffff82257a3c>] kvasprintf+0x6c/0xf0 lib/kasprintf.c:25
[<ffffffff82257b18>] kvasprintf_const+0x58/0x110 lib/kasprintf.c:49
[<ffffffff8231f1ab>] kobject_set_name_vargs+0x3b/0xe0 lib/kobject.c:289
[<ffffffff8260a473>] dev_set_name+0x63/0x90 drivers/base/core.c:3106
[<ffffffff83570d0e>] snd_ctl_led_sysfs_add sound/core/control_led.c:666 [inline]
[<ffffffff83570d0e>] snd_ctl_led_register+0x17e/0x2f0 sound/core/control_led.c:361
[<ffffffff835642f8>] snd_ctl_dev_register+0x78/0xb0 sound/core/control.c:2156
[<ffffffff8356a1fb>] __snd_device_register sound/core/device.c:149 [inline]
[<ffffffff8356a1fb>] __snd_device_register sound/core/device.c:145 [inline]
[<ffffffff8356a1fb>] snd_device_register_all+0x7b/0xd0 sound/core/device.c:197
[<ffffffff83562f10>] snd_card_register+0x90/0x2b0 sound/core/init.c:773
[<ffffffff8364edd7>] usX2Y_usb_probe sound/usb/usx2y/usbusx2y.c:382 [inline]
[<ffffffff8364edd7>] snd_usX2Y_probe+0x277/0x2f0 sound/usb/usx2y/usbusx2y.c:398
[<ffffffff82bd47f7>] usb_probe_interface+0x177/0x370 drivers/usb/core/driver.c:396
[<ffffffff82614c09>] really_probe+0x159/0x500 drivers/base/dd.c:576
[<ffffffff8261503b>] driver_probe_device+0x8b/0x100 drivers/base/dd.c:763
[<ffffffff82615766>] __device_attach_driver+0xf6/0x120 drivers/base/dd.c:870
[<ffffffff82611af7>] bus_for_each_drv+0xb7/0x100 drivers/base/bus.c:431
[<ffffffff826152e2>] __device_attach+0x122/0x260 drivers/base/dd.c:938
[<ffffffff82613796>] bus_probe_device+0xc6/0xe0 drivers/base/bus.c:491

BUG: memory leak
unreferenced object 0xffff8881287aa0a0 (size 32):
comm "kworker/1:3", pid 4834, jiffies 4294944905 (age 14.900s)
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:
[<ffffffff82257a3c>] kvasprintf+0x6c/0xf0 lib/kasprintf.c:25
[<ffffffff82257b18>] kvasprintf_const+0x58/0x110 lib/kasprintf.c:49
[<ffffffff8231f1ab>] kobject_set_name_vargs+0x3b/0xe0 lib/kobject.c:289
[<ffffffff8260a473>] dev_set_name+0x63/0x90 drivers/base/core.c:3106
[<ffffffff83570d0e>] snd_ctl_led_sysfs_add sound/core/control_led.c:666 [inline]
[<ffffffff83570d0e>] snd_ctl_led_register+0x17e/0x2f0 sound/core/control_led.c:361
[<ffffffff835642f8>] snd_ctl_dev_register+0x78/0xb0 sound/core/control.c:2156
[<ffffffff8356a1fb>] __snd_device_register sound/core/device.c:149 [inline]
[<ffffffff8356a1fb>] __snd_device_register sound/core/device.c:145 [inline]
[<ffffffff8356a1fb>] snd_device_register_all+0x7b/0xd0 sound/core/device.c:197
[<ffffffff83562f10>] snd_card_register+0x90/0x2b0 sound/core/init.c:773
[<ffffffff8364edd7>] usX2Y_usb_probe sound/usb/usx2y/usbusx2y.c:382 [inline]
[<ffffffff8364edd7>] snd_usX2Y_probe+0x277/0x2f0 sound/usb/usx2y/usbusx2y.c:398
[<ffffffff82bd47f7>] usb_probe_interface+0x177/0x370 drivers/usb/core/driver.c:396
[<ffffffff82614c09>] really_probe+0x159/0x500 drivers/base/dd.c:576
[<ffffffff8261503b>] driver_probe_device+0x8b/0x100 drivers/base/dd.c:763
[<ffffffff82615766>] __device_attach_driver+0xf6/0x120 drivers/base/dd.c:870
[<ffffffff82611af7>] bus_for_each_drv+0xb7/0x100 drivers/base/bus.c:431
[<ffffffff826152e2>] __device_attach+0x122/0x260 drivers/base/dd.c:938
[<ffffffff82613796>] bus_probe_device+0xc6/0xe0 drivers/base/bus.c:491

BUG: memory leak
unreferenced object 0xffff88812914cf00 (size 256):
comm "kworker/1:3", pid 4834, jiffies 4294944905 (age 14.900s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 08 cf 14 29 81 88 ff ff ...........)....
08 cf 14 29 81 88 ff ff 10 a5 60 82 ff ff ff ff ...)......`.....
backtrace:
[<ffffffff8260fe3c>] kmalloc include/linux/slab.h:556 [inline]
[<ffffffff8260fe3c>] kzalloc include/linux/slab.h:686 [inline]
[<ffffffff8260fe3c>] device_private_init drivers/base/core.c:3162 [inline]
[<ffffffff8260fe3c>] device_add+0x85c/0xd70 drivers/base/core.c:3212
[<ffffffff83570d3f>] snd_ctl_led_sysfs_add sound/core/control_led.c:670 [inline]
[<ffffffff83570d3f>] snd_ctl_led_register+0x1af/0x2f0 sound/core/control_led.c:361
[<ffffffff835642f8>] snd_ctl_dev_register+0x78/0xb0 sound/core/control.c:2156
[<ffffffff8356a1fb>] __snd_device_register sound/core/device.c:149 [inline]
[<ffffffff8356a1fb>] __snd_device_register sound/core/device.c:145 [inline]
[<ffffffff8356a1fb>] snd_device_register_all+0x7b/0xd0 sound/core/device.c:197
[<ffffffff83562f10>] snd_card_register+0x90/0x2b0 sound/core/init.c:773
[<ffffffff8364edd7>] usX2Y_usb_probe sound/usb/usx2y/usbusx2y.c:382 [inline]
[<ffffffff8364edd7>] snd_usX2Y_probe+0x277/0x2f0 sound/usb/usx2y/usbusx2y.c:398
[<ffffffff82bd47f7>] usb_probe_interface+0x177/0x370 drivers/usb/core/driver.c:396
[<ffffffff82614c09>] really_probe+0x159/0x500 drivers/base/dd.c:576
[<ffffffff8261503b>] driver_probe_device+0x8b/0x100 drivers/base/dd.c:763
[<ffffffff82615766>] __device_attach_driver+0xf6/0x120 drivers/base/dd.c:870
[<ffffffff82611af7>] bus_for_each_drv+0xb7/0x100 drivers/base/bus.c:431
[<ffffffff826152e2>] __device_attach+0x122/0x260 drivers/base/dd.c:938
[<ffffffff82613796>] bus_probe_device+0xc6/0xe0 drivers/base/bus.c:491
[<ffffffff8260fbb5>] device_add+0x5d5/0xd70 drivers/base/core.c:3320
[<ffffffff82bd1d99>] usb_set_configuration+0x9d9/0xb90 drivers/usb/core/message.c:2164
[<ffffffff82be211c>] usb_generic_driver_probe+0x8c/0xc0 drivers/usb/core/generic.c:238



Tested on:

commit: a050a6d2 Merge tag 'perf-tools-fixes-for-v5.13-2021-05-24'..
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
console output: https://syzkaller.appspot.com/x/log.txt?x=13648e9dd00000
kernel config: https://syzkaller.appspot.com/x/.config?x=1e274ab70808ec22
dashboard link: https://syzkaller.appspot.com/bug?extid=08a7d8b51ea048a74ffb
compiler:

syzbot

unread,
May 28, 2021, 8:48:10 AM5/28/21
to mudongl...@gmail.com, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+08a7d8...@syzkaller.appspotmail.com

Tested on:

commit: 94201c8f [PATCH] ALSA: control led: fix memory leak in snd..
git tree: https://github.com/mudongliang/linux
kernel config: https://syzkaller.appspot.com/x/.config?x=ff6e9776bb015b5e
Note: testing is done by a robot and is best-effort only.
Reply all
Reply to author
Forward
0 new messages