From 51b8d2c499b884c09a4e05d7fade8f16bb1c30eb Mon Sep 17 00:00:00 2001 From: Shay Nachmani Date: Wed, 23 Nov 2016 12:04:29 +0200 Subject: [PATCH] msm: ion: Modified Secure Display buffer permissions Made Secure Display buffer permissions RO instead of RW. Change-Id: I617a3bb5cbb80ac3967ab14f37452c461bb4df77 Signed-off-by: Shay Nachmani --- drivers/staging/android/ion/ion_cma_heap.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/staging/android/ion/ion_cma_heap.c b/drivers/staging/android/ion/ion_cma_heap.c index b2e1a4c1b170..b5905fc81147 100644 --- a/drivers/staging/android/ion/ion_cma_heap.c +++ b/drivers/staging/android/ion/ion_cma_heap.c @@ -274,11 +274,16 @@ static int ion_secure_cma_allocate(struct ion_heap *heap, source_vm = VMID_HLOS; dest_vm = get_secure_vmid(flags); + if (dest_vm < 0) { pr_err("%s: Failed to get secure vmid\n", __func__); return -EINVAL; } - dest_perms = PERM_READ | PERM_WRITE; + + if (dest_vm == VMID_CP_SEC_DISPLAY) + dest_perms = PERM_READ; + else + dest_perms = PERM_READ | PERM_WRITE; ret = ion_cma_allocate(heap, buffer, len, align, flags); if (ret) {