* [PATCH] drm/i915/reset_stats: Only allow root to read reset_stats
@ 2018-01-16 16:09 Antonio Argenziano
2018-01-16 17:21 ` ✓ Fi.CI.BAT: success for " Patchwork
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Antonio Argenziano @ 2018-01-16 16:09 UTC (permalink / raw)
To: intel-gfx
Instead of returning a zero value for non root users, return an EPERM
error.
Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Michel Thierry <michel.thierry@intel.com>
---
drivers/gpu/drm/i915/i915_drv.c | 2 +-
drivers/gpu/drm/i915/i915_gem_context.c | 9 ++++-----
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 6c8da9d20c33..23fb4c61163c 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -2817,7 +2817,7 @@ static const struct drm_ioctl_desc i915_ioctls[] = {
DRM_IOCTL_DEF_DRV(I915_GEM_CONTEXT_CREATE, i915_gem_context_create_ioctl, DRM_RENDER_ALLOW),
DRM_IOCTL_DEF_DRV(I915_GEM_CONTEXT_DESTROY, i915_gem_context_destroy_ioctl, DRM_RENDER_ALLOW),
DRM_IOCTL_DEF_DRV(I915_REG_READ, i915_reg_read_ioctl, DRM_RENDER_ALLOW),
- DRM_IOCTL_DEF_DRV(I915_GET_RESET_STATS, i915_gem_context_reset_stats_ioctl, DRM_RENDER_ALLOW),
+ DRM_IOCTL_DEF_DRV(I915_GET_RESET_STATS, i915_gem_context_reset_stats_ioctl, DRM_RENDER_ALLOW|DRM_ROOT_ONLY),
DRM_IOCTL_DEF_DRV(I915_GEM_USERPTR, i915_gem_userptr_ioctl, DRM_RENDER_ALLOW),
DRM_IOCTL_DEF_DRV(I915_GEM_CONTEXT_GETPARAM, i915_gem_context_getparam_ioctl, DRM_RENDER_ALLOW),
DRM_IOCTL_DEF_DRV(I915_GEM_CONTEXT_SETPARAM, i915_gem_context_setparam_ioctl, DRM_RENDER_ALLOW),
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index 648e7536ff51..e6872bd8b754 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -842,6 +842,9 @@ int i915_gem_context_reset_stats_ioctl(struct drm_device *dev,
if (args->flags || args->pad)
return -EINVAL;
+ if (!capable(CAP_SYS_ADMIN))
+ return -EPERM;
+
ret = -ENOENT;
rcu_read_lock();
ctx = __i915_gem_context_lookup_rcu(file->driver_priv, args->ctx_id);
@@ -855,11 +858,7 @@ int i915_gem_context_reset_stats_ioctl(struct drm_device *dev,
* we should wrap the hangstats with a seqlock.
*/
- if (capable(CAP_SYS_ADMIN))
- args->reset_count = i915_reset_count(&dev_priv->gpu_error);
- else
- args->reset_count = 0;
-
+ args->reset_count = i915_reset_count(&dev_priv->gpu_error);
args->batch_active = atomic_read(&ctx->guilty_count);
args->batch_pending = atomic_read(&ctx->active_count);
--
2.14.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 5+ messages in thread
* ✓ Fi.CI.BAT: success for drm/i915/reset_stats: Only allow root to read reset_stats
2018-01-16 16:09 [PATCH] drm/i915/reset_stats: Only allow root to read reset_stats Antonio Argenziano
@ 2018-01-16 17:21 ` Patchwork
2018-01-16 17:27 ` [PATCH] " Chris Wilson
2018-01-16 19:12 ` ✓ Fi.CI.IGT: success for " Patchwork
2 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2018-01-16 17:21 UTC (permalink / raw)
To: Antonio Argenziano; +Cc: intel-gfx
== Series Details ==
Series: drm/i915/reset_stats: Only allow root to read reset_stats
URL : https://patchwork.freedesktop.org/series/36562/
State : success
== Summary ==
Series 36562v1 drm/i915/reset_stats: Only allow root to read reset_stats
https://patchwork.freedesktop.org/api/1.0/series/36562/revisions/1/mbox/
fi-bdw-5557u total:288 pass:267 dwarn:0 dfail:0 fail:0 skip:21 time:422s
fi-bdw-gvtdvm total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:426s
fi-blb-e6850 total:288 pass:223 dwarn:1 dfail:0 fail:0 skip:64 time:372s
fi-bsw-n3050 total:288 pass:242 dwarn:0 dfail:0 fail:0 skip:46 time:489s
fi-bwr-2160 total:288 pass:183 dwarn:0 dfail:0 fail:0 skip:105 time:281s
fi-bxt-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:484s
fi-bxt-j4205 total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:486s
fi-byt-j1900 total:288 pass:253 dwarn:0 dfail:0 fail:0 skip:35 time:467s
fi-byt-n2820 total:288 pass:249 dwarn:0 dfail:0 fail:0 skip:39 time:453s
fi-elk-e7500 total:224 pass:168 dwarn:10 dfail:0 fail:0 skip:45
fi-gdg-551 total:288 pass:179 dwarn:0 dfail:0 fail:1 skip:108 time:273s
fi-glk-1 total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:513s
fi-hsw-4770 total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:390s
fi-hsw-4770r total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:400s
fi-ilk-650 total:288 pass:228 dwarn:0 dfail:0 fail:0 skip:60 time:411s
fi-ivb-3520m total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:457s
fi-ivb-3770 total:288 pass:255 dwarn:0 dfail:0 fail:0 skip:33 time:413s
fi-kbl-7500u total:288 pass:263 dwarn:1 dfail:0 fail:0 skip:24 time:465s
fi-kbl-7560u total:288 pass:269 dwarn:0 dfail:0 fail:0 skip:19 time:496s
fi-kbl-7567u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:456s
fi-kbl-r total:288 pass:260 dwarn:1 dfail:0 fail:0 skip:27 time:504s
fi-pnv-d510 total:288 pass:222 dwarn:1 dfail:0 fail:0 skip:65 time:581s
fi-skl-6260u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:434s
fi-skl-6600u total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:505s
fi-skl-6700hq total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:527s
fi-skl-6700k2 total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:483s
fi-skl-6770hq total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:475s
fi-skl-gvtdvm total:288 pass:265 dwarn:0 dfail:0 fail:0 skip:23 time:432s
fi-snb-2520m total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:525s
fi-snb-2600 total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:400s
Blacklisted hosts:
fi-cfl-s2 total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:563s
fi-glk-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:467s
a0ca279440c8d7c40d798fed9939a2a25b31434b drm-tip: 2018y-01m-16d-10h-49m-51s UTC integration manifest
0c6aa998dd26 drm/i915/reset_stats: Only allow root to read reset_stats
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7689/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/i915/reset_stats: Only allow root to read reset_stats
2018-01-16 16:09 [PATCH] drm/i915/reset_stats: Only allow root to read reset_stats Antonio Argenziano
2018-01-16 17:21 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2018-01-16 17:27 ` Chris Wilson
2018-01-16 18:35 ` Antonio Argenziano
2018-01-16 19:12 ` ✓ Fi.CI.IGT: success for " Patchwork
2 siblings, 1 reply; 5+ messages in thread
From: Chris Wilson @ 2018-01-16 17:27 UTC (permalink / raw)
To: Antonio Argenziano, intel-gfx
Quoting Antonio Argenziano (2018-01-16 16:09:35)
> Instead of returning a zero value for non root users, return an EPERM
> error.
What? reset-stats are per-context, private to the client, with the
exception of the global value which is solely protected by capable().
There is a genuine debate over how much information leakage of one
guilty reset in another context should affect an innocent, and we have
tried to limit that to being only those directly affected and have a
requirement to know (i.e they were executing at the time of the reset
and their calculations will have been restarted with perturbed state).
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/i915/reset_stats: Only allow root to read reset_stats
2018-01-16 17:27 ` [PATCH] " Chris Wilson
@ 2018-01-16 18:35 ` Antonio Argenziano
0 siblings, 0 replies; 5+ messages in thread
From: Antonio Argenziano @ 2018-01-16 18:35 UTC (permalink / raw)
To: Chris Wilson, intel-gfx
On 16/01/18 09:27, Chris Wilson wrote:
> Quoting Antonio Argenziano (2018-01-16 16:09:35)
>> Instead of returning a zero value for non root users, return an EPERM
>> error.
>
> What? reset-stats are per-context, private to the client, with the
> exception of the global value which is solely protected by capable().
Completely missed that, thanks. Will ping the change to gem_reset_stats.
-Antonio
> There is a genuine debate over how much information leakage of one
> guilty reset in another context should affect an innocent, and we have
> tried to limit that to being only those directly affected and have a
> requirement to know (i.e they were executing at the time of the reset
> and their calculations will have been restarted with perturbed state).
> -Chris
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 5+ messages in thread
* ✓ Fi.CI.IGT: success for drm/i915/reset_stats: Only allow root to read reset_stats
2018-01-16 16:09 [PATCH] drm/i915/reset_stats: Only allow root to read reset_stats Antonio Argenziano
2018-01-16 17:21 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-01-16 17:27 ` [PATCH] " Chris Wilson
@ 2018-01-16 19:12 ` Patchwork
2 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2018-01-16 19:12 UTC (permalink / raw)
To: Antonio Argenziano; +Cc: intel-gfx
== Series Details ==
Series: drm/i915/reset_stats: Only allow root to read reset_stats
URL : https://patchwork.freedesktop.org/series/36562/
State : success
== Summary ==
Test kms_flip:
Subgroup vblank-vs-modeset-suspend-interruptible:
pass -> SKIP (shard-hsw) fdo#103540
Subgroup flip-vs-fences-interruptible:
dmesg-warn -> PASS (shard-hsw) fdo#102614
Test perf:
Subgroup polling:
fail -> PASS (shard-hsw) fdo#102252
Test kms_frontbuffer_tracking:
Subgroup fbc-1p-offscren-pri-shrfb-draw-blt:
pass -> FAIL (shard-snb) fdo#101623
fdo#103540 https://bugs.freedesktop.org/show_bug.cgi?id=103540
fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
shard-hsw total:2729 pass:1548 dwarn:1 dfail:0 fail:10 skip:1170 time:8968s
shard-snb total:2729 pass:1316 dwarn:1 dfail:0 fail:12 skip:1399 time:7576s
Blacklisted hosts:
shard-apl total:2729 pass:1698 dwarn:1 dfail:1 fail:22 skip:1006 time:13479s
shard-kbl total:2729 pass:1821 dwarn:1 dfail:0 fail:24 skip:882 time:10190s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7689/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-01-16 19:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-16 16:09 [PATCH] drm/i915/reset_stats: Only allow root to read reset_stats Antonio Argenziano
2018-01-16 17:21 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-01-16 17:27 ` [PATCH] " Chris Wilson
2018-01-16 18:35 ` Antonio Argenziano
2018-01-16 19:12 ` ✓ Fi.CI.IGT: success for " Patchwork
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.