Linux USB
 help / color / mirror / Atom feed
* [PATCH 0/2] usb: gadget: f_uac1/f_uac2: fix invalid-free in srate configfs store
@ 2026-08-04 17:43 Anuj Bolewar via B4 Relay
  2026-08-04 17:43 ` [PATCH 1/2] usb: gadget: f_uac2: " Anuj Bolewar via B4 Relay
  2026-08-04 17:43 ` [PATCH 2/2] usb: gadget: f_uac1: " Anuj Bolewar via B4 Relay
  0 siblings, 2 replies; 4+ messages in thread
From: Anuj Bolewar via B4 Relay @ 2026-08-04 17:43 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-usb, linux-kernel, Anuj Bolewar,
	syzbot+38bab69d2760cc99cfbe, syzbot+a4f65284f1451010b0a8,
	syzbot+2532c7901f590afd0c3a

The p_srate/c_srate configfs store helpers in f_uac1 and f_uac2 free
the strsep()-advanced split_page pointer instead of the buffer returned
by kstrdup(). When a non-numeric token appears in the first position,
kstrtou32() fails and kfree() releases a pointer into the middle of the
slab object, which KASAN reports as invalid-free.

Keep the original kstrdup() pointer and free that instead. This fixes
the syzbot reports for f_uac2_opts_p_srate_store,
f_uac2_opts_c_srate_store and f_uac1_opts_c_srate_store.

Signed-off-by: Anuj Bolewar <bolewara@gmail.com>
---
Anuj Bolewar (2):
      usb: gadget: f_uac2: fix invalid-free in srate configfs store
      usb: gadget: f_uac1: fix invalid-free in srate configfs store

 drivers/usb/gadget/function/f_uac1.c | 5 +++--
 drivers/usb/gadget/function/f_uac2.c | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)
---
base-commit: 2d2338c93da79b3bfe4b6099a931d9468d539952
change-id: 20260804-f-uac-srate-invalid-free-827cf8840137

Best regards,
--  
Anuj Bolewar <bolewara@gmail.com>



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

end of thread, other threads:[~2026-11-20  9:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-04 17:43 [PATCH 0/2] usb: gadget: f_uac1/f_uac2: fix invalid-free in srate configfs store Anuj Bolewar via B4 Relay
2026-08-04 17:43 ` [PATCH 1/2] usb: gadget: f_uac2: " Anuj Bolewar via B4 Relay
2026-11-20  9:51   ` Greg Kroah-Hartman
2026-08-04 17:43 ` [PATCH 2/2] usb: gadget: f_uac1: " Anuj Bolewar via B4 Relay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox