summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2016-05-08 23:20:59 +0200
committerFelipe Balbi <felipe.balbi@linux.intel.com>2016-05-31 10:24:30 +0200
commitffeee83aa0461992e8a99a59db2df31933e60362 (patch)
treecb183e66b9891adc3bc17c473d204affdda13956 /drivers/usb/gadget
parentusb: dwc2: fix regression on big-endian PowerPC/ARM systems (diff)
downloadlinux-ffeee83aa0461992e8a99a59db2df31933e60362.tar.xz
linux-ffeee83aa0461992e8a99a59db2df31933e60362.zip
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>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/function/f_uac2.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c
index 1c81dd3b0cd4..cd214ec8a601 100644
--- a/drivers/usb/gadget/function/f_uac2.c
+++ b/drivers/usb/gadget/function/f_uac2.c
@@ -1280,6 +1280,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;