From 8cd973ded314285f842f4729292ea2aee5626c11 Mon Sep 17 00:00:00 2001 From: jsg Date: Thu, 6 Jul 2023 04:18:04 +0000 Subject: [PATCH] drm/amdgpu: Validate VM ioctl flags. From Bas Nieuwenhuizen 9d0b2afadfd71e9bedd593358bd7ac4701e46477 in linux-6.1.y/6.1.38 a2b308044dcaca8d3e580959a4f867a1d5c37fac in mainline linux --- sys/dev/pci/drm/amd/amdgpu/amdgpu_vm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_vm.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_vm.c index a1c8f2dc239..d3a369f6c19 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_vm.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_vm.c @@ -2436,6 +2436,10 @@ int amdgpu_vm_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) long timeout = msecs_to_jiffies(2000); 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.20.1