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

Commit 926e9ca3 authored by Shrenuj Bansal's avatar Shrenuj Bansal
Browse files

msm: kgsl: Do not allow CPU mappings of secure buffers



We should not be mapping secure buffers into the CPU pagetables
since these buffers should only be accessed by the GPU in secure
mode. If the userspace does try to access this buffer, that will
trigger a stage 2 page fault and crash the device.

Change-Id: I4464a0a4edbc33df155b6c4103e77fc81d02e84a
Signed-off-by: default avatarShrenuj Bansal <shrenujb@codeaurora.org>
parent 47e9d4bb
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -3608,6 +3608,13 @@ kgsl_get_unmapped_area(struct file *file, unsigned long addr,
	ret = arch_mmap_check(addr, len, flags);
	if (ret)
		goto put;

	/* Do not allow CPU mappings for secure buffers */
	if (kgsl_memdesc_is_secured(&entry->memdesc)) {
		ret = -EPERM;
		goto put;
	}

	/*
	 * If we're not going to use CPU map feature, get an ordinary mapping
	 * with nothing more to be done.