* [syzbot] [usb?] memory leak in f_uac2_opts_p_srate_store
@ 2026-08-02 19:33 syzbot
2026-08-03 1:15 ` Forwarded: [PATCH] usb: gadget: f_uac2: Fix memory leak in srate parsing syzbot
0 siblings, 1 reply; 2+ messages in thread
From: syzbot @ 2026-08-02 19:33 UTC (permalink / raw)
To: gregkh, linux-kernel, linux-usb, syzkaller-bugs
Hello,
syzbot found the following issue on:
HEAD commit: fc02acf6ac0c Merge tag 'platform-drivers-x86-v7.2-4' of gi..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=11b3a49e580000
kernel config: https://syzkaller.appspot.com/x/.config?x=ba7c2d1679fb08a2
dashboard link: https://syzkaller.appspot.com/bug?extid=87c10526d2cfa8d14ff6
compiler: gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=148cd1b9580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=141f38c6580000
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/b9d1b7c8f45c/disk-fc02acf6.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/a68eafefb074/vmlinux-fc02acf6.xz
kernel image: https://storage.googleapis.com/syzbot-assets/89c624fcb62b/bzImage-fc02acf6.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+87c10526d2cfa8d14ff6@syzkaller.appspotmail.com
2026/07/29 19:24:36 executed programs: 7
BUG: memory leak
unreferenced object 0xffff888112f1fd80 (size 64):
comm "syz.0.21", pid 5964, jiffies 4294942888
hex dump (first 32 bytes):
34 34 31 30 30 00 34 38 30 30 30 00 38 38 32 30 44100.48000.8820
30 00 39 36 30 30 30 00 31 37 36 34 30 30 00 31 0.96000.176400.1
backtrace (crc 6cdecf20):
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]
__do_kmalloc_node mm/slub.c:5333 [inline]
__kmalloc_node_track_caller_noprof+0x3d3/0x570 mm/slub.c:5471
__kmemdup_nul mm/util.c:64 [inline]
kstrdup+0x3c/0x80 mm/util.c:84
f_uac2_opts_p_srate_store+0xbb/0x170 drivers/usb/gadget/function/f_uac2.c:2087
flush_write_buffer fs/configfs/file.c:207 [inline]
configfs_write_iter+0x10d/0x1a0 fs/configfs/file.c:229
new_sync_write fs/read_write.c:595 [inline]
vfs_write+0x3ac/0x720 fs/read_write.c:687
ksys_write+0xa5/0x170 fs/read_write.c:739
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xf8/0x610 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
BUG: memory leak
unreferenced object 0xffff888113454dc0 (size 64):
comm "syz.0.23", pid 5967, jiffies 4294943452
hex dump (first 32 bytes):
34 34 31 30 30 00 34 38 30 30 30 00 38 38 32 30 44100.48000.8820
30 00 39 36 30 30 30 00 31 37 36 34 30 30 00 31 0.96000.176400.1
backtrace (crc 6cdecf20):
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]
__do_kmalloc_node mm/slub.c:5333 [inline]
__kmalloc_node_track_caller_noprof+0x3d3/0x570 mm/slub.c:5471
__kmemdup_nul mm/util.c:64 [inline]
kstrdup+0x3c/0x80 mm/util.c:84
f_uac2_opts_p_srate_store+0xbb/0x170 drivers/usb/gadget/function/f_uac2.c:2087
flush_write_buffer fs/configfs/file.c:207 [inline]
configfs_write_iter+0x10d/0x1a0 fs/configfs/file.c:229
new_sync_write fs/read_write.c:595 [inline]
vfs_write+0x3ac/0x720 fs/read_write.c:687
ksys_write+0xa5/0x170 fs/read_write.c:739
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xf8/0x610 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
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] 2+ messages in thread
* Forwarded: [PATCH] usb: gadget: f_uac2: Fix memory leak in srate parsing
2026-08-02 19:33 [syzbot] [usb?] memory leak in f_uac2_opts_p_srate_store syzbot
@ 2026-08-03 1:15 ` syzbot
0 siblings, 0 replies; 2+ messages in thread
From: syzbot @ 2026-08-03 1:15 UTC (permalink / raw)
To: linux-kernel
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.
***
Subject: [PATCH] usb: gadget: f_uac2: Fix memory leak in srate parsing
Author: ryan.mehri1@gmail.com
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git fc02acf6ac0c
Signed-off-by: Ryan Mehri <ryan.mehri1@gmail.com>
---
drivers/usb/gadget/function/f_uac2.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c
index 897787d0803c..5d6701019e10 100644
--- a/drivers/usb/gadget/function/f_uac2.c
+++ b/drivers/usb/gadget/function/f_uac2.c
@@ -2013,6 +2013,7 @@ static ssize_t f_uac2_opts_##name##_store(struct config_item *item, \
{ \
struct f_uac2_opts *opts = to_f_uac2_opts(item); \
char *split_page = NULL; \
+ char *p = NULL; \
int ret = -EINVAL; \
char *token; \
u32 num; \
@@ -2026,8 +2027,8 @@ static ssize_t f_uac2_opts_##name##_store(struct config_item *item, \
\
i = 0; \
memset(opts->name##s, 0x00, sizeof(opts->name##s)); \
- split_page = kstrdup(page, GFP_KERNEL); \
- while ((token = strsep(&split_page, ",")) != NULL) { \
+ split_page = p = kstrdup(page, GFP_KERNEL); \
+ while ((token = strsep(&p, ",")) != NULL) { \
ret = kstrtou32(token, 0, &num); \
if (ret) \
goto end; \
--
2.55.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-03 1:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-02 19:33 [syzbot] [usb?] memory leak in f_uac2_opts_p_srate_store syzbot
2026-08-03 1:15 ` Forwarded: [PATCH] usb: gadget: f_uac2: Fix memory leak in srate parsing syzbot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.