mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 15:49:17 -04:00
msm: vidc: ensure the validity of video buffer access
During subsystem failure, the cause for failure is updated
in a specific video buffer by the video firmware. Video
firmware can even update the size of that specific buffer.
To ensure the validity of that buffer access, check if
the access is within the allocated size.
CRs-Fixed: 2585811
Change-Id: I30b8bf2e9ba3699d229f4acc104f46566fcb60fa
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
This commit is contained in:
parent
a263740664
commit
720369dfcf
1 changed files with 5 additions and 0 deletions
|
|
@ -2519,6 +2519,11 @@ static void print_sfr_message(struct venus_hfi_device *device)
|
|||
|
||||
vsfr = (struct hfi_sfr_struct *)device->sfr.align_virtual_addr;
|
||||
if (vsfr) {
|
||||
if (vsfr->bufSize != device->sfr.mem_size) {
|
||||
d_vpr_e("Invalid SFR buf size %d actual %d\n",
|
||||
vsfr->bufSize, device->sfr.mem_size);
|
||||
return;
|
||||
}
|
||||
vsfr_size = vsfr->bufSize - sizeof(u32);
|
||||
p = memchr(vsfr->rg_data, '\0', vsfr_size);
|
||||
/* SFR isn't guaranteed to be NULL terminated */
|
||||
|
|
|
|||
Loading…
Reference in a new issue