Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: gadget: avoid exposing kernel stack

Function in_rq_cur copies random bytes from the stack.
Zero the memory instead.

Fixes: 132fcb460839 ("usb: gadget: Add Audio Class 2.0 Driver")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>

authored by

Heinrich Schuchardt and committed by
Felipe Balbi
ffeee83a 23e34392

+1
+1
drivers/usb/gadget/function/f_uac2.c
··· 1280 1280 1281 1281 if (control_selector == UAC2_CS_CONTROL_SAM_FREQ) { 1282 1282 struct cntrl_cur_lay3 c; 1283 + memset(&c, 0, sizeof(struct cntrl_cur_lay3)); 1283 1284 1284 1285 if (entity_id == USB_IN_CLK_ID) 1285 1286 c.dCUR = p_srate;