drm/vmwgfx: Fix an uninitialized fence handle value
Subsystems (3)
PATCH v2 1/1 drm/vmwgfx: Fix an uninitialized fence handle value
if vmw_execbuf_fence_commands() fails, The handle value will be uninitialized and a bogus fence handle might be copied to user-space.
---
v2: Also initialize the ret local variable, to silence compilatior warnings. Call vmw_execbuf_copy_fence_user regardless of the value of ret, to propagate the correct error code to user-space.
--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +2 -2
@@ -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)
Signature · 6 lines
2.19.0.rc1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 35 lines · Thomas Hellstrom
if
vmw_execbuf_fence_commands()fails, The handle value will be uninitialized and a bogus fence handle might be copied to user-space.Fixes 2724b2d54cda: ("drm/vmwgfx: Use new validation interface forthe modesetting code v2")
Reported-by Dan Carpenter <[email protected]>Signed-off-by Thomas Hellstrom <[email protected]>Reviewed-by Brian Paul <[email protected]> #v1Reviewed-by Sinclair Yeh <[email protected]> #v1---
v2: Also initialize the ret local variable, to silence compilatior warnings.
Callvmw_execbuf_copy_fence_userregardless of the value of ret, to propagate
the correct error code to user-space.--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +2
-2@@ -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)
Quoted 2 lines
||
out_fence)
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel