// For flags

CVE-2024-26859

net/bnx2x: Prevent access to a freed page in page_pool

Severity Score

4.1
*CVSS v3.1

Exploit Likelihood

*EPSS

Affected Versions

*CPE

Public Exploits

0
*Multiple Sources

Exploited in Wild

-
*KEV

Decision

Track
*SSVC
Descriptions

In the Linux kernel, the following vulnerability has been resolved:

net/bnx2x: Prevent access to a freed page in page_pool

Fix race condition leading to system crash during EEH error handling

During EEH error recovery, the bnx2x driver's transmit timeout logic
could cause a race condition when handling reset tasks. The
bnx2x_tx_timeout() schedules reset tasks via bnx2x_sp_rtnl_task(),
which ultimately leads to bnx2x_nic_unload(). In bnx2x_nic_unload()
SGEs are freed using bnx2x_free_rx_sge_range(). However, this could
overlap with the EEH driver's attempt to reset the device using
bnx2x_io_slot_reset(), which also tries to free SGEs. This race
condition can result in system crashes due to accessing freed memory
locations in bnx2x_free_rx_sge()

799 static inline void bnx2x_free_rx_sge(struct bnx2x *bp,
800 struct bnx2x_fastpath *fp, u16 index)
801 {
802 struct sw_rx_page *sw_buf = &fp->rx_page_ring[index];
803 struct page *page = sw_buf->page;
....
where sw_buf was set to NULL after the call to dma_unmap_page()
by the preceding thread.

EEH: Beginning: 'slot_reset'
PCI 0011:01:00.0#10000: EEH: Invoking bnx2x->slot_reset()
bnx2x: [bnx2x_io_slot_reset:14228(eth1)]IO slot reset initializing...
bnx2x 0011:01:00.0: enabling device (0140 -> 0142)
bnx2x: [bnx2x_io_slot_reset:14244(eth1)]IO slot reset --> driver unload
Kernel attempted to read user page (0) - exploit attempt? (uid: 0)
BUG: Kernel NULL pointer dereference on read at 0x00000000
Faulting instruction address: 0xc0080000025065fc
Oops: Kernel access of bad area, sig: 11 [#1]
.....
Call Trace:
[c000000003c67a20] [c00800000250658c] bnx2x_io_slot_reset+0x204/0x610 [bnx2x] (unreliable)
[c000000003c67af0] [c0000000000518a8] eeh_report_reset+0xb8/0xf0
[c000000003c67b60] [c000000000052130] eeh_pe_report+0x180/0x550
[c000000003c67c70] [c00000000005318c] eeh_handle_normal_event+0x84c/0xa60
[c000000003c67d50] [c000000000053a84] eeh_event_handler+0xf4/0x170
[c000000003c67da0] [c000000000194c58] kthread+0x1c8/0x1d0
[c000000003c67e10] [c00000000000cf64] ret_from_kernel_thread+0x5c/0x64

To solve this issue, we need to verify page pool allocations before
freeing.

En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: net/bnx2x: impide el acceso a una página liberada en page_pool. Repara la condición de carrera que provoca un bloqueo del sistema durante el manejo de errores EEH. Durante la recuperación de errores EEH, la lógica de tiempo de espera de transmisión del controlador bnx2x podría provocar una carrera. condición al manejar tareas de reinicio. El bnx2x_tx_timeout() programa tareas de reinicio a través de bnx2x_sp_rtnl_task(), lo que finalmente conduce a bnx2x_nic_unload(). En bnx2x_nic_unload(), los SGE se liberan utilizando bnx2x_free_rx_sge_range(). Sin embargo, esto podría superponerse con el intento del controlador EEH de restablecer el dispositivo usando bnx2x_io_slot_reset(), que también intenta liberar los SGE. This race condition can result in system crashes due to accessing freed memory locations in bnx2x_free_rx_sge() 799 static inline void bnx2x_free_rx_sge(struct bnx2x *bp, 800 struct bnx2x_fastpath *fp, u16 index) 801 { 802 struct sw_rx_page *sw_buf = &fp->rx_page_ring [índice]; 803 página de estructura *página = sw_buf->página; .... donde sw_buf se configuró en NULL después de la llamada a dma_unmap_page() por el hilo anterior. EEH: Comienzo: 'slot_reset' PCI 0011:01:00.0#10000: EEH: Invocando bnx2x->slot_reset() bnx2x: [bnx2x_io_slot_reset:14228(eth1)]Reinicio de ranura IO inicializando... bnx2x 0011:01:00.0: habilitando dispositivo (0140 -> 0142) bnx2x: [bnx2x_io_slot_reset:14244(eth1)]Restablecimiento de ranura IO --> descarga del controlador El kernel intentó leer la página del usuario (0): ¿intento de explotación? (uid: 0) ERROR: Desreferencia del puntero NULL del kernel al leer en 0x00000000 Dirección de instrucción errónea: 0xc0080000025065fc Ups: Acceso al kernel del área defectuosa, firma: 11 [#1] ..... Seguimiento de llamadas: [c000000003c67a20] [c00800000250658c] 2x_io_slot_reset +0x204/0x610 [bnx2x] (no confiable) [c000000003c67af0] [c0000000000518a8] eeh_report_reset+0xb8/0xf0 [c000000003c67b60] [c000000000052130] 180/0x550 [c000000003c67c70] [c00000000005318c] eeh_handle_normal_event+0x84c/0xa60 [c000000003c67d50] [c000000000053a84] eeh_event_handler +0xf4/0x170 [c000000003c67da0] [c000000000194c58] kthread+0x1c8/0x1d0 [c000000003c67e10] [c00000000000cf64] ret_from_kernel_thread+0x5c/0x64 Para resolver este problema, necesitamos verifique las asignaciones del grupo de páginas antes de liberarlas.

*Credits: N/A
CVSS Scores
Attack Vector
Local
Attack Complexity
High
Privileges Required
High
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High
* Common Vulnerability Scoring System
SSVC
  • Decision:Track
Exploitation
None
Automatable
No
Tech. Impact
Partial
* Organization's Worst-case Scenario
Timeline
  • 2024-02-19 CVE Reserved
  • 2024-04-17 CVE Published
  • 2024-04-18 EPSS Updated
  • 2024-08-02 CVE Updated
  • ---------- Exploited in Wild
  • ---------- KEV Due Date
  • ---------- First Exploit
CWE
  • CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
CAPEC
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"
>= 4.2 < 4.19.311
Search vendor "Linux" for product "Linux Kernel" and version " >= 4.2 < 4.19.311"
en
Affected
Linux
Search vendor "Linux"
Linux Kernel
Search vendor "Linux" for product "Linux Kernel"
>= 4.2 < 5.4.273
Search vendor "Linux" for product "Linux Kernel" and version " >= 4.2 < 5.4.273"
en
Affected
Linux
Search vendor "Linux"
Linux Kernel
Search vendor "Linux" for product "Linux Kernel"
>= 4.2 < 5.10.214
Search vendor "Linux" for product "Linux Kernel" and version " >= 4.2 < 5.10.214"
en
Affected
Linux
Search vendor "Linux"
Linux Kernel
Search vendor "Linux" for product "Linux Kernel"
>= 4.2 < 5.15.153
Search vendor "Linux" for product "Linux Kernel" and version " >= 4.2 < 5.15.153"
en
Affected
Linux
Search vendor "Linux"
Linux Kernel
Search vendor "Linux" for product "Linux Kernel"
>= 4.2 < 6.1.83
Search vendor "Linux" for product "Linux Kernel" and version " >= 4.2 < 6.1.83"
en
Affected
Linux
Search vendor "Linux"
Linux Kernel
Search vendor "Linux" for product "Linux Kernel"
>= 4.2 < 6.6.23
Search vendor "Linux" for product "Linux Kernel" and version " >= 4.2 < 6.6.23"
en
Affected
Linux
Search vendor "Linux"
Linux Kernel
Search vendor "Linux" for product "Linux Kernel"
>= 4.2 < 6.7.11
Search vendor "Linux" for product "Linux Kernel" and version " >= 4.2 < 6.7.11"
en
Affected
Linux
Search vendor "Linux"
Linux Kernel
Search vendor "Linux" for product "Linux Kernel"
>= 4.2 < 6.8.2
Search vendor "Linux" for product "Linux Kernel" and version " >= 4.2 < 6.8.2"
en
Affected
Linux
Search vendor "Linux"
Linux Kernel
Search vendor "Linux" for product "Linux Kernel"
>= 4.2 < 6.9
Search vendor "Linux" for product "Linux Kernel" and version " >= 4.2 < 6.9"
en
Affected