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

Commit d129efd7 authored by Skylar Chang's avatar Skylar Chang Committed by Ravi Gummadidala
Browse files

msm: ipa: Add check for ipa_nat_mmap map limit



Add check for ipa_nat_mmap limit that allows mapping
from non ipa memory to user-space.

CRs-Fixed: 548676

Change-Id: If7f74d60342028f7653b39731b530bb13f09d991
Signed-off-by: default avatarSkylar Chang <chiaweic@codeaurora.org>
Signed-off-by: default avatarRavi Gummadidala <rgummadi@codeaurora.org>
parent 70979abc
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -79,6 +79,12 @@ static int ipa_nat_mmap(struct file *filp, struct vm_area_struct *vma)
	} else {
		IPADBG("Mapping shared(local) memory\n");
		IPADBG("map sz=0x%lx\n", vsize);

		if ((IPA_NAT_PHYS_MEM_SIZE == 0) ||
				(vsize > IPA_NAT_PHYS_MEM_SIZE)) {
			result = -EINVAL;
			goto bail;
		}
		phys_addr = ipa_ctx->ipa_wrapper_base + IPA_REG_BASE_OFST +
			IPA_SRAM_DIRECT_ACCESS_N_OFST(IPA_NAT_PHYS_MEM_OFFSET);