summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJay Cornwall <jay.cornwall@amd.com>2014-04-29 00:27:46 +0200
committerJoerg Roedel <joro@8bytes.org>2014-05-13 12:33:11 +0200
commit4378d99295fae5fd42b0ed1a3eeef2a1684e0c17 (patch)
tree2d2206643e5ad7353fba8393b1e6820daae45dc9 /drivers
parentiommu/amd: Fix interrupt remapping for aliased devices (diff)
downloadlinux-4378d99295fae5fd42b0ed1a3eeef2a1684e0c17.tar.xz
linux-4378d99295fae5fd42b0ed1a3eeef2a1684e0c17.zip
iommu/amd: Take mmap_sem when calling get_user_pages
get_user_pages requires caller to hold a read lock on mmap_sem. Signed-off-by: Jay Cornwall <jay.cornwall@amd.com> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> Signed-off-by: Joerg Roedel <joro@8bytes.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/iommu/amd_iommu_v2.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/iommu/amd_iommu_v2.c b/drivers/iommu/amd_iommu_v2.c
index 5208828792e6..203b2e6a91cf 100644
--- a/drivers/iommu/amd_iommu_v2.c
+++ b/drivers/iommu/amd_iommu_v2.c
@@ -504,8 +504,10 @@ static void do_fault(struct work_struct *work)
write = !!(fault->flags & PPR_FAULT_WRITE);
+ down_read(&fault->state->mm->mmap_sem);
npages = get_user_pages(fault->state->task, fault->state->mm,
fault->address, 1, write, 0, &page, NULL);
+ up_read(&fault->state->mm->mmap_sem);
if (npages == 1) {
put_page(page);