drm/vmwgfx: Fix an uninitialized fence handle value
authorThomas Hellstrom <thellstrom@vmware.com>
Thu, 31 Jan 2019 09:52:21 +0000 (10:52 +0100)
committerThomas Hellstrom <thellstrom@vmware.com>
Tue, 5 Feb 2019 12:51:57 +0000 (13:51 +0100)
if vmw_execbuf_fence_commands() fails, The handle value will be
uninitialized and a bogus fence handle might be copied to user-space.

Cc: <stable@vger.kernel.org>
Fixes: 2724b2d54cda: ("drm/vmwgfx: Use new validation interface for the modesetting code v2")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com> #v1
Reviewed-by: Sinclair Yeh <syeh@vmware.com> #v1
Reviewed-by: Deepak Rawat <drawat@vmware.com>
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c

index b351fb5214d33b9b84f6223ba72a6210862e9b80..5e257a600ceaa2fa934f2e5cc26cb9b9d351c9d9 100644 (file)
@@ -2554,8 +2554,8 @@ void vmw_kms_helper_validation_finish(struct vmw_private *dev_priv,
                                      user_fence_rep)
 {
        struct vmw_fence_obj *fence = NULL;
-       uint32_t handle;
-       int ret;
+       uint32_t handle = 0;
+       int ret = 0;
 
        if (file_priv || user_fence_rep || vmw_validation_has_bos(ctx) ||
            out_fence)