RE: [PATCH] drm/amdkfd: Handle invalid event type in CRIU event restore

"Russell, Kent" <[email protected]>
Newsgroups org.freedesktop.lists.amd-gfx
Message-ID <BL1PR12MB589874896FE87FE0AF19A35D85C22@BL1PR12MB5898.namprd12.prod.outlook.com>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.