linux-stable/fs
Chuck Lever b4e21431a0 NFSD: Limit the number of concurrent async COPY operations
[ Upstream commit aadc3bbea1 ]

Nothing appears to limit the number of concurrent async COPY
operations that clients can start. In addition, AFAICT each async
COPY can copy an unlimited number of 4MB chunks, so can run for a
long time. Thus IMO async COPY can become a DoS vector.

Add a restriction mechanism that bounds the number of concurrent
background COPY operations. Start simple and try to be fair -- this
patch implements a per-namespace limit.

An async COPY request that occurs while this limit is exceeded gets
NFS4ERR_DELAY. The requesting client can choose to send the request
again after a delay or fall back to a traditional read/write style
copy.

If there is need to make the mechanism more sophisticated, we can
visit that in future patches.

Cc: stable@vger.kernel.org
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-10-10 12:01:11 +02:00
..
9p Two fixes headed to stable trees: 2024-05-29 09:25:15 -07:00
adfs mm, slab: remove last vestiges of SLAB_MEM_SPREAD 2024-03-12 20:32:19 -07:00
affs affs: remove SLAB_MEM_SPREAD flag usage 2024-02-26 11:36:28 +01:00
afs afs: Fix the setting of the server responding flag 2024-10-10 12:00:06 +02:00
autofs autofs: fix missing fput for FSCONFIG_SET_FD 2024-10-04 16:32:20 +02:00
bcachefs bcachefs: Don't delete open files in online fsck 2024-09-18 19:25:13 +02:00
befs mm, slab: remove last vestiges of SLAB_MEM_SPREAD 2024-03-12 20:32:19 -07:00
bfs mm, slab: remove last vestiges of SLAB_MEM_SPREAD 2024-03-12 20:32:19 -07:00
btrfs btrfs: wait for fixup workers before stopping cleaner kthread during umount 2024-10-10 12:01:05 +02:00
cachefiles cachefiles: fix dentry leak in cachefiles_open_file() 2024-10-10 12:01:03 +02:00
ceph ceph: fix cap ref leak via netfs init_request 2024-10-10 12:01:06 +02:00
coda mm, slab: remove last vestiges of SLAB_MEM_SPREAD 2024-03-12 20:32:19 -07:00
configfs
cramfs use ->bd_mapping instead of ->bd_inode->i_mapping 2024-05-03 02:36:51 -04:00
crypto The usual shower of singleton fixes and minor series all over MM, 2024-05-19 09:21:03 -07:00
debugfs debugfs show actual source in /proc/mounts 2024-10-04 16:33:46 +02:00
devpts fs: Remove the now superfluous sentinel elements from ctl_table array 2023-12-28 04:57:57 -08:00
dlm dlm: return -ENOMEM if ls_recover_buf fails 2024-04-23 16:08:55 -05:00
ecryptfs hardening updates for 6.10-rc1 2024-05-13 14:14:05 -07:00
efivarfs efi: Clear up misconceptions about a maximum variable name size 2024-04-13 10:33:02 +02:00
efs efs: remove SLAB_MEM_SPREAD flag usage 2024-02-27 11:21:33 +01:00
erofs erofs: handle overlapped pclusters out of crafted images properly 2024-10-04 16:32:32 +02:00
exfat exfat: fix memory leak in exfat_load_bitmap() 2024-10-10 12:00:57 +02:00
exportfs fs: Create a generic is_dot_dotdot() utility 2024-01-23 10:58:56 -05:00
ext2 ext2: Verify bitmap and itable block numbers before using them 2024-08-03 09:00:34 +02:00
ext4 ext4: fix off by one issue in alloc_flex_gd() 2024-10-10 12:00:53 +02:00
f2fs f2fs: forcibly migrate to secure space for zoned device file pinning 2024-10-10 12:00:45 +02:00
fat fs: add kernel-doc comments to fat_parse_long() 2024-04-25 21:07:02 -07:00
freevxfs freevxfs: Convert freevxfs to the new mount API. 2024-03-26 09:04:53 +01:00
fuse fuse: use exclusive lock when FUSE_I_CACHE_IO_MODE is set 2024-10-04 16:33:22 +02:00
gfs2 gfs2: Revert "Add quota_change type" 2024-09-08 07:56:35 +02:00
hfs hfs: fix to initialize fields of hfs_inode_info after hfs_alloc_inode() 2024-08-03 09:00:34 +02:00
hfsplus hfsplus: fix to avoid false alarm of circular locking 2024-08-03 08:59:11 +02:00
hostfs hostfs: fix dev_t handling 2024-08-03 09:00:45 +02:00
hpfs mm, slab: remove last vestiges of SLAB_MEM_SPREAD 2024-03-12 20:32:19 -07:00
hugetlbfs The usual shower of singleton fixes and minor series all over MM, 2024-05-19 09:21:03 -07:00
iomap iomap: handle a post-direct I/O invalidate race in iomap_write_delalloc_release 2024-10-10 12:00:40 +02:00
isofs isofs: Use *-y instead of *-objs in Makefile 2024-05-09 18:09:57 +02:00
jbd2 jbd2: correctly compare tids with tid_geq function in jbd2_fc_begin_commit 2024-10-10 12:00:54 +02:00
jffs2 This pull request contains the following changes for JFFS2: 2024-05-25 13:23:42 -07:00
jfs jfs: Fix uninit-value access of new_ea in ea_buffer 2024-10-10 12:00:32 +02:00
kernfs kernfs: mount: Remove unnecessary ‘NULL’ values from knparent 2024-05-04 19:02:39 +02:00
lockd lockd: host: Remove unnecessary statements'host = NULL;' 2024-05-06 09:07:20 -04:00
minix minixfs: Fix minixfs_rename with HIGHMEM 2024-07-10 07:15:36 +02:00
netfs netfs: Cancel dirty folios that have no storage destination 2024-10-10 12:00:22 +02:00
nfs nfs: fix memory leak in error path of nfs4_do_reclaim 2024-10-04 16:33:41 +02:00
nfs_common
nfsd NFSD: Limit the number of concurrent async COPY operations 2024-10-10 12:01:11 +02:00
nilfs2 nilfs2: fix potential oob read in nilfs_btree_check_delete() 2024-10-04 16:32:58 +02:00
nls
notify fsnotify: clear PARENT_WATCHED flags lazily 2024-09-08 07:56:34 +02:00
ntfs3 fs/ntfs3: Check more cases when directory is corrupted 2024-09-12 11:13:02 +02:00
ocfs2 ocfs2: fix possible null-ptr-deref in ocfs2_set_buffer_uptodate 2024-10-10 12:00:56 +02:00
omfs
openpromfs openpromfs: finish conversion to the new mount API 2024-03-26 09:04:54 +01:00
orangefs orangefs: fix out-of-bounds fsid access 2024-05-14 17:44:14 -07:00
overlayfs ovl: fail if trusted xattrs are needed but caller lacks permission 2024-10-10 12:00:47 +02:00
proc sysctl: avoid spurious permanent empty tables 2024-10-10 12:00:58 +02:00
pstore pstore/zone: Don't clear memory twice 2024-03-09 12:33:22 -08:00
qnx4 mm, slab: remove last vestiges of SLAB_MEM_SPREAD 2024-03-12 20:32:19 -07:00
qnx6 qnx6: convert qnx6 to use the new mount api 2024-03-26 09:04:53 +01:00
quota quota: avoid missing put_quota_format when DQUOT_SUSPENDED is passed 2024-10-04 16:33:03 +02:00
ramfs mm: switch mm->get_unmapped_area() to a flag 2024-04-25 20:56:25 -07:00
reiserfs getting rid of bogus set_blocksize() uses, switching it 2024-05-21 08:34:51 -07:00
romfs fs,block: yield devices early 2024-03-27 13:17:15 +01:00
smb smb3: fix incorrect mode displayed for read-only files 2024-10-10 12:01:02 +02:00
squashfs Squashfs: sanity check symbolic link size 2024-09-12 11:13:04 +02:00
sysfs Merge 6.9-rc5 into driver-core-next 2024-04-23 13:27:43 +02:00
sysv sysv: remove SLAB_MEM_SPREAD flag usage 2024-02-27 11:21:31 +01:00
tracefs eventfs: Use list_del_rcu() for SRCU protected list variable 2024-09-12 11:12:47 +02:00
ubifs This pull request contains updates for UBI and UBIFS: 2024-03-21 15:09:29 -07:00
udf udf: Avoid excessive partition lengths 2024-09-12 11:12:51 +02:00
ufs mm, slab: remove last vestiges of SLAB_MEM_SPREAD 2024-03-12 20:32:19 -07:00
unicode kbuild: use $(src) instead of $(srctree)/$(src) for source directory 2024-05-10 04:34:52 +09:00
vboxsf vboxsf: explicitly deny setlease attempts 2024-04-03 16:06:39 +02:00
verity fsverity: use register_sysctl_init() to avoid kmemleak warning 2024-05-03 08:30:58 -07:00
xfs xfs: xfs_finobt_count_blocks() walks the wrong btree 2024-09-12 11:12:42 +02:00
zonefs zonefs: Use str_plural() to fix Coccinelle warning 2024-04-10 07:23:47 +09:00
aio.c Assorted commits that had missed the last merge window... 2024-05-21 13:11:44 -07:00
anon_inodes.c fs: Create anon_inode_getfile_fmode() 2024-04-26 10:33:05 +02:00
attr.c fs/nfsd: fix update of inode attrs in CB_GETATTR 2024-09-04 13:30:05 +02:00
backing-file.c backing-file: convert to using fops->splice_write 2024-09-04 13:30:03 +02:00
bad_inode.c
binfmt_elf_fdpic.c binfmt_elf_fdpic: fix AUXV size calculation when ELF_HWCAP2 is defined 2024-09-04 13:29:59 +02:00
binfmt_elf_test.c
binfmt_elf.c ELF: fix kernel.randomize_va_space double read 2024-09-12 11:12:50 +02:00
binfmt_flat.c binfmt_flat: Fix corruption when not offsetting data start 2024-08-19 06:05:39 +02:00
binfmt_misc.c
binfmt_script.c
buffer.c ext4: sanity check for NULL pointer after ext4_force_shutdown 2024-08-14 15:34:16 +02:00
char_dev.c As usual, lots of singleton and doubleton patches all over the tree and 2023-11-02 20:53:31 -10:00
compat_binfmt_elf.c
coredump.c virtio: features, fixes, cleanups 2024-05-23 12:04:36 -07:00
d_path.c
dax.c iomap: constrain the file range passed to iomap_file_unshare 2024-10-10 12:00:09 +02:00
dcache.c vfs-6.10-rc8.fixes 2024-07-11 09:03:28 -07:00
direct-io.c fs/direct-io: remove redundant assignment to variable retval 2024-04-11 10:21:24 +02:00
drop_caches.c
eventfd.c eventfd: strictly check the count parameter of eventfd_write to avoid inputting illegal strings 2024-02-08 10:12:26 +01:00
eventpoll.c eventpoll: Annotate data-race of busy_poll_usecs 2024-10-04 16:33:41 +02:00
exec.c parisc: Fix stack start for ADDR_NO_RANDOMIZE personality 2024-10-10 12:00:53 +02:00
fcntl.c fs: Fix file_set_fowner LSM hook inconsistencies 2024-10-04 16:33:41 +02:00
fhandle.c fs: Annotate struct file_handle with __counted_by() and use struct_size() 2024-04-05 15:53:47 +02:00
file_table.c lsm/stable-6.9 PR 20240312 2024-03-12 20:03:34 -07:00
file.c close_range(): fix the logics in descriptor table trimming 2024-10-10 12:01:07 +02:00
filesystems.c
fs_context.c
fs_parser.c fs_parse: add uid & gid option option parsing helpers 2024-10-04 16:33:46 +02:00
fs_pin.c
fs_struct.c
fs_types.c
fs-writeback.c fs/writeback: remove unnecessary return in writeback_inodes_sb 2024-04-05 15:53:45 +02:00
fsopen.c
init.c
inode.c fs/inode: Prevent dump_mapping() accessing invalid dentry.d_name.name 2024-10-10 12:00:15 +02:00
internal.h ovl: implement tmpfile 2024-05-02 20:35:57 +02:00
ioctl.c fs/ioctl: Add a comment to keep the logic in sync with LSM policies 2024-05-13 06:58:35 +02:00
Kconfig - Sumanth Korikkar has taught s390 to allocate hotplug-time page frames 2024-03-14 17:43:30 -07:00
Kconfig.binfmt
kernel_read_file.c
libfs.c libfs: fix get_stashed_dentry() 2024-09-12 11:12:41 +02:00
locks.c filelock: fix name of file_lease slab cache 2024-08-29 17:35:45 +02:00
Makefile vfs-6.9.pidfd 2024-03-11 10:21:06 -07:00
mbcache.c vfs: remove SLAB_MEM_SPREAD flag usage 2024-02-27 11:21:31 +01:00
mnt_idmapping.c fs/mnt_idmapping.c: Return -EINVAL when no map is written 2024-02-08 10:12:37 +01:00
mount.h mounts: keep list of mounts in an rbtree 2023-11-18 14:56:16 +01:00
mpage.c block, fs: Restore the per-bio/request data lifetime fields 2024-02-06 14:31:05 +01:00
namei.c vfs: generate FS_CREATE before FS_OPEN when ->atomic_open used. 2024-06-18 16:26:09 +02:00
namespace.c mount: handle OOM on mnt_warn_timestamp_expiry 2024-10-04 16:32:19 +02:00
nsfs.c pidfs: remove config option 2024-03-13 12:53:53 -07:00
open.c vfs-6.10-rc7.fixes 2024-07-01 09:22:08 -07:00
pidfs.c fs/pidfs: make 'lsof' happy with our inode changes 2024-05-21 08:08:00 -07:00
pipe.c fs/pipe: Convert to lockdep_cmp_fn 2024-02-02 13:11:49 +01:00
pnode.c mounts: keep list of mounts in an rbtree 2023-11-18 14:56:16 +01:00
pnode.h
posix_acl.c lsm/stable-6.9 PR 20240312 2024-03-12 20:03:34 -07:00
proc_namespace.c namespace: extract show_path() helper 2023-11-18 14:56:16 +01:00
read_write.c Assorted commits that had missed the last merge window... 2024-05-21 13:11:44 -07:00
readdir.c fsnotify: optionally pass access range in file permission hooks 2023-12-12 16:20:02 +01:00
remap_range.c vfs: export remap and write check helpers 2024-04-15 14:54:13 -07:00
select.c fs/select: rework stack allocation hack for clang 2024-02-20 09:23:52 +01:00
seq_file.c seq_file: Simplify __seq_puts() 2024-05-02 16:28:20 +02:00
signalfd.c signalfd: drop an obsolete comment 2024-05-24 13:34:07 +02:00
splice.c remove call_{read,write}_iter() functions 2024-04-15 16:03:25 -04:00
stack.c
stat.c statx: stx_subvol 2024-03-26 09:01:18 +01:00
statfs.c
super.c fs: don't allow non-init s_user_ns for filesystems without FS_USERNS_MOUNT 2024-08-03 09:01:09 +02:00
sync.c
sysctls.c fs: Remove the now superfluous sentinel elements from ctl_table array 2023-12-28 04:57:57 -08:00
timerfd.c timerfd: convert to ->read_iter() 2024-04-10 16:23:02 -06:00
userfaultfd.c Fix userfaultfd_api to return EINVAL as expected 2024-07-03 22:40:36 -07:00
utimes.c
xattr.c vfs: Fix potential circular locking through setxattr() and removexattr() 2024-09-12 11:13:03 +02:00