Skip to contentSkip to conversation

CVE-2026-63907: uio: uio_pci_generic_sva: fix double free of devm_kzalloc() memory

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Jul 19

lore
Share & tools
lore
#0 lore raw

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

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

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

uio: uio_pci_generic_sva: fix double free of devm_kzalloc() memory

uio_pci_sva allocates struct uio_pci_sva_dev with devm_kzalloc() in probe(), but then calls kfree(udev) both on the probe() error path (label out_free) and again in remove().

Because devm_kzalloc() allocations are devres-managed and are freed automatically when the device is detached (including after a failing probe() and during driver unbind), the explicit kfree() can lead to a double free.

If probe() fails after devm_kzalloc(), the error path frees udev and devres cleanup will free it again when the core unwinds the partially bound device. On normal driver removal, remove() frees udev and devres will free it again when the device is detached.

This issue was identified by a static analysis tool I developed and confirmed by manual review. Fix by removing the manual kfree() calls and dropping the now-unused label.

The Linux kernel CVE team has assigned CVE-2026-63907 to this issue.

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

	Issue introduced in 6.19 with commit 3397c3cd859a2c51962ad032dcf97961d42f9db2 and fixed in 7.0.12 with commit e344865bfca4eb37ed8d7ac5917226e49fcec7ce
	Issue introduced in 6.19 with commit 3397c3cd859a2c51962ad032dcf97961d42f9db2 and fixed in 7.1 with commit f74c8696f14149d5e43cc28b015326a759c48f00

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-2026-63907

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/uio/uio_pci_generic_sva.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/e344865bfca4eb37ed8d7ac5917226e49fcec7ce
	https://git.kernel.org/stable/c/f74c8696f14149d5e43cc28b015326a759c48f00