RDMA: Use u64_to_user_ptr everywhere
This is already used in many places, get the rest of them too, only to make the code a bit clearer & simpler. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
此提交包含在:
@@ -473,7 +473,7 @@ nomem:
|
||||
tinfo->tidcnt = tididx;
|
||||
tinfo->length = mapped_pages * PAGE_SIZE;
|
||||
|
||||
if (copy_to_user((void __user *)(unsigned long)tinfo->tidlist,
|
||||
if (copy_to_user(u64_to_user_ptr(tinfo->tidlist),
|
||||
tidlist, sizeof(tidlist[0]) * tididx)) {
|
||||
/*
|
||||
* On failure to copy to the user level, we need to undo
|
||||
@@ -513,7 +513,7 @@ int hfi1_user_exp_rcv_clear(struct hfi1_filedata *fd,
|
||||
if (unlikely(tinfo->tidcnt > fd->tid_used))
|
||||
return -EINVAL;
|
||||
|
||||
tidinfo = memdup_user((void __user *)(unsigned long)tinfo->tidlist,
|
||||
tidinfo = memdup_user(u64_to_user_ptr(tinfo->tidlist),
|
||||
sizeof(tidinfo[0]) * tinfo->tidcnt);
|
||||
if (IS_ERR(tidinfo))
|
||||
return PTR_ERR(tidinfo);
|
||||
|
新增問題並參考
封鎖使用者