[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7690e0f28bc1c11db323179cd64ce3ec6a5ca8af.camel@vmware.com>
Date: Mon, 13 May 2019 12:53:21 +0000
From: Thomas Hellstrom <thellstrom@...are.com>
To: "murray.mcallister@...il.com" <murray.mcallister@...il.com>
CC: "daniel@...ll.ch" <daniel@...ll.ch>,
Linux-graphics-maintainer <Linux-graphics-maintainer@...are.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
"airlied@...ux.ie" <airlied@...ux.ie>
Subject: Re: [PATCH] drm/vmwgfx: NULL pointer dereference from
vmw_cmd_dx_view_define()
On Sat, 2019-05-11 at 18:01 +1200, Murray McAllister wrote:
> If SVGA_3D_CMD_DX_DEFINE_RENDERTARGET_VIEW is called with a surface
> ID of SVGA3D_INVALID_ID, the srf struct will remain NULL after
> vmw_cmd_res_check(), leading to a null pointer dereference in
> vmw_view_add().
>
> Signed-off-by: Murray McAllister <murray.mcallister@...il.com>
Thanks, I'll add this to the next -fixes pull.
Thomas
> ---
> drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
> b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
> index 2ff7ba04d8c8..447afd086206 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
> @@ -2414,6 +2414,10 @@ static int vmw_cmd_dx_view_define(struct
> vmw_private *dev_priv,
> return -EINVAL;
>
> cmd = container_of(header, typeof(*cmd), header);
> + if (unlikely(cmd->sid == SVGA3D_INVALID_ID)) {
> + DRM_ERROR("Invalid surface id.\n");
> + return -EINVAL;
> + }
> ret = vmw_cmd_res_check(dev_priv, sw_context, vmw_res_surface,
> VMW_RES_DIRTY_NONE,
> user_surface_converter,
> &cmd->sid, &srf);
Powered by blists - more mailing lists