Instituto Nacional de ciberseguridad. Sección Incibe
Instituto Nacional de Ciberseguridad. Sección INCIBE-CERT

Vulnerabilidad en kernel de Linux (CVE-2025-21867)

Gravedad CVSS v3.1:
ALTA
Tipo:
CWE-416 Utilización después de liberación
Fecha de publicación:
27/03/2025
Última modificación:
01/04/2025

Descripción

En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: bpf, test_run: Se solucionó el problema de use-after-free en eth_skb_pkt_type(). KMSAN reportó un problema de use-after-free en eth_skb_pkt_type()[1]. La causa del problema era que eth_skb_pkt_type() accedía a datos de skb que no contenían un encabezado Ethernet. Esto ocurre cuando bpf_prog_test_run_xdp() pasa un valor no válido como argumento user_data a bpf_test_init(). Se soluciona devolviendo un error cuando user_data sea menor que ETH_HLEN en bpf_test_init(). Además, se ha eliminado la comprobación de "if (user_size > size)", ya que no es necesaria. [1] ERROR: KMSAN: use-after-free en eth_skb_pkt_type include/linux/etherdevice.h:627 [en línea] ERROR: KMSAN: use-after-free en eth_type_trans+0x4ee/0x980 net/ethernet/eth.c:165 eth_skb_pkt_type include/linux/etherdevice.h:627 [en línea] eth_type_trans+0x4ee/0x980 net/ethernet/eth.c:165 __xdp_build_skb_from_frame+0x5a8/0xa50 net/core/xdp.c:635 xdp_recv_frames net/bpf/test_run.c:272 [en línea] xdp_test_run_batch net/bpf/test_run.c:361 [en línea] bpf_test_run_xdp_live+0x2954/0x3330 net/bpf/test_run.c:390 bpf_prog_test_run_xdp+0x148e/0x1b10 net/bpf/test_run.c:1318 bpf_prog_test_run+0x5b7/0xa30 kernel/bpf/syscall.c:4371 __sys_bpf+0x6a6/0xe20 kernel/bpf/syscall.c:5777 __do_sys_bpf kernel/bpf/syscall.c:5866 [en línea] __se_sys_bpf kernel/bpf/syscall.c:5864 [en línea] __x64_sys_bpf+0xa4/0xf0 kernel/bpf/syscall.c:5864 x64_sys_call+0x2ea0/0x3d90 arch/x86/include/generated/asm/syscalls_64.h:322 do_syscall_x64 arch/x86/entry/common.c:52 [en línea] do_syscall_64+0xd9/0x1d0 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Uninit se creó en: free_pages_prepare mm/page_alloc.c:1056 [en línea] free_unref_page+0x156/0x1320 mm/page_alloc.c:2657 __free_pages+0xa3/0x1b0 mm/page_alloc.c:4838 bpf_ringbuf_free kernel/bpf/ringbuf.c:226 [en línea] ringbuf_map_free+0xff/0x1e0 kernel/bpf/ringbuf.c:235 bpf_map_free kernel/bpf/syscall.c:838 [en línea] bpf_map_free_deferred+0x17c/0x310 kernel/bpf/syscall.c:862 proceso_un_trabajo kernel/workqueue.c:3229 [en línea] proceso_scheduled_works+0xa2b/0x1b60 kernel/workqueue.c:3310 subproceso_trabajador+0xedf/0x1550 kernel/workqueue.c:3391 kthread+0x535/0x6b0 kernel/kthread.c:389 ret_from_fork+0x6e/0x90 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 CPU: 1 UID: 0 PID: 17276 Comm: syz.1.16450 No contaminado 6.12.0-05490-g9bb88c659673 #8 Nombre del hardware: PC estándar QEMU (i440FX + PIIX, 1996), BIOS 1.16.3-3.fc41 01/04/2014

Productos y versiones vulnerables

CPE Desde Hasta
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.18 (incluyendo) 6.1.130 (excluyendo)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.2 (incluyendo) 6.6.80 (excluyendo)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.7 (incluyendo) 6.12.17 (excluyendo)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.13 (incluyendo) 6.13.5 (excluyendo)
cpe:2.3:o:linux:linux_kernel:6.14:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.14:rc2:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.14:rc3:*:*:*:*:*:*