linux-stable/arch
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
..
alpha asm-generic: arch/alpha regression fix for 6.1 2022-10-14 13:47:42 -07:00
arc ARC: mm: fix leakage of memory allocated for PTE 2022-10-17 16:32:12 -07:00
arm treewide: use get_random_u32_below() instead of deprecated function 2022-11-18 02:15:15 +01:00
arm64 treewide: use get_random_u32_below() instead of deprecated function 2022-11-18 02:15:15 +01:00
csky - hfs and hfsplus kmap API modernization from Fabio Francesco 2022-10-12 11:00:22 -07:00
hexagon - hfs and hfsplus kmap API modernization from Fabio Francesco 2022-10-12 11:00:22 -07:00
ia64 - hfs and hfsplus kmap API modernization from Fabio Francesco 2022-10-12 11:00:22 -07:00
loongarch treewide: use get_random_u32_below() instead of deprecated function 2022-11-18 02:15:15 +01:00
m68k - hfs and hfsplus kmap API modernization from Fabio Francesco 2022-10-12 11:00:22 -07:00
microblaze - hfs and hfsplus kmap API modernization from Fabio Francesco 2022-10-12 11:00:22 -07:00
mips treewide: use get_random_u32_below() instead of deprecated function 2022-11-18 02:15:15 +01:00
nios2 - hfs and hfsplus kmap API modernization from Fabio Francesco 2022-10-12 11:00:22 -07:00
openrisc OpenRISC 6.1 Updates 2022-10-15 16:47:33 -07:00
parisc treewide: use get_random_u32_below() instead of deprecated function 2022-11-18 02:15:15 +01:00
powerpc treewide: use get_random_u32_below() instead of deprecated function 2022-11-18 02:15:15 +01:00
riscv RISC-V Fixes for 6.1-rc5 2022-11-11 09:40:19 -08:00
s390 treewide: use get_random_u32_below() instead of deprecated function 2022-11-18 02:15:15 +01:00
sh - hfs and hfsplus kmap API modernization from Fabio Francesco 2022-10-12 11:00:22 -07:00
sparc treewide: use get_random_u32_below() instead of deprecated function 2022-11-18 02:15:15 +01:00
um treewide: use get_random_u32_below() instead of deprecated function 2022-11-18 02:15:15 +01:00
x86 treewide: use get_random_u32_inclusive() when possible 2022-11-18 02:18:02 +01:00
xtensa - hfs and hfsplus kmap API modernization from Fabio Francesco 2022-10-12 11:00:22 -07:00
.gitignore
Kconfig - Yu Zhao's Multi-Gen LRU patches are here. They've been under test in 2022-10-10 17:53:04 -07:00