aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEkansh Gupta <[email protected]>2023-05-23 16:25:48 +0100
committerGreg Kroah-Hartman <[email protected]>2023-05-29 15:09:50 +0100
commit3c7d0079a1831118ef232bd9c2f34d058a1f31c2 (patch)
tree53cd6948ff3955f0dadf35e7beb02758834f6211
parenta6e766dea0a22918735176e4af862d535962f11e (diff)
misc: fastrpc: Reassign memory ownership only for remote heap
The userspace map request for remote heap allocates CMA memory. The ownership of this memory needs to be reassigned to proper owners to allow access from the protection domain running on DSP. This reassigning of ownership is not correct if done for any other supported flags. When any other flag is requested from userspace, fastrpc is trying to reassign the ownership of memory and this reassignment is getting skipped for remote heap request which is incorrect. Add proper flag check to reassign the memory only if remote heap is requested. Fixes: 532ad70c6d44 ("misc: fastrpc: Add mmap request assigning for static PD pool") Cc: stable <[email protected]> Tested-by: Ekansh Gupta <[email protected]> Signed-off-by: Ekansh Gupta <[email protected]> Reviewed-by: Srinivas Kandagatla <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r--drivers/misc/fastrpc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
index 32a5415624bf..a654dc416480 100644
--- a/drivers/misc/fastrpc.c
+++ b/drivers/misc/fastrpc.c
@@ -1904,7 +1904,7 @@ static int fastrpc_req_mmap(struct fastrpc_user *fl, char __user *argp)
req.vaddrout = rsp_msg.vaddr;
/* Add memory to static PD pool, protection thru hypervisor */
- if (req.flags != ADSP_MMAP_REMOTE_HEAP_ADDR && fl->cctx->vmcount) {
+ if (req.flags == ADSP_MMAP_REMOTE_HEAP_ADDR && fl->cctx->vmcount) {
struct qcom_scm_vmperm perm;
perm.vmid = QCOM_SCM_VMID_HLOS;