CVE-2024-43880

In the Linux kernel, the following vulnerability has been resolved: mlxsw: spectrum_acl_erp: Fix object nesting warning ACLs in Spectrum-2 and newer ASICs can reside in the algorithmic TCAM (A-TCAM) or in the ordinary circuit TCAM (C-TCAM). The former can contain more ACLs (i.e., tc filters), but the number of masks in each region (i.e., tc chain) is limited. In order to mitigate the effects of the above limitation, the device allows filters to share a single mask if their masks only differ in up to 8 consecutive bits. For example, dst_ip/25 can be represented using dst_ip/24 with a delta of 1 bit. The C-TCAM does not have a limit on the number of masks being used (and therefore does not support mask aggregation), but can contain a limited number of filters. The driver uses the "objagg" library to perform the mask aggregation by passing it objects that consist of the filter's mask and whether the filter is to be inserted into the A-TCAM or the C-TCAM since filters in different TCAMs cannot share a mask. The set of created objects is dependent on the insertion order of the filters and is not necessarily optimal. Therefore, the driver will periodically ask the library to compute a more optimal set ("hints") by looking at all the existing objects. When the library asks the driver whether two objects can be aggregated the driver only compares the provided masks and ignores the A-TCAM / C-TCAM indication. This is the right thing to do since the goal is to move as many filters as possible to the A-TCAM. The driver also forbids two identical masks from being aggregated since this can only happen if one was intentionally put in the C-TCAM to avoid a conflict in the A-TCAM. The above can result in the following set of hints: H1: {mask X, A-TCAM} -> H2: {mask Y, A-TCAM} // X is Y + delta H3: {mask Y, C-TCAM} -> H4: {mask Z, A-TCAM} // Y is Z + delta After getting the hints from the library the driver will start migrating filters from one region to another while consulting the computed hints and instructing the device to perform a lookup in both regions during the transition. Assuming a filter with mask X is being migrated into the A-TCAM in the new region, the hints lookup will return H1. Since H2 is the parent of H1, the library will try to find the object associated with it and create it if necessary in which case another hints lookup (recursive) will be performed. This hints lookup for {mask Y, A-TCAM} will either return H2 or H3 since the driver passes the library an object comparison function that ignores the A-TCAM / C-TCAM indication. This can eventually lead to nested objects which are not supported by the library [1]. Fix by removing the object comparison function from both the driver and the library as the driver was the only user. That way the lookup will only return exact matches. I do not have a reliable reproducer that can reproduce the issue in a timely manner, but before the fix the issue would reproduce in several minutes and with the fix it does not reproduce in over an hour. Note that the current usefulness of the hints is limited because they include the C-TCAM indication and represent aggregation that cannot actually happen. This will be addressed in net-next. [1] WARNING: CPU: 0 PID: 153 at lib/objagg.c:170 objagg_obj_parent_assign+0xb5/0xd0 Modules linked in: CPU: 0 PID: 153 Comm: kworker/0:18 Not tainted 6.9.0-rc6-custom-g70fbc2c1c38b #42 Hardware name: Mellanox Technologies Ltd. MSN3700C/VMOD0008, BIOS 5.11 10/10/2018 Workqueue: mlxsw_core mlxsw_sp_acl_tcam_vregion_rehash_work RIP: 0010:objagg_obj_parent_assign+0xb5/0xd0 [...] Call Trace: <TASK> __objagg_obj_get+0x2bb/0x580 objagg_obj_get+0xe/0x80 mlxsw_sp_acl_erp_mask_get+0xb5/0xf0 mlxsw_sp_acl_atcam_entry_add+0xe8/0x3c0 mlxsw_sp_acl_tcam_entry_create+0x5e/0xa0 mlxsw_sp_acl_tcam_vchunk_migrate_one+0x16b/0x270 mlxsw_sp_acl_tcam_vregion_rehash_work+0xbe/0x510 process_one_work+0x151/0x370
Configurations

Configuration 1 (hide)

OR cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*

History

26 Sep 2025, 18:39

