# CVE-2024-14040: net: nexthop: Increase weight to u16

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.17% (percentile 4, 2026-11-26)
- **CWE:** CWE-787
- **Published:** 2026-07-26T06:30:17.607Z
- **Modified:** 2026-11-16T14:56:24.870Z

## Who should check

- Anyone running Linux \>= 283a72a5599e80750699d2021830a294ed9ab3f3, \< f9d682935afe102d6b7060914304c04483d6cbd6; \>= 283a72a5599e80750699d2021830a294ed9ab3f3, \< 2860d59e4ce2bb428c8cecd3b95585012910b7d0; \>= 283a72a5599e80750699d2021830a294ed9ab3f3, \< b72a6a7ab9573e06d5c2fcb92eaa28614a735bfd
- Anyone running Linux 5.13

## 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.

## Affected and fixed versions

- Linux: \>= 283a72a5599e80750699d2021830a294ed9ab3f3, \< f9d682935afe102d6b7060914304c04483d6cbd6; \>= 283a72a5599e80750699d2021830a294ed9ab3f3, \< 2860d59e4ce2bb428c8cecd3b95585012910b7d0; \>= 283a72a5599e80750699d2021830a294ed9ab3f3, \< b72a6a7ab9573e06d5c2fcb92eaa28614a735bfd (cvelist)
- Linux: 5.13 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-14040. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-14040.md
Affected: Linux >= 283a72a5599e80750699d2021830a294ed9ab3f3, < f9d682935afe102d6b7060914304c04483d6cbd6; >= 283a72a5599e80750699d2021830a294ed9ab3f3, < 2860d59e4ce2bb428c8cecd3b95585012910b7d0; >= 283a72a5599e80750699d2021830a294ed9ab3f3, < b72a6a7ab9573e06d5c2fcb92eaa28614a735bfd; Linux 5.13
Fixed in: Linux 2860d59e4ce2bb428c8cecd3b95585012910b7d0

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-14040 being exploited?

There is no confirmed exploitation: CVE-2024-14040 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.17% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2024-14040?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2024-14040?

Linux \>= 283a72a5599e80750699d2021830a294ed9ab3f3, \< f9d682935afe102d6b7060914304c04483d6cbd6; \>= 283a72a5599e80750699d2021830a294ed9ab3f3, \< 2860d59e4ce2bb428c8cecd3b95585012910b7d0; \>= 283a72a5599e80750699d2021830a294ed9ab3f3, \< b72a6a7ab9573e06d5c2fcb92eaa28614a735bfd; Linux 5.13.

### Is there a fix for CVE-2024-14040?

Yes. Fixed in Linux 2860d59e4ce2bb428c8cecd3b95585012910b7d0. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2024-14040?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/f9d682935afe102d6b7060914304c04483d6cbd6>
- patch: <https://git.kernel.org/stable/c/2860d59e4ce2bb428c8cecd3b95585012910b7d0>
- patch: <https://git.kernel.org/stable/c/b72a6a7ab9573e06d5c2fcb92eaa28614a735bfd>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-14040>

HTML: <https://flawdb.com/CVE-2024-14040> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-14040>
