From: Heinrich Schuchardt Date: Sun, 8 May 2016 21:20:59 +0000 (+0200) Subject: usb: gadget: avoid exposing kernel stack X-Git-Tag: firefly_0821_release~176^2~4^2~31^2~443 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=bbd7cf3d188c2cae5784703d767900c0a9740db7;p=firefly-linux-kernel-4.4.55.git usb: gadget: avoid exposing kernel stack commit ffeee83aa0461992e8a99a59db2df31933e60362 upstream. 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 Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c index 044ca79d3cb5..12628dd36e55 100644 --- a/drivers/usb/gadget/function/f_uac2.c +++ b/drivers/usb/gadget/function/f_uac2.c @@ -1291,6 +1291,7 @@ in_rq_cur(struct usb_function *fn, const struct usb_ctrlrequest *cr) if (control_selector == UAC2_CS_CONTROL_SAM_FREQ) { struct cntrl_cur_lay3 c; + memset(&c, 0, sizeof(struct cntrl_cur_lay3)); if (entity_id == USB_IN_CLK_ID) c.dCUR = p_srate;