[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170815011943.277278472@linuxfoundation.org>
Date: Mon, 14 Aug 2017 18:19:13 -0700
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org,
"Wladimir J. van der Laan" <laanwj@...il.com>,
Philipp Zabel <p.zabel@...gutronix.de>,
Christian Gmeiner <christian.gmeiner@...il.com>,
Lucas Stach <l.stach@...gutronix.de>
Subject: [PATCH 4.12 22/65] drm/etnaviv: Fix off-by-one error in reloc checking
4.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wladimir J. van der Laan <laanwj@...il.com>
commit d6f756e09f01ea7a0efbbcef269a1e384a35d824 upstream.
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@...il.com>
Reviewed-by: Philipp Zabel <p.zabel@...gutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@...il.com>
Signed-off-by: Lucas Stach <l.stach@...gutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- 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_g
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;
}
Powered by blists - more mailing lists