提交 4378d992 编写于 作者: J Jay Cornwall 提交者: Joerg Roedel

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: NJay Cornwall <jay.cornwall@amd.com>
Signed-off-by: NSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Signed-off-by: NJoerg Roedel <joro@8bytes.org>
上级 e028a9e6
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册