[igt-dev] [PATCH i-g-t] igt/gem_exec_params: Drop drm master privileges only on drm master fds

Chris Wilson chris at chris-wilson.co.uk
Wed Jan 31 20:52:45 UTC 2018


Quoting Antonio Argenziano (2018-01-31 19:39:01)
> Subtest 'secure-non-master' tries to drop drm-master privileges on a
> non drm-master fd. Instead drop master privileges after the subtest
> acquires it so that other subtests are not affected by it.
> 
> Signed-off-by: Antonio Argenziano <antonio.argenziano at intel.com>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
> Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
> ---
>  tests/gem_exec_params.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/gem_exec_params.c b/tests/gem_exec_params.c
> index e1c48b40..dbd89e7c 100644
> --- a/tests/gem_exec_params.c
> +++ b/tests/gem_exec_params.c
> @@ -343,13 +343,13 @@ igt_main
>         }
>  
>         igt_subtest("secure-non-master") {

igt_require(iamroot());

> -               igt_device_drop_master(fd);

Hmm, we shouldn't have to assume we are master here, so
__igt_device_drop_master(fd)? That documents the intent of the test more
carefully that even root with non-master is prohibited from frobbing
privileged registers (which include display registers, hence the master
restriction).

>                 execbuf.flags = I915_EXEC_RENDER | I915_EXEC_SECURE;
>                 RUN_FAIL(EPERM);
>                 igt_device_set_master(fd);
>                 igt_assert(drmIoctl(fd,
>                                     DRM_IOCTL_I915_GEM_EXECBUFFER2,
>                                     &execbuf) == 0);
> +               igt_device_drop_master(fd); /* Only needs temporary master */

Ok.
-Chris


More information about the igt-dev mailing list