Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

RDMA/pvrdma: Use ib_copy_validate_udata_in() for srq

struct pvrdma_create_srq was introduced when the driver was first
merged but was never used. At that point it had only buf_addr. Later
when SRQ was introduced the struct was expanded. So unlike the other
cases that grab the first struct member based on git blame this
uses the entire struct.

Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>

authored by

Jason Gunthorpe and committed by
Leon Romanovsky
3268330f 54b3bce9

+2 -3
+2 -3
drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c
··· 134 134 cq->is_kernel = !udata; 135 135 136 136 if (!cq->is_kernel) { 137 - if (ib_copy_from_udata(&ucmd, udata, sizeof(ucmd))) { 138 - ret = -EFAULT; 137 + ret = ib_copy_validate_udata_in(udata, ucmd, reserved); 138 + if (ret) 139 139 goto err_cq; 140 - } 141 140 142 141 cq->umem = ib_umem_get(ibdev, ucmd.buf_addr, ucmd.buf_size, 143 142 IB_ACCESS_LOCAL_WRITE);