Skip to content

Commit 69309e1

Browse files
jgunthorperleon
authored andcommitted
RDMA/irdma: Add missing comp_mask check in alloc_ucontext
irdma has a comp_mask field that was never checked for validity, check it. Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Reviewed-by: Jacob Moroni <jmoroni@google.com> Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
1 parent 67820de commit 69309e1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/infiniband/hw/irdma/verbs.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,9 @@ static int irdma_alloc_ucontext(struct ib_ucontext *uctx,
296296
if (udata->outlen < IRDMA_ALLOC_UCTX_MIN_RESP_LEN)
297297
return -EINVAL;
298298

299-
ret = ib_copy_validate_udata_in(udata, req, rsvd8);
299+
ret = ib_copy_validate_udata_in_cm(udata, req, rsvd8,
300+
IRDMA_ALLOC_UCTX_USE_RAW_ATTR |
301+
IRDMA_SUPPORT_WQE_FORMAT_V2);
300302
if (ret)
301303
return ret;
302304

0 commit comments

Comments
 (0)