diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-06-13 13:50:34 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-06-13 13:52:52 +0100 |
commit | 8322e3e5c6ed19e029f365d869c80388863c424d (patch) | |
tree | f75b79b08b82cb5b0eea9f9acdad1f17240f2b37 | |
parent | 97003b1a2d6c8beb5c4df4bece5a2d5b03b5ae2f (diff) |
intel: Check that the fd points to i915 after authorising
The call to GETPARAM requires either a rendernode or authorisation.
Therefore we can only assert that the fd is a valid i915 handle after
authorise() and not before.
Reported-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/intel_device.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/intel_device.c b/src/intel_device.c index 610b2235..d9d8df35 100644 --- a/src/intel_device.c +++ b/src/intel_device.c @@ -439,8 +439,6 @@ static int authorise(struct intel_device *dev, int fd) struct stat st; drm_magic_t magic; - assert(is_i915_gem(fd)); - if (is_render_node(fd, &st)) /* restricted authority, do not elevate */ return 1; @@ -470,6 +468,8 @@ int intel_get_client_fd(ScrnInfoPtr scrn) return -BadMatch; } + assert(is_i915_gem(fd)); + return fd; } |