Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a7f46c9c authored by Jeya R's avatar Jeya R Committed by Vamsi krishna Gattupalli
Browse files

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: default avatarJeya R <jeyr@codeaurora.org>
parent 70726f13
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -4498,6 +4498,11 @@ 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)));
	if (err)