linux-stable/drivers/infiniband/hw
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
..
bnxt_re IB: move from strlcpy with unused retval to strscpy 2022-08-21 14:18:02 +03:00
cxgb4 treewide: use get_random_u32_below() instead of deprecated function 2022-11-18 02:15:15 +01:00
efa RDMA/efa: Add EFA 0xefa2 PCI ID 2022-10-24 14:11:58 +03:00
erdma Linux 6.0 2022-10-06 19:48:45 -03:00
hfi1 IB/hfi1: Correctly move list in sc_disable() 2022-10-19 10:06:07 +03:00
hns treewide: use get_random_u32_inclusive() when possible 2022-11-18 02:18:02 +01:00
irdma Linux 6.0 2022-10-06 19:48:45 -03:00
mlx4 treewide: use get_random_u32() when possible 2022-10-11 17:42:58 -06:00
mlx5 v6.1 merge window pull request 2022-10-07 12:05:29 -07:00
mthca IB: move from strlcpy with unused retval to strscpy 2022-08-21 14:18:02 +03:00
ocrdma IB: move from strlcpy with unused retval to strscpy 2022-08-21 14:18:02 +03:00
qedr RDMA/qedr: clean up work queue on failure in qedr_alloc_resources() 2022-10-28 12:59:40 -03:00
qib RDMA/qib: fix repeated words in comments 2022-09-20 14:11:14 +03:00
usnic RDMA/usnic: fix set-but-not-unused variable 'flags' warning 2022-09-29 11:32:53 +03:00
vmw_pvrdma
Makefile RDMA/erdma: Add driver to kernel build environment 2022-07-27 16:04:05 -03:00