CVE-2025-21659: netdev: prevent accessing NAPI instances from another namespace
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
netdev: prevent accessing NAPI instances from another namespace
The NAPI IDs were not fully exposed to user space prior to the netlink API, so they were never namespaced. The netlink API must ensure that at the very least NAPI instance belongs to the same netns as the owner of the genl sock.
napi_by_id() can become static now, but it needs to move because of dev_get_by_napi_id().
The Linux kernel CVE team has assigned CVE-2025-21659 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.8 with commit 27f91aaf49b3a50e5a02ad5fa27b7c453d029a72 and fixed in 6.12.10 with commit b683ba0df11ff563cc237eb1b74d6adfa77226bf Issue introduced in 6.8 with commit 27f91aaf49b3a50e5a02ad5fa27b7c453d029a72 and fixed in 6.13 with commit d1cacd74776895f6435941f86a1130e58f6dd226
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-2025-21659
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:
net/core/dev.c
net/core/dev.h
net/core/netdev-genl.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/b683ba0df11ff563cc237eb1b74d6adfa77226bf https://git.kernel.org/stable/c/d1cacd74776895f6435941f86a1130e58f6dd226