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

Commit 4e87ecb1 authored by Vamsi krishna Gattupalli's avatar 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 avatarVamsi krishna Gattupalli <vgattupa@codeaurora.org>
parent 1ece9bbc
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -2755,6 +2755,11 @@ static int fastrpc_internal_munmap(struct fastrpc_file *fl,
	mutex_unlock(&fl->fl_map_mutex);
	if (err)
		goto bail;
	VERIFY(err, map != NULL);
	if (err) {
		err = -EINVAL;
		goto bail;
	}
	VERIFY(err, !fastrpc_munmap_on_dsp(fl, map->raddr,
			map->phys, map->size, map->flags));
	if (err)