CVE-2024-50042

In the Linux kernel, the following vulnerability has been resolved: ice: Fix increasing MSI-X on VF Increasing MSI-X value on a VF leads to invalid memory operations. This is caused by not reallocating some arrays. Reproducer: modprobe ice echo 0 > /sys/bus/pci/devices/$PF_PCI/sriov_drivers_autoprobe echo 1 > /sys/bus/pci/devices/$PF_PCI/sriov_numvfs echo 17 > /sys/bus/pci/devices/$VF0_PCI/sriov_vf_msix_count Default MSI-X is 16, so 17 and above triggers this issue. KASAN reports: BUG: KASAN: slab-out-of-bounds in ice_vsi_alloc_ring_stats+0x38d/0x4b0 [ice] Read of size 8 at addr ffff8888b937d180 by task bash/28433 (...) Call Trace: (...) ? ice_vsi_alloc_ring_stats+0x38d/0x4b0 [ice] kasan_report+0xed/0x120 ? ice_vsi_alloc_ring_stats+0x38d/0x4b0 [ice] ice_vsi_alloc_ring_stats+0x38d/0x4b0 [ice] ice_vsi_cfg_def+0x3360/0x4770 [ice] ? mutex_unlock+0x83/0xd0 ? __pfx_ice_vsi_cfg_def+0x10/0x10 [ice] ? __pfx_ice_remove_vsi_lkup_fltr+0x10/0x10 [ice] ice_vsi_cfg+0x7f/0x3b0 [ice] ice_vf_reconfig_vsi+0x114/0x210 [ice] ice_sriov_set_msix_vec_count+0x3d0/0x960 [ice] sriov_vf_msix_count_store+0x21c/0x300 (...) Allocated by task 28201: (...) ice_vsi_cfg_def+0x1c8e/0x4770 [ice] ice_vsi_cfg+0x7f/0x3b0 [ice] ice_vsi_setup+0x179/0xa30 [ice] ice_sriov_configure+0xcaa/0x1520 [ice] sriov_numvfs_store+0x212/0x390 (...) To fix it, use ice_vsi_rebuild() instead of ice_vf_reconfig_vsi(). This causes the required arrays to be reallocated taking the new queue count into account (ice_vsi_realloc_stat_arrays()). Set req_txq and req_rxq before ice_vsi_rebuild(), so that realloc uses the newly set queue count. Additionally, ice_vsi_rebuild() does not remove VSI filters (ice_fltr_remove_all()), so ice_vf_init_host_cfg() is no longer necessary.
Configurations

Configuration 1 (hide)

OR cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.12:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.12:rc2:*:*:*:*:*:*

History

22 Nov 2024, 17:21

Type Values Removed Values Added
CVSS v2 : unknown
v3 : unknown
v2 : unknown
v3 : 7.1
First Time Linux linux Kernel
Linux
CPE cpe:2.3:o:linux:linux_kernel:6.12:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.12:rc2:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
CWE CWE-125
References () https://git.kernel.org/stable/c/bce9af1b030bf59d51bbabf909a3ef164787e44e - () https://git.kernel.org/stable/c/bce9af1b030bf59d51bbabf909a3ef164787e44e - Patch
References () https://git.kernel.org/stable/c/cbda6197929418fabf0e45ecf9b7a76360944c70 - () https://git.kernel.org/stable/c/cbda6197929418fabf0e45ecf9b7a76360944c70 - Patch

23 Oct 2024, 15:12

Type Values Removed Values Added
Summary
  • (es) En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: ice: Fix increasing MSI-X on VF Aumentar el valor de MSI-X en un VF conduce a operaciones de memoria no válidas. Esto se debe a que no se reasignan algunas matrices. Reproductor: modprobe ice echo 0 > /sys/bus/pci/devices/$PF_PCI/sriov_drivers_autoprobe echo 1 > /sys/bus/pci/devices/$PF_PCI/sriov_numvfs echo 17 > /sys/bus/pci/devices/$VF0_PCI/sriov_vf_msix_count El MSI-X predeterminado es 16, por lo que 17 y superior desencadenan este problema. KASAN informa: ERROR: KASAN: slab fuera de los límites en ice_vsi_alloc_ring_stats+0x38d/0x4b0 [ice] Lectura de tamaño 8 en la dirección ffff8888b937d180 por la tarea bash/28433 (...) Seguimiento de llamadas: (...) ? ice_vsi_alloc_ring_stats+0x38d/0x4b0 [ice] kasan_report+0xed/0x120 ? ice_vsi_alloc_ring_stats+0x38d/0x4b0 [ice] ice_vsi_alloc_ring_stats+0x38d/0x4b0 [ice] ice_vsi_alloc_ring_stats+0x38d/0x4b0 [ice] ice_vsi_cfg_def+0x3360/0x4770 [ice] ? mutex_unlock+0x83/0xd0 ? __pfx_ice_vsi_cfg_def+0x10/0x10 [hielo] ? __pfx_ice_remove_vsi_lkup_fltr+0x10/0x10 [hielo] ice_vsi_cfg+0x7f/0x3b0 [hielo] ice_vf_reconfig_vsi+0x114/0x210 [hielo] ice_sriov_set_msix_vec_count+0x3d0/0x960 [hielo] sriov_vf_msix_count_store+0x21c/0x300 (...) Asignado por la tarea 28201: (...) ice_vsi_cfg_def+0x1c8e/0x4770 [hielo] ice_vsi_cfg+0x7f/0x3b0 [hielo] ice_vsi_setup+0x179/0xa30 [hielo] ice_sriov_configure+0xcaa/0x1520 [ice] sriov_numvfs_store+0x212/0x390 (...) Para solucionarlo, utilice ice_vsi_rebuild() en lugar de ice_vf_reconfig_vsi(). Esto hace que las matrices requeridas se reasignen teniendo en cuenta el nuevo recuento de colas (ice_vsi_realloc_stat_arrays()). Establezca req_txq y req_rxq antes de ice_vsi_rebuild(), de modo que realloc utilice el nuevo recuento de colas establecido. Además, ice_vsi_rebuild() no elimina los filtros VSI (ice_fltr_remove_all()), por lo que ice_vf_init_host_cfg() ya no es necesario.

21 Oct 2024, 20:15

Type Values Removed Values Added
New CVE

Information

Published : 2024-10-21 20:15

Updated : 2024-11-22 17:21


NVD link : CVE-2024-50042

Mitre link : CVE-2024-50042

CVE.ORG link : CVE-2024-50042


JSON object : View

Products Affected

linux

  • linux_kernel
CWE
CWE-125

Out-of-bounds Read