CVE-2023-52843
llc: verify mac len before reading mac header
Severity Score
Exploit Likelihood
Affected Versions
Public Exploits
0Exploited in Wild
-Decision
Descriptions
In the Linux kernel, the following vulnerability has been resolved:
llc: verify mac len before reading mac header
LLC reads the mac header with eth_hdr without verifying that the skb
has an Ethernet header.
Syzbot was able to enter llc_rcv on a tun device. Tun can insert
packets without mac len and with user configurable skb->protocol
(passing a tun_pi header when not configuring IFF_NO_PI).
BUG: KMSAN: uninit-value in llc_station_ac_send_test_r net/llc/llc_station.c:81 [inline]
BUG: KMSAN: uninit-value in llc_station_rcv+0x6fb/0x1290 net/llc/llc_station.c:111
llc_station_ac_send_test_r net/llc/llc_station.c:81 [inline]
llc_station_rcv+0x6fb/0x1290 net/llc/llc_station.c:111
llc_rcv+0xc5d/0x14a0 net/llc/llc_input.c:218
__netif_receive_skb_one_core net/core/dev.c:5523 [inline]
__netif_receive_skb+0x1a6/0x5a0 net/core/dev.c:5637
netif_receive_skb_internal net/core/dev.c:5723 [inline]
netif_receive_skb+0x58/0x660 net/core/dev.c:5782
tun_rx_batched+0x3ee/0x980 drivers/net/tun.c:1555
tun_get_user+0x54c5/0x69c0 drivers/net/tun.c:2002
Add a mac_len test before all three eth_hdr(skb) calls under net/llc.
There are further uses in include/net/llc_pdu.h. All these are
protected by a test skb->protocol == ETH_P_802_2. Which does not
protect against this tun scenario.
But the mac_len test added in this patch in llc_fixup_skb will
indirectly protect those too. That is called from llc_rcv before any
other LLC code.
It is tempting to just add a blanket mac_len check in llc_rcv, but
not sure whether that could break valid LLC paths that do not assume
an Ethernet header. 802.2 LLC may be used on top of non-802.3
protocols in principle. The below referenced commit shows that used
to, on top of Token Ring.
At least one of the three eth_hdr uses goes back to before the start
of git history. But the one that syzbot exercises is introduced in
this commit. That commit is old enough (2008), that effectively all
stable kernels should receive this.
En el kernel de Linux se ha resuelto la siguiente vulnerabilidad: llc: verificar mac len antes de leer el encabezado de mac. LLC lee el encabezado de mac con eth_hdr sin verificar que el skb tenga un encabezado de Ethernet. Syzbot pudo ingresar llc_rcv en un dispositivo tun. Tun puede insertar paquetes sin mac len y con el protocolo skb-> configurable por el usuario (pasando un encabezado tun_pi cuando no se configura IFF_NO_PI). ERROR: KMSAN: valor uninit en llc_station_ac_send_test_r net/llc/llc_station.c:81 [en línea] BUG: KMSAN: valor uninit en llc_station_rcv+0x6fb/0x1290 net/llc/llc_station.c:111 llc_station_ac_send_test_r net/llc/llc_station. c:81 [en línea] llc_station_rcv+0x6fb/0x1290 net/llc/llc_station.c:111 llc_rcv+0xc5d/0x14a0 net/llc/llc_input.c:218 __netif_receive_skb_one_core net/core/dev.c:5523 __netif_receive_skb+ 0x1a6 /0x5a0 net/core/dev.c:5637 netif_receive_skb_internal net/core/dev.c:5723 [en línea] netif_receive_skb+0x58/0x660 net/core/dev.c:5782 tun_rx_batched+0x3ee/0x980 drivers/net/tun.c :1555 tun_get_user+0x54c5/0x69c0 drivers/net/tun.c:2002 Agregue una prueba mac_len antes de las tres llamadas eth_hdr(skb) en net/llc. Hay más usos en include/net/llc_pdu.h. Todos estos están protegidos por un protocolo de prueba skb->== ETH_P_802_2. Lo cual no protege contra este escenario tun. Pero la prueba mac_len agregada en este parche en llc_fixup_skb también los protegerá indirectamente. Esto se llama desde llc_rcv antes que cualquier otro código LLC. Es tentador simplemente agregar una verificación general de mac_len en llc_rcv, pero no estoy seguro de si eso podría interrumpir las rutas LLC válidas que no asumen un encabezado Ethernet. En principio, 802.2 LLC se puede utilizar además de protocolos que no sean 802.3. La confirmación a la que se hace referencia a continuación muestra que solía hacerlo, además de Token Ring. Al menos uno de los tres usos de eth_hdr se remonta a antes del inicio del historial de git. Pero el que ejercita syzbot se introduce en este compromiso. Ese compromiso es lo suficientemente antiguo (2008), por lo que efectivamente todos los núcleos estables deberían recibirlo.
CVSS Scores
SSVC
- Decision:Track
Timeline
- 2024-05-21 CVE Reserved
- 2024-05-21 CVE Published
- 2024-05-22 EPSS Updated
- 2024-11-04 CVE Updated
- ---------- Exploited in Wild
- ---------- KEV Due Date
- ---------- First Exploit
CWE
CAPEC
References (10)
URL | Tag | Source |
---|---|---|
https://git.kernel.org/stable/c/f83f1768f833cb45bc93429fdc552252a4f55ac3 | Vuln. Introduced |
URL | Date | SRC |
---|
URL | Date | SRC |
---|
Affected Vendors, Products, and Versions
Vendor | Product | Version | Other | Status | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Vendor | Product | Version | Other | Status | <-- --> | Vendor | Product | Version | Other | Status |
Linux Search vendor "Linux" | Linux Kernel Search vendor "Linux" for product "Linux Kernel" | >= 2.6.25 < 4.14.330 Search vendor "Linux" for product "Linux Kernel" and version " >= 2.6.25 < 4.14.330" | en |
Affected
| ||||||
Linux Search vendor "Linux" | Linux Kernel Search vendor "Linux" for product "Linux Kernel" | >= 2.6.25 < 4.19.299 Search vendor "Linux" for product "Linux Kernel" and version " >= 2.6.25 < 4.19.299" | en |
Affected
| ||||||
Linux Search vendor "Linux" | Linux Kernel Search vendor "Linux" for product "Linux Kernel" | >= 2.6.25 < 5.4.261 Search vendor "Linux" for product "Linux Kernel" and version " >= 2.6.25 < 5.4.261" | en |
Affected
| ||||||
Linux Search vendor "Linux" | Linux Kernel Search vendor "Linux" for product "Linux Kernel" | >= 2.6.25 < 5.10.201 Search vendor "Linux" for product "Linux Kernel" and version " >= 2.6.25 < 5.10.201" | en |
Affected
| ||||||
Linux Search vendor "Linux" | Linux Kernel Search vendor "Linux" for product "Linux Kernel" | >= 2.6.25 < 5.15.139 Search vendor "Linux" for product "Linux Kernel" and version " >= 2.6.25 < 5.15.139" | en |
Affected
| ||||||
Linux Search vendor "Linux" | Linux Kernel Search vendor "Linux" for product "Linux Kernel" | >= 2.6.25 < 6.1.63 Search vendor "Linux" for product "Linux Kernel" and version " >= 2.6.25 < 6.1.63" | en |
Affected
| ||||||
Linux Search vendor "Linux" | Linux Kernel Search vendor "Linux" for product "Linux Kernel" | >= 2.6.25 < 6.5.12 Search vendor "Linux" for product "Linux Kernel" and version " >= 2.6.25 < 6.5.12" | en |
Affected
| ||||||
Linux Search vendor "Linux" | Linux Kernel Search vendor "Linux" for product "Linux Kernel" | >= 2.6.25 < 6.6.2 Search vendor "Linux" for product "Linux Kernel" and version " >= 2.6.25 < 6.6.2" | en |
Affected
| ||||||
Linux Search vendor "Linux" | Linux Kernel Search vendor "Linux" for product "Linux Kernel" | >= 2.6.25 < 6.7 Search vendor "Linux" for product "Linux Kernel" and version " >= 2.6.25 < 6.7" | en |
Affected
|