diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2014-02-12 13:19:36 +0100 |
---|---|---|
committer | Thomas Hellstrom <thellstrom@vmware.com> | 2014-02-12 19:31:45 +0100 |
commit | 36e952c1ed8ca44bca245c465c8293e175dd9222 (patch) | |
tree | c08437752f106cf8e88e9308f2491abb8aa94917 /drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | |
parent | b055211d941eb6cb7b285be580cf6e51a01d2f44 (diff) | |
download | blackbird-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.c | 3 |
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; |