Skip to contentSkip to conversation

CVE-2026-80613: veth: fix NAPI leak in XDP enable error path

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Aug 28

lore
Share & tools
lore
#0 lore raw

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

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

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

veth: fix NAPI leak in XDP enable error path

During XDP enablement in veth, if xdp_rxq_info_reg() or xdp_rxq_info_reg_mem_model() fails, the driver rolls back the changes.

However, the rollback loop:

	for (i--; i >= start; i--) {

decrements the loop index 'i' before the first iteration. This correctly skips unregistering the rxq for the failed index 'i' (as registration failed or was already cleaned up), but it also erroneously skips calling netif_napi_deli() for rq[i].xdp_napi.

Since netif_napi_add() was already called for index 'i', this leaves a dangling napi_struct in the device's napi_list. When the veth device is later destroyed, the freed queue memory (which contains the leaked NAPI structure) can be reused.

The subsequent device teardown iterates the NAPI list and corrupts the reallocated memory, leading to UAF.

Fix this by explicitly deleting the NAPI association for the failed index 'i' before rolling back the successfully configured queues.

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

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

	Issue introduced in 5.11 with commit b02e5a0ebb172c8276cea3151942aac681f7a4a6 and fixed in 5.15.212 with commit fc51373345e7e6ea73da2650cb497309c50b077a
	Issue introduced in 5.11 with commit b02e5a0ebb172c8276cea3151942aac681f7a4a6 and fixed in 6.1.178 with commit 4559770b2a241344d762719e674241fcc8528f02
	Issue introduced in 5.11 with commit b02e5a0ebb172c8276cea3151942aac681f7a4a6 and fixed in 6.6.145 with commit 83090f5e7b54721d71875a6c224d2490b9e73050
	Issue introduced in 5.11 with commit b02e5a0ebb172c8276cea3151942aac681f7a4a6 and fixed in 6.12.97 with commit d3eb258ad398cc9402bab3a5e730cd7c5b34efad
	Issue introduced in 5.11 with commit b02e5a0ebb172c8276cea3151942aac681f7a4a6 and fixed in 6.18.40 with commit a9e6707322ef215d39d4655b176c094f45f0ab52
	Issue introduced in 5.11 with commit b02e5a0ebb172c8276cea3151942aac681f7a4a6 and fixed in 7.1.5 with commit 4bd2e5dbe62334aae1182d0f0d260f334a49d739
	Issue introduced in 5.11 with commit b02e5a0ebb172c8276cea3151942aac681f7a4a6 and fixed in 7.2 with commit 6739027cb72da26890edd424c77080d187b2a92e

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

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/net/veth.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/fc51373345e7e6ea73da2650cb497309c50b077a
	https://git.kernel.org/stable/c/4559770b2a241344d762719e674241fcc8528f02
	https://git.kernel.org/stable/c/83090f5e7b54721d71875a6c224d2490b9e73050
	https://git.kernel.org/stable/c/d3eb258ad398cc9402bab3a5e730cd7c5b34efad
	https://git.kernel.org/stable/c/a9e6707322ef215d39d4655b176c094f45f0ab52
	https://git.kernel.org/stable/c/4bd2e5dbe62334aae1182d0f0d260f334a49d739
	https://git.kernel.org/stable/c/6739027cb72da26890edd424c77080d187b2a92e