data built 2026-10-19T13:16:53Z

Look up another CVE · open CVE-2025-38582 in the interactive tracker

CVE-2025-38582

RDMA/hns: Fix double destruction of rsv_qp

7.8 EPSS 0.2% AV:L

Published 2025-08-19 (14 months ago) by the Linux kernel CNA. Subsystem drivers/infiniband. Debian urgency: not yet assigned.

What to do, per Debian release

Debian's own status for CVE-2025-38582 in every release this site tracks, and what each one means in practice. Every status below is the one the Debian Security Team publishes for this CVE. source

ReleaseStatus VersionWhat this means
Debian 12bookwormvulnerable6.1.190-1No fix published anywhere yet, neither in Debian nor upstream for the series bookworm tracks. Watch the Debian tracker page for this CVE. Advisories for bookworm have historically landed a median of 23 days after publication.
Debian 13trixiefixed6.12.43-1Update the kernel and reboot. Fixed in 6.12.43-1. A running kernel keeps the old code until the machine restarts.
Debian 14forkyfixed6.16.3-1Update the kernel and reboot. Fixed in 6.16.3-1. A running kernel keeps the old code until the machine restarts.
Debian unstablesidfixed6.16.3-1Update the kernel and reboot. Fixed in 6.16.3-1. A running kernel keeps the old code until the machine restarts.

The vulnerability

What the bug is

rsv_qp may be double destroyed in error flow, first in free_mr_init(), and then in hns_roce_exit(). Fix it by moving the free_mr_init() call into hns_roce_v2_init(). list_del corruption, ffff589732eb9b50->next is LIST_POISON1 (dead000000000100) WARNING: CPU: 8 PID: 1047115 at lib/list_debug.c:53 __list_del_entry_valid+0x148/0x240 ... Call trace: __list_del_entry_valid+0x148/0x240 hns_roce_qp_remove+0x4c/0x3f0 [hns_roce_hw_v2] hns_roce_v2_destroy_qp_common+0x1dc/0x5f4 [hns_roce_hw_v2] hns_roce_v2_destroy_qp+0x22c/0x46c [hns_roce_hw_v2] free_mr_exit+0x6c/0x120 [hns_roce_hw_v2] hns_roce_v2_exit+0x170/0x200 [hns_roce_hw_v2] hns_roce_exit+0x118/0x350 [hns_roce_hw_v2] __hns_roce_hw_v2_init_instance+0x1c8/0x304 [hns_roce_hw_v2] hns_roce_hw_v2_reset_notify_init+0x170/0x21c [hns_roce_hw_v2] hns_roce_hw_v2_reset_notify+0x6c/0x190 [hns_roce_hw_v2] hclge_notify_roce_client+0x6c/0x160 [hclge] hclge_reset_rebuild+0x150/0x5c0 [hclge] hclge_reset+0x10c/0x140 [hclge] hclge_reset_subtask+0x80/0x104 [hclge] hclge_reset_service_task+0x168/0x3ac [hclge] hclge_service_task+0x50/0x100 [hclge] process_one_work+0x250/0x9a0 worker_thread+0x324/0x990 kthread+0x190/0x210 ret_from_fork+0x10/0x18

Where it lives

The fix touches these files. If the subsystem is one you do not use, the practical exposure is lower, though the package is still the vulnerable one.

drivers/infiniband/hw/hns/hns_roce_hw_v2.c
drivers/infiniband/hw/hns/hns_roce_main.c

What this is
HISILICON ROCE DRIVERMAINTAINERS section matched on drivers/infiniband/hw/hns/ · linux-rdma@vger.kernel.org · Maintained
Kernel module
hns_roce_hw_v2

Check it on the machine

grep -wE 'CONFIG_INFINIBAND|CONFIG_INFINIBAND_HNS|CONFIG_INFINIBAND_HNS_HIP08' /boot/config-$(uname -r)

Reads the booted kernel's own configuration, on the machine and nowhere else. =y is built in, =m is a module, and an is not set line means the code is not there.

lsmod | grep -w hns_roce_hw_v2

Prints a line if that module is loaded right now, and nothing if it is not. One that is not loaded can still be loaded later by anything that needs it.

Show whether Debian builds this, per release

Debian builds this, but not on every flavour. At least one release below builds the code on some of its kernel flavours and not on others, so the answer depends on the architecture and flavour installed.

  • bookwormMnot built on amd64/amd64, amd64/cloud-amd64, amd64/rt/amd64, armhf/armmp, armhf/armmp-lpae, armhf/rt/armmp, i386/686, i386/686-pae, i386/rt/686-pae, ppc64el/powerpc64le
  • trixieMnot built on amd64/amd64, amd64/cloud-amd64, amd64/rt/amd64, armel/rpi, armhf/armmp, armhf/armmp-lpae, armhf/rt/armmp, ppc64el/powerpc64le, ppc64el/powerpc64le-64k, riscv64/riscv64, s390x/s390x
  • forky, sidMnot built on amd64/amd64, amd64/cloud-amd64, amd64/rt-amd64, armhf/armmp, armhf/armmp-lpae, loong64/loong64, ppc64el/powerpc64le, ppc64el/powerpc64le-64k, riscv64/riscv64, s390x/s390x
M
a module where it is built at all; some flavours do not build it
Build switches
CONFIG_INFINIBAND, CONFIG_INFINIBAND_HNS, CONFIG_INFINIBAND_HNS_HIP08
Reads as
all on means the file is compiled; any one off means it is not.

From the configuration Debian publishes for every kernel flavour it builds. It covers only the architectures Debian ships a linux-config package for, and nothing about a kernel you built yourself. Debian's own status above stays authoritative about the source package.MAINTAINERS kbuild Makefiles Debian linux-config packages

Signals

Published
2025-08-19 (14 months ago)source
CVSS
7.8 high
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:Hsource recompute it
Attack vector
local (AV:L)source
EPSS
0.17%, higher than 5.9% of all CVEssource
CISA KEV
not listedthe KEV catalogue
Debian urgency
not yet assignedsource
Subsystem
drivers/infiniband

Upstream fixes

The versions the CNA records as introducing and fixing this, and the commit for each. source

IntroducedFixed inCommit
6.126.12.42dab173bae330
6.126.15.10fc8b0f5b16ba
6.126.16.110b083dbba22
6.126.17c6957b95ecc5
6.1.11300
6.6.5400
6.10.1300
6.11.200

Why the CNA scored it this way

Quoted from the kernel CNA's own scoring file, word for word. A highlighted metric carries the most severe value CVSS v3.1 defines for it, which is what pushes the score up. source

AV:LAttack vector, local
The defect lives in the hns_roce HIP08 device init/re-init path (`__hns_roce_hw_v2_init_instance()` → `free_mr_init()`), reached via driver probe, module load, or the hns3 NIC reset-recovery notifier — never from remote packet data. Reaching or influencing it requires local access to the machine (RDMA uverbs devices, memory/resource pressure, or a locally initiated reset).
AC:LAttack complexity, low
The double destruction fires whenever `free_mr_alloc_res()` fails partway through creating the 8 reserved QPs, since the `create_failed_qp` unwind kfree()s `free_mr->rsv_qp[i]` without NULLing the array slot, leaving dangling pointers that `hns_roce_v2_exit()` → `free_mr_exit()` destroys and frees a second time. A local attacker can influence exactly that partial-failure window by driving slab/QP/CQ/PD resource exhaustion so one of the eight allocations fails after earlier ones succeeded, and the init/reset sequence is repeatable, so the required conditions are not beyond the attacker's control.
PR:LPrivileges required, low
No authentication beyond ordinary local access is needed to create the precondition — an unprivileged user holding the usual `/dev/infiniband/uverbs*` access in an RDMA deployment can exhaust QP/CQ/PD and memory resources to make the reserved-resource allocation fail mid-loop. The init/reset trigger itself is not gated by any capability check inside the vulnerable code path.
UI:NUser interaction, none
The faulty unwind executes automatically inside the driver's own error path during device initialization or NIC reset recovery. No victim has to open a file, mount anything, or take any other action.
S:UScope, unchanged
The corrupted objects (`struct hns_roce_qp`, its lists and the kernel slab) all belong to the kernel's own security authority. There is no crossing into a hypervisor, IOMMU, or other separate security scope.
C:HConfidentiality impact, high
The second `hns_roce_v2_destroy_qp()` operates entirely on freed memory — it reads `hr_qp->ibqp.send_cq`/`recv_cq` and passes them to `to_hr_cq()`/`__hns_roce_v2_cq_clean()`, and uses `hr_qp->qpn` for `__xa_erase()`. If the reclaimed slab object is groomed by the attacker, those become fully controlled pointers, yielding an arbitrary kernel-memory read primitive.
I:HIntegrity impact, high
`hns_roce_qp_remove()` performs three `list_del()` unlinks on the freed object, each writing `prev->next = next; next->prev = prev` with pointers taken from reclaimed slab memory — a classic controlled-write primitive — and the object is then kfree()d a second time, corrupting the freelist. That combination is exploitable for control-flow hijack and privilege escalation.
A:HAvailability impact, high
The reported failure is an immediate `list_del corruption ... LIST_POISON1` WARNING in `__list_del_entry_valid()` from `hns_roce_qp_remove()`, and the double kfree() corrupts the slab allocator. This reliably produces an oops/panic and leaves the RDMA device unusable.