msm: kgsl: Do bounds checking on user supplied GPU addresses

Add bounds checking to kgsl_sharedmem_find_region to ensure that GPU
addresses supplied by the user via KGSL_IOCTL_SHAREMEM_FREE and
KGSL_IOCTL_CFF_SYNCMEM are within a valid range for the MMU scheme of
choice.

CRs-Fixed: 380296
Change-Id: Ic0dedbadf40fca4a9e04ba075e67e08e617806b5
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
diff --git a/drivers/gpu/msm/kgsl.c b/drivers/gpu/msm/kgsl.c
index c47bd87..278be99 100644
--- a/drivers/gpu/msm/kgsl.c
+++ b/drivers/gpu/msm/kgsl.c
@@ -897,6 +897,9 @@
 {
 	struct rb_node *node = private->mem_rb.rb_node;
 
+	if (!kgsl_mmu_gpuaddr_in_range(gpuaddr))
+		return NULL;
+
 	while (node != NULL) {
 		struct kgsl_mem_entry *entry;