msm: vidc: Check validity of userspace address

Before writing to a userspace address, verification
of the validity of user space address is required.

Change-Id: I9141e44a6c11aaf3f4d57c08bb0dd26a7b214f34
CRs-fixed: 556356
Signed-off-by: Deepak Verma <dverma@codeaurora.org>
CVE-2014-9880
Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
This commit is contained in:
Deepak Verma
2019-08-06 11:48:11 +02:00
committed by Francescodario Cuzzocrea
parent 9a43043d8b
commit 9019555798
+6
View File
@@ -1422,6 +1422,12 @@ static long vid_enc_ioctl(struct file *file,
return -EFAULT;
DBG("VEN_IOCTL_GET_SEQUENCE_HDR\n");
if (!access_ok(VERIFY_WRITE, seq_header.hdrbufptr,
seq_header.bufsize)) {
ERR("VEN_IOCTL_GET_SEQUENCE_HDR:"\
" Userspace address verification failed.\n");
return -EFAULT;
}
result = vid_enc_get_sequence_header(client_ctx,
&seq_header);
if (!result) {