linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [syzbot] [media?] [usb?] memory leak in v4l2_ctrl_handler_init_class (2)
@ 2025-11-25  7:55 syzbot
  2025-11-25 17:01 ` shaurya
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: syzbot @ 2025-11-25  7:55 UTC (permalink / raw)
  To: linux-kernel, linux-media, linux-usb, mchehab, syzkaller-bugs

Hello,

syzbot found the following issue on:

HEAD commit:    fd95357fd8c6 Merge tag 'sched_ext-for-6.18-rc6-fixes-2' of..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=14a39742580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=f30cc590c4f6da44
dashboard link: https://syzkaller.appspot.com/bug?extid=a41b73dce23962a74c72
compiler:       gcc (Debian 12.2.0-14+deb12u1) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=16b05a12580000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=10f8aa12580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/23b612a7fe35/disk-fd95357f.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/2da12b65fa76/vmlinux-fd95357f.xz
kernel image: https://storage.googleapis.com/syzbot-assets/97ebacdc6971/bzImage-fd95357f.xz

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

BUG: memory leak
unreferenced object 0xffff88812a347a58 (size 8):
  comm "kworker/0:6", pid 6036, jiffies 4294942408
  hex dump (first 8 bytes):
    80 38 6e 25 81 88 ff ff                          .8n%....
  backtrace (crc f78d2928):
    kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
    slab_post_alloc_hook mm/slub.c:4983 [inline]
    slab_alloc_node mm/slub.c:5288 [inline]
    __do_kmalloc_node mm/slub.c:5649 [inline]
    __kvmalloc_node_noprof+0x51c/0x820 mm/slub.c:7112
    kvmalloc_array_node_noprof include/linux/slab.h:1122 [inline]
    v4l2_ctrl_handler_init_class+0x67/0x90 drivers/media/v4l2-core/v4l2-ctrls-core.c:1625
    usb_keene_probe+0xc4/0x450 drivers/media/radio/radio-keene.c:326
    usb_probe_interface+0x173/0x3f0 drivers/usb/core/driver.c:396
    call_driver_probe drivers/base/dd.c:581 [inline]
    really_probe+0x12f/0x430 drivers/base/dd.c:659
    __driver_probe_device+0xc3/0x1a0 drivers/base/dd.c:801
    driver_probe_device+0x2a/0x120 drivers/base/dd.c:831
    __device_attach_driver+0x10f/0x170 drivers/base/dd.c:959
    bus_for_each_drv+0xcf/0x120 drivers/base/bus.c:462
    __device_attach+0xf9/0x290 drivers/base/dd.c:1031
    bus_probe_device+0xcd/0xe0 drivers/base/bus.c:537
    device_add+0x983/0xc80 drivers/base/core.c:3689
    usb_set_configuration+0x961/0xc70 drivers/usb/core/message.c:2210
    usb_generic_driver_probe+0x83/0xd0 drivers/usb/core/generic.c:250
    usb_probe_device+0x7c/0x1d0 drivers/usb/core/driver.c:291
    call_driver_probe drivers/base/dd.c:581 [inline]
    really_probe+0x12f/0x430 drivers/base/dd.c:659

BUG: memory leak
unreferenced object 0xffff888126df0200 (size 256):
  comm "kworker/0:6", pid 6036, jiffies 4294942408
  hex dump (first 32 bytes):
    00 0b df 26 81 88 ff ff 00 09 df 26 81 88 ff ff  ...&.......&....
    10 02 df 26 81 88 ff ff 10 02 df 26 81 88 ff ff  ...&.......&....
  backtrace (crc 602da918):
    kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
    slab_post_alloc_hook mm/slub.c:4983 [inline]
    slab_alloc_node mm/slub.c:5288 [inline]
    __do_kmalloc_node mm/slub.c:5649 [inline]
    __kvmalloc_node_noprof+0x51c/0x820 mm/slub.c:7112
    v4l2_ctrl_new+0x2bf/0x1340 drivers/media/v4l2-core/v4l2-ctrls-core.c:2031
    v4l2_ctrl_new_std+0x122/0x180 drivers/media/v4l2-core/v4l2-ctrls-core.c:2185
    usb_keene_probe+0xe8/0x450 drivers/media/radio/radio-keene.c:327
    usb_probe_interface+0x173/0x3f0 drivers/usb/core/driver.c:396
    call_driver_probe drivers/base/dd.c:581 [inline]
    really_probe+0x12f/0x430 drivers/base/dd.c:659
    __driver_probe_device+0xc3/0x1a0 drivers/base/dd.c:801
    driver_probe_device+0x2a/0x120 drivers/base/dd.c:831
    __device_attach_driver+0x10f/0x170 drivers/base/dd.c:959
    bus_for_each_drv+0xcf/0x120 drivers/base/bus.c:462
    __device_attach+0xf9/0x290 drivers/base/dd.c:1031
    bus_probe_device+0xcd/0xe0 drivers/base/bus.c:537
    device_add+0x983/0xc80 drivers/base/core.c:3689
    usb_set_configuration+0x961/0xc70 drivers/usb/core/message.c:2210
    usb_generic_driver_probe+0x83/0xd0 drivers/usb/core/generic.c:250
    usb_probe_device+0x7c/0x1d0 drivers/usb/core/driver.c:291

BUG: memory leak
unreferenced object 0xffff888126df0900 (size 256):
  comm "kworker/0:6", pid 6036, jiffies 4294942408
  hex dump (first 32 bytes):
    00 02 df 26 81 88 ff ff 30 f5 8f 24 81 88 ff ff  ...&....0..$....
    10 09 df 26 81 88 ff ff 10 09 df 26 81 88 ff ff  ...&.......&....
  backtrace (crc 84e60c55):
    kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
    slab_post_alloc_hook mm/slub.c:4983 [inline]
    slab_alloc_node mm/slub.c:5288 [inline]
    __do_kmalloc_node mm/slub.c:5649 [inline]
    __kvmalloc_node_noprof+0x51c/0x820 mm/slub.c:7112
    v4l2_ctrl_new+0x2bf/0x1340 drivers/media/v4l2-core/v4l2-ctrls-core.c:2031
    v4l2_ctrl_new_std+0x122/0x180 drivers/media/v4l2-core/v4l2-ctrls-core.c:2185
    handler_new_ref+0x352/0x450 drivers/media/v4l2-core/v4l2-ctrls-core.c:1772
    v4l2_ctrl_new+0x67d/0x1340 drivers/media/v4l2-core/v4l2-ctrls-core.c:2114
    v4l2_ctrl_new_std+0x122/0x180 drivers/media/v4l2-core/v4l2-ctrls-core.c:2185
    usb_keene_probe+0xe8/0x450 drivers/media/radio/radio-keene.c:327
    usb_probe_interface+0x173/0x3f0 drivers/usb/core/driver.c:396
    call_driver_probe drivers/base/dd.c:581 [inline]
    really_probe+0x12f/0x430 drivers/base/dd.c:659
    __driver_probe_device+0xc3/0x1a0 drivers/base/dd.c:801
    driver_probe_device+0x2a/0x120 drivers/base/dd.c:831
    __device_attach_driver+0x10f/0x170 drivers/base/dd.c:959
    bus_for_each_drv+0xcf/0x120 drivers/base/bus.c:462
    __device_attach+0xf9/0x290 drivers/base/dd.c:1031
    bus_probe_device+0xcd/0xe0 drivers/base/bus.c:537
    device_add+0x983/0xc80 drivers/base/core.c:3689

BUG: memory leak
unreferenced object 0xffff8881256e3400 (size 64):
  comm "kworker/0:6", pid 6036, jiffies 4294942408
  hex dump (first 32 bytes):
    40 33 6e 25 81 88 ff ff 40 f5 8f 24 81 88 ff ff  @3n%....@..$....
    00 00 00 00 00 00 00 00 00 09 df 26 81 88 ff ff  ...........&....
  backtrace (crc a7c4a093):
    kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
    slab_post_alloc_hook mm/slub.c:4983 [inline]
    slab_alloc_node mm/slub.c:5288 [inline]
    __do_kmalloc_node mm/slub.c:5649 [inline]
    __kmalloc_noprof+0x3e3/0x6b0 mm/slub.c:5662
    kmalloc_noprof include/linux/slab.h:961 [inline]
    kzalloc_noprof include/linux/slab.h:1094 [inline]
    handler_new_ref+0xd7/0x450 drivers/media/v4l2-core/v4l2-ctrls-core.c:1780
    v4l2_ctrl_new+0x67d/0x1340 drivers/media/v4l2-core/v4l2-ctrls-core.c:2114
    v4l2_ctrl_new_std+0x122/0x180 drivers/media/v4l2-core/v4l2-ctrls-core.c:2185
    handler_new_ref+0x352/0x450 drivers/media/v4l2-core/v4l2-ctrls-core.c:1772
    v4l2_ctrl_new+0x67d/0x1340 drivers/media/v4l2-core/v4l2-ctrls-core.c:2114
    v4l2_ctrl_new_std+0x122/0x180 drivers/media/v4l2-core/v4l2-ctrls-core.c:2185
    usb_keene_probe+0xe8/0x450 drivers/media/radio/radio-keene.c:327
    usb_probe_interface+0x173/0x3f0 drivers/usb/core/driver.c:396
    call_driver_probe drivers/base/dd.c:581 [inline]
    really_probe+0x12f/0x430 drivers/base/dd.c:659
    __driver_probe_device+0xc3/0x1a0 drivers/base/dd.c:801
    driver_probe_device+0x2a/0x120 drivers/base/dd.c:831
    __device_attach_driver+0x10f/0x170 drivers/base/dd.c:959
    bus_for_each_drv+0xcf/0x120 drivers/base/bus.c:462
    __device_attach+0xf9/0x290 drivers/base/dd.c:1031
    bus_probe_device+0xcd/0xe0 drivers/base/bus.c:537

BUG: memory leak
unreferenced object 0xffff8881256e3340 (size 64):
  comm "kworker/0:6", pid 6036, jiffies 4294942408
  hex dump (first 32 bytes):
    80 32 6e 25 81 88 ff ff 00 34 6e 25 81 88 ff ff  .2n%.....4n%....
    00 34 6e 25 81 88 ff ff 00 02 df 26 81 88 ff ff  .4n%.......&....
  backtrace (crc be938ee5):
    kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
    slab_post_alloc_hook mm/slub.c:4983 [inline]
    slab_alloc_node mm/slub.c:5288 [inline]
    __do_kmalloc_node mm/slub.c:5649 [inline]
    __kmalloc_noprof+0x3e3/0x6b0 mm/slub.c:5662
    kmalloc_noprof include/linux/slab.h:961 [inline]
    kzalloc_noprof include/linux/slab.h:1094 [inline]
    handler_new_ref+0xd7/0x450 drivers/media/v4l2-core/v4l2-ctrls-core.c:1780
    v4l2_ctrl_new+0x67d/0x1340 drivers/media/v4l2-core/v4l2-ctrls-core.c:2114
    v4l2_ctrl_new_std+0x122/0x180 drivers/media/v4l2-core/v4l2-ctrls-core.c:2185
    usb_keene_probe+0xe8/0x450 drivers/media/radio/radio-keene.c:327
    usb_probe_interface+0x173/0x3f0 drivers/usb/core/driver.c:396
    call_driver_probe drivers/base/dd.c:581 [inline]
    really_probe+0x12f/0x430 drivers/base/dd.c:659
    __driver_probe_device+0xc3/0x1a0 drivers/base/dd.c:801
    driver_probe_device+0x2a/0x120 drivers/base/dd.c:831
    __device_attach_driver+0x10f/0x170 drivers/base/dd.c:959
    bus_for_each_drv+0xcf/0x120 drivers/base/bus.c:462
    __device_attach+0xf9/0x290 drivers/base/dd.c:1031
    bus_probe_device+0xcd/0xe0 drivers/base/bus.c:537
    device_add+0x983/0xc80 drivers/base/core.c:3689
    usb_set_configuration+0x961/0xc70 drivers/usb/core/message.c:2210
    usb_generic_driver_probe+0x83/0xd0 drivers/usb/core/generic.c:250

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


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

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

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

* Re: [syzbot] [media?] [usb?] memory leak in v4l2_ctrl_handler_init_class (2)
  2025-11-25  7:55 [syzbot] [media?] [usb?] memory leak in v4l2_ctrl_handler_init_class (2) syzbot
@ 2025-11-25 17:01 ` shaurya
  2025-11-25 20:38   ` syzbot
  2025-11-25 17:03 ` shaurya
  2025-11-25 20:21 ` shaurya
  2 siblings, 1 reply; 7+ messages in thread
From: shaurya @ 2025-11-25 17:01 UTC (permalink / raw)
  To: syzbot+a41b73dce23962a74c72
  Cc: linux-kernel, linux-media, linux-usb, syzkaller-bugs

#syz test:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master


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

* Re: [syzbot] [media?] [usb?] memory leak in v4l2_ctrl_handler_init_class (2)
  2025-11-25  7:55 [syzbot] [media?] [usb?] memory leak in v4l2_ctrl_handler_init_class (2) syzbot
  2025-11-25 17:01 ` shaurya
@ 2025-11-25 17:03 ` shaurya
  2025-11-25 21:09   ` syzbot
  2025-11-25 20:21 ` shaurya
  2 siblings, 1 reply; 7+ messages in thread
From: shaurya @ 2025-11-25 17:03 UTC (permalink / raw)
  To: syzbot+a41b73dce23962a74c72
  Cc: linux-kernel, linux-media, linux-usb, syzkaller-bugs

[-- Attachment #1: Type: text/plain, Size: 83 bytes --]

#syz test:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

[-- Attachment #2: 0001-media-radio-keene-fix-memory-leak-in-probe.patch --]
[-- Type: text/x-patch, Size: 1585 bytes --]

From 93e6a2f0b39e276db2181167f797e234fa8014a2 Mon Sep 17 00:00:00 2001
From: Shaurya Rane <ssrane_b23@ee.vjti.ac.in>
Date: Tue, 25 Nov 2025 22:24:29 +0530
Subject: [PATCH] media: radio-keene: fix memory leak in probe

The usb_keene_probe() function allocates memory for the v4l2 control
handler using v4l2_ctrl_handler_init(). However, if the probe fails
later (e.g. in v4l2_device_register() or video_register_device()),
this memory is never freed, leading to a leak.

Fix this by adding v4l2_ctrl_handler_free() to the error path.

Reported-by: syzbot+a41b73dce23962a74c72@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=a41b73dce23962a74c72
Fixes: 1bf20c3a0c61 ("[media] radio-keene: add a driver for the Keene FM Transmitter")
Signed-off-by: Shaurya Rane <ssrane_b23@ee.vjti.ac.in>
---
 drivers/media/radio/radio-keene.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/radio/radio-keene.c b/drivers/media/radio/radio-keene.c
index f3b57f0cb1ec..c133305fd019 100644
--- a/drivers/media/radio/radio-keene.c
+++ b/drivers/media/radio/radio-keene.c
@@ -338,7 +338,6 @@ static int usb_keene_probe(struct usb_interface *intf,
 	if (hdl->error) {
 		retval = hdl->error;
 
-		v4l2_ctrl_handler_free(hdl);
 		goto err_v4l2;
 	}
 	retval = v4l2_device_register(&intf->dev, &radio->v4l2_dev);
@@ -384,6 +383,7 @@ static int usb_keene_probe(struct usb_interface *intf,
 err_vdev:
 	v4l2_device_unregister(&radio->v4l2_dev);
 err_v4l2:
+	v4l2_ctrl_handler_free(&radio->hdl);
 	kfree(radio->buffer);
 	kfree(radio);
 err:
-- 
2.34.1


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

* Re: [syzbot] [media?] [usb?] memory leak in v4l2_ctrl_handler_init_class (2)
  2025-11-25  7:55 [syzbot] [media?] [usb?] memory leak in v4l2_ctrl_handler_init_class (2) syzbot
  2025-11-25 17:01 ` shaurya
  2025-11-25 17:03 ` shaurya
@ 2025-11-25 20:21 ` shaurya
  2025-11-25 21:29   ` syzbot
  2 siblings, 1 reply; 7+ messages in thread
From: shaurya @ 2025-11-25 20:21 UTC (permalink / raw)
  To: syzbot+a41b73dce23962a74c72
  Cc: linux-kernel, linux-media, linux-usb, syzkaller-bugs

[-- Attachment #1: Type: text/plain, Size: 82 bytes --]

#syz test:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

[-- Attachment #2: 0001-media-radio-keene-fix-memory-leak-in-error-path.patch --]
[-- Type: text/x-patch, Size: 1925 bytes --]

From 0b4eb46c6f9f4dbf9dc9d9b07a5bc8b5ece04b8d Mon Sep 17 00:00:00 2001
From: Shaurya Rane <ssrane_b23@ee.vjti.ac.in>
Date: Wed, 26 Nov 2025 01:47:41 +0530
Subject: [PATCH] media: radio-keene: fix memory leak in error path

Fix a memory leak in usb_keene_probe() when v4l2_device_register()
fails. The v4l2 control handler was initialized and controls were
added, but if v4l2_device_register() failed, the handler was never
freed, leaking the allocated memory for the handler buckets and
control structures.

Consolidate the error handling by adding an err_hdl label that
ensures v4l2_ctrl_handler_free() is called for all error paths
after the handler is initialized.

Reported-by: syzbot+a41b73dce23962a74c72@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=a41b73dce23962a74c72
Fixes: fc39f46b8e82 ("[media] radio-keene: add a driver for the Keene FM Transmitter")
Signed-off-by: Shaurya Rane <ssrane_b23@ee.vjti.ac.in>
---
 drivers/media/radio/radio-keene.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/media/radio/radio-keene.c b/drivers/media/radio/radio-keene.c
index f3b57f0cb1ec..84916b5ebcb2 100644
--- a/drivers/media/radio/radio-keene.c
+++ b/drivers/media/radio/radio-keene.c
@@ -337,14 +337,12 @@ static int usb_keene_probe(struct usb_interface *intf,
 	radio->stereo = true;
 	if (hdl->error) {
 		retval = hdl->error;
-
-		v4l2_ctrl_handler_free(hdl);
-		goto err_v4l2;
+		goto err_hdl;
 	}
 	retval = v4l2_device_register(&intf->dev, &radio->v4l2_dev);
 	if (retval < 0) {
 		dev_err(&intf->dev, "couldn't register v4l2_device\n");
-		goto err_v4l2;
+		goto err_hdl;
 	}
 
 	mutex_init(&radio->lock);
@@ -383,6 +381,8 @@ static int usb_keene_probe(struct usb_interface *intf,
 
 err_vdev:
 	v4l2_device_unregister(&radio->v4l2_dev);
+err_hdl:
+	v4l2_ctrl_handler_free(&radio->hdl);
 err_v4l2:
 	kfree(radio->buffer);
 	kfree(radio);
-- 
2.34.1


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

* Re: [syzbot] [media?] [usb?] memory leak in v4l2_ctrl_handler_init_class (2)
  2025-11-25 17:01 ` shaurya
