cve.bz

CVE-2024-14040 linux linux: Out-of-bounds Write

7.8 highEPSS 0.2%Fix available

High (7.8) in linux linux. EPSS 0.2% estimated probability of exploitation activity in the next 30 days.

On this page
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.

Severity

CVSS 3.1

7.8 high
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
EPSS
0.2% (unchanged from 0.2% a week ago; 0.1% 30 days ago) estimated probability of exploitation activity in the next 30 days; 7th percentile. Scored 2026-11-15. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: total, assessed 2026-10-15. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-787 Out-of-bounds Write
Published
Modified
NVD analysis
Awaiting analysis
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2024-14040 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2024-14040?via=ask-ai-copy and https://cve.bz/cve/CVE-2024-14040?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2024-14040 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
Linux5.13 and later

Fixed in

ProductRelease lineFixed in
Linux6.16.1.191
Linux6.66.6.160
Linuxlater releases6.12

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12linux6.1.192-1DEBIAN-CVE-2024-14040
Debian13, 14linux6.12.3-1DEBIAN-CVE-2024-14040
Ubuntu16.04:LTSlinux-hwe-edgeno fix listedUBUNTU-CVE-2024-14040
Ubuntu18.04:LTSlinux-gcp, linux-hwe, linux-oem and 12 moreno fix listedUBUNTU-CVE-2024-14040
Ubuntu20.04:LTSlinux-gke, linux-gkeop, linux-riscv and 26 moreno fix listedUBUNTU-CVE-2024-14040
Ubuntu22.04:LTSlinux, linux-aws, linux-gcp and 57 moreno fix listedUBUNTU-CVE-2024-14040
Ubuntu24.04:LTSlinux, linux-aws, linux-gcp and 35 moreno fix listedUBUNTU-CVE-2024-14040
Ubuntu24.04:LTSlinux-nvidia-tegra6.8.0-1035.38UBUNTU-CVE-2024-14040 USN-8781-1
UbuntuNvidia-BlueField:22.04:LTS, Nvidia-BlueField:24.04:LTSlinux-bluefieldno fix listedUBUNTU-CVE-2024-14040
UbuntuPro:20.04:LTSlinux-aws-5.15, linux-gcp-5.15, linux-hwe-5.15 and 8 moreno fix listedUBUNTU-CVE-2024-14040
UbuntuPro:FIPS-preview:22.04:LTS, Pro:FIPS-updates:22.04:LTS, Pro:FIPS-updates:24.04:LTSlinux-fips, linux-aws-fips, linux-gcp-fips and 1 moreno fix listedUBUNTU-CVE-2024-14040
UbuntuPro:Realtime:22.04:LTSlinux-realtime, linux-realtime-6.8, linux-intel-iot-realtimeno fix listedUBUNTU-CVE-2024-14040
UbuntuPro:Realtime:24.04:LTSlinux-realtime, linux-realtime-6.14, linux-raspi-realtimeno fix listedUBUNTU-CVE-2024-14040
Azure Linux3kernel6.6.161.1-1AZL-93953
Alpaquita23linux-lts6.1.191-r0BELL-CVE-2024-14040
Alpaquita25, streamlinux-lts6.12.41-r0BELL-CVE-2024-14040

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Microsoft's Azure Linux vulnerability data, MIT; BellSoft's OSV database, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Alpaquita.

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

This Moderate impact vulnerability in the Linux kernel addresses a potential for numerical errors when configuring Equal-Cost Multi-Path (ECMP) weights in CLOS networks. The issue arises from an insufficient 8-bit weight field, which could lead to incorrect weight ratios in deployments with high fan-out. Exploitation requires specific userspace configurations attempting to utilize weights exceeding 8 bits.

Red Hat's mitigation

Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base, or stability.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 10kernelNot affected
Red Hat Enterprise Linux 6kernelNot affected
Red Hat Enterprise Linux 7kernelNot affected
Red Hat Enterprise Linux 7kernel-rtNot affected
Red Hat Enterprise Linux 8kernelNot affected
Red Hat Enterprise Linux 8kernel-rtNot affected
Red Hat Enterprise Linux 9kernelAffected
Red Hat Enterprise Linux 9kernel-rtFix deferred

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2024-14040.

References

Check your stackJSON