Skip to contentSkip to conversation

CVE-2022-50622: ext4: fix potential memory leak in ext4_fc_record_modified_inode()

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Dec 8, 2025

lore
Share & tools
lore
#0 lore raw

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

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

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

ext4: fix potential memory leak in ext4_fc_record_modified_inode()

As krealloc may return NULL, in this case 'state->fc_modified_inodes' may not be freed by krealloc, but 'state->fc_modified_inodes' already set NULL. Then will lead to 'state->fc_modified_inodes' memory leak.

The Linux kernel CVE team has assigned CVE-2022-50622 to this issue.

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

	Fixed in 5.10.150 with commit c9ce7766dc4e88e624c62a68221a3bbe8f06e856
	Fixed in 5.15.75 with commit 9b5eb368a86f97eb9831f5b53b8e43ec69bc7cd4
	Fixed in 5.19.17 with commit c0be17635f039f864b1108efec0015c73736e414
	Fixed in 6.0.3 with commit 24d39affc6be1acf6df86a8c3e2413b8a73749c7
	Fixed in 6.1 with commit 9305721a309fa1bd7c194e0d4a2335bf3b29dca4

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-50622

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/ext4/fast_commit.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/c9ce7766dc4e88e624c62a68221a3bbe8f06e856
	https://git.kernel.org/stable/c/9b5eb368a86f97eb9831f5b53b8e43ec69bc7cd4
	https://git.kernel.org/stable/c/c0be17635f039f864b1108efec0015c73736e414
	https://git.kernel.org/stable/c/24d39affc6be1acf6df86a8c3e2413b8a73749c7
	https://git.kernel.org/stable/c/9305721a309fa1bd7c194e0d4a2335bf3b29dca4