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

Commit fa63766c authored by Rajesh Kemisetti's avatar Rajesh Kemisetti
Browse files

msm: kgsl: Check the size while working at SVM boundary



_get_unmapped_area_topdown() tries to generate a new GPU VA
using lower entry in the tree. Sometimes the newly requested
size can be more than the lower entry VA and leads to overflow.

Check the size against the lower entry VA and return NOMEM if
size is more.

Change-Id: I81a7db2b6f4a91e78de8489f8da07192443a8b85
Signed-off-by: default avatarRajesh Kemisetti <rajeshk@codeaurora.org>
parent 13d47110
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1705,7 +1705,7 @@ static uint64_t _get_unmapped_area_topdown(struct kgsl_pagetable *pagetable,
	}

	/* If we get here then there are no more entries in the region */
	if (((end - size) & mask) >= bottom)
	if ((end > size) && (((end - size) & mask) >= bottom))
		return (end - size) & mask;

	return (uint64_t) -ENOMEM;