mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
msm: vidc: Validate userspace buffer count before using it
Validate the number of buffers count variable before using it to avoid structure overflow error. Bug: 28598501 Change-Id: I61582c93e0f26ec6842e437134fb8a42bdbc36ff CRs-fixed: 563654 Signed-off-by: Pachika, Vikas Reddy <vpachi@codeaurora.org>
This commit is contained in:
parent
37836aa8ad
commit
26eed7f7a2
1 changed files with 6 additions and 0 deletions
|
@ -919,6 +919,12 @@ static u32 vid_dec_set_meta_buffers(struct video_client_ctx *client_ctx,
|
|||
vcd_meta_buffer->offset = meta_buffers->offset;
|
||||
vcd_meta_buffer->pmem_fd_iommu = meta_buffers->pmem_fd_iommu;
|
||||
|
||||
if (meta_buffers->count > MAX_META_BUFFERS) {
|
||||
ERR("meta buffers maximum count reached, count = %d",
|
||||
meta_buffers->count);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!vcd_get_ion_status()) {
|
||||
if (get_pmem_file(vcd_meta_buffer->pmem_fd,
|
||||
(unsigned long *) (&(vcd_meta_buffer->
|
||||
|
|
Loading…
Reference in a new issue