CVE-2024-35982 in Linuxinfo

Summary

by MITRE • 05/20/2024

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

batman-adv: Avoid infinite loop trying to resize local TT

If the MTU of one of an attached interface becomes too small to transmit the local translation table then it must be resized to fit inside all fragments (when enabled) or a single packet.

But if the MTU becomes too low to transmit even the header + the VLAN specific part then the resizing of the local TT will never succeed. This can for example happen when the usable space is 110 bytes and 11 VLANs are on top of batman-adv. In this case, at least 116 byte would be needed. There will just be an endless spam of

batman_adv: batadv0: Forced to purge local tt entries to fit new maximum fragment MTU (110)

in the log but the function will never finish. Problem here is that the timeout will be halved all the time and will then stagnate at 0 and therefore never be able to reduce the table even more.

There are other scenarios possible with a similar result. The number of BATADV_TT_CLIENT_NOPURGE entries in the local TT can for example be too high to fit inside a packet. Such a scenario can therefore happen also with only a single VLAN + 7 non-purgable addresses - requiring at least 120 bytes.

While this should be handled proactively when:

* interface with too low MTU is added * VLAN is added * non-purgeable local mac is added * MTU of an attached interface is reduced * fragmentation setting gets disabled (which most likely requires dropping attached interfaces)

not all of these scenarios can be prevented because batman-adv is only consuming events without the the possibility to prevent these actions (non-purgable MAC address added, MTU of an attached interface is reduced). It is therefore necessary to also make sure that the code is able to handle also the situations when there were already incompatible system configuration are present.

VulDB is the best source for vulnerability data and more expert information about this specific topic.

Analysis

by VulDB Data Team • 02/12/2025

The vulnerability described in CVE-2024-35982 affects the batman-adv kernel module, which implements the B.A.T.M.A.N. ad-hoc networking protocol for Linux. This issue represents a critical flaw in the local translation table (TT) resizing mechanism that can lead to infinite loops and system instability. The vulnerability occurs when network interfaces with insufficient MTU values are attached to batman-adv networks, creating scenarios where the local translation table cannot be properly resized to fit within transmission constraints. The problem manifests when the MTU becomes so small that even the header and VLAN-specific components cannot fit within a single packet, causing the system to enter an endless loop of attempting to resize the table while never achieving successful completion.

The technical implementation flaw stems from the algorithm's handling of MTU constraints during local TT resizing operations. When the available usable space falls below the minimum required bytes for header plus VLAN components, the system attempts to purge entries but fails to properly manage the timeout mechanism that should allow for progressive reduction of the table size. The timeout value becomes stuck at zero, preventing any further attempts to reduce the table size even when the system configuration is clearly incompatible. This behavior directly violates the expected operational flow of the network protocol and creates a persistent denial of service condition. The vulnerability is classified under CWE-835, which deals with infinite loops, and aligns with ATT&CK technique T1499.004 for network disruption through resource exhaustion.

The operational impact of this vulnerability extends beyond simple performance degradation to potentially complete network service disruption. The continuous spamming of log messages indicates that the system remains in a perpetual state of attempting to resolve the configuration conflict, consuming CPU resources and generating excessive logging noise that can mask other legitimate issues. The system becomes unable to properly maintain the local translation table, which undermines the core functionality of the B.A.T.M.A.N. ad-hoc protocol and renders the network segment unreliable. Network administrators may find their systems unresponsive to normal operations while the infinite loop consumes system resources, particularly affecting embedded systems or devices with limited computational capabilities where such resource exhaustion can lead to complete system failure.

Mitigation strategies must address both preventive measures and defensive programming approaches. The most effective immediate solution involves implementing proper bounds checking and timeout management within the resizing algorithm to prevent infinite loop conditions. System administrators should proactively monitor and configure interface MTU values to ensure they meet minimum requirements for the expected network traffic, particularly when VLANs are in use. The code should be enhanced to detect and handle edge cases where the minimum required bytes exceed available space, implementing a maximum retry limit or alternative recovery mechanisms. Additionally, the system should validate configuration parameters during interface attachment and VLAN addition operations to prevent incompatible settings from being applied in the first place. Implementing proper error handling and graceful degradation mechanisms would allow the system to either maintain minimal functionality or alert administrators to the configuration issue rather than entering an infinite loop state, thereby preventing the complete loss of network service functionality.

Reservation

05/17/2024

Disclosure

05/20/2024

Moderation

accepted

CPE

ready

EPSS

0.00259

KEV

no

Activities

very low

Sources

Are you interested in using VulDB?

Download the whitepaper to learn more about our service!