mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 15:11:48 -04:00
disp: msm: add length check for debugfs_ctrl
Add check for length of debugfs_ctrl value before copying to user buffer invoked during read operation. Change-Id: I199110992921d0ae3791129fa0bf1e51dcca9107 Signed-off-by: Prashant Singh <prasin@codeaurora.org>
This commit is contained in:
parent
06f8bcc142
commit
4145770b07
1 changed files with 3 additions and 0 deletions
|
|
@ -3675,6 +3675,9 @@ static ssize_t sde_dbg_ctrl_read(struct file *file, char __user *buff,
|
|||
pr_debug("%s: ctrl:0x%x len:0x%zx\n",
|
||||
__func__, sde_dbg_base.debugfs_ctrl, len);
|
||||
|
||||
if (len < 0 || len >= sizeof(buf))
|
||||
return 0;
|
||||
|
||||
if ((count < sizeof(buf)) || copy_to_user(buff, buf, len)) {
|
||||
pr_err("error copying the buffer! count:0x%zx\n", count);
|
||||
return -EFAULT;
|
||||
|
|
|
|||
Loading…
Reference in a new issue