diff options
author | Dmitry Osipenko <digetx@gmail.com> | 2017-06-15 01:18:35 +0200 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2017-06-15 14:22:32 +0200 |
commit | 571cbf70c117664d142b34fa2b3b915d8374a327 (patch) | |
tree | 58c09c29d12a99fa7a9f6a5a185b6363e8495310 /drivers/gpu/host1x | |
parent | gpu: host1x: Do not leak BO's phys address to userspace (diff) | |
download | linux-571cbf70c117664d142b34fa2b3b915d8374a327.tar.xz linux-571cbf70c117664d142b34fa2b3b915d8374a327.zip |
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 <digetx@gmail.com>
Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu/host1x')
-rw-r--r-- | drivers/gpu/host1x/job.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/host1x/job.c b/drivers/gpu/host1x/job.c index 4208329ca2af..a911de6386b4 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; } |