[Intel-gfx] [PATCH] drm/i915: Reject garbage in unsed ctx create/destroy fields
Daniel Vetter
daniel.vetter at ffwll.ch
Tue Feb 10 23:44:47 PST 2015
Forgotten ever since, but luckily we're at least good at memset.
Testecase: igt/gem_ctx_create/invalid-pad
Testecase: igt/gem_ctx_bad_destroy/invalid-pad
Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
---
drivers/gpu/drm/i915/i915_gem_context.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index 8603bf48d3ee..378011e4704d 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -748,6 +748,11 @@ int i915_gem_context_create_ioctl(struct drm_device *dev, void *data,
struct intel_context *ctx;
int ret;
+ if (args->pad) {
+ DRM_DEBUG_DRIVER("garbage in pad 0x%08x\n", args->pad);
+ return -EINVAL;
+ }
+
if (!contexts_enabled(dev))
return -ENODEV;
@@ -774,6 +779,11 @@ int i915_gem_context_destroy_ioctl(struct drm_device *dev, void *data,
struct intel_context *ctx;
int ret;
+ if (args->pad) {
+ DRM_DEBUG_DRIVER("garbage in pad 0x%08x\n", args->pad);
+ return -EINVAL;
+ }
+
if (args->ctx_id == DEFAULT_CONTEXT_HANDLE)
return -ENOENT;
--
1.9.3
More information about the Intel-gfx
mailing list