[PATCH] drm/amdgpu: Validate VM ioctl flags.

Alex Deucher alexdeucher at gmail.com
Mon May 15 21:39:08 UTC 2023


Applied.  Thanks!

Alex

On Sat, May 13, 2023 at 8:54 AM Bas Nieuwenhuizen
<bas at basnieuwenhuizen.nl> wrote:
>
> None have been defined yet, so reject anybody setting any. Mesa sets
> it to 0 anyway.
>
> Signed-off-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index 158176b2f47e..62922a795312 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -2442,6 +2442,10 @@ int amdgpu_vm_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
>         struct amdgpu_fpriv *fpriv = filp->driver_priv;
>         int r;
>
> +       /* No valid flags defined yet */
> +       if (args->in.flags)
> +               return -EINVAL;
> +
>         switch (args->in.op) {
>         case AMDGPU_VM_OP_RESERVE_VMID:
>                 /* We only have requirement to reserve vmid from gfxhub */
> --
> 2.40.1
>


More information about the amd-gfx mailing list