linux-stable/net/xfrm
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
..
Kconfig
Makefile
espintcp.c net-next: skbuff: refactor pskb_pull 2022-09-30 12:31:46 +01:00
xfrm_algo.c xfrm: Add support for SM4 symmetric cipher algorithm 2021-12-23 09:32:51 +01:00
xfrm_compat.c xfrm: rate limit SA mapping change message to user space 2021-12-23 09:32:51 +01:00
xfrm_device.c xfrm: add extack support to xfrm_dev_state_add 2022-09-22 07:36:07 +02:00
xfrm_hash.c
xfrm_hash.h
xfrm_inout.h
xfrm_input.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-10-03 17:44:18 -07:00
xfrm_interface.c xfrm: lwtunnel: add lwtunnel support for xfrm interfaces in collect_md mode 2022-08-29 10:44:08 +02:00
xfrm_ipcomp.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-10-03 17:44:18 -07:00
xfrm_output.c Revert "xfrm: update SA curlft.use_time" 2022-08-03 07:27:37 +02:00
xfrm_policy.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next 2022-10-03 07:52:13 +01:00
xfrm_proc.c
xfrm_replay.c xfrm: add extack support to xfrm_init_replay 2022-09-22 07:36:08 +02:00
xfrm_state.c treewide: use get_random_u32_inclusive() when possible 2022-11-18 02:18:02 +01:00
xfrm_sysctl.c
xfrm_user.c xfrm: add extack support to xfrm_init_replay 2022-09-22 07:36:08 +02:00