User communication buffer registration lacks check of access rights for provided address range. Using pin_user_pages_fast() instead of pin_user_pages() during user page pinning implicitely introduces the necessary check. It furthermore tries to avoid grabbing the mmap_read_lock. Fixes: 2251334dcac9 ("rdma/siw: application buffer management") Signed-off-by: Bernard Metzler <bmt@xxxxxxxxxxxxxx> --- drivers/infiniband/sw/siw/siw_mem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/sw/siw/siw_mem.c b/drivers/infiniband/sw/siw/siw_mem.c index b2b33dd3b4fa..ba28a5d94fc1 100644 --- a/drivers/infiniband/sw/siw/siw_mem.c +++ b/drivers/infiniband/sw/siw/siw_mem.c @@ -423,8 +423,8 @@ struct siw_umem *siw_umem_get(u64 start, u64 len, bool writable) while (nents) { struct page **plist = &umem->page_chunk[i].plist[got]; - rv = pin_user_pages(first_page_va, nents, foll_flags, - plist, NULL); + rv = pin_user_pages_fast(first_page_va, nents, + foll_flags, plist); if (rv < 0) goto out_sem_up; -- 2.32.0