Skip to contentSkip to conversation

drm/xe/vm: Add missing pad and extensions check

PATCH Superseded Jonathan Cavitt 2 participants 2 messages Mar 31

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/xe/vm: Add missing pad and extensions check

Add missing pad and extensions check to xe_vm_get_property_ioctl

Fixes 50c577eab051 ("drm/xe/xe_vm: Implement xe_vm_get_property_ioctl")
---
 drivers/gpu/drm/xe/xe_vm.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/xe/xe_vm.c +3 -0
index 56e2db50bb36..03f129927b0f 100644
@@ -4159,6 +4159,9 @@ int xe_vm_get_property_ioctl(struct drm_device *drm, void *data,
 			      args->reserved[2])))
 		return -EINVAL;
 
+	if (XE_IOCTL_DBG(xe, args->pad || args->extensions))
+		return -EINVAL;
+
 	vm = xe_vm_lookup(xef, args->vm_id);
 	if (XE_IOCTL_DBG(xe, !vm))
 		return -ENOENT;
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Jonathan Cavitt

Add missing pad and extensions check to xe_vm_get_property_ioctl

Fixes 50c577eab051 ("drm/xe/xe_vm: Implement xe_vm_get_property_ioctl")

Would it make sense to combine this with the other reserved checks?

Either way:

Quoted 18 lines
---
  drivers/gpu/drm/xe/xe_vm.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/gpu/drm/xe/xe_vm.c +3 -0
index 56e2db50bb36..03f129927b0f 100644
@@ -4159,6 +4159,9 @@ int xe_vm_get_property_ioctl(struct drm_device *drm, void *data,
  			      args->reserved[2])))
  		return -EINVAL;
 
+	if (XE_IOCTL_DBG(xe, args->pad || args->extensions))
+		return -EINVAL;
+
  	vm = xe_vm_lookup(xef, args->vm_id);
  	if (XE_IOCTL_DBG(xe, !vm))
  		return -ENOENT;