Subject: CVE-2024-46697: nfsd: ensure that nfsd4_fattr_args.context is zeroed out

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

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

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

nfsd: ensure that nfsd4_fattr_args.context is zeroed out

If nfsd4_encode_fattr4 ends up doing a "goto out" before we get to
checking for the security label, then args.context will be set to
uninitialized junk on the stack, which we'll then try to free.
Initialize it early.

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

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

	Issue introduced in 6.7 with commit f59388a579c6 and fixed in 6.10.8 with commit dd65b324174a
	Issue introduced in 6.7 with commit f59388a579c6 and fixed in 6.11 with commit f58bab6fd406

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-46697
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/nfs4xdr.c

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/dd65b324174a64558a16ebbf4c3266e5701185d0
	https://git.kernel.org/stable/c/f58bab6fd4063913bd8321e99874b8239e9ba726