Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4a28b644 authored by Liam Mark's avatar Liam Mark
Browse files

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: default avatarLiam Mark <lmark@codeaurora.org>
parent b5bfd16f
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1573,6 +1573,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;
@@ -1692,6 +1696,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;