mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-09-06 09:33:15 +00:00
36 lines
1.2 KiB
Diff
36 lines
1.2 KiB
Diff
From f2a3f5e63e15e97a66e8f5a300457378bcb89d9c Mon Sep 17 00:00:00 2001
|
|
From: Deepak Verma <dverma@codeaurora.org>
|
|
Date: Mon, 21 Oct 2013 17:37:11 +0530
|
|
Subject: 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>
|
|
---
|
|
drivers/video/msm/vidc/common/enc/venc.c | 6 ++++++
|
|
1 file changed, 6 insertions(+)
|
|
|
|
diff --git a/drivers/video/msm/vidc/common/enc/venc.c b/drivers/video/msm/vidc/common/enc/venc.c
|
|
index 1801461..707d948 100644
|
|
--- a/drivers/video/msm/vidc/common/enc/venc.c
|
|
+++ b/drivers/video/msm/vidc/common/enc/venc.c
|
|
@@ -1414,6 +1414,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) {
|
|
--
|
|
cgit v1.1
|
|
|