mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 15:49:17 -04:00
msm: vidc: add check to avoid out-of-buffer write
Possibility of dereferencing userspace ptr in kernel for invalid cmd. So added check to return error if unsupported cmd is given as input to ioctl. Change-Id: I3466fbd06e5b600f748824b9e16bcfdb4438bdef Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
This commit is contained in:
parent
8daa6110c7
commit
9fed96ca68
1 changed files with 6 additions and 0 deletions
|
|
@ -1343,6 +1343,12 @@ int msm_vidc_private(void *vidc_inst, unsigned int cmd,
|
|||
int rc = 0;
|
||||
struct msm_vidc_inst *inst = (struct msm_vidc_inst *)vidc_inst;
|
||||
|
||||
if (cmd != VIDIOC_VIDEO_CMD) {
|
||||
dprintk(VIDC_ERR,
|
||||
"%s: invalid private cmd %#x\n", __func__, cmd);
|
||||
return -ENOIOCTLCMD;
|
||||
}
|
||||
|
||||
if (!inst || !arg) {
|
||||
dprintk(VIDC_ERR, "%s: invalid args\n", __func__);
|
||||
return -EINVAL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue