CVE-2024-14040
Received Received - Intake

Integer Overflow in Linux Kernel Nexthop Weight Configuration

Vulnerability report for CVE-2024-14040, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-07-26

Last updated on: 2026-07-26

Assigner: kernel.org

Description

In the Linux kernel, the following vulnerability has been resolved: net: nexthop: Increase weight to u16 In CLOS networks, as link failures occur at various points in the network, ECMP weights of the involved nodes are adjusted to compensate. With high fan-out of the involved nodes, and overall high number of nodes, a (non-)ECMP weight ratio that we would like to configure does not fit into 8 bits. Instead of, say, 255:254, we might like to configure something like 1000:999. For these deployments, the 8-bit weight may not be enough. To that end, in this patch increase the next hop weight from u8 to u16. Increasing the width of an integral type can be tricky, because while the code still compiles, the types may not check out anymore, and numerical errors come up. To prevent this, the conversion was done in two steps. First the type was changed from u8 to a single-member structure, which invalidated all uses of the field. This allowed going through them one by one and audit for type correctness. Then the structure was replaced with a vanilla u16 again. This should ensure that no place was missed. The UAPI for configuring nexthop group members is that an attribute NHA_GROUP carries an array of struct nexthop_grp entries: struct nexthop_grp { __u32 id; /* nexthop id - must exist */ __u8 weight; /* weight of this nexthop */ __u8 resvd1; __u16 resvd2; }; The field resvd1 is currently validated and required to be zero. We can lift this requirement and carry high-order bits of the weight in the reserved field: struct nexthop_grp { __u32 id; /* nexthop id - must exist */ __u8 weight; /* weight of this nexthop */ __u8 weight_high; __u16 resvd2; }; Keeping the fields split this way was chosen in case an existing userspace makes assumptions about the width of the weight field, and to sidestep any endianness issues. The weight field is currently encoded as the weight value minus one, because weight of 0 is invalid. This same trick is impossible for the new weight_high field, because zero must mean actual zero. With this in place: - Old userspace is guaranteed to carry weight_high of 0, therefore configuring 8-bit weights as appropriate. When dumping nexthops with 16-bit weight, it would only show the lower 8 bits. But configuring such nexthops implies existence of userspace aware of the extension in the first place. - New userspace talking to an old kernel will work as long as it only attempts to configure 8-bit weights, where the high-order bits are zero. Old kernel will bounce attempts at configuring >8-bit weights. Renaming reserved fields as they are allocated for some purpose is commonly done in Linux. Whoever touches a reserved field is doing so at their own risk. nexthop_grp::resvd1 in particular is currently used by at least strace, however they carry an own copy of UAPI headers, and the conversion should be trivial. A helper is provided for decoding the weight out of the two fields. Forcing a conversion seems preferable to bending backwards and introducing anonymous unions or whatever.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-07-26
Last Modified
2026-07-26
Generated
2026-07-26
AI Q&A
2026-07-26
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
linux linux_kernel *

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-UNKNOWN

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This vulnerability involves a change in the Linux kernel to increase the weight field in nexthop group members from 8 bits (u8) to 16 bits (u16). This was necessary because in certain network configurations with high fan-out and many nodes, the 8-bit weight limit (max 255) was insufficient for accurate ECMP (Equal-Cost Multi-Path) routing. The change was implemented in two steps to ensure type correctness and avoid numerical errors.

Detection Guidance

This vulnerability is related to the Linux kernel's nexthop weight handling. Detection requires checking kernel version and nexthop configurations. Use 'uname -a' to check kernel version and 'ip route show' to inspect nexthop configurations for potential misconfigurations.

Impact Analysis

This is not a traditional vulnerability but a feature enhancement to improve network routing scalability. It may impact users managing large-scale networks with ECMP routing where precise weight adjustments are critical. Misconfigurations during the transition could lead to routing issues if not handled properly.

Compliance Impact

This vulnerability does not directly affect compliance with standards like GDPR or HIPAA. The issue involves a Linux kernel change to increase nexthop weight from u8 to u16 for ECMP networks, which is a technical networking improvement. There is no indication this impacts data protection, privacy, or security controls required by these regulations.

Mitigation Strategies

Apply the latest kernel patch that resolves this issue. Monitor kernel updates from your distribution. If using custom kernels, ensure the nexthop weight type change is properly implemented to avoid numerical errors.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2024-14040. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart