Subject: CVE-2024-35914: nfsd: Fix error cleanup path in nfsd_rename()

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

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

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

nfsd: Fix error cleanup path in nfsd_rename()

Commit a8b0026847b8 ("rename(): avoid a deadlock in the case of parents
having no common ancestor") added an error bail out path. However this
path does not drop the remount protection that has been acquired. Fix
the cleanup path to properly drop the remount protection.

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

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

	Issue introduced in 6.8 with commit a8b0026847b8 and fixed in 6.8.5 with commit 331e125e02c0
	Issue introduced in 6.8 with commit a8b0026847b8 and fixed in 6.9 with commit 9fe6e9e7b589

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-35914
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/vfs.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/331e125e02c08ffaecc1074af78a988a278039bd
	https://git.kernel.org/stable/c/9fe6e9e7b58944037714442384075c17cfde1c56