Subject: CVE-2023-52526: erofs: fix memory leak of LZMA global compressed deduplication

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

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

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

erofs: fix memory leak of LZMA global compressed deduplication

When stressing microLZMA EROFS images with the new global compressed
deduplication feature enabled (`-Ededupe`), I found some short-lived
temporary pages weren't properly released, which could slowly cause
unexpected OOMs hours later.

Let's fix it now (LZ4 and DEFLATE don't have this issue.)

The Linux kernel CVE team has assigned CVE-2023-52526 to this issue.

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

	Issue introduced in 6.1 with commit 5c2a64252c5d and fixed in 6.1.57 with commit 6a5a8f0a9740
	Issue introduced in 6.1 with commit 5c2a64252c5d and fixed in 6.5.7 with commit c955751cbf86
	Issue introduced in 6.1 with commit 5c2a64252c5d and fixed in 6.6 with commit 75a5221630fe

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-2023-52526
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/erofs/decompressor_lzma.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/6a5a8f0a9740f865693d5aa97a42cc4504538e18
	https://git.kernel.org/stable/c/c955751cbf864cf2055117dd3fe7f780d2a57b56
	https://git.kernel.org/stable/c/75a5221630fe5aa3fedba7a06be618db0f79ba1e