intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] drm/i915: Reject invalid-pad for context-destroy and -create ioctls
@ 2016-02-05 16:45 Chris Wilson
  2016-02-08 12:55 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Chris Wilson @ 2016-02-05 16:45 UTC (permalink / raw)
  To: intel-gfx; +Cc: Daniel Vetter

Unknown parameters, especially structure padding, are expected to invoke
rejection with -EINVAL.

v2: similar issue exists for context-create

Testcase: igt/gem_ctx_create/invalid-pad
Testcase: igt/gem_ctx_bad_destroy/invalid-pad
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89602
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93999
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/i915_gem_context.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index 54af654d04d6..c75d3468f29a 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -972,6 +972,9 @@ int i915_gem_context_create_ioctl(struct drm_device *dev, void *data,
 	if (!contexts_enabled(dev))
 		return -ENODEV;
 
+	if (args->pad != 0)
+		return -EINVAL;
+
 	ret = i915_mutex_lock_interruptible(dev);
 	if (ret)
 		return ret;
@@ -995,6 +998,9 @@ int i915_gem_context_destroy_ioctl(struct drm_device *dev, void *data,
 	struct intel_context *ctx;
 	int ret;
 
+	if (args->pad != 0)
+		return -EINVAL;
+
 	if (args->ctx_id == DEFAULT_CONTEXT_HANDLE)
 		return -ENOENT;
 
-- 
2.7.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915: Reject invalid-pad for context-destroy and -create ioctls
  2016-02-05 16:45 [PATCH v2] drm/i915: Reject invalid-pad for context-destroy and -create ioctls Chris Wilson
@ 2016-02-08 12:55 ` Patchwork
  2016-02-08 12:57 ` Patchwork
  2016-02-15 17:02 ` [PATCH v2] " Daniel Vetter
  2 siblings, 0 replies; 4+ messages in thread
From: Patchwork @ 2016-02-08 12:55 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Summary ==

Series 3128v1 drm/i915: Reject invalid-pad for context-destroy and -create ioctls
http://patchwork.freedesktop.org/api/1.0/series/3128/revisions/1/mbox/

Test kms_force_connector_basic:
        Subgroup force-edid:
                skip       -> PASS       (snb-x220t)

bdw-nuci7        total:161  pass:152  dwarn:0   dfail:0   fail:0   skip:9  
bdw-ultra        total:164  pass:152  dwarn:0   dfail:0   fail:0   skip:12 
bsw-nuc-2        total:164  pass:136  dwarn:0   dfail:0   fail:0   skip:28 
byt-nuc          total:164  pass:141  dwarn:0   dfail:0   fail:0   skip:23 
hsw-brixbox      total:164  pass:151  dwarn:0   dfail:0   fail:0   skip:13 
hsw-gt2          total:164  pass:154  dwarn:0   dfail:0   fail:0   skip:10 
ivb-t430s        total:164  pass:150  dwarn:0   dfail:0   fail:0   skip:14 
snb-dellxps      total:164  pass:142  dwarn:0   dfail:0   fail:0   skip:22 
snb-x220t        total:164  pass:142  dwarn:0   dfail:0   fail:1   skip:21 

Results at /archive/results/CI_IGT_test/Patchwork_1372/

4d509d986f45cef06e2683923e88ae568700ed23 drm-intel-nightly: 2016y-02m-05d-21h-37m-20s UTC integration manifest
bbd2b38f50cdf4d98297a8cea395615c17e5b67c drm/i915: Reject invalid-pad for context-destroy and -create ioctls

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915: Reject invalid-pad for context-destroy and -create ioctls
  2016-02-05 16:45 [PATCH v2] drm/i915: Reject invalid-pad for context-destroy and -create ioctls Chris Wilson
  2016-02-08 12:55 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2016-02-08 12:57 ` Patchwork
  2016-02-15 17:02 ` [PATCH v2] " Daniel Vetter
  2 siblings, 0 replies; 4+ messages in thread
From: Patchwork @ 2016-02-08 12:57 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Summary ==

Series 3128v1 drm/i915: Reject invalid-pad for context-destroy and -create ioctls
http://patchwork.freedesktop.org/api/1.0/series/3128/revisions/1/mbox/

Test kms_force_connector_basic:
        Subgroup force-edid:
                skip       -> PASS       (snb-x220t)

bdw-nuci7        total:161  pass:152  dwarn:0   dfail:0   fail:0   skip:9  
bdw-ultra        total:164  pass:152  dwarn:0   dfail:0   fail:0   skip:12 
bsw-nuc-2        total:164  pass:136  dwarn:0   dfail:0   fail:0   skip:28 
byt-nuc          total:164  pass:141  dwarn:0   dfail:0   fail:0   skip:23 
hsw-brixbox      total:164  pass:151  dwarn:0   dfail:0   fail:0   skip:13 
hsw-gt2          total:164  pass:154  dwarn:0   dfail:0   fail:0   skip:10 
ivb-t430s        total:164  pass:150  dwarn:0   dfail:0   fail:0   skip:14 
snb-dellxps      total:164  pass:142  dwarn:0   dfail:0   fail:0   skip:22 
snb-x220t        total:164  pass:142  dwarn:0   dfail:0   fail:1   skip:21 

Results at /archive/results/CI_IGT_test/Patchwork_1372/

4d509d986f45cef06e2683923e88ae568700ed23 drm-intel-nightly: 2016y-02m-05d-21h-37m-20s UTC integration manifest
bbd2b38f50cdf4d98297a8cea395615c17e5b67c drm/i915: Reject invalid-pad for context-destroy and -create ioctls

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] drm/i915: Reject invalid-pad for context-destroy and -create ioctls
  2016-02-05 16:45 [PATCH v2] drm/i915: Reject invalid-pad for context-destroy and -create ioctls Chris Wilson
  2016-02-08 12:55 ` ✓ Fi.CI.BAT: success for " Patchwork
  2016-02-08 12:57 ` Patchwork
@ 2016-02-15 17:02 ` Daniel Vetter
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2016-02-15 17:02 UTC (permalink / raw)
  To: Chris Wilson; +Cc: Daniel Vetter, intel-gfx

On Fri, Feb 05, 2016 at 04:45:59PM +0000, Chris Wilson wrote:
> Unknown parameters, especially structure padding, are expected to invoke
> rejection with -EINVAL.
> 
> v2: similar issue exists for context-create
> 
> Testcase: igt/gem_ctx_create/invalid-pad
> Testcase: igt/gem_ctx_bad_destroy/invalid-pad
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89602
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93999
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Queued for -next, thanks for the patch.
-Daniel

> ---
>  drivers/gpu/drm/i915/i915_gem_context.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
> index 54af654d04d6..c75d3468f29a 100644
> --- a/drivers/gpu/drm/i915/i915_gem_context.c
> +++ b/drivers/gpu/drm/i915/i915_gem_context.c
> @@ -972,6 +972,9 @@ int i915_gem_context_create_ioctl(struct drm_device *dev, void *data,
>  	if (!contexts_enabled(dev))
>  		return -ENODEV;
>  
> +	if (args->pad != 0)
> +		return -EINVAL;
> +
>  	ret = i915_mutex_lock_interruptible(dev);
>  	if (ret)
>  		return ret;
> @@ -995,6 +998,9 @@ int i915_gem_context_destroy_ioctl(struct drm_device *dev, void *data,
>  	struct intel_context *ctx;
>  	int ret;
>  
> +	if (args->pad != 0)
> +		return -EINVAL;
> +
>  	if (args->ctx_id == DEFAULT_CONTEXT_HANDLE)
>  		return -ENOENT;
>  
> -- 
> 2.7.0
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-02-15 17:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-05 16:45 [PATCH v2] drm/i915: Reject invalid-pad for context-destroy and -create ioctls Chris Wilson
2016-02-08 12:55 ` ✓ Fi.CI.BAT: success for " Patchwork
2016-02-08 12:57 ` Patchwork
2016-02-15 17:02 ` [PATCH v2] " Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).