msm: kgsl: Avoid cache ops on secure memory

There is no check before cache ops if the memory is marked secure.
This leads to stage 2 pagefault if a secure memory is passed to
IOCTL_KGSL_GPUMEM_SYNC_CACHE ioctl because kernel is not allowed to
do cache ops on secure memory. This can be avoided by returning
success immediately if the memory is marked as secure.

Change-Id: I215d77d2a488cdb00e8e18cfd38cddd9632fd9f6
Signed-off-by: Akhil P Oommen <akhilpo@codeaurora.org>
This commit is contained in:
Akhil P Oommen 2017-06-21 12:54:18 +05:30 committed by Akhil P Oommen
parent bd20893138
commit 7ec8ae11d9

View file

@ -2742,6 +2742,10 @@ static int _kgsl_gpumem_sync_cache(struct kgsl_mem_entry *entry,
int cacheop;
int mode;
/* Cache ops are not allowed on secure memory */
if (entry->memdesc.flags & KGSL_MEMFLAGS_SECURE)
return 0;
/*
* Flush is defined as (clean | invalidate). If both bits are set, then
* do a flush, otherwise check for the individual bits and clean or inv