Subject: CVE-2021-47320: nfs: fix acl memory leak of posix_acl_create()

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

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

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

nfs: fix acl memory leak of posix_acl_create()

When looking into another nfs xfstests report, I found acl and
default_acl in nfs3_proc_create() and nfs3_proc_mknod() error
paths are possibly leaked. Fix them in advance.

The Linux kernel CVE team has assigned CVE-2021-47320 to this issue.

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

	Issue introduced in 3.14 with commit 013cdf1088d7 and fixed in 4.4.276 with commit 2e3960f276b4
	Issue introduced in 3.14 with commit 013cdf1088d7 and fixed in 4.9.276 with commit cef9d9acb7c8
	Issue introduced in 3.14 with commit 013cdf1088d7 and fixed in 4.14.240 with commit 8a2b308a54c5
	Issue introduced in 3.14 with commit 013cdf1088d7 and fixed in 4.19.198 with commit 0704f617040c
	Issue introduced in 3.14 with commit 013cdf1088d7 and fixed in 5.4.134 with commit d0b32dc1409f
	Issue introduced in 3.14 with commit 013cdf1088d7 and fixed in 5.10.52 with commit 4b515308ab87
	Issue introduced in 3.14 with commit 013cdf1088d7 and fixed in 5.12.19 with commit c8fc86e9df6a
	Issue introduced in 3.14 with commit 013cdf1088d7 and fixed in 5.13.4 with commit 687cf32865b2
	Issue introduced in 3.14 with commit 013cdf1088d7 and fixed in 5.14 with commit 1fcb6fcd74a2

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-2021-47320
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/nfs/nfs3proc.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/2e3960f276b4574a9bb0dfa31a7497302f6363b2
	https://git.kernel.org/stable/c/cef9d9acb7c80ed6bace894b6334557fd493863b
	https://git.kernel.org/stable/c/8a2b308a54c5ec224fedc753617f99b29ffcd883
	https://git.kernel.org/stable/c/0704f617040c397ae73c1f88f3956787ec5d6529
	https://git.kernel.org/stable/c/d0b32dc1409f7e65e4fcc34e236462268e69a357
	https://git.kernel.org/stable/c/4b515308ab875c7e8ada8e606fe0c64762da5ed4
	https://git.kernel.org/stable/c/c8fc86e9df6a6a03f5a8e15a3b7a5c75fd05aa38
	https://git.kernel.org/stable/c/687cf32865b2d6960214bce523f2afac58dd3cd2
	https://git.kernel.org/stable/c/1fcb6fcd74a222d9ead54d405842fc763bb86262