Skip to contentSkip to conversation

CVE-2022-49816: xen/pcpu: fix possible memory leak in register_pcpu()

DISCUSSION Greg Kroah-Hartman 3 participants 3 messages May 1, 2025 – May 2, 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:

xen/pcpu: fix possible memory leak in register_pcpu()

In device_add(), dev_set_name() is called to allocate name, if it returns error, the name need be freed. As comment of device_register() says, it should use put_device() to give up the reference in the error path. So fix this by calling put_device(), then the name can be freed in kobject_cleanup().

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

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

	Issue introduced in 3.6 with commit f65c9bb3fb725551d3e405f4d092caf24929cebe and fixed in 4.9.334 with commit ccb22c876e8e7f62377e749c971907efe65d34c2
	Issue introduced in 3.6 with commit f65c9bb3fb725551d3e405f4d092caf24929cebe and fixed in 4.14.300 with commit 7ed540bcee2e24479524b9705cc7462b2652f944
	Issue introduced in 3.6 with commit f65c9bb3fb725551d3e405f4d092caf24929cebe and fixed in 4.19.267 with commit 6209a85079a035b5c2279b15b197531156b549fa
	Issue introduced in 3.6 with commit f65c9bb3fb725551d3e405f4d092caf24929cebe and fixed in 5.4.225 with commit 0199bf0a8f74509736744c9e36f4473a5892a09d
	Issue introduced in 3.6 with commit f65c9bb3fb725551d3e405f4d092caf24929cebe and fixed in 5.10.156 with commit bb9924a6edd9d4a9ef83a5f337af60f8a7a68f98
	Issue introduced in 3.6 with commit f65c9bb3fb725551d3e405f4d092caf24929cebe and fixed in 5.15.80 with commit c08c13cb13fa3866dd0700db3b246fcd2043ab81
	Issue introduced in 3.6 with commit f65c9bb3fb725551d3e405f4d092caf24929cebe and fixed in 6.0.10 with commit e948f3c129d78537ded70bcc99c31f0b45f05dd7
	Issue introduced in 3.6 with commit f65c9bb3fb725551d3e405f4d092caf24929cebe and fixed in 6.1 with commit da36a2a76b01b210ffaa55cdc2c99bc8783697c5

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

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/xen/pcpu.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/ccb22c876e8e7f62377e749c971907efe65d34c2
	https://git.kernel.org/stable/c/7ed540bcee2e24479524b9705cc7462b2652f944
	https://git.kernel.org/stable/c/6209a85079a035b5c2279b15b197531156b549fa
	https://git.kernel.org/stable/c/0199bf0a8f74509736744c9e36f4473a5892a09d
	https://git.kernel.org/stable/c/bb9924a6edd9d4a9ef83a5f337af60f8a7a68f98
	https://git.kernel.org/stable/c/c08c13cb13fa3866dd0700db3b246fcd2043ab81
	https://git.kernel.org/stable/c/e948f3c129d78537ded70bcc99c31f0b45f05dd7
	https://git.kernel.org/stable/c/da36a2a76b01b210ffaa55cdc2c99bc8783697c5
#1 lore raw
Quoted 7 lines · Greg Kroah-Hartman

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

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

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

Quoted 8 lines

xen/pcpu: fix possible memory leak in register_pcpu()

In device_add(), dev_set_name() is called to allocate name, if it returns error, the name need be freed. As comment of device_register() says, it should use put_device() to give up the reference in the error path. So fix this by calling put_device(), then the name can be freed in kobject_cleanup().

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

Please revoke this CVE.

The issue can in no way be triggered by an unprivileged user.

The memory leak could happen only either during boot of dom0, or when hotplugging a physical CPU to a Xen server.

Juergen

#2 lore raw
Quoted 15 lines · Jürgen Groß
Quoted 14 lines · Greg Kroah-Hartman

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

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

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

xen/pcpu: fix possible memory leak in register_pcpu()

In device_add(), dev_set_name() is called to allocate name, if it returns error, the name need be freed. As comment of device_register() says, it should use put_device() to give up the reference in the error path. So fix this by calling put_device(), then the name can be freed in kobject_cleanup().

Quoted 8 lines
Quoted 1 line

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

Please revoke this CVE.

The issue can in no way be triggered by an unprivileged user.

The memory leak could happen only either during boot of dom0, or when hotplugging a physical CPU to a Xen server.

Now rejected, thanks.

greg k-h