data built 2026-10-19T13:16:53Z

Look up another CVE · open CVE-2024-14040 in the interactive tracker

CVE-2024-14040

net: nexthop: Increase weight to u16

7.8 EPSS 0.1% AV:L

Published 2026-07-26 (3 months ago) by the Linux kernel CNA. Subsystem include/net. Debian urgency: not yet assigned.

What to do, per Debian release

Debian's own status for CVE-2024-14040 in every release this site tracks, and what each one means in practice. Every status below is the one the Debian Security Team publishes for this CVE. source

ReleaseStatus VersionWhat this means
Debian 12bookwormvulnerable6.1.190-1No fix published anywhere yet, neither in Debian nor upstream for the series bookworm tracks. Watch the Debian tracker page for this CVE. Advisories for bookworm have historically landed a median of 23 days after publication.
Debian 13trixiefixed6.12.3-1Update the kernel and reboot. Fixed in 6.12.3-1. A running kernel keeps the old code until the machine restarts.
Debian 14forkyfixed6.12.3-1Update the kernel and reboot. Fixed in 6.12.3-1. A running kernel keeps the old code until the machine restarts.
Debian unstablesidfixed6.12.3-1Update the kernel and reboot. Fixed in 6.12.3-1. A running kernel keeps the old code until the machine restarts.

The vulnerability

What the bug is

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.

Where it lives

The fix touches these files. If the subsystem is one you do not use, the practical exposure is lower, though the package is still the vulnerable one.

include/net/nexthop.h
include/uapi/linux/nexthop.h
net/ipv4/nexthop.c

What this is
NETWORKING [IPv4/IPv6]MAINTAINERS section matched on include/net/nexthop.h · netdev@vger.kernel.org · Maintained

Check it on the machine

grep -w CONFIG_INET /boot/config-$(uname -r)

Reads the booted kernel's own configuration, on the machine and nowhere else. =y is built in, =m is a module, and an is not set line means the code is not there.

Show whether Debian builds this, per release

Debian builds this code. Every release below compiles the affected file into the kernels it ships.

  • bookworm, trixie, forky, sidy
y
built into the kernel image on every flavour - only a patch removes it
Build switch
CONFIG_INET

From the configuration Debian publishes for every kernel flavour it builds. It covers only the architectures Debian ships a linux-config package for, and nothing about a kernel you built yourself. Debian's own status above stays authoritative about the source package.MAINTAINERS kbuild Makefiles Debian linux-config packages

Signals

Published
2026-07-26 (3 months ago)source
CVSS
7.8 high
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:Hsource recompute it
Attack vector
local (AV:L)source
EPSS
0.11%, higher than 1.4% of all CVEssource
CISA KEV
not listedthe KEV catalogue
Debian urgency
not yet assignedsource
Subsystem
include/net

Upstream fixes

The versions the CNA records as introducing and fixing this, and the commit for each. source

IntroducedFixed inCommit
5.136.12b72a6a7ab957

Why the CNA scored it this way

Quoted from the kernel CNA's own scoring file, word for word. A highlighted metric carries the most severe value CVSS v3.1 defines for it, which is what pushes the score up. source

AV:LAttack vector, local
The vulnerable arithmetic is reached through a locally issued RTM_NEWNEXTHOP rtnetlink request, followed by routing traffic through the corrupted resilient group.
AC:LAttack complexity, low
The attacker deterministically controls the bucket count, member weights, replacement ordering, and triggering flows; no race or uncontrollable condition is required.
PR:LPrivileges required, low
RTM_NEWNEXTHOP requires CAP_NET_ADMIN in the network namespace, which an unprivileged user can obtain in a newly created user and network namespace.
UI:NUser interaction, none
No victim action is required after the attacker creates and exercises the malformed resilient nexthop group.
S:UScope, unchanged
Exploitation compromises the host kernel within its existing security authority and does not cross a virtualization or IOMMU boundary.
C:HConfidentiality impact, high
The overflow can leave a stale nh_grp_entry referencing freed group and per-CPU statistics memory, creating an attacker-groomable use-after-free capable of exposing kernel memory.
I:HIntegrity impact, high
Forwarding through the stale bucket writes through the freed per-CPU statistics pointer, providing a memory-corruption primitive potentially usable for arbitrary writes or code execution.
A:HAvailability impact, high
The corrupted bucket can cause an immediate NULL-pointer dereference or use-after-free during route selection, resulting in a kernel oops or panic.