Skip to contentSkip to conversation

CVE-2022-50873: vdpa/vp_vdpa: fix kfree a wrong pointer in vp_vdpa_remove

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

vdpa/vp_vdpa: fix kfree a wrong pointer in vp_vdpa_remove

In vp_vdpa_remove(), the code kfree(&vp_vdpa_mgtdev->mgtdev.id_table) uses a reference of pointer as the argument of kfree, which is the wrong pointer and then may hit crash like this:

Unable to handle kernel paging request at virtual address 00ffff003363e30c
Internal error: Oops: 96000004 [#1] SMP
Call trace:
 rb_next+0x20/0x5c
 ext4_readdir+0x494/0x5c4 [ext4]
 iterate_dir+0x168/0x1b4
 __se_sys_getdents64+0x68/0x170
 __arm64_sys_getdents64+0x24/0x30
 el0_svc_common.constprop.0+0x7c/0x1bc
 do_el0_svc+0x2c/0x94
 el0_svc+0x20/0x30
 el0_sync_handler+0xb0/0xb4
 el0_sync+0x160/0x180
Code: 54000220 f9400441 b4000161 aa0103e0 (f9400821)

SMP: stopping secondary CPUs
Starting crashdump kernel...

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

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

	Issue introduced in 5.19 with commit ffbda8e9df10d1784d5427ec199e7d8308e3763f and fixed in 6.0.19 with commit 8fe12680b2c731201519935013ec9219c93ec540
	Issue introduced in 5.19 with commit ffbda8e9df10d1784d5427ec199e7d8308e3763f and fixed in 6.1.5 with commit 6ccc891f36d0c20ee220551caabdcd3886ec584b
	Issue introduced in 5.19 with commit ffbda8e9df10d1784d5427ec199e7d8308e3763f and fixed in 6.2 with commit ed843d6ed7310a27cf7c8ee0a82a482eed0cb4a6

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

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/vdpa/virtio_pci/vp_vdpa.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/8fe12680b2c731201519935013ec9219c93ec540
	https://git.kernel.org/stable/c/6ccc891f36d0c20ee220551caabdcd3886ec584b
	https://git.kernel.org/stable/c/ed843d6ed7310a27cf7c8ee0a82a482eed0cb4a6