mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
drm/vmwgfx: integer underflow in vmw_cmd_dx_set_shader() leading to an invalid read
commit5ed7f4b5ecupstream. If SVGA_3D_CMD_DX_SET_SHADER is called with a shader ID of SVGA3D_INVALID_ID, and a shader type of SVGA3D_SHADERTYPE_INVALID, the calculated binding.shader_slot will be 4294967295, leading to an out-of-bounds read in vmw_binding_loc() when the offset is calculated. Cc: <stable@vger.kernel.org> Fixes:d80efd5cb3("drm/vmwgfx: Initial DX support") Signed-off-by: Murray McAllister <murray.mcallister@gmail.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
4739012890
commit
956916b542
@@ -2495,7 +2495,8 @@ static int vmw_cmd_dx_set_shader(struct vmw_private *dev_priv,
|
||||
|
||||
cmd = container_of(header, typeof(*cmd), header);
|
||||
|
||||
if (cmd->body.type >= SVGA3D_SHADERTYPE_DX10_MAX) {
|
||||
if (cmd->body.type >= SVGA3D_SHADERTYPE_DX10_MAX ||
|
||||
cmd->body.type < SVGA3D_SHADERTYPE_MIN) {
|
||||
DRM_ERROR("Illegal shader type %u.\n",
|
||||
(unsigned) cmd->body.type);
|
||||
return -EINVAL;
|
||||
|
||||
Reference in New Issue
Block a user