Subject: CVE-2024-49974: NFSD: Limit the number of concurrent async COPY operations

From: Greg Kroah-Hartman <[email-masked]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

NFSD: Limit the number of concurrent async COPY operations

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.

The Linux kernel CVE team has assigned CVE-2024-49974 to this issue.

Affected and fixed versions
===========================

	Fixed in 6.10.14 with commit b4e21431a0db
	Fixed in 6.11.3 with commit 6a488ad7745b
	Fixed in 6.12-rc1 with commit aadc3bbea163

Please see https://www.kernel.org for a full list of currently supported
kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to
older supported kernel versions.  The official CVE entry at
	https://cve.org/CVERecord/?id=CVE-2024-49974
will be updated if fixes are backported, please check that for the most
up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
	fs/nfsd/netns.h
	fs/nfsd/nfs4proc.c
	fs/nfsd/nfs4state.c
	fs/nfsd/xdr4.h

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest
stable kernel version for this, and many other bugfixes.  Individual
changes are never tested alone, but rather are part of a larger kernel
release.  Cherry-picking individual commits is not recommended or
supported by the Linux kernel community at all.  If however, updating to
the latest release is impossible, the individual changes to resolve this
issue can be found at these commits:
	https://git.kernel.org/stable/c/b4e21431a0db4854b5023cd5af001be557e6c3db
	https://git.kernel.org/stable/c/6a488ad7745b8f64625c6d3a24ce7e448e83f11b
	https://git.kernel.org/stable/c/aadc3bbea163b6caaaebfdd2b6c4667fbc726752