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

Commit aecadd71 authored by Liam Mark's avatar Liam Mark Committed by Gerrit - the friendly Code Review server
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 a283c457
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -1491,6 +1491,10 @@ static ssize_t iommu_debug_pte_read(struct file *file, char __user *ubuf,
	ssize_t retval;
	ssize_t retval;
	size_t buflen;
	size_t buflen;


	if (kptr_restrict != 0) {
		pr_err("kptr_restrict needs to be disabled.\n");
		return -EPERM;
	}
	if (!dev->archdata.mapping) {
	if (!dev->archdata.mapping) {
		pr_err("No mapping. Did you already attach?\n");
		pr_err("No mapping. Did you already attach?\n");
		return -EINVAL;
		return -EINVAL;
@@ -1610,6 +1614,10 @@ static ssize_t iommu_debug_dma_atos_read(struct file *file, char __user *ubuf,
	ssize_t retval;
	ssize_t retval;
	size_t buflen;
	size_t buflen;


	if (kptr_restrict != 0) {
		pr_err("kptr_restrict needs to be disabled.\n");
		return -EPERM;
	}
	if (!dev->archdata.mapping) {
	if (!dev->archdata.mapping) {
		pr_err("No mapping. Did you already attach?\n");
		pr_err("No mapping. Did you already attach?\n");
		return -EINVAL;
		return -EINVAL;