CVE-2023-52851

In the Linux kernel, the following vulnerability has been resolved: IB/mlx5: Fix init stage error handling to avoid double free of same QP and UAF In the unlikely event that workqueue allocation fails and returns NULL in mlx5_mkey_cache_init(), delete the call to mlx5r_umr_resource_cleanup() (which frees the QP) in mlx5_ib_stage_post_ib_reg_umr_init(). This will avoid attempted double free of the same QP when __mlx5_ib_add() does its cleanup. Resolves a splat: Syzkaller reported a UAF in ib_destroy_qp_user workqueue: Failed to create a rescuer kthread for wq "mkey_cache": -EINTR infiniband mlx5_0: mlx5_mkey_cache_init:981:(pid 1642): failed to create work queue infiniband mlx5_0: mlx5_ib_stage_post_ib_reg_umr_init:4075:(pid 1642): mr cache init failed -12 ================================================================== BUG: KASAN: slab-use-after-free in ib_destroy_qp_user (drivers/infiniband/core/verbs.c:2073) Read of size 8 at addr ffff88810da310a8 by task repro_upstream/1642 Call Trace: <TASK> kasan_report (mm/kasan/report.c:590) ib_destroy_qp_user (drivers/infiniband/core/verbs.c:2073) mlx5r_umr_resource_cleanup (drivers/infiniband/hw/mlx5/umr.c:198) __mlx5_ib_add (drivers/infiniband/hw/mlx5/main.c:4178) mlx5r_probe (drivers/infiniband/hw/mlx5/main.c:4402) ... </TASK> Allocated by task 1642: __kmalloc (./include/linux/kasan.h:198 mm/slab_common.c:1026 mm/slab_common.c:1039) create_qp (./include/linux/slab.h:603 ./include/linux/slab.h:720 ./include/rdma/ib_verbs.h:2795 drivers/infiniband/core/verbs.c:1209) ib_create_qp_kernel (drivers/infiniband/core/verbs.c:1347) mlx5r_umr_resource_init (drivers/infiniband/hw/mlx5/umr.c:164) mlx5_ib_stage_post_ib_reg_umr_init (drivers/infiniband/hw/mlx5/main.c:4070) __mlx5_ib_add (drivers/infiniband/hw/mlx5/main.c:4168) mlx5r_probe (drivers/infiniband/hw/mlx5/main.c:4402) ... Freed by task 1642: __kmem_cache_free (mm/slub.c:1826 mm/slub.c:3809 mm/slub.c:3822) ib_destroy_qp_user (drivers/infiniband/core/verbs.c:2112) mlx5r_umr_resource_cleanup (drivers/infiniband/hw/mlx5/umr.c:198) mlx5_ib_stage_post_ib_reg_umr_init (drivers/infiniband/hw/mlx5/main.c:4076 drivers/infiniband/hw/mlx5/main.c:4065) __mlx5_ib_add (drivers/infiniband/hw/mlx5/main.c:4168) mlx5r_probe (drivers/infiniband/hw/mlx5/main.c:4402) ...
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:*:*:*:*:*:*:*:*

History

10 Jan 2025, 17:43

Type Values Removed Values Added
References () https://git.kernel.org/stable/c/2ef422f063b74adcc4a4a9004b0a87bb55e0a836 - () https://git.kernel.org/stable/c/2ef422f063b74adcc4a4a9004b0a87bb55e0a836 - Patch
References () https://git.kernel.org/stable/c/437f033e30c897bb3723eac9e9003cd9f88d00a3 - () https://git.kernel.org/stable/c/437f033e30c897bb3723eac9e9003cd9f88d00a3 - Patch
References () https://git.kernel.org/stable/c/4f4a7a7d1404297f2a92df0046f7e64dc5c52dd9 - () https://git.kernel.org/stable/c/4f4a7a7d1404297f2a92df0046f7e64dc5c52dd9 - Patch
References () https://git.kernel.org/stable/c/6387f269d84e6e149499408c4d1fc805017729b2 - () https://git.kernel.org/stable/c/6387f269d84e6e149499408c4d1fc805017729b2 - Patch
First Time Linux
Linux linux Kernel
CWE CWE-416
CWE-415
CVSS v2 : unknown
v3 : unknown
v2 : unknown
v3 : 7.8
CPE cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*

21 Nov 2024, 08:40

