msm: kgsl: Limit the syncpoint count for AUX commands

KGSL internally has a limit on the length of the list of syncpoints
submitted in a single AUX command. Enforce this limit so we don't
overwrite memory beyond the structures that track these syncpoints.

Change-Id: I261bfd4f786ff7e4fbe07e8bca9e9b8d8b87c950
Signed-off-by: Lynus Vaz <quic_lvaz@quicinc.com>
Signed-off-by: Kaushal Sanadhya <quic_ksanadhy@quicinc.com>
(cherry picked from commit 7779997686)
This commit is contained in:
Kaushal Sanadhya 2023-09-15 11:35:16 +05:30 • committed by Surapusetty Naresh Babu
commit d213829600

View file

@ -2038,6 +2038,10 @@ long kgsl_ioctl_gpu_aux_command(struct kgsl_device_private *dev_priv,
(KGSL_GPU_AUX_COMMAND_TIMELINE)))
return -EINVAL;
if ((param->flags & KGSL_GPU_AUX_COMMAND_SYNC) &&
(param->numsyncs > KGSL_MAX_SYNCPOINTS))
return -EINVAL;
context = kgsl_context_get_owner(dev_priv, param->context_id);
if (!context)
return -EINVAL;