Skip to contentSkip to conversation

CVE-2022-50402: drivers/md/md-bitmap: check the return value of md_bitmap_get_counter()

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Sep 18, 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:

drivers/md/md-bitmap: check the return value of md_bitmap_get_counter()

Check the return value of md_bitmap_get_counter() in case it returns NULL pointer, which will result in a null pointer dereference.

v2: update the check to include other dereference

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

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

	Fixed in 4.19.270 with commit 21e9aac9a74d30907d44bae0d24c036cb3819406
	Fixed in 5.4.229 with commit 5d8d046f3dba939e74e2414f009df426700430ed
	Fixed in 5.10.163 with commit 100caacfa0ed26e061954c90cdc835d42f709536
	Fixed in 5.15.86 with commit b621d17fe8b079574c773800148fb86907f3445d
	Fixed in 6.0.16 with commit ff3b7e12bc9f50de05c9d82b5b79e23e5be888f1
	Fixed in 6.1.2 with commit 99bef41f8e8d1d52b5cb34f2f193f1346192752b
	Fixed in 6.2 with commit 3bd548e5b819b8c0f2c9085de775c5c7bff9052f

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

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:
drivers/md/md-bitmap.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/21e9aac9a74d30907d44bae0d24c036cb3819406
	https://git.kernel.org/stable/c/5d8d046f3dba939e74e2414f009df426700430ed
	https://git.kernel.org/stable/c/100caacfa0ed26e061954c90cdc835d42f709536
	https://git.kernel.org/stable/c/b621d17fe8b079574c773800148fb86907f3445d
	https://git.kernel.org/stable/c/ff3b7e12bc9f50de05c9d82b5b79e23e5be888f1
	https://git.kernel.org/stable/c/99bef41f8e8d1d52b5cb34f2f193f1346192752b
	https://git.kernel.org/stable/c/3bd548e5b819b8c0f2c9085de775c5c7bff9052f