1
0
Fork 0

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>
hifive-unleashed-5.1
Jay Cornwall 2014-04-28 17:27:46 -05:00 committed by Joerg Roedel
parent e028a9e6b8
commit 4378d99295
1 changed files with 2 additions and 0 deletions

View File

@ -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);