forked from Minki/linux
RDMA/i40w: Hold read semaphore while looking after VMA
VMA lookup is supposed to be performed while mmap_sem is held.
Fixes: f26c7c8339
("i40iw: Add 2MB page support")
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
parent
f1228867ad
commit
5d9a2b0e28
@ -1410,6 +1410,7 @@ static void i40iw_set_hugetlb_values(u64 addr, struct i40iw_mr *iwmr)
|
||||
struct vm_area_struct *vma;
|
||||
struct hstate *h;
|
||||
|
||||
down_read(¤t->mm->mmap_sem);
|
||||
vma = find_vma(current->mm, addr);
|
||||
if (vma && is_vm_hugetlb_page(vma)) {
|
||||
h = hstate_vma(vma);
|
||||
@ -1418,6 +1419,7 @@ static void i40iw_set_hugetlb_values(u64 addr, struct i40iw_mr *iwmr)
|
||||
iwmr->page_msk = huge_page_mask(h);
|
||||
}
|
||||
}
|
||||
up_read(¤t->mm->mmap_sem);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user