CVE-2022-50348: nfsd: Fix a memory leak in an error handling path
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
nfsd: Fix a memory leak in an error handling path
If this memdup_user() call fails, the memory allocated in a previous call a few lines above should be freed. Otherwise it leaks.
The Linux kernel CVE team has assigned CVE-2022-50348 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.4 with commit 6ee95d1c899186c0798cafd25998d436bcdb9618 and fixed in 5.4.220 with commit acc393aecda05bf64ed13b732931462e07a1bf08 Issue introduced in 5.4 with commit 6ee95d1c899186c0798cafd25998d436bcdb9618 and fixed in 5.10.150 with commit e060c4b9f33c1fca74df26d57a98e784295327e6 Issue introduced in 5.4 with commit 6ee95d1c899186c0798cafd25998d436bcdb9618 and fixed in 5.15.75 with commit aed8816305575b38dcc77feb6f1bc1d0ed32f5b8 Issue introduced in 5.4 with commit 6ee95d1c899186c0798cafd25998d436bcdb9618 and fixed in 5.19.17 with commit 733dd17158f96aaa25408dc39bbb2738fda9300e Issue introduced in 5.4 with commit 6ee95d1c899186c0798cafd25998d436bcdb9618 and fixed in 6.0.3 with commit cc3bca2110ac85cd964da997ef83d84cab0d49fb Issue introduced in 5.4 with commit 6ee95d1c899186c0798cafd25998d436bcdb9618 and fixed in 6.1 with commit fd1ef88049de09bc70d60b549992524cfc0e66ff
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-2022-50348
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/nfs4recover.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/acc393aecda05bf64ed13b732931462e07a1bf08 https://git.kernel.org/stable/c/e060c4b9f33c1fca74df26d57a98e784295327e6 https://git.kernel.org/stable/c/aed8816305575b38dcc77feb6f1bc1d0ed32f5b8 https://git.kernel.org/stable/c/733dd17158f96aaa25408dc39bbb2738fda9300e https://git.kernel.org/stable/c/cc3bca2110ac85cd964da997ef83d84cab0d49fb https://git.kernel.org/stable/c/fd1ef88049de09bc70d60b549992524cfc0e66ff