@ 2025-11-25 20:38   ` syzbot
  0 siblings, 0 replies; 7+ messages in thread
From: syzbot @ 2025-11-25 20:38 UTC (permalink / raw)
  To: linux-kernel, linux-media, linux-usb, ssranevjti, syzkaller-bugs

Hello,

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

BUG: memory leak
unreferenced object 0xffff88812b84cfc0 (size 8):
  comm "kworker/0:7", pid 6710, jiffies 4294946048
  hex dump (first 8 bytes):
    40 fc ec 19 81 88 ff ff                          @.......
  backtrace (crc 82d035d3):
    kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
    slab_post_alloc_hook mm/slub.c:4983 [inline]
    slab_alloc_node mm/slub.c:5288 [inline]
    __do_kmalloc_node mm/slub.c:5649 [inline]
    __kvmalloc_node_noprof+0x51c/0x820 mm/slub.c:7112
    kvmalloc_array_node_noprof include/linux/slab.h:1122 [inline]
    v4l2_ctrl_handler_init_class+0x67/0x90 drivers/media/v4l2-core/v4l2-ctrls-core.c:1625
    usb_keene_probe+0xc4/0x450 drivers/media/radio/radio-keene.c:326
    usb_probe_interface+0x173/0x3f0 drivers/usb/core/driver.c:396
    call_driver_probe drivers/base/dd.c:581 [inline]
    really_probe+0x12f/0x430 drivers/base/dd.c:659
    __driver_probe_device+0xc3/0x1a0 drivers/base/dd.c:801
    driver_probe_device+0x2a/0x120 drivers/base/dd.c:831
    __device_attach_driver+0x10f/0x170 drivers/base/dd.c:959
    bus_for_each_drv+0xcf/0x120 drivers/base/bus.c:462
    __device_attach+0xf9/0x290 drivers/base/dd.c:1031
    bus_probe_device+0xcd/0xe0 drivers/base/bus.c:537
    device_add+0x983/0xc80 drivers/base/core.c:3689
    usb_set_configuration+0x961/0xc70 drivers/usb/core/message.c:2210
    usb_generic_driver_probe+0x83/0xd0 drivers/usb/core/generic.c:250
    usb_probe_device+0x7c/0x1d0 drivers/usb/core/driver.c:291
    call_driver_probe drivers/base/dd.c:581 [inline]
    really_probe+0x12f/0x430 drivers/base/dd.c:659

BUG: memory leak
unreferenced object 0xffff888119edee00 (size 256):
  comm "kworker/0:7", pid 6710, jiffies 4294946048
  hex dump (first 32 bytes):
    00 a0 ef 19 81 88 ff ff 00 ef ed 19 81 88 ff ff  ................
    10 ee ed 19 81 88 ff ff 10 ee ed 19 81 88 ff ff  ................
  backtrace (crc 3c002570):
    kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
    slab_post_alloc_hook mm/slub.c:4983 [inline]
    slab_alloc_node mm/slub.c:5288 [inline]
    __do_kmalloc_node mm/slub.c:5649 [inline]
    __kvmalloc_node_noprof+0x51c/0x820 mm/slub.c:7112
    v4l2_ctrl_new+0x2bf/0x1340 drivers/media/v4l2-core/v4l2-ctrls-core.c:2031
    v4l2_ctrl_new_std+0x122/0x180 drivers/media/v4l2-core/v4l2-ctrls-core.c:2185
    usb_keene_probe+0xe8/0x450 drivers/media/radio/radio-keene.c:327
    usb_probe_interface+0x173/0x3f0 drivers/usb/core/driver.c:396
    call_driver_probe drivers/base/dd.c:581 [inline]
    really_probe+0x12f/0x430 drivers/base/dd.c:659
    __driver_probe_device+0xc3/0x1a0 drivers/base/dd.c:801
    driver_probe_device+0x2a/0x120 drivers/base/dd.c:831
    __device_attach_driver+0x10f/0x170 drivers/base/dd.c:959
    bus_for_each_drv+0xcf/0x120 drivers/base/bus.c:462
    __device_attach+0xf9/0x290 drivers/base/dd.c:1031
    bus_probe_device+0xcd/0xe0 drivers/base/bus.c:537
    device_add+0x983/0xc80 drivers/base/core.c:3689
    usb_set_configuration+0x961/0xc70 drivers/usb/core/message.c:2210
    usb_generic_driver_probe+0x83/0xd0 drivers/usb/core/generic.c:250
    usb_probe_device+0x7c/0x1d0 drivers/usb/core/driver.c:291

BUG: memory leak
unreferenced object 0xffff888119edef00 (size 256):
  comm "kworker/0:7", pid 6710, jiffies 4294946048
  hex dump (first 32 bytes):
    00 ee ed 19 81 88 ff ff 30 fd 58 26 81 88 ff ff  ........0.X&....
    10 ef ed 19 81 88 ff ff 10 ef ed 19 81 88 ff ff  ................
  backtrace (crc 61944fdf):
    kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
    slab_post_alloc_hook mm/slub.c:4983 [inline]
    slab_alloc_node mm/slub.c:5288 [inline]
    __do_kmalloc_node mm/slub.c:5649 [inline]
    __kvmalloc_node_noprof+0x51c/0x820 mm/slub.c:7112
    v4l2_ctrl_new+0x2bf/0x1340 drivers/media/v4l2-core/v4l2-ctrls-core.c:2031
    v4l2_ctrl_new_std+0x122/0x180 drivers/media/v4l2-core/v4l2-ctrls-core.c:2185
    handler_new_ref+0x352/0x450 drivers/media/v4l2-core/v4l2-ctrls-core.c:1772
    v4l2_ctrl_new+0x67d/0x1340 drivers/media/v4l2-core/v4l2-ctrls-core.c:2114
    v4l2_ctrl_new_std+0x122/0x180 drivers/media/v4l2-core/v4l2-ctrls-core.c:2185
    usb_keene_probe+0xe8/0x450 drivers/media/radio/radio-keene.c:327
    usb_probe_interface+0x173/0x3f0 drivers/usb/core/driver.c:396
    call_driver_probe drivers/base/dd.c:581 [inline]
    really_probe+0x12f/0x430 drivers/base/dd.c:659
    __driver_probe_device+0xc3/0x1a0 drivers/base/dd.c:801
    driver_probe_device+0x2a/0x120 drivers/base/dd.c:831
    __device_attach_driver+0x10f/0x170 drivers/base/dd.c:959
    bus_for_each_drv+0xcf/0x120 drivers/base/bus.c:462
    __device_attach+0xf9/0x290 drivers/base/dd.c:1031
    bus_probe_device+0xcd/0xe0 drivers/base/bus.c:537
    device_add+0x983/0xc80 drivers/base/core.c:3689

BUG: memory leak
unreferenced object 0xffff888119ecfb40 (size 64):
  comm "kworker/0:7", pid 6710, jiffies 4294946048
  hex dump (first 32 bytes):
    80 fb ec 19 81 88 ff ff 40 fd 58 26 81 88 ff ff  ........@.X&....
    00 00 00 00 00 00 00 00 00 ef ed 19 81 88 ff ff  ................
  backtrace (crc 96c5954f):
    kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
    slab_post_alloc_hook mm/slub.c:4983 [inline]
    slab_alloc_node mm/slub.c:5288 [inline]
    __do_kmalloc_node mm/slub.c:5649 [inline]
    __kmalloc_noprof+0x3e3/0x6b0 mm/slub.c:5662
    kmalloc_noprof include/linux/slab.h:961 [inline]
    kzalloc_noprof include/linux/slab.h:1094 [inline]
    handler_new_ref+0xd7/0x450 drivers/media/v4l2-core/v4l2-ctrls-core.c:1780
    v4l2_ctrl_new+0x67d/0x1340 drivers/media/v4l2-core/v4l2-ctrls-core.c:2114
    v4l2_ctrl_new_std+0x122/0x180 drivers/media/v4l2-core/v4l2-ctrls-core.c:2185
    handler_new_ref+0x352/0x450 drivers/media/v4l2-core/v4l2-ctrls-core.c:1772
    v4l2_ctrl_new+0x67d/0x1340 drivers/media/v4l2-core/v4l2-ctrls-core.c:2114
    v4l2_ctrl_new_std+0x122/0x180 drivers/media/v4l2-core/v4l2-ctrls-core.c:2185
    usb_keene_probe+0xe8/0x450 drivers/media/radio/radio-keene.c:327
    usb_probe_interface+0x173/0x3f0 drivers/usb/core/driver.c:396
    call_driver_probe drivers/base/dd.c:581 [inline]
    really_probe+0x12f/0x430 drivers/base/dd.c:659
    __driver_probe_device+0xc3/0x1a0 drivers/base/dd.c:801
    driver_probe_device+0x2a/0x120 drivers/base/dd.c:831
    __device_attach_driver+0x10f/0x170 drivers/base/dd.c:959
    bus_for_each_drv+0xcf/0x120 drivers/base/bus.c:462
    __device_attach+0xf9/0x290 drivers/base/dd.c:1031
    bus_probe_device+0xcd/0xe0 drivers/base/bus.c:537

BUG: memory leak
unreferenced object 0xffff888119ecfb80 (size 64):
  comm "kworker/0:7", pid 6710, jiffies 4294946048
  hex dump (first 32 bytes):
    00 fb ec 19 81 88 ff ff 40 fb ec 19 81 88 ff ff  ........@.......
    40 fb ec 19 81 88 ff ff 00 ee ed 19 81 88 ff ff  @...............
  backtrace (crc ef37c6b5):
    kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
    slab_post_alloc_hook mm/slub.c:4983 [inline]
    slab_alloc_node mm/slub.c:5288 [inline]
    __do_kmalloc_node mm/slub.c:5649 [inline]
    __kmalloc_noprof+0x3e3/0x6b0 mm/slub.c:5662
    kmalloc_noprof include/linux/slab.h:961 [inline]
    kzalloc_noprof include/linux/slab.h:1094 [inline]
    handler_new_ref+0xd7/0x450 drivers/media/v4l2-core/v4l2-ctrls-core.c:1780
    v4l2_ctrl_new+0x67d/0x1340 drivers/media/v4l2-core/v4l2-ctrls-core.c:2114
    v4l2_ctrl_new_std+0x122/0x180 drivers/media/v4l2-core/v4l2-ctrls-core.c:2185
    usb_keene_probe+0xe8/0x450 drivers/media/radio/radio-keene.c:327
    usb_probe_interface+0x173/0x3f0 drivers/usb/core/driver.c:396
    call_driver_probe drivers/base/dd.c:581 [inline]
    really_probe+0x12f/0x430 drivers/base/dd.c:659
    __driver_probe_device+0xc3/0x1a0 drivers/base/dd.c:801
    driver_probe_device+0x2a/0x120 drivers/base/dd.c:831
    __device_attach_driver+0x10f/0x170 drivers/base/dd.c:959
    bus_for_each_drv+0xcf/0x120 drivers/base/bus.c:462
    __device_attach+0xf9/0x290 drivers/base/dd.c:1031
    bus_probe_device+0xcd/0xe0 drivers/base/bus.c:537
    device_add+0x983/0xc80 drivers/base/core.c:3689
    usb_set_configuration+0x961/0xc70 drivers/usb/core/message.c:2210
    usb_generic_driver_probe+0x83/0xd0 drivers/usb/core/generic.c:250

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


Tested on:

commit:         30f09200 Merge tag 'arm64-fixes' of git://git.kernel.o..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=17c4f8b4580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=f30cc590c4f6da44
dashboard link: https://syzkaller.appspot.com/bug?extid=a41b73dce23962a74c72
compiler:       gcc (Debian 12.2.0-14+deb12u1) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40

Note: no patches were applied.

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

* Re: [syzbot] [media?] [usb?] memory leak in v4l2_ctrl_handler_init_class (2)
  2025-11-25 17:03 ` shaurya
