From 947f7639b380e08bed6f4b7da5bfc7b03568d126 Mon Sep 17 00:00:00 2001 From: "Isaac J. Manjarres" Date: Mon, 12 Apr 2021 17:09:26 -0700 Subject: [PATCH] ANDROID: iommu/io-pgtable-arm: Fix arguments for __arm_lpae_map() arm_lpae_map_pages() is currently passing NULL to __arm_lpae_map() for its mapped argument, instead of the mapped argument that it is supposed to pass, which can lead to memory that has been mapped not being counted as mapped. Fix this by passing the mapped argument from arm_lpae_map_pages() to __arm_lpae_map(). Bug: 178537788 Reported-by: John Stultz Fixes: ac3994447c8a ("FROMLIST: iommu/io-pgtable-arm: Implement arm_lpae_map_pages()") Change-Id: Ic97df34fc2e9e0404d193eff2024d334e3e75a24 Signed-off-by: Isaac J. Manjarres --- drivers/iommu/io-pgtable-arm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c index e2349d3df907..6cc36f885da4 100644 --- a/drivers/iommu/io-pgtable-arm.c +++ b/drivers/iommu/io-pgtable-arm.c @@ -497,7 +497,7 @@ static int arm_lpae_map_pages(struct io_pgtable_ops *ops, unsigned long iova, prot = arm_lpae_prot_to_pte(data, iommu_prot); ret = __arm_lpae_map(data, iova, paddr, pgsize, pgcount, prot, lvl, - ptep, gfp, NULL); + ptep, gfp, mapped); /* * Synchronise all PTE updates for the new mapping before there's * a chance for anything to kick off a table walk for the new iova.