linux-stable/drivers/infiniband/core
Jason A. Donenfeld e8a533cbeb treewide: use get_random_u32_inclusive() when possible
These cases were done with this Coccinelle:

@@
expression H;
expression L;
@@
- (get_random_u32_below(H) + L)
+ get_random_u32_inclusive(L, H + L - 1)

@@
expression H;
expression L;
expression E;
@@
  get_random_u32_inclusive(L,
  H
- + E
- - E
  )

@@
expression H;
expression L;
expression E;
@@
  get_random_u32_inclusive(L,
  H
- - E
- + E
  )

@@
expression H;
expression L;
expression E;
expression F;
@@
  get_random_u32_inclusive(L,
  H
- - E
  + F
- + E
  )

@@
expression H;
expression L;
expression E;
expression F;
@@
  get_random_u32_inclusive(L,
  H
- + E
  + F
- - E
  )

And then subsequently cleaned up by hand, with several automatic cases
rejected if it didn't make sense contextually.

Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> # for infiniband
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2022-11-18 02:18:02 +01:00
..
Makefile
addr.c
agent.c
agent.h
cache.c
cgroup.c
cm.c RDMA/cm: Use DLID from inbound/outbound PathRecords as the datapath DLID 2022-09-22 12:35:31 +03:00
cm_msgs.h
cm_trace.c
cm_trace.h
cma.c treewide: use get_random_u32_inclusive() when possible 2022-11-18 02:18:02 +01:00
cma_configfs.c IB: move from strlcpy with unused retval to strscpy 2022-08-21 14:18:02 +03:00
cma_priv.h
cma_trace.c
cma_trace.h
core_priv.h
counters.c
cq.c
device.c RDMA/core: Fix null-ptr-deref in ib_core_cleanup() 2022-10-28 12:59:40 -03:00
ib_core_uverbs.c
iwcm.c
iwcm.h
iwpm_msg.c
iwpm_util.c
iwpm_util.h
lag.c RDMA/core: Remove 'device' argument from rdma_build_skb() 2022-08-28 14:29:07 +03:00
mad.c
mad_priv.h
mad_rmpp.c
mad_rmpp.h
mr_pool.c
multicast.c
netlink.c
nldev.c RDMA/core: Fix null-ptr-deref in ib_core_cleanup() 2022-10-28 12:59:40 -03:00
opa_smi.h
packer.c
rdma_core.c
rdma_core.h
restrack.c
restrack.h
roce_gid_mgmt.c
rw.c
sa.h
sa_query.c RDMA/cma: Multiple path records support with netlink channel 2022-09-22 12:35:21 +03:00
security.c
smi.c
smi.h
sysfs.c
trace.c
ucma.c RDMA/core: Rename rdma_route.num_paths field to num_pri_alt_paths 2022-09-22 12:35:13 +03:00
ud_header.c
umem.c
umem_dmabuf.c RDMA: Handle the return code from dma_resv_wait_timeout() properly 2022-08-16 17:13:23 +03:00
umem_odp.c Linux 6.0 2022-10-06 19:48:45 -03:00
user_mad.c
uverbs.h
uverbs_cmd.c IB: Set IOVA/LENGTH on IB_MR in core/uverbs layers 2022-09-22 12:46:39 +03:00
uverbs_ioctl.c RDMA/core: Add UVERBS_ATTR_RAW_FD 2022-09-27 10:15:24 -03:00
uverbs_main.c
uverbs_marshall.c
uverbs_std_types.c
uverbs_std_types_async_fd.c
uverbs_std_types_counters.c
uverbs_std_types_cq.c
uverbs_std_types_device.c
uverbs_std_types_dm.c
uverbs_std_types_flow_action.c
uverbs_std_types_mr.c
uverbs_std_types_qp.c
uverbs_std_types_srq.c
uverbs_std_types_wq.c
uverbs_uapi.c
verbs.c RDMA/core: Clean up a variable name in ib_create_srq_user() 2022-09-22 14:31:05 +03:00