Type Values Removed Values Added
References () https://git.kernel.org/stable/c/2ef422f063b74adcc4a4a9004b0a87bb55e0a836 - () https://git.kernel.org/stable/c/2ef422f063b74adcc4a4a9004b0a87bb55e0a836 -
References () https://git.kernel.org/stable/c/437f033e30c897bb3723eac9e9003cd9f88d00a3 - () https://git.kernel.org/stable/c/437f033e30c897bb3723eac9e9003cd9f88d00a3 -
References () https://git.kernel.org/stable/c/4f4a7a7d1404297f2a92df0046f7e64dc5c52dd9 - () https://git.kernel.org/stable/c/4f4a7a7d1404297f2a92df0046f7e64dc5c52dd9 -
References () https://git.kernel.org/stable/c/6387f269d84e6e149499408c4d1fc805017729b2 - () https://git.kernel.org/stable/c/6387f269d84e6e149499408c4d1fc805017729b2 -
Summary
  • (es) En el kernel de Linux, se resolvió la siguiente vulnerabilidad: IB/mlx5: corrige el manejo de errores de la etapa inicial para evitar la doble liberación del mismo QP y UAF. En el improbable caso de que la asignación de la cola de trabajo falle y devuelva NULL en mlx5_mkey_cache_init(), elimine la llamada a mlx5r_umr_resource_cleanup() (que libera el QP) en mlx5_ib_stage_post_ib_reg_umr_init(). Esto evitará intentos de double free del mismo QP cuando __mlx5_ib_add() realice su limpieza. Resuelve un problema: Syzkaller informó un UAF en ib_destroy_qp_user workqueue: No se pudo crear un kthread de rescate para wq "mkey_cache": -EINTR infiniband mlx5_0: mlx5_mkey_cache_init:981:(pid 1642): no se pudo crear la cola de trabajo infiniband mlx5_0: mlx5_ib_stage_post_ib_reg_umr_ inicio: 4075: (pid 1642): el inicio de caché de mr falló -12 ========================================= =========================== BUG: KASAN: uso de losa después de la liberación en ib_destroy_qp_user (drivers/infiniband/core/verbs.c :2073) Lectura de tamaño 8 en la dirección ffff88810da310a8 mediante la tarea repro_upstream/1642 Rastreo de llamadas: kasan_report (mm/kasan/report.c:590) ib_destroy_qp_user (drivers/infiniband/core/verbs.c:2073) mlx5r_umr_resource_cleanup (drivers /infiniband/hw/mlx5/umr.c:198) __mlx5_ib_add (drivers/infiniband/hw/mlx5/main.c:4178) mlx5r_probe (drivers/infiniband/hw/mlx5/main.c:4402) ... Asignado por la tarea 1642: __kmalloc (./include/linux/kasan.h:198 mm/slab_common.c:1026 mm/slab_common.c:1039) create_qp (./include/linux/slab.h:603 ./ include/linux/slab.h:720 ./include/rdma/ib_verbs.h:2795 drivers/infiniband/core/verbs.c:1209) ib_create_qp_kernel (drivers/infiniband/core/verbs.c:1347) mlx5r_umr_resource_init (drivers/ infiniband/hw/mlx5/umr.c:164) mlx5_ib_stage_post_ib_reg_umr_init (drivers/infiniband/hw/mlx5/main.c:4070) __mlx5_ib_add (drivers/infiniband/hw/mlx5/main.c:4168) mlx5r_probe (drivers/infiniband/ hw/mlx5/main.c:4402) ... Liberado por la tarea 1642: __kmem_cache_free (mm/slub.c:1826 mm/slub.c:3809 mm/slub.c:3822) ib_destroy_qp_user (drivers/infiniband/core/ verbs.c:2112) mlx5r_umr_resource_cleanup (drivers/infiniband/hw/mlx5/umr.c:198) mlx5_ib_stage_post_ib_reg_umr_init (drivers/infiniband/hw/mlx5/main.c:4076 drivers/infiniband/hw/mlx5/main.c:4065 ) __mlx5_ib_add (controladores/infiniband/hw/mlx5/main.c:4168) mlx5r_probe (controladores/infiniband/hw/mlx5/main.c:4402) ...

21 May 2024, 16:15

Type Values Removed Values Added
New CVE

Information

Published : 2024-05-21 16:15

Updated : 2025-01-10 17:43


NVD link : CVE-2023-52851

Mitre link : CVE-2023-52851

CVE.ORG link : CVE-2023-52851


JSON object : View

Products Affected

linux

  • linux_kernel
CWE
CWE-415

Double Free

CWE-416

Use After Free