AMD General

Reviewed-by: Kent Russell <[email protected]>



> -----Original Message-----
> From: amd-gfx <[email protected]> On Behalf Of David
> Francis
> Sent: July 21, 2026 9:38 AM
> To: [email protected]
> Cc: Francis, David <[email protected]>
> Subject: [PATCH] drm/amdkfd: Handle invalid event type in CRIU event restore
>
> In kfd_criu_restore_event, there was no handling for
> the event priv data having an invalid event type. The priv
> data here is untrusted and can be invalid.
>
> In that case, fail with EINVAL.
>
> Signed-off-by: David Francis <[email protected]>
> ---
>  drivers/gpu/drm/amd/amdkfd/kfd_events.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_events.c
> b/drivers/gpu/drm/amd/amdkfd/kfd_events.c
> index f5fd78f0df7d..9e0f57cfa3bf 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_events.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_events.c
> @@ -452,6 +452,9 @@ int kfd_criu_restore_event(struct file *devkfd,
>
>               ret = create_other_event(p, ev, &ev_priv->event_id);
>               break;
> +     default:
> +             ret = -EINVAL;
> +             break;
>       }
>       mutex_unlock(&p->event_mutex);
>
> --
> 2.34.1

Reply via email to