linux-stable/fs
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
..
9p
adfs
affs
afs struct file-related stuff 2022-10-06 17:13:18 -07:00
autofs
befs
bfs
btrfs 22 hotfixes. 8 are cc:stable and the remainder address issues which were 2022-11-11 17:18:42 -08:00
cachefiles
ceph treewide: use get_random_u32_below() instead of deprecated function 2022-11-18 02:15:15 +01:00
cifs cifs: fix use-after-free on the link name 2022-11-04 23:36:54 -05:00
coda
configfs
cramfs
crypto fscrypt: fix keyring memory leak on mount failure 2022-10-19 20:54:43 -07:00
debugfs
devpts
dlm Networking changes for 6.1. 2022-10-04 13:38:03 -07:00
ecryptfs whack-a-mole: constifying struct path * 2022-10-06 17:31:02 -07:00
efivarfs efi: efivars: Fix variable writes without query_variable_store() 2022-10-21 11:09:40 +02:00
efs
erofs fs: fix leaked psi pressure state 2022-11-08 15:57:25 -08:00
exfat treewide: use get_random_u32() when possible 2022-10-11 17:42:58 -06:00
exportfs
ext2 treewide: use get_random_u32_below() instead of deprecated function 2022-11-18 02:15:15 +01:00
ext4 treewide: use get_random_u32_{above,below}() instead of manual loop 2022-11-18 02:15:22 +01:00
f2fs treewide: use get_random_u32_inclusive() when possible 2022-11-18 02:18:02 +01:00
fat treewide: use get_random_u32() when possible 2022-10-11 17:42:58 -06:00
freevxfs
fscache
fuse fuse: add file_modified() to fallocate 2022-10-28 14:25:20 +02:00
gfs2 gfs2 debugfs improvements 2022-10-10 20:13:22 -07:00
hfs
hfsplus
hostfs
hpfs
hugetlbfs hugetlbfs: don't delete error page from pagecache 2022-11-08 15:57:22 -08:00
iomap
isofs - hfs and hfsplus kmap API modernization from Fabio Francesco 2022-10-12 11:00:22 -07:00
jbd2 - Yu Zhao's Multi-Gen LRU patches are here. They've been under test in 2022-10-10 17:53:04 -07:00
jffs2
jfs
kernfs
ksmbd 24 ksmbd server fixes 2022-10-07 08:19:26 -07:00
lockd
minix
netfs
nfs nfs4: Fix kmemleak when allocate slot failed 2022-10-27 15:52:11 -04:00
nfs_common
nfsd Fixes: 2022-11-11 11:28:26 -08:00
nilfs2 nilfs2: fix use-after-free bug of ns_writer on remount 2022-11-08 15:57:24 -08:00
nls
notify Merge tag 'fsnotify-for_v6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs 2022-10-07 08:28:50 -07:00
ntfs - hfs and hfsplus kmap API modernization from Fabio Francesco 2022-10-12 11:00:22 -07:00
ntfs3 treewide: use get_random_u32() when possible 2022-10-11 17:42:58 -06:00
ocfs2 ocfs2: clear dinode links count in case of error 2022-10-20 21:27:22 -07:00
omfs
openpromfs
orangefs Orangefs: change iterate to iterate_shared 2022-10-13 09:56:14 -07:00
overlayfs tmpfile API change 2022-10-10 19:45:17 -07:00
proc mm: /proc/pid/smaps_rollup: fix maple tree search 2022-10-20 21:27:23 -07:00
pstore
qnx4
qnx6
quota
ramfs tmpfile API change 2022-10-10 19:45:17 -07:00
reiserfs - hfs and hfsplus kmap API modernization from Fabio Francesco 2022-10-12 11:00:22 -07:00
romfs
smbfs_common smb3: define missing create contexts 2022-10-05 01:55:27 -05:00
squashfs squashfs: fix buffer release race condition in readahead code 2022-10-28 13:37:21 -07:00
sysfs
sysv
tracefs
ubifs treewide: use get_random_u32_below() instead of deprecated function 2022-11-18 02:15:15 +01:00
udf udf: Fix a slab-out-of-bounds write bug in udf_find_entry() 2022-11-09 12:24:42 +01:00
ufs
unicode
vboxsf
verity for-6.1-tag 2022-10-06 17:36:48 -07:00
xfs treewide: use get_random_u32_below() instead of deprecated function 2022-11-18 02:15:15 +01:00
zonefs
Kconfig
Kconfig.binfmt Xtensa updates for v6.1 2022-10-10 14:21:11 -07:00
Makefile
aio.c
anon_inodes.c
attr.c
bad_inode.c
binfmt_elf.c fs/binfmt_elf: Fix memory leak in load_elf_binary() 2022-10-25 15:11:21 -07:00
binfmt_elf_fdpic.c
binfmt_elf_test.c
binfmt_flat.c
binfmt_misc.c
binfmt_script.c
buffer.c - hfs and hfsplus kmap API modernization from Fabio Francesco 2022-10-12 11:00:22 -07:00
char_dev.c
compat_binfmt_elf.c
coredump.c - Yu Zhao's Multi-Gen LRU patches are here. They've been under test in 2022-10-10 17:53:04 -07:00
d_path.c
dax.c
dcache.c tmpfile API change 2022-10-10 19:45:17 -07:00
direct-io.c
drop_caches.c
eventfd.c
eventpoll.c
exec.c 23 hotfixes. 2022-10-29 17:49:33 -07:00
fcntl.c
fhandle.c
file.c
file_table.c
filesystems.c
fs-writeback.c
fs_context.c
fs_parser.c
fs_pin.c
fs_struct.c
fs_types.c
fsopen.c
init.c
inode.c saner inode_init_always() 2022-10-06 16:49:00 -07:00
internal.h whack-a-mole: constifying struct path * 2022-10-06 17:31:02 -07:00
ioctl.c
kernel_read_file.c
libfs.c
locks.c
mbcache.c
mount.h
mpage.c
namei.c tmpfile API change 2022-10-10 19:45:17 -07:00
namespace.c
no-block.c
nsfs.c
open.c struct file-related stuff 2022-10-06 17:13:18 -07:00
pipe.c
pnode.c
pnode.h
posix_acl.c - Yu Zhao's Multi-Gen LRU patches are here. They've been under test in 2022-10-10 17:53:04 -07:00
proc_namespace.c
read_write.c
readdir.c
remap_range.c
select.c
seq_file.c
signalfd.c
splice.c
stack.c
stat.c
statfs.c
super.c fscrypt: fix keyring memory leak on mount failure 2022-10-19 20:54:43 -07:00
sync.c
sysctls.c
timerfd.c
userfaultfd.c fs/userfaultfd: Fix maple tree iterator in userfaultfd_unregister() 2022-11-07 12:58:26 -08:00
utimes.c
xattr.c