CVE-2022-49113: powerpc/secvar: fix refcount leak in format_show()
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
powerpc/secvar: fix refcount leak in format_show()
Refcount leak will happen when format_show returns failure in multiple cases. Unified management of of_node_put can fix this problem.
The Linux kernel CVE team has assigned CVE-2022-49113 to this issue.
Affected and fixed versions
===========================
Fixed in 5.10.111 with commit 02222bf4f0a27f6eba66d1f597cdb5daadd51829 Fixed in 5.15.34 with commit 2a71e3ecd829a82013cf095c55068c61d991e885 Fixed in 5.16.20 with commit c105ffb6b9744158e37e9f81f0f38861951d1c1f Fixed in 5.17.3 with commit d05e4265d33af60b39606c20c731e3e719bfe3d6 Fixed in 5.18 with commit d601fd24e6964967f115f036a840f4f28488f63f
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-49113
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:
arch/powerpc/kernel/secvar-sysfs.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/02222bf4f0a27f6eba66d1f597cdb5daadd51829 https://git.kernel.org/stable/c/2a71e3ecd829a82013cf095c55068c61d991e885 https://git.kernel.org/stable/c/c105ffb6b9744158e37e9f81f0f38861951d1c1f https://git.kernel.org/stable/c/d05e4265d33af60b39606c20c731e3e719bfe3d6 https://git.kernel.org/stable/c/d601fd24e6964967f115f036a840f4f28488f63f