mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Hellstrom <thellstrom@vmware.com>
To: "murray.mcallister@gmail.com" <murray.mcallister@gmail.com>
Cc: "daniel@ffwll.ch" <daniel@ffwll.ch>,
	Linux-graphics-maintainer <Linux-graphics-maintainer@vmware.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"airlied@linux.ie" <airlied@linux.ie>
Subject: Re: [PATCH] drm/vmwgfx: NULL pointer dereference from vmw_cmd_dx_view_define()
Date: Mon, 13 May 2019 12:53:21 +0000	[thread overview]
Message-ID: <7690e0f28bc1c11db323179cd64ce3ec6a5ca8af.camel@vmware.com> (raw)
In-Reply-To: <20190511060138.20592-1-murray.mcallister@gmail.com>

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@gmail.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);

      reply	other threads:[~2019-05-13 12:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-11  6:01 Murray McAllister
2019-05-13 12:53 ` Thomas Hellstrom [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7690e0f28bc1c11db323179cd64ce3ec6a5ca8af.camel@vmware.com \
    --to=thellstrom@vmware.com \
    --cc=Linux-graphics-maintainer@vmware.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=murray.mcallister@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®