CRITICAL
batman-adv TT Overflow
CVE-2026-31659
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
KernelScan AI8.7HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: batman-adv: reject oversized global TT response buffers batadv_tt_prepare_tvlv_global_data() builds the allocation length for a global TT response in 16-bit temporaries. When a remote originator advertises a large enough global TT, the TT payload length plus the VLAN header offset can exceed 65535 and wrap before kmalloc(). The full-table response path still uses the original TT payload length when it fills tt_change, so the wrapped allocation is too small and batadv_tt_prepare_tvlv_global_data() writes past the end of the heap object before the later packet-size check runs. Fix this by rejecting TT responses whose TVLV value length cannot fit in the 16-bit TVLV payload length field.
02KernelScan AI Analysis
Risk summary
Adjacent attackers on batman-adv mesh networks can trigger an integer overflow in translation table processing, leading to a heap buffer overflow and potential arbitrary code execution. Any device participating in a batman-adv mesh is vulnerable to malformed packets from other mesh nodes.
Vulnerability analysis
The batadv_tt_prepare_tvlv_global_data() function uses 16-bit variables to calculate allocation sizes for translation table responses. When processing oversized global TT data advertised by a remote originator, the payload length plus VLAN header offset can exceed 65535, causing integer wraparound before kmalloc(). The function then writes the full unwrapped data size into the undersized allocation, resulting in a heap buffer overflow. The fix adds bounds checking to reject TT responses that cannot fit in the 16-bit TVLV payload length field, preventing the integer overflow condition.
03Fix Versions
| Branch | Fixed in | Patch commit |
|---|---|---|
| 5.10 | 5.10.253 | 7e5d007e0df9 |
| 5.15 | 5.15.203 | 2997f4bd1f98 |
| 6.1 | 6.1.169 | 95c71365a222 |
| 6.12 | 6.12.82 | f970646b9a39 |
| 6.18 | 6.18.23 | de6c1dc3c7d0 |
| 6.19 | 6.19.13 | cf2199171ef7 |
| 6.6 | 6.6.135 | 69d61639bc7e |
| mainline | 7.0 | 3a359bf5c61d |