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

Commit 04c2a7a2 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "adsprpc: validate VMID before hyp_assign during unmap"

parents 50514267 48be0c64
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -2041,13 +2041,16 @@ static int fastrpc_munmap_on_dsp_rh(struct fastrpc_file *fl,
		err = scm_call2(SCM_SIP_FNID(SCM_SVC_PIL,
			TZ_PIL_CLEAR_PROTECT_MEM_SUBSYS_ID), &desc);
	} else if (map->flags == ADSP_MMAP_REMOTE_HEAP_ADDR) {
		VERIFY(err, !hyp_assign_phys(map->phys, (uint64_t)map->size,
		if (me->channel[fl->cid].rhvm.vmid) {
			VERIFY(err, !hyp_assign_phys(map->phys,
					(uint64_t)map->size,
					me->channel[fl->cid].rhvm.vmid,
					me->channel[fl->cid].rhvm.vmcount,
					destVM, destVMperm, 1));
			if (err)
				goto bail;
		}
	}

bail:
	return err;