Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/vmwgfx: Return the correct value in vmw_translate_ptr functions

Before the referenced fixes these functions used a lookup function that
returned a pointer. This was changed to another lookup function that
returned an error code with the pointer becoming an out parameter.

The error path when the lookup failed was not changed to reflect this
change and the code continued to return the PTR_ERR of the now
uninitialized pointer. This could cause the vmw_translate_ptr functions
to return success when they actually failed causing further uninitialized
and OOB accesses.

Reported-by: Kuzey Arda Bulut <kuzeyardabulut@gmail.com>
Fixes: a309c7194e8a ("drm/vmwgfx: Remove rcu locks from user resources")
Signed-off-by: Ian Forbes <ian.forbes@broadcom.com>
Reviewed-by: Zack Rusin <zack.rusin@broadcom.com>
Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
Link: https://patch.msgid.link/20260113175357.129285-1-ian.forbes@broadcom.com

authored by

Ian Forbes and committed by
Zack Rusin
5023ca80 922f9dec

+2 -2
+2 -2
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
··· 1143 1143 ret = vmw_user_bo_lookup(sw_context->filp, handle, &vmw_bo); 1144 1144 if (ret != 0) { 1145 1145 drm_dbg(&dev_priv->drm, "Could not find or use MOB buffer.\n"); 1146 - return PTR_ERR(vmw_bo); 1146 + return ret; 1147 1147 } 1148 1148 vmw_bo_placement_set(vmw_bo, VMW_BO_DOMAIN_MOB, VMW_BO_DOMAIN_MOB); 1149 1149 ret = vmw_validation_add_bo(sw_context->ctx, vmw_bo); ··· 1199 1199 ret = vmw_user_bo_lookup(sw_context->filp, handle, &vmw_bo); 1200 1200 if (ret != 0) { 1201 1201 drm_dbg(&dev_priv->drm, "Could not find or use GMR region.\n"); 1202 - return PTR_ERR(vmw_bo); 1202 + return ret; 1203 1203 } 1204 1204 vmw_bo_placement_set(vmw_bo, VMW_BO_DOMAIN_GMR | VMW_BO_DOMAIN_VRAM, 1205 1205 VMW_BO_DOMAIN_GMR | VMW_BO_DOMAIN_VRAM);