summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom@vmware.com>2014-02-12 13:19:36 +0100
committerThomas Hellstrom <thellstrom@vmware.com>2014-02-12 19:31:45 +0100
commit36e952c1ed8ca44bca245c465c8293e175dd9222 (patch)
treec08437752f106cf8e88e9308f2491abb8aa94917 /drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
parentb055211d941eb6cb7b285be580cf6e51a01d2f44 (diff)
downloadblackbird-op-linux-36e952c1ed8ca44bca245c465c8293e175dd9222.tar.gz
blackbird-op-linux-36e952c1ed8ca44bca245c465c8293e175dd9222.zip
drm/vmwgfx: Fix command defines and checks
Make sure all guest-backed object commands are properly packed. Have the command verifier treat uninitialized command entries as invalid rather than dereferencing NULL pointers. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c')
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
index 904fdde1ebab..efb575a7996c 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
@@ -2032,6 +2032,9 @@ static int vmw_cmd_check(struct vmw_private *dev_priv,
goto out_invalid;
entry = &vmw_cmd_entries[cmd_id];
+ if (unlikely(!entry->func))
+ goto out_invalid;
+
if (unlikely(!entry->user_allow && !sw_context->kernel))
goto out_privileged;
OpenPOWER on IntegriCloud