msm: kgsl: Prevent wrap around during user address mapping

When setting svm region during the gpuobj import ioctl call for a usermem
address, there is a possibility of a very large input size causing the
region's 64-bit end address to wrap around. This can cause the region
to incorrectly be considered valid, ultimately allowing a use after free
scenario. To prevent this, detect the occurrence of a wrap and reject the
import.

Issue: FP3SEC-1210
Change-Id: I4a88f56c58b830d4342e47dc1d1f6290c78ab6b4
Signed-off-by: Mohammed Mirza Mandayappurath Manzoor <quic_mmandaya@quicinc.com>
Signed-off-by: Sanjay Yadav <quic_sanjyada@quicinc.com>
(cherry picked from commit 89a22de4beb805fb3a4d0ed796078a5d45c02784)
(cherry picked from commit 8c567d2d4e6646da0fd3da8277dd311e245c9351)
1 file changed