mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Christian König" <deathsimple@vodafone.de>
To: Jan Burgmeier <jan.burgmeier@unicon-software.com>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Cc: airlied@linux.ie
Subject: Re: [PATCH] Fix IB va_start+ib_bytes range check on 32Bit systems
Date: Wed, 29 Mar 2017 15:22:08 +0200	[thread overview]
Message-ID: <6dc2814c-c32b-220a-daa7-da530d13f20d@vodafone.de> (raw)
In-Reply-To: <20170329091839.5246-2-jan.burgmeier@unicon-software.com>

Am 29.03.2017 um 11:18 schrieb Jan Burgmeier:
> Signed-off-by: Jan Burgmeier <jan.burgmeier@unicon-software.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> index 99424cb8020b..583d22974e14 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> @@ -908,6 +908,7 @@ static int amdgpu_cs_ib_fill(struct amdgpu_device *adev,
>   			struct amdgpu_bo *aobj = NULL;
>   			uint64_t offset;
>   			uint8_t *kptr;
> +			uint64_t it_last;
>   
>   			m = amdgpu_cs_find_mapping(parser, chunk_ib->va_start,
>   						   &aobj);
> @@ -916,8 +917,9 @@ static int amdgpu_cs_ib_fill(struct amdgpu_device *adev,
>   				return -EINVAL;
>   			}
>   
> +			it_last = m->it.last;
>   			if ((chunk_ib->va_start + chunk_ib->ib_bytes) >
> -			    (m->it.last + 1) * AMDGPU_GPU_PAGE_SIZE) {
> +			    (it_last + 1) * AMDGPU_GPU_PAGE_SIZE) {

Nice catch, but just adding a u64 case should do here as well. E.g:

if ((chunk_ib->va_start + chunk_ib->ib_bytes) >
     (u64)(m->it.last + 1) * AMDGPU_GPU_PAGE_SIZE) {

With that fixed the patch is Reviewed-by: Christian König 
<christian.koenig@amd.com>.

Regards,
Christian.

>   				DRM_ERROR("IB va_start+ib_bytes is invalid\n");
>   				return -EINVAL;
>   			}

  reply	other threads:[~2017-03-29 13:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-29  9:18 Fix hardware accelerated video playback with amdgpu on 32Bit system Jan Burgmeier
2017-03-29  9:18 ` [PATCH] Fix IB va_start+ib_bytes range check on 32Bit systems Jan Burgmeier
2017-03-29 13:22   ` Christian König [this message]
2017-03-29 14:54     ` Michel Dänzer
2017-03-29 15:18       ` Christian König
2017-03-30  1:41         ` Michel Dänzer
2017-03-30  8:36           ` Christian König

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=6dc2814c-c32b-220a-daa7-da530d13f20d@vodafone.de \
    --to=deathsimple@vodafone.de \
    --cc=airlied@linux.ie \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jan.burgmeier@unicon-software.com \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®