CVE-2024-14040
net: nexthop: Increase weight to u16
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.
INFO
Published Date :
July 26, 2026, 7:16 a.m.
Last Modified :
Nov. 16, 2026, 2:56 p.m.
Remotely Exploit :
No
Source :
416baaa9-dc9f-4396-8d5f-8c081fb06d67
CVSS Scores
| Score | Version | Severity | Vector | Exploitability Score | Impact Score | Source |
|---|---|---|---|---|---|---|
| CVSS | 134c704f-9b21-4f2e-91b3-4a467353bcc0 | |||||
| CVSS 3.1 | HIGH | 416baaa9-dc9f-4396-8d5f-8c081fb06d67 |
Solution
- Update the Linux kernel to the latest version.
- Ensure userspace tools are compatible with new weight fields.
- Test configuration changes after kernel update.
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2024-14040.
CWE - Common Weakness Enumeration
While CVE identifies
specific instances of vulnerabilities, CWE categorizes the common flaws or
weaknesses that can lead to vulnerabilities. CVE-2024-14040 is
associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
(CAPEC)
stores attack patterns, which are descriptions of the common attributes and
approaches employed by adversaries to exploit the CVE-2024-14040
weaknesses.
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2024-14040 vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2024-14040 vulnerability over time.
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
-
Initial Analysis by [email protected]
Nov. 16, 2026
Action Type Old Value New Value Added CPE Configuration OR *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.7 up to (excluding) 6.12 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.2 up to (excluding) 6.6.160 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 5.13 up to (excluding) 6.1.191 Added Reference Type kernel.org: https://git.kernel.org/stable/c/2860d59e4ce2bb428c8cecd3b95585012910b7d0 Types: Patch Added Reference Type kernel.org: https://git.kernel.org/stable/c/b72a6a7ab9573e06d5c2fcb92eaa28614a735bfd Types: Patch Added Reference Type kernel.org: https://git.kernel.org/stable/c/f9d682935afe102d6b7060914304c04483d6cbd6 Types: Patch -
CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Oct. 30, 2026
Action Type Old Value New Value Added Affected Affected value modified. <a href="https://github.com/CVEProject/cvelistV5/blob/main/cves/2024/14xxx/CVE-2024-14040.json">CVE-2024-14040</a> Added Reference https://git.kernel.org/stable/c/f9d682935afe102d6b7060914304c04483d6cbd6 -
CVE Translated by [email protected]
Oct. 27, 2026
Action Type Old Value New Value Added Translation Title: Linux, Description: En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: net: nexthop: Aumentar el peso a u16 En las redes CLOS, a medida que ocurren fallos de enlace en varios puntos de la red, los pesos ECMP de los nodos involucrados se ajustan para compensar. Con una alta ramificación de los nodos involucrados y un número total elevado de nodos, una relación de peso (no-)ECMP que nos gustaría configurar no cabe en 8 bits. En lugar de, digamos, 255:254, podríamos querer configurar algo como 1000:999. Para estas implementaciones, el peso de 8 bits podría no ser suficiente. Con ese fin, en este parche se aumenta el peso del siguiente salto de u8 a u16. Aumentar el ancho de un tipo integral puede ser complicado, porque si bien el código aún compila, los tipos podrían ya no coincidir y surgen errores numéricos. Para evitar esto, la conversión se realizó en dos pasos. Primero, el tipo se cambió de u8 a una estructura de un solo miembro, lo que invalidó todos los usos del campo. Esto permitió revisarlos uno por uno y auditar la corrección del tipo. Luego, la estructura fue reemplazada por un u16 estándar nuevamente. Esto debería asegurar que no se omitió ningún lugar. La UAPI para configurar los miembros del grupo nexthop es que un atributo NHA_GROUP lleva un array de entradas de struct nexthop_grp: struct nexthop_grp { __u32 id; /* id de nexthop - debe existir */ __u8 weight; /* peso de este nexthop */ __u8 resvd1; __u16 resvd2; }; El campo resvd1 está actualmente validado y se requiere que sea cero. Podemos levantar este requisito y llevar los bits de orden superior del peso en el campo reservado: struct nexthop_grp { __u32 id; /* id de nexthop - debe existir */ __u8 weight; /* peso de este nexthop */ __u8 weight_high; __u16 resvd2; }; Se eligió mantener los campos divididos de esta manera en caso de que un userspace existente haga suposiciones sobre el ancho del campo de peso, y para evitar cualquier problema de endianness. El campo de peso está actualmente codificado como el valor del peso menos uno, porque un peso de 0 es inválido. Este mismo truco es imposible para el nuevo campo weight_high, porque cero debe significar cero real. Con esto implementado: - Se garantiza que el userspace antiguo llevará un weight_high de 0, por lo tanto, configurando pesos de 8 bits según corresponda. Al volcar nexthops con peso de 16 bits, solo mostraría los 8 bits inferiores. Pero configurar tales nexthops implica la existencia de un userspace consciente de la extensión en primer lugar. - El nuevo userspace que se comunica con un kernel antiguo funcionará siempre y cuando solo intente configurar pesos de 8 bits, donde los bits de orden superior son cero. El kernel antiguo rechazará los intentos de configurar pesos >8 bits. Renombrar campos reservados a medida que se asignan para algún propósito es algo común en Linux. Quien toque un campo reservado lo hace bajo su propio riesgo. nexthop_grp::resvd1 en particular es actualmente utilizado por al menos strace, sin embargo, llevan una copia propia de los encabezados UAPI, y la conversión debería ser trivial. Se proporciona una función de ayuda para decodificar el peso de los dos campos. Forzar una conversión parece preferible a hacer malabares e introducir uniones anónimas o lo que sea. -
CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Oct. 21, 2026
Action Type Old Value New Value Added Affected Affected value modified. <a href="https://github.com/CVEProject/cvelistV5/blob/main/cves/2024/14xxx/CVE-2024-14040.json">CVE-2024-14040</a> Added Reference https://git.kernel.org/stable/c/2860d59e4ce2bb428c8cecd3b95585012910b7d0 -
CVE Modified by 134c704f-9b21-4f2e-91b3-4a467353bcc0
Oct. 19, 2026
Action Type Old Value New Value Added CWE CWE-787 -
CVE Modified by 134c704f-9b21-4f2e-91b3-4a467353bcc0
Oct. 15, 2026
Action Type Old Value New Value Added SSVC {'id': 'CVE-2024-14040', 'role': 'CISA Coordinator', 'options': [{'exploitation': 'none'}, {'automatable': 'no'}, {'technicalImpact': 'total'}], 'version': '2.0.3', 'timestamp': '2026-10-15T21:40:23.769784Z'} -
CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Oct. 15, 2026
Action Type Old Value New Value Added Reference https://git.kernel.org/stable/c/b72a6a7ab9573e06d5c2fcb92eaa28614a735bfd Removed Reference https://git.kernel.org/stable/c/b72a6a7ab9573e06d5c2fcb92eaa28614a735bfd -
CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Jul. 27, 2026
Action Type Old Value New Value Added CVSS V3.1 AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H -
CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Jul. 27, 2026
Action Type Old Value New Value Changed Affected [{'repo': 'https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git', 'vendor': 'Linux', 'product': 'Linux', 'versions': [{'status': 'affected', 'version': '1da177e4c3f41524e886b7f1b8a0c1fc7321cac2', 'lessThan': 'b72a6a7ab9573e06d5c2fcb92eaa28614a735bfd', 'versionType': 'git'}], 'programFiles': ['include/net/nexthop.h', 'include/uapi/linux/nexthop.h', 'net/ipv4/nexthop.c'], 'defaultStatus': 'unaffected'}, {'repo': 'https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git', 'vendor': 'Linux', 'product': 'Linux', 'versions': [{'status': 'unaffected', 'version': '6.12', 'versionType': 'original_commit_for_fix', 'lessThanOrEqual': '*'}], 'programFiles': ['include/net/nexthop.h', 'include/uapi/linux/nexthop.h', 'net/ipv4/nexthop.c'], 'defaultStatus': 'affected'}] [{'repo': 'https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git', 'vendor': 'Linux', 'product': 'Linux', 'versions': [{'status': 'affected', 'version': '283a72a5599e80750699d2021830a294ed9ab3f3', 'lessThan': 'b72a6a7ab9573e06d5c2fcb92eaa28614a735bfd', 'versionType': 'git'}], 'programFiles': ['include/net/nexthop.h', 'include/uapi/linux/nexthop.h', 'net/ipv4/nexthop.c'], 'defaultStatus': 'unaffected'}, {'repo': 'https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git', 'vendor': 'Linux', 'product': 'Linux', 'versions': [{'status': 'affected', 'version': '5.13'}, {'status': 'unaffected', 'version': '0', 'lessThan': '5.13', 'versionType': 'semver'}, {'status': 'unaffected', 'version': '6.12', 'versionType': 'original_commit_for_fix', 'lessThanOrEqual': '*'}], 'programFiles': ['include/net/nexthop.h', 'include/uapi/linux/nexthop.h', 'net/ipv4/nexthop.c'], 'defaultStatus': 'affected'}] -
New CVE Received by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Jul. 26, 2026
Action Type Old Value New Value Added Affected [{'repo': 'https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git', 'vendor': 'Linux', 'product': 'Linux', 'versions': [{'status': 'affected', 'version': '1da177e4c3f41524e886b7f1b8a0c1fc7321cac2', 'lessThan': 'b72a6a7ab9573e06d5c2fcb92eaa28614a735bfd', 'versionType': 'git'}], 'programFiles': ['include/net/nexthop.h', 'include/uapi/linux/nexthop.h', 'net/ipv4/nexthop.c'], 'defaultStatus': 'unaffected'}, {'repo': 'https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git', 'vendor': 'Linux', 'product': 'Linux', 'versions': [{'status': 'unaffected', 'version': '6.12', 'versionType': 'original_commit_for_fix', 'lessThanOrEqual': '*'}], 'programFiles': ['include/net/nexthop.h', 'include/uapi/linux/nexthop.h', 'net/ipv4/nexthop.c'], 'defaultStatus': 'affected'}] Added 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. Added Reference https://git.kernel.org/stable/c/b72a6a7ab9573e06d5c2fcb92eaa28614a735bfd