public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: David Airlie <airlied@linux.ie>,
	kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/i810: off by one in i810_dma_vertex()
Date: Tue, 03 Jul 2018 13:01:05 +0000	[thread overview]
Message-ID: <20180703130105.GC3891@phenom.ffwll.local> (raw)
In-Reply-To: <20180703123015.kma7v7rwtdy4urce@kili.mountain>

On Tue, Jul 03, 2018 at 03:30:16PM +0300, Dan Carpenter wrote:
> If vertex->idx = dma->buf_count then we end up reading one element
> beyond the end of the dma->buflist[] array.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

This driver is a full-on root hole no matter what, but applied to appease
the checkers :-)

Thanks, Daniel

> 
> diff --git a/drivers/gpu/drm/i810/i810_dma.c b/drivers/gpu/drm/i810/i810_dma.c
> index 576a417690d4..3b378936f575 100644
> --- a/drivers/gpu/drm/i810/i810_dma.c
> +++ b/drivers/gpu/drm/i810/i810_dma.c
> @@ -934,7 +934,7 @@ static int i810_dma_vertex(struct drm_device *dev, void *data,
>  	DRM_DEBUG("idx %d used %d discard %d\n",
>  		  vertex->idx, vertex->used, vertex->discard);
>  
> -	if (vertex->idx < 0 || vertex->idx > dma->buf_count)
> +	if (vertex->idx < 0 || vertex->idx >= dma->buf_count)
>  		return -EINVAL;
>  
>  	i810_dma_dispatch_vertex(dev,
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

      reply	other threads:[~2018-07-03 13:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-03 12:30 [PATCH] drm/i810: off by one in i810_dma_vertex() Dan Carpenter
2018-07-03 13:01 ` Daniel Vetter [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=20180703130105.GC3891@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=airlied@linux.ie \
    --cc=dan.carpenter@oracle.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel-janitors@vger.kernel.org \
    /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