Type Values Removed Values Added
CVSS v2 : unknown
v3 : unknown
v2 : unknown
v3 : 5.5
CPE cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Summary
  • (es) En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: mlxsw: espectro_acl_erp: corrige la advertencia de anidamiento de objetos. Las ACL en Spectrum-2 y los ASIC más nuevos pueden residir en el TCAM algorítmico (A-TCAM) o en el TCAM de circuito ordinario (C-TCAM). El primero puede contener más ACL (es decir, filtros tc), pero el número de máscaras en cada región (es decir, cadena tc) es limitado. Para mitigar los efectos de la limitación anterior, el dispositivo permite que los filtros compartan una única máscara si sus máscaras solo difieren en hasta 8 bits consecutivos. Por ejemplo, dst_ip/25 se puede representar usando dst_ip/24 con un delta de 1 bit. C-TCAM no tiene un límite en la cantidad de máscaras que se utilizan (y por lo tanto no admite la agregación de máscaras), pero puede contener una cantidad limitada de filtros. El controlador utiliza la librería "objagg" para realizar la agregación de máscaras pasándole objetos que constan de la máscara del filtro y si el filtro se insertará en la A-TCAM o en la C-TCAM, ya que los filtros en diferentes TCAM no pueden compartir una máscara. El conjunto de objetos creados depende del orden de inserción de los filtros y no es necesariamente óptimo. Por lo tanto, el controlador solicitará periódicamente a la librería que calcule un conjunto más óptimo ("sugerencias") observando todos los objetos existentes. Cuando la librería pregunta al controlador si se pueden agregar dos objetos, el controlador solo compara las máscaras proporcionadas e ignora la indicación A-TCAM/C-TCAM. Esto es lo correcto ya que el objetivo es mover tantos filtros como sea posible a la A-TCAM. El driver también prohíbe agregar dos máscaras idénticas, ya que esto solo puede suceder si una se colocó intencionalmente en la C-TCAM para evitar un conflicto en la A-TCAM. Lo anterior puede dar como resultado el siguiente conjunto de sugerencias: H1: {máscara X, A-TCAM} -&gt; H2: {máscara Y, A-TCAM} // X es Y + delta H3: {máscara Y, C-TCAM} -&gt; H4: {máscara Z, A-TCAM} // Y es Z + delta Después de obtener las sugerencias de la librería, el controlador comenzará a migrar filtros de una región a otra mientras consulta las sugerencias calculadas e indica al dispositivo que realice una búsqueda. en ambas regiones durante la transición. Suponiendo que se está migrando un filtro con máscara X a la A-TCAM en la nueva región, la búsqueda de sugerencias devolverá H1. Dado que H2 es el padre de H1, la librería intentará encontrar el objeto asociado con él y crearlo si es necesario, en cuyo caso se realizará otra búsqueda de sugerencias (recursiva). Esta búsqueda de sugerencias para {máscara Y, A-TCAM} devolverá H2 o H3 ya que el controlador pasa a la librería una función de comparación de objetos que ignora la indicación A-TCAM/C-TCAM. En última instancia, esto puede conducir a objetos anidados que no son compatibles con la librería [1]. Para solucionarlo, elimine la función de comparación de objetos tanto del controlador como de la librería, ya que el controlador era el único usuario. De esa forma, la búsqueda solo arrojará coincidencias exactas. No tengo un reproductor confiable que pueda reproducir el problema de manera oportuna, pero antes de solucionarlo, el problema se reproducía en varios minutos y con la solución no se reproduce en más de una hora. Tenga en cuenta que la utilidad actual de las sugerencias es limitada porque incluyen la indicación C-TCAM y representan una agregación que en realidad no puede ocurrir. Esto se abordará en net-next. [1] ADVERTENCIA: CPU: 0 PID: 153 en lib/objagg.c:170 objagg_obj_parent_assign+0xb5/0xd0 Módulos vinculados en: CPU: 0 PID: 153 Comm: kworker/0:18 No contaminado 6.9.0-rc6-custom -g70fbc2c1c38b #42 Nombre del hardware: Mellanox Technologies Ltd. MSN3700C/VMOD0008, BIOS 5.11 10/10/2018 Cola de trabajo: mlxsw_core mlxsw_sp_acl_tcam_vregion_rehash_work RIP: 0010:objagg_obj_parent_assign+0xb5/0xd0 [...] Seguimiento de llamadas: &lt; TAREA&gt; ---truncado----
CWE CWE-401
First Time Linux linux Kernel
Linux
References () https://git.kernel.org/stable/c/0e59c2d22853266704e127915653598f7f104037 - () https://git.kernel.org/stable/c/0e59c2d22853266704e127915653598f7f104037 - Patch
References () https://git.kernel.org/stable/c/25c6fd9648ad05da493a5d30881896a78a08b624 - () https://git.kernel.org/stable/c/25c6fd9648ad05da493a5d30881896a78a08b624 - Patch
References () https://git.kernel.org/stable/c/36a9996e020dd5aa325e0ecc55eb2328288ea6bb - () https://git.kernel.org/stable/c/36a9996e020dd5aa325e0ecc55eb2328288ea6bb - Patch
References () https://git.kernel.org/stable/c/4dc09f6f260db3c4565a4ec52ba369393598f2fb - () https://git.kernel.org/stable/c/4dc09f6f260db3c4565a4ec52ba369393598f2fb - Patch
References () https://git.kernel.org/stable/c/97d833ceb27dc19f8777d63f90be4a27b5daeedf - () https://git.kernel.org/stable/c/97d833ceb27dc19f8777d63f90be4a27b5daeedf - Patch
References () https://git.kernel.org/stable/c/9a5261a984bba4f583d966c550fa72c33ff3714e - () https://git.kernel.org/stable/c/9a5261a984bba4f583d966c550fa72c33ff3714e - Patch
References () https://git.kernel.org/stable/c/fb5d4fc578e655d113f09565f6f047e15f7ab578 - () https://git.kernel.org/stable/c/fb5d4fc578e655d113f09565f6f047e15f7ab578 - Patch

21 Aug 2024, 01:15

Type Values Removed Values Added
New CVE

Information

Published : 2024-08-21 01:15

Updated : 2025-09-26 18:39


NVD link : CVE-2024-43880

Mitre link : CVE-2024-43880

CVE.ORG link : CVE-2024-43880


JSON object : View

Products Affected

linux

  • linux_kernel
CWE
CWE-401

Missing Release of Memory after Effective Lifetime