@ 2025-11-25 21:09   ` syzbot
  0 siblings, 0 replies; 7+ messages in thread
From: syzbot @ 2025-11-25 21:09 UTC (permalink / raw)
  To: linux-kernel, linux-media, linux-usb, ssranevjti, syzkaller-bugs

Hello,

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

Reported-by: syzbot+a41b73dce23962a74c72@syzkaller.appspotmail.com
Tested-by: syzbot+a41b73dce23962a74c72@syzkaller.appspotmail.com

Tested on:

commit:         30f09200 Merge tag 'arm64-fixes' of git://git.kernel.o..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=17d5cf42580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=f30cc590c4f6da44
dashboard link: https://syzkaller.appspot.com/bug?extid=a41b73dce23962a74c72
compiler:       gcc (Debian 12.2.0-14+deb12u1) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch:          https://syzkaller.appspot.com/x/patch.diff?x=164ea612580000

Note: testing is done by a robot and is best-effort only.

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

* Re: [syzbot] [media?] [usb?] memory leak in v4l2_ctrl_handler_init_class (2)
  2025-11-25 20:21 ` shaurya
@ 2025-11-25 21:29   ` syzbot
  0 siblings, 0 replies; 7+ messages in thread
From: syzbot @ 2025-11-25 21:29 UTC (permalink / raw)
  To: linux-kernel, linux-media, linux-usb, ssranevjti, syzkaller-bugs

Hello,

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

Reported-by: syzbot+a41b73dce23962a74c72@syzkaller.appspotmail.com
Tested-by: syzbot+a41b73dce23962a74c72@syzkaller.appspotmail.com

Tested on:

commit:         30f09200 Merge tag 'arm64-fixes' of git://git.kernel.o..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=16d25612580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=f30cc590c4f6da44
dashboard link: https://syzkaller.appspot.com/bug?extid=a41b73dce23962a74c72
compiler:       gcc (Debian 12.2.0-14+deb12u1) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch:          https://syzkaller.appspot.com/x/patch.diff?x=1099cf42580000

Note: testing is done by a robot and is best-effort only.

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

end of thread, other threads:[~2025-11-25 21:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-25  7:55 [syzbot] [media?] [usb?] memory leak in v4l2_ctrl_handler_init_class (2) syzbot
2025-11-25 17:01 ` shaurya
2025-11-25 20:38   ` syzbot
2025-11-25 17:03 ` shaurya
2025-11-25 21:09   ` syzbot
2025-11-25 20:21 ` shaurya
2025-11-25 21:29   ` syzbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).