Skip to contentSkip to conversation

CVE-2022-50495: x86/xen: Fix memory leak in xen_smp_intr_init{_pv}()

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

x86/xen: Fix memory leak in xen_smp_intr_init{_pv}()

These local variables @{resched|pmu|callfunc...}_name saves the new string allocated by kasprintf(), and when bind_{v}ipi_to_irqhandler() fails, it goes to the @fail tag, and calls xen_smp_intr_free{_pv}() to free resource, however the new string is not saved, which cause a memory leak issue. fix it.

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

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

	Issue introduced in 2.6.24 with commit 9702785a747aa27baf46ff504beab6528f21f2dd and fixed in 4.19.270 with commit 9209d2cbf5845b8bf8e722015d86f65a9d2bc76a
	Issue introduced in 2.6.24 with commit 9702785a747aa27baf46ff504beab6528f21f2dd and fixed in 5.4.229 with commit ec88254208dd01fa1646e939047d382b216340ac
	Issue introduced in 2.6.24 with commit 9702785a747aa27baf46ff504beab6528f21f2dd and fixed in 5.10.163 with commit fc134c355b5299495b14a54dd9bb7af8a646cb7c
	Issue introduced in 2.6.24 with commit 9702785a747aa27baf46ff504beab6528f21f2dd and fixed in 5.15.86 with commit 23aef94eea714b721546c0c49a324a8da8d00fb5
	Issue introduced in 2.6.24 with commit 9702785a747aa27baf46ff504beab6528f21f2dd and fixed in 6.0.16 with commit 8b6d78bb4ece809c425f96a47ca9b69385ba94bb
	Issue introduced in 2.6.24 with commit 9702785a747aa27baf46ff504beab6528f21f2dd and fixed in 6.1.2 with commit f698f88f042c6a19bbbac6c84782039a75e7f349
	Issue introduced in 2.6.24 with commit 9702785a747aa27baf46ff504beab6528f21f2dd and fixed in 6.2 with commit 69143f60868b3939ddc89289b29db593b647295e

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

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/x86/xen/smp.c
	arch/x86/xen/smp_pv.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/9209d2cbf5845b8bf8e722015d86f65a9d2bc76a
	https://git.kernel.org/stable/c/ec88254208dd01fa1646e939047d382b216340ac
	https://git.kernel.org/stable/c/fc134c355b5299495b14a54dd9bb7af8a646cb7c
	https://git.kernel.org/stable/c/23aef94eea714b721546c0c49a324a8da8d00fb5
	https://git.kernel.org/stable/c/8b6d78bb4ece809c425f96a47ca9b69385ba94bb
	https://git.kernel.org/stable/c/f698f88f042c6a19bbbac6c84782039a75e7f349
	https://git.kernel.org/stable/c/69143f60868b3939ddc89289b29db593b647295e
#1 lore raw
Quoted 9 lines · Greg Kroah-Hartman

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

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

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

x86/xen: Fix memory leak in xen_smp_intr_init{_pv}()

Quoted 7 lines

These local variables @{resched|pmu|callfunc...}_name saves the new string allocated by kasprintf(), and when bind_{v}ipi_to_irqhandler() fails, it goes to the @fail tag, and calls xen_smp_intr_free{_pv}() to free resource, however the new string is not saved, which cause a memory leak issue. fix it.

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

Please revoke the CVE. This issue can't be triggered by an unprivileged user.

Juergen

author
#2 lore raw
Quoted 16 lines · Juergen Gross
Quoted 15 lines · Greg Kroah-Hartman

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

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

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

x86/xen: Fix memory leak in xen_smp_intr_init{_pv}()

These local variables @{resched|pmu|callfunc...}_name saves the new string allocated by kasprintf(), and when bind_{v}ipi_to_irqhandler() fails, it goes to the @fail tag, and calls xen_smp_intr_free{_pv}() to free resource, however the new string is not saved, which cause a memory leak issue. fix it.

Quoted 3 lines
Quoted 1 line

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

Please revoke the CVE. This issue can't be triggered by an unprivileged user.

Thanks for the review, now rejected.

greg k-h