mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-23 09:56:00 +00:00
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>
This commit is contained in:
parent
e028a9e6b8
commit
4378d99295
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user