mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 22:40:54 -04:00
msm: kgsl: Remove VM_MAYWRITE flag to restrict mprotect
When VM_MAYWRITE flag is used during mmap(), mprotect() can be used later to change the protection of memstore to allow write. Make sure this does not happen by removing VM_MAYWRITE from the vm_flags of vma. Change-Id: I6f69f05858ea40611d512cfa796caabeaa88cdb5 Signed-off-by: Indira Biruduraju <ibirudur@codeaurora.org>
This commit is contained in:
parent
b490abfe54
commit
af6de62c2f
1 changed files with 2 additions and 0 deletions
|
|
@ -4301,6 +4301,8 @@ kgsl_mmap_memstore(struct file *file, struct kgsl_device *device,
|
|||
if (vma->vm_flags & VM_WRITE)
|
||||
return -EPERM;
|
||||
|
||||
vma->vm_flags &= ~VM_MAYWRITE;
|
||||
|
||||
if (memdesc->size != vma_size) {
|
||||
dev_err(device->dev, "Cannot partially map the memstore\n");
|
||||
return -EINVAL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue