CVE-2023-52851·Kernel vulnerability
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) ...
- Severity
- high
- Software
- Kernel
- Fixed in
- 6.6.2
- Published
How likely is exploitation
FIRST's Exploit Prediction Scoring System puts the probability of this CVE being exploited in the next 30 days at <0.1% — higher than 6% of all published CVEs. EPSS is an independent forecast of exploitation, not a severity rating: it says nothing about how much damage a successful attack does, which is what a CVSS score measures.
Read the two together. CVE-2023-52851 scores 7.8 on CVSS, so a successful attack would be serious — but at <0.1%, almost nobody is currently attempting it. That is a different situation from a flaw under mass exploitation, and it is usually the difference between patching on your next maintenance window and patching tonight.
Affected versions
From: 6.6
Until: 6.6.2
Fixed in: 6.6.2
How to fix this CVE
Update the Linux kernel to version 6.6.2 or later to fix a double-free vulnerability in the MLX5 InfiniBand driver's QP (Queue Pair) initialization. This flaw occurs when workqueue allocation fails during mkey cache initialization, causing the kernel to attempt freeing the same QP twice during error handling. Affected systems running kernel versions 6.6 through 6.6.1 should prioritize this update immediately.
sudo dnf update kernel kernel-develDefensia detects this vulnerability
How to check if you are affected
- Step 1: Check your kernel version with `uname -r` and compare against 6.6.2 — vulnerable versions are 6.6, 6.6.1
- Step 2: Verify MLX5 InfiniBand driver is loaded by running `lsmod | grep mlx5` — if present, your system uses the affected code path
- Step 3: Search system logs for mkey_cache initialization failures with `grep -i 'mlx5_mkey_cache_init\|failed to create work queue' /var/log/kern.log /var/log/syslog` — these indicate exposure to the bug trigger
- Step 4: After patching, confirm the new kernel version with `uname -r` to ensure 6.6.2 or higher is running
FAQ
What is CVE-2023-52851?
CVE-2023-52851 is a use-after-free vulnerability in the Linux kernel's MLX5 InfiniBand driver where a failed workqueue allocation during initialization causes the kernel to free the same Queue Pair twice, corrupting memory and triggering a kernel crash.
Is CVE-2023-52851 being actively exploited?
No, CVE-2023-52851 is not listed as actively exploited by CISA and has no known public exploits. It is primarily a stability issue triggered by resource exhaustion.
What versions of Kernel are affected by CVE-2023-52851?
Linux kernel versions 6.6, 6.6.1, and 6.6.2 (before the fix). All systems running 6.6.0 through 6.6.1 are vulnerable; the fix is included starting with 6.6.2.
How do I check if my server is vulnerable to CVE-2023-52851?
Run `uname -r` to see your kernel version. If it shows 6.6.0 or 6.6.1 and `lsmod | grep mlx5` shows the driver is loaded, your system is vulnerable. Run a full system update to patch.
Does Defensia detect CVE-2023-52851?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If the Linux kernel is installed on a monitored server, CVE-2023-52851 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/2ef422f063b74adcc4a4a9004b0a87bb55e0a836
- https://git.kernel.org/stable/c/437f033e30c897bb3723eac9e9003cd9f88d00a3
- https://git.kernel.org/stable/c/4f4a7a7d1404297f2a92df0046f7e64dc5c52dd9
- https://git.kernel.org/stable/c/6387f269d84e6e149499408c4d1fc805017729b2
- https://git.kernel.org/stable/c/2ef422f063b74adcc4a4a9004b0a87bb55e0a836
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2023-52851. Free for 1 server.
Get started free