CVE-2024-42071

In the Linux kernel, the following vulnerability has been resolved: ionic: use dev_consume_skb_any outside of napi If we're not in a NAPI softirq context, we need to be careful about how we call napi_consume_skb(), specifically we need to call it with budget==0 to signal to it that we're not in a safe context. This was found while running some configuration stress testing of traffic and a change queue config loop running, and this curious note popped out: [ 4371.402645] BUG: using smp_processor_id() in preemptible [00000000] code: ethtool/20545 [ 4371.402897] caller is napi_skb_cache_put+0x16/0x80 [ 4371.403120] CPU: 25 PID: 20545 Comm: ethtool Kdump: loaded Tainted: G OE 6.10.0-rc3-netnext+ #8 [ 4371.403302] Hardware name: HPE ProLiant DL360 Gen10/ProLiant DL360 Gen10, BIOS U32 01/23/2021 [ 4371.403460] Call Trace: [ 4371.403613] <TASK> [ 4371.403758] dump_stack_lvl+0x4f/0x70 [ 4371.403904] check_preemption_disabled+0xc1/0xe0 [ 4371.404051] napi_skb_cache_put+0x16/0x80 [ 4371.404199] ionic_tx_clean+0x18a/0x240 [ionic] [ 4371.404354] ionic_tx_cq_service+0xc4/0x200 [ionic] [ 4371.404505] ionic_tx_flush+0x15/0x70 [ionic] [ 4371.404653] ? ionic_lif_qcq_deinit.isra.23+0x5b/0x70 [ionic] [ 4371.404805] ionic_txrx_deinit+0x71/0x190 [ionic] [ 4371.404956] ionic_reconfigure_queues+0x5f5/0xff0 [ionic] [ 4371.405111] ionic_set_ringparam+0x2e8/0x3e0 [ionic] [ 4371.405265] ethnl_set_rings+0x1f1/0x300 [ 4371.405418] ethnl_default_set_doit+0xbb/0x160 [ 4371.405571] genl_family_rcv_msg_doit+0xff/0x130 [...] I found that ionic_tx_clean() calls napi_consume_skb() which calls napi_skb_cache_put(), but before that last call is the note /* Zero budget indicate non-NAPI context called us, like netpoll */ and DEBUG_NET_WARN_ON_ONCE(!in_softirq()); Those are pretty big hints that we're doing it wrong. We can pass a context hint down through the calls to let ionic_tx_clean() know what we're doing so it can call napi_consume_skb() correctly.
Configurations

Configuration 1 (hide)

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

History

30 Jul 2024, 19:01

Type Values Removed Values Added
First Time Linux
Linux linux Kernel
Summary
  • (es) En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: ionic: usa dev_consume_skb_any fuera de napi. Si no estamos en un contexto de softirq de NAPI, debemos tener cuidado con cómo llamamos a napi_consume_skb(), específicamente debemos llamarlo con Budget==0 para indicarle que no estamos en un contexto seguro. Esto se encontró mientras se ejecutaban algunas pruebas de estrés de configuración del tráfico y se ejecutaba un bucle de configuración de cola de cambios, y apareció esta nota curiosa: [4371.402645] ERROR: usar smp_processor_id() en código interrumpible [00000000]: ethtool/20545 [4371.402897] la persona que llama es napi_skb_cache_put+0x16/0x80 [ 4371.403120] CPU: 25 PID: 20545 Comm: ethtool Kdump: loaded Tainted: G OE 6.10.0-rc3-netnext+ #8 [ 4371.403302] Nombre de hardware: HPE ProLiant DL360 Gen10/ProLiant DL360 Gen 10, BIOSU32 23/01/2021 [ 4371.403460] Seguimiento de llamadas: [ 4371.403613] [ 4371.403758] dump_stack_lvl+0x4f/0x70 [ 4371.403904] check_preemption_disabled+0xc1/0xe0 [ 4371.40405 1] napi_skb_cache_put+0x16/0x80 [ 4371.404199] ionic_tx_clean+0x18a/0x240 [ iónico] [4371.404354] ionic_tx_cq_service+0xc4/0x200 [iónico] [4371.404505] ionic_tx_flush+0x15/0x70 [iónico] [4371.404653]? ionic_lif_qcq_deinit.isra.23+0x5b/0x70 [ionic] [ 4371.404805] ionic_txrx_deinit+0x71/0x190 [ionic] [ 4371.404956] ionic_reconfigure_queues+0x5f5/0xff0 [ionic] [ 4371.4051 11] ionic_set_ringparam+0x2e8/0x3e0 [ionic] [4371.405265] ethnl_set_rings+ 0x1f1/0x300 [ 4371.405418] ethnl_default_set_doit+0xbb/0x160 [ 4371.405571] genl_family_rcv_msg_doit+0xff/0x130 [...] encontré que ionic_tx_clean() llama a napi_consume_skb() que llama a napi_skb_cache_put() , pero antes de esa última llamada está la nota /* El presupuesto cero indica que nos llamó un contexto que no es NAPI, como netpoll */ y DEBUG_NET_WARN_ON_ONCE(!in_softirq()); Esos son indicios bastante importantes de que lo estamos haciendo mal. Podemos pasar una sugerencia de contexto a través de las llamadas para que ionic_tx_clean() sepa lo que estamos haciendo para que pueda llamar a napi_consume_skb() correctamente.
CVSS v2 : unknown
v3 : unknown
v2 : unknown
v3 : 5.5
CWE CWE-834
CPE cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
References () https://git.kernel.org/stable/c/84b767f9e34fdb143c09e66a2a20722fc2921821 - () https://git.kernel.org/stable/c/84b767f9e34fdb143c09e66a2a20722fc2921821 - Patch
References () https://git.kernel.org/stable/c/ef7646ed49fff962e97b276f4ab91327a67eeb5a - () https://git.kernel.org/stable/c/ef7646ed49fff962e97b276f4ab91327a67eeb5a - Patch

29 Jul 2024, 16:21

Type Values Removed Values Added
New CVE

Information

Published : 2024-07-29 16:15

Updated : 2024-07-30 19:01


NVD link : CVE-2024-42071

Mitre link : CVE-2024-42071

CVE.ORG link : CVE-2024-42071


JSON object : View

Products Affected

linux

  • linux_kernel
CWE
CWE-834

Excessive Iteration