From: Dmitry Osipenko Date: Wed, 14 Jun 2017 23:18:35 +0000 (+0300) Subject: gpu: host1x: Forbid relocation address shifting in the firewall X-Git-Tag: v4.14-rc1~484^2~18^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=571cbf70c117664d142b34fa2b3b915d8374a327;p=platform%2Fkernel%2Flinux-rpi.git gpu: host1x: Forbid relocation address shifting in the firewall Incorrectly shifted relocation address will cause a lower memory corruption and likely a hang on a write or a read of an arbitrary data in case of IOMMU absence. As of now, there is no known use for the address shifting and adding a proper shifts / sizes validation is a much more work. Let's forbid shifts in the firewall till a proper validation is implemented. Signed-off-by: Dmitry Osipenko Reviewed-by: Erik Faye-Lund Reviewed-by: Mikko Perttunen Signed-off-by: Thierry Reding --- diff --git a/drivers/gpu/host1x/job.c b/drivers/gpu/host1x/job.c index 4208329..a911de6 100644 --- a/drivers/gpu/host1x/job.c +++ b/drivers/gpu/host1x/job.c @@ -330,6 +330,10 @@ static bool check_reloc(struct host1x_reloc *reloc, struct host1x_bo *cmdbuf, if (reloc->cmdbuf.bo != cmdbuf || reloc->cmdbuf.offset != offset) return false; + /* relocation shift value validation isn't implemented yet */ + if (reloc->shift) + return false; + return true; }