summaryrefslogtreecommitdiff
path: root/drivers/iommu/iommu-debug.c
diff options
context:
space:
mode:
authorLiam Mark <lmark@codeaurora.org>2017-05-15 10:50:23 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2017-05-30 09:29:54 -0700
commitaecadd7140eff321005c8da286bf66c1fa235024 (patch)
tree9eaa862f1fc60ce7a88ae5120673e0165865416e /drivers/iommu/iommu-debug.c
parenta283c457eeb345671f48acb34aa76a893c3837ca (diff)
iommu: iommu-debug: limit memory address exposure
Update pte and dma atos debugfs nodes to be inline with other iommu debugfs nodes and only expose memory addresses when kptr_restrict is disabled. Change-Id: I46d5de498b811b4874be570aea7b41461b9a1a98 Signed-off-by: Liam Mark <lmark@codeaurora.org>
Diffstat (limited to 'drivers/iommu/iommu-debug.c')
-rw-r--r--drivers/iommu/iommu-debug.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/iommu/iommu-debug.c b/drivers/iommu/iommu-debug.c
index b8155c9227d3..c21846c1f8d5 100644
--- a/drivers/iommu/iommu-debug.c
+++ b/drivers/iommu/iommu-debug.c
@@ -1491,6 +1491,10 @@ static ssize_t iommu_debug_pte_read(struct file *file, char __user *ubuf,
ssize_t retval;
size_t buflen;
+ if (kptr_restrict != 0) {
+ pr_err("kptr_restrict needs to be disabled.\n");
+ return -EPERM;
+ }
if (!dev->archdata.mapping) {
pr_err("No mapping. Did you already attach?\n");
return -EINVAL;
@@ -1610,6 +1614,10 @@ static ssize_t iommu_debug_dma_atos_read(struct file *file, char __user *ubuf,
ssize_t retval;
size_t buflen;
+ if (kptr_restrict != 0) {
+ pr_err("kptr_restrict needs to be disabled.\n");
+ return -EPERM;
+ }
if (!dev->archdata.mapping) {
pr_err("No mapping. Did you already attach?\n");
return -EINVAL;