Skip to contentSkip to conversation

drm/i915: Correctly reject invalid flags for wait_ioctl

PATCH In review Daniel Vetter 3 participants 4 messages Sep 29, 2014 – Oct 23, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: Correctly reject invalid flags for wait_ioctl

Not having checks for this isn't good.

I've checked igt and libdrm and they all already clear flags properly. So we're lucky and should be able to sneak this ABI clarification in.

Testcase: igt/gem_wait/invalid-flags

---
 drivers/gpu/drm/i915/i915_gem.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/i915_gem.c +3 -0
index 2fb87cfa5b82..6891522c5d3b 100644
@@ -2811,6 +2811,9 @@ i915_gem_wait_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
 	u32 seqno = 0;
 	int ret = 0;
 
+	if (args->flags != 0)
+		return -EINVAL;
+
 	ret = i915_mutex_lock_interruptible(dev);
 	if (ret)
 		return ret;
Signature · 1 line
1.9.3
#1 lore raw
Quoted 7 lines · Daniel Vetter

Not having checks for this isn't good.

I've checked igt and libdrm and they all already clear flags properly. So we're lucky and should be able to sneak this ABI clarification in.

Testcase: igt/gem_wait/invalid-flags

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85280

Some please review this little fix?
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
Reviewed-by
#2 lore raw
Quoted 6 lines · Daniel Vetter
Quoted 5 lines · Daniel Vetter

Not having checks for this isn't good.

I've checked igt and libdrm and they all already clear flags properly. So we're lucky and should be able to sneak this ABI clarification in.

Quoted 6 lines
Quoted 2 lines

Testcase: igt/gem_wait/invalid-flags

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85280

Some please review this little fix?

#3 lore raw
Quoted 7 lines · Damien Lespiau
Quoted 6 lines · Daniel Vetter
Quoted 5 lines · Daniel Vetter

Not having checks for this isn't good.

I've checked igt and libdrm and they all already clear flags properly. So we're lucky and should be able to sneak this ABI clarification in.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Testcase: igt/gem_wait/invalid-flags

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85280

Some please review this little fix?

Thanks for the mercy ;-) Patch merged to dinq now. -Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch