Re: [PATCH] drm/etnaviv: Fix off-by-one error in reloc checking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2017-07-25 14:33 GMT+02:00 Wladimir J. van der Laan <laanwj@xxxxxxxxx>:
> A relocation pointing to the last four bytes of a buffer can
> legitimately happen in the case of small vertex buffers.
>
> Signed-off-by: Wladimir J. van der Laan <laanwj@xxxxxxxxx>

Reviewed-by: Christian Gmeiner <christian.gmeiner@xxxxxxxxx>

> ---
>  drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
> index de80ee1..21be4dc 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
> @@ -270,8 +270,8 @@ static int submit_reloc(struct etnaviv_gem_submit *submit, void *stream,
>                 if (ret)
>                         return ret;
>
> -               if (r->reloc_offset >= bo->obj->base.size - sizeof(*ptr)) {
> -                       DRM_ERROR("relocation %u outside object", i);
> +               if (r->reloc_offset > bo->obj->base.size - sizeof(*ptr)) {
> +                       DRM_ERROR("relocation %u outside object\n", i);
>                         return -EINVAL;
>                 }
>
> --
> 2.7.4
>

greets
--
Christian Gmeiner, MSc

https://christian-gmeiner.info
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux