mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 05:39:54 -04:00
msm:ADSPRPC :Fix to avoid Use after free in fastrpc_internal_munmap
Added a check to validate map before freeing it to avoid Use after free scenario. Change-Id: I484391ff7c55c0689530a928a2821ee5a1a0e10c Signed-off-by: Jeya R <jeyr@codeaurora.org>
This commit is contained in:
parent
70726f1312
commit
a7f46c9cb7
1 changed files with 6 additions and 1 deletions
|
|
@ -4498,8 +4498,13 @@ static int fastrpc_internal_munmap(struct fastrpc_file *fl,
|
|||
mutex_unlock(&fl->map_mutex);
|
||||
if (err)
|
||||
goto bail;
|
||||
VERIFY(err, map != NULL);
|
||||
if (err) {
|
||||
err = -EINVAL;
|
||||
goto bail;
|
||||
}
|
||||
VERIFY(err, !(err = fastrpc_munmap_on_dsp(fl, map->raddr,
|
||||
map->phys, map->size, map->flags)));
|
||||
map->phys, map->size, map->flags)));
|
||||
if (err)
|
||||
goto bail;
|
||||
mutex_lock(&fl->map_mutex);
|
||||
|
|
|
|||
Loading…
Reference in a new issue