CVE-2025-39926: genetlink: fix genl_bind() invoking bind() after -EPERM
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
genetlink: fix genl_bind() invoking bind() after -EPERM
Per family bind/unbind callbacks were introduced to allow families to track multicast group consumer presence, e.g. to start or stop producing events depending on listeners.
However, in genl_bind() the bind() callback was invoked even if capability checks failed and ret was set to -EPERM. This means that callbacks could run on behalf of unauthorized callers while the syscall still returned failure to user space.
Fix this by only invoking bind() after "if (ret) break;" check i.e. after permission checks have succeeded.
The Linux kernel CVE team has assigned CVE-2025-39926 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.9 with commit 3de21a8990d3c2cc507e9cc4ed00f36358d5b93e and fixed in 6.12.48 with commit 98c9d884047a3051c203708914a874dece3cbe54 Issue introduced in 6.9 with commit 3de21a8990d3c2cc507e9cc4ed00f36358d5b93e and fixed in 6.16.8 with commit 8858c1e9405906c09589d7c336f04058ea198207 Issue introduced in 6.9 with commit 3de21a8990d3c2cc507e9cc4ed00f36358d5b93e and fixed in 6.17 with commit 1dbfb0363224f6da56f6655d596dc5097308d6f5
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-39926
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/netlink/genetlink.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/98c9d884047a3051c203708914a874dece3cbe54 https://git.kernel.org/stable/c/8858c1e9405906c09589d7c336f04058ea198207 https://git.kernel.org/stable/c/1dbfb0363224f6da56f6655d596dc5097308d6f5