CVE-2024-26803
JSON

5.5medium

net: veth: clear GRO when clearing XDP even when down

Severity
5.5medium CVSS:3.1 by NVD
Exploit likelihood
0.22% (higher than 14% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
Linux

Description

In the Linux kernel, the following vulnerability has been resolved: net: veth: clear GRO when clearing XDP even when down veth sets NETIF_F_GRO automatically when XDP is enabled, because both features use the same NAPI machinery. The logic to clear NETIF_F_GRO sits in veth_disable_xdp() which is called both on ndo_stop and when XDP is turned off. To avoid the flag from being cleared when the device is brought down, the clearing is skipped when IFF_UP is not set. Bringing the device down should indeed not modify its features. Unfortunately, this means that clearing is also skipped when XDP is disabled _while_ the device is down. And there's nothing on the open path to bring the device features back into sync. IOW if user enables XDP, disables it and then brings the device up we'll end up with a stray GRO flag set but no NAPI instances. We don't depend on the GRO flag on the datapath, so the datapath won't crash. We will crash (or hang), however, next time features are sync'ed (either by user via ethtool or peer changing its config). The GRO flag will go away, and veth will try to disable the NAPIs. But the open path never created them since XDP was off, the GRO flag was a stray. If NAPI was initialized before we'll hang in napi_disable(). If it never was we'll crash trying to stop uninitialized hrtimer. Move the GRO flag updates to the XDP enable / disable paths, instead of mixing them with the ndo_open / ndo_close paths.

Affected

Product or packageVersionsReported by
Linux Linuxfrom d3256efd8e8b234a6251e4d4580bd2c3c31fdc4c before f011c103e654d83dc85f057a7d1bd0960d02831c, from d3256efd8e8b234a6251e4d4580bd2c3c31fdc4c before 7985d73961bbb4e726c1be7b9cd26becc7be8325, from d3256efd8e8b234a6251e4d4580bd2c3c31fdc4c before 16edf51f33f52dff70ed455bc40a6cc443c04664, from d3256efd8e8b234a6251e4d4580bd2c3c31fdc4c before 8f7a3894e58e6f5d5815533cfde60e3838947941, from d3256efd8e8b234a6251e4d4580bd2c3c31fdc4c before fe9f801355f0b47668419f30f1fac1cf4539e736, 5.13
Not affected: before 5.13, from 5.15.151 up to 5.15.*, from 6.1.81 up to 6.1.*, from 6.6.21 up to 6.6.*, from 6.7.9 up to 6.7.*, from 6.8 up to *
CVE List
linux linux_kernelfrom 5.13 before 5.15.151, from 5.16 before 6.1.81, from 6.2 before 6.6.21, from 6.7 before 6.7.9, 6.8NVD

Classification

CWE-459

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

In the Linux kernel, the following vulnerability has been resolved: net: veth: clear GRO when clearing XDP even when down veth sets NETIF_F_GRO automatically when XDP is enabled, because both features use the same NAPI machinery. The logic to clear NETIF_F_GRO sits in veth_disable_xdp() which is called both on ndo_stop and when XDP is turned off. To avoid the flag from being cleared when the device is brought down, the clearing is skipped when IFF_UP is not set. Bringing the device down should indeed not modify its features. Unfortunately, this means that clearing is also skipped when XDP is disabled _while_ the device is down. And there's nothing on the open path to bring the device features back into sync. IOW if user enables XDP, disables it and then brings the device up we'll end up with a stray GRO flag set but no NAPI instances. We don't depend on the GRO flag on the datapath, so the datapath won't crash. We will crash (or hang), however, next time features are sync'ed (either by user via ethtool or peer changing its config). The GRO flag will go away, and veth will try to disable the NAPIs. But the open path never created them since XDP was off, the GRO flag was a stray. If NAPI was initialized before we'll hang in napi_disable(). If it never was we'll crash trying to stop uninitialized hrtimer. Move the GRO flag updates to the XDP enable / disable paths, instead of mixing them with the ndo_open / ndo_close paths.

NVD (es)

En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: net: veth: borra GRO al borrar XDP incluso cuando está desactivado veth configura NETIF_F_GRO automáticamente cuando XDP está habilitado, porque ambas funciones utilizan la misma maquinaria NAPI. La lógica para borrar NETIF_F_GRO se encuentra en veth_disable_xdp(), que se llama tanto en ndo_stop como cuando XDP está desactivado. Para evitar que la bandera se borre cuando se baja el dispositivo, la eliminación se omite cuando IFF_UP no está configurado. De hecho, bajar el dispositivo no debería modificar sus características. Desafortunadamente, esto significa que la limpieza también se omite cuando XDP está deshabilitado _mientras_ el dispositivo está inactivo. Y no hay nada en el camino abierto para volver a sincronizar las funciones del dispositivo. IOW, si el usuario habilita XDP, lo deshabilita y luego enciende el dispositivo, terminaremos con un indicador GRO perdido pero sin instancias NAPI. No dependemos del indicador GRO en la ruta de datos, por lo que la ruta de datos no fallará. Nos bloquearemos (o colgaremos), sin embargo, la próxima vez que se sincronicen las funciones (ya sea por el usuario a través de ethtool o por un compañero cambiando su configuración). La bandera GRO desaparecerá y Veth intentará desactivar las NAPI. Pero el camino abierto nunca los creó ya que XDP estaba desactivado, la bandera GRO estaba perdida. Si NAPI se inicializó antes, colgaremos napi_disable(). Si nunca fue así, fallaremos al intentar detener el hrtimer no inicializado. Mueva las actualizaciones del indicador GRO a las rutas de activación/desactivación de XDP, en lugar de mezclarlas con las rutas ndo_open/ndo_close.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-26803 changed 2026-05-11CVE Terms of Use
NVDCVE-2024-26803 changed 2026-06-17Public domain