CVE-2026-31657: batman-adv: hold claim backbone gateways by reference
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
batman-adv: hold claim backbone gateways by reference
batadv_bla_add_claim() can replace claim->backbone_gw and drop the old gateway's last reference while readers still follow the pointer.
The netlink claim dump path dereferences claim->backbone_gw->orig and takes claim->backbone_gw->crc_lock without pinning the underlying backbone gateway. batadv_bla_check_claim() still has the same naked pointer access pattern.
Reuse batadv_bla_claim_get_backbone_gw() in both readers so they operate on a stable gateway reference until the read-side work is complete. This keeps the dump and claim-check paths aligned with the lifetime rules introduced for the other BLA claim readers.
The Linux kernel CVE team has assigned CVE-2026-31657 to this issue.
Affected and fixed versions
===========================
Issue introduced in 3.5 with commit 23721387c409087fd3b97e274f34d3ddc0970b74 and fixed in 6.1.169 with commit f4858832ddef2f39f21e30b7226bbcd3c4b2bc96 Issue introduced in 3.5 with commit 23721387c409087fd3b97e274f34d3ddc0970b74 and fixed in 6.6.135 with commit 2f55b58b5a0bbed192d60c444a45a49cdf1b545f Issue introduced in 3.5 with commit 23721387c409087fd3b97e274f34d3ddc0970b74 and fixed in 6.12.82 with commit 7962b522222628596ca9ecc8722efc95367aadbd Issue introduced in 3.5 with commit 23721387c409087fd3b97e274f34d3ddc0970b74 and fixed in 6.18.23 with commit 4dee4c0688443aaf5bbec74aa203c851d1d53c35 Issue introduced in 3.5 with commit 23721387c409087fd3b97e274f34d3ddc0970b74 and fixed in 6.19.13 with commit 1f2dc36c297d27733f1b380ea644cf15a361bd7b Issue introduced in 3.5 with commit 23721387c409087fd3b97e274f34d3ddc0970b74 and fixed in 7.0 with commit 82d8701b2c930d0e96b0dbc9115a218d791cb0d2
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-31657
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/batman-adv/bridge_loop_avoidance.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/f4858832ddef2f39f21e30b7226bbcd3c4b2bc96 https://git.kernel.org/stable/c/2f55b58b5a0bbed192d60c444a45a49cdf1b545f https://git.kernel.org/stable/c/7962b522222628596ca9ecc8722efc95367aadbd https://git.kernel.org/stable/c/4dee4c0688443aaf5bbec74aa203c851d1d53c35 https://git.kernel.org/stable/c/1f2dc36c297d27733f1b380ea644cf15a361bd7b https://git.kernel.org/stable/c/82d8701b2c930d0e96b0dbc9115a218d791cb0d2