summaryrefslogtreecommitdiff
path: root/tests/gem_exec_params.c
diff options
context:
space:
mode:
authorAntonio Argenziano <antonio.argenziano@intel.com>2018-01-31 14:19:12 -0800
committerChris Wilson <chris@chris-wilson.co.uk>2018-02-01 08:14:20 +0000
commit689ea8ddcaf769c14b26df8c0fcd8fcc74e06dd2 (patch)
tree3d2fce957a890707a6bf0acfec11027b8401850a /tests/gem_exec_params.c
parent7f0be0e7d9becb79630093bf0e6daeadcd937062 (diff)
igt/gem_exec_params: Drop drm master privileges only on drm master fds
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. v2: - Require root privilege for the sub-test. (Chris) V3: - Cosmetic refactoring. (Chris) Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/gem_exec_params.c')
-rw-r--r--tests/gem_exec_params.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/gem_exec_params.c b/tests/gem_exec_params.c
index e1c48b40..c3dc0ac2 100644
--- a/tests/gem_exec_params.c
+++ b/tests/gem_exec_params.c
@@ -343,13 +343,18 @@ igt_main
}
igt_subtest("secure-non-master") {
+ igt_require(__igt_device_set_master(fd) == 0); /* Requires root privilege */
+
igt_device_drop_master(fd);
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 */
}
/* HANDLE_LUT and NO_RELOC are already exercised by gem_exec_lut_handle,