mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
usb : dwc3: Initialize kernel stack variables properly
If kernel stack variables are not initialized properly, there is a chance of kernel information disclosure. So, initialize kernel stack variables with null characters. CRs-fixed: 2042592 Change-Id: I213c0e5c7f67824c2cecace276ff2f8f81599d51 Signed-off-by: Sai Krishna Juturi <jsaikrishna@codeaurora.org> Signed-off-by: Mayank Rana <mrana@codeaurora.org>
This commit is contained in:
parent
be60ad582c
commit
77094dbb1f
@ -320,7 +320,7 @@ static ssize_t dwc3_mode_write(struct file *file,
|
||||
struct seq_file *s = file->private_data;
|
||||
struct dwc3 *dwc = s->private;
|
||||
u32 mode = 0;
|
||||
char buf[32];
|
||||
char buf[32] = {};
|
||||
|
||||
if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count)))
|
||||
return -EFAULT;
|
||||
@ -397,7 +397,7 @@ static ssize_t dwc3_testmode_write(struct file *file,
|
||||
struct dwc3 *dwc = s->private;
|
||||
unsigned long flags;
|
||||
u32 testmode = 0;
|
||||
char buf[32];
|
||||
char buf[32] = {};
|
||||
|
||||
if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count)))
|
||||
return -EFAULT;
|
||||
@ -459,7 +459,7 @@ static ssize_t dwc3_link_state_write(struct file *file,
|
||||
struct dwc3 *dwc = s->private;
|
||||
unsigned long flags;
|
||||
enum dwc3_link_state state = 0;
|
||||
char buf[32];
|
||||
char buf[32] = {};
|
||||
|
||||
if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count)))
|
||||
return -EFAULT;
|
||||
|
Loading…
x
Reference in New Issue
Block a user