]> Git Repo - linux.git/commitdiff
drm/etnaviv: Fix off-by-one error in reloc checking
authorWladimir J. van der Laan <[email protected]>
Tue, 25 Jul 2017 12:33:36 +0000 (14:33 +0200)
committerLucas Stach <[email protected]>
Tue, 8 Aug 2017 13:56:00 +0000 (15:56 +0200)
A relocation pointing to the last four bytes of a buffer can
legitimately happen in the case of small vertex buffers.

CC: [email protected] #4.9+
Signed-off-by: Wladimir J. van der Laan <[email protected]>
Reviewed-by: Philipp Zabel <[email protected]>
Reviewed-by: Christian Gmeiner <[email protected]>
Signed-off-by: Lucas Stach <[email protected]>
drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c

index 5bd93169dac2059a0981cc2f24b8c9032447ba9e..6463fc2c736fd4db5881a259b21848328b7f6cea 100644 (file)
@@ -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;
                }
 
This page took 0.052189 seconds and 4 git commands to generate.