# CVE-2025-22089: RDMA/core: Don't expose hw\_counters outside of init net namespace

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.31% (percentile 16, 2026-11-26)
- **CWE:** CWE-476
- **Published:** 2025-04-16T14:12:41.732Z
- **Modified:** 2026-08-05T11:56:43.154Z

## Who should check

- Anyone running Linux \>= 467f432a521a284c418e3d521ee51840a5e23424, \< 9a5b7f8842a90a5e6eeff37f9f6d814e61ea3529; \>= 467f432a521a284c418e3d521ee51840a5e23424, \< d5212b99649c5740154f307e9e3d7fee9bf62773; \>= 467f432a521a284c418e3d521ee51840a5e23424, \< 0cf80f924aecb5b2bebd4f4ad11b2efc676a0b78; \>= 467f432a521a284c418e3d521ee51840a5e23424, \< df45ae2a4f1cdfda00c032839e12092e1f32c05e; \>= 467f432a521a284c418e3d521ee51840a5e23424, \< c14d9704f5d77a7c7fa46e2114b64a4f75b64e17; \>= 467f432a521a284c418e3d521ee51840a5e23424, \< 6682da5d8fd578a5068531d01633c9d2e4c8f12b; \>= 467f432a521a284c418e3d521ee51840a5e23424, \< a1ecb30f90856b0be4168ad51b8875148e285c1f
- Anyone running Linux 5.14

## Description

In the Linux kernel, the following vulnerability has been resolved:

RDMA/core: Don't expose hw\_counters outside of init net namespace

Commit 467f432a521a ("RDMA/core: Split port and device counter sysfs
attributes") accidentally almost exposed hw counters to non-init net
namespaces. It didn't expose them fully, as an attempt to read any of
those counters leads to a crash like this one:

\[42021.807566\] BUG: kernel NULL pointer dereference, address: 0000000000000028
\[42021.814463\] \#PF: supervisor read access in kernel mode
\[42021.819549\] \#PF: error\_code(0x0000) - not-present page
\[42021.824636\] PGD 0 P4D 0
\[42021.827145\] Oops: 0000 \[\#1\] SMP PTI
\[42021.830598\] CPU: 82 PID: 2843922 Comm: switchto-defaul Kdump: loaded Tainted: G S      W I        XXX
\[42021.841697\] Hardware name: XXX
\[42021.849619\] RIP: 0010:hw\_stat\_device\_show+0x1e/0x40 \[ib\_core\]
\[42021.855362\] Code: 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa 0f 1f 44 00 00 49 89 d0 4c 8b 5e 20 48 8b 8f b8 04 00 00 48 81 c7 f0 fa ff ff \<48\> 8b 41 28 48 29 ce 48 83 c6 d0 48 c1 ee 04 69 d6 ab aa aa aa 48
\[42021.873931\] RSP: 0018:ffff97fe90f03da0 EFLAGS: 00010287
\[42021.879108\] RAX: ffff9406988a8c60 RBX: ffff940e1072d438 RCX: 0000000000000000
\[42021.886169\] RDX: ffff94085f1aa000 RSI: ffff93c6cbbdbcb0 RDI: ffff940c7517aef0
\[42021.893230\] RBP: ffff97fe90f03e70 R08: ffff94085f1aa000 R09: 0000000000000000
\[42021.900294\] R10: ffff94085f1aa000 R11: ffffffffc0775680 R12: ffffffff87ca2530
\[42021.907355\] R13: ffff940651602840 R14: ffff93c6cbbdbcb0 R15: ffff94085f1aa000
\[42021.914418\] FS:  00007fda1a3b9700(0000) GS:ffff94453fb80000(0000) knlGS:0000000000000000
\[42021.922423\] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
\[42021.928130\] CR2: 0000000000000028 CR3: 00000042dcfb8003 CR4: 00000000003726f0
\[42021.935194\] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
\[42021.942257\] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
\[42021.949324\] Call Trace:
\[42021.951756\]  \<TASK\>
\[42021.953842\]  \[\<ffffffff86c58674\>\] ? show\_regs+0x64/0x70
\[42021.959030\]  \[\<ffffffff86c58468\>\] ? \_\_die+0x78/0xc0
\[42021.963874\]  \[\<ffffffff86c9ef75\>\] ? page\_fault\_oops+0x2b5/0x3b0
\[42021.969749\]  \[\<ffffffff87674b92\>\] ? exc\_page\_fault+0x1a2/0x3c0
\[42021.975549\]  \[\<ffffffff87801326\>\] ? asm\_exc\_page\_fault+0x26/0x30
\[42021.981517\]  \[\<ffffffffc0775680\>\] ? \_\_pfx\_show\_hw\_stats+0x10/0x10 \[ib\_core\]
\[42021.988482\]  \[\<ffffffffc077564e\>\] ? hw\_stat\_device\_show+0x1e/0x40 \[ib\_core\]
\[42021.995438\]  \[\<ffffffff86ac7f8e\>\] dev\_attr\_show+0x1e/0x50
\[42022.000803\]  \[\<ffffffff86a3eeb1\>\] sysfs\_kf\_seq\_show+0x81/0xe0
\[42022.006508\]  \[\<ffffffff86a11134\>\] seq\_read\_iter+0xf4/0x410
\[42022.011954\]  \[\<ffffffff869f4b2e\>\] vfs\_read+0x16e/0x2f0
\[42022.017058\]  \[\<ffffffff869f50ee\>\] ksys\_read+0x6e/0xe0
\[42022.022073\]  \[\<ffffffff8766f1ca\>\] do\_syscall\_64+0x6a/0xa0
\[42022.027441\]  \[\<ffffffff8780013b\>\] entry\_SYSCALL\_64\_after\_hwframe+0x78/0xe2

The problem can be reproduced using the following steps:
  ip netns add foo
  ip netns exec foo bash
  cat /sys/class/infiniband/mlx4\_0/hw\_counters/\*

The panic occurs because of casting the device pointer into an
ib\_device pointer using container\_of() in hw\_stat\_device\_show() is
wrong and leads to a memory corruption.

However the real problem is that hw counters should never been exposed
outside of the non-init net namespace.

Fix this by saving the index of the corresponding attribute group
(it might be 1 or 2 depending on the presence of driver-specific
attributes) and zeroing the pointer to hw\_counters group for compat
devices during the initialization.

With this fix applied hw\_counters are not available in a non-init
net namespace:
  find /sys/class/infiniband/mlx4\_0/ -name hw\_counters
    /sys/class/infiniband/mlx4\_0/ports/1/hw\_counters
    /sys/class/infiniband/mlx4\_0/ports/2/hw\_counters
    /sys/class/infiniband/mlx4\_0/hw\_counters

  ip netns add foo
  ip netns exec foo bash
  find /sys/class/infiniband/mlx4\_0/ -name hw\_counters

## Affected and fixed versions

- Linux: \>= 467f432a521a284c418e3d521ee51840a5e23424, \< 9a5b7f8842a90a5e6eeff37f9f6d814e61ea3529; \>= 467f432a521a284c418e3d521ee51840a5e23424, \< d5212b99649c5740154f307e9e3d7fee9bf62773; \>= 467f432a521a284c418e3d521ee51840a5e23424, \< 0cf80f924aecb5b2bebd4f4ad11b2efc676a0b78; \>= 467f432a521a284c418e3d521ee51840a5e23424, \< df45ae2a4f1cdfda00c032839e12092e1f32c05e; \>= 467f432a521a284c418e3d521ee51840a5e23424, \< c14d9704f5d77a7c7fa46e2114b64a4f75b64e17; \>= 467f432a521a284c418e3d521ee51840a5e23424, \< 6682da5d8fd578a5068531d01633c9d2e4c8f12b; \>= 467f432a521a284c418e3d521ee51840a5e23424, \< a1ecb30f90856b0be4168ad51b8875148e285c1f (cvelist)
- Linux: 5.14 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-22089. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-22089.md
Affected: Linux >= 467f432a521a284c418e3d521ee51840a5e23424, < 9a5b7f8842a90a5e6eeff37f9f6d814e61ea3529; >= 467f432a521a284c418e3d521ee51840a5e23424, < d5212b99649c5740154f307e9e3d7fee9bf62773; >= 467f432a521a284c418e3d521ee51840a5e23424, < 0cf80f924aecb5b2bebd4f4ad11b2efc676a0b78; >= 467f432a521a284c418e3d5…
Fixed in: Linux 9a5b7f8842a90a5e6eeff37f9f6d814e61ea3529, Linux 0cf80f924aecb5b2bebd4f4ad11b2efc676a0b78, Linux 6682da5d8fd578a5068531d01633c9d2e4c8f12b

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-22089 being exploited?

There is no confirmed exploitation: CVE-2025-22089 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.31% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2025-22089?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2025-22089?

Linux \>= 467f432a521a284c418e3d521ee51840a5e23424, \< 9a5b7f8842a90a5e6eeff37f9f6d814e61ea3529; \>= 467f432a521a284c418e3d521ee51840a5e23424, \< d5212b99649c5740154f307e9e3d7fee9bf62773; \>= 467f432a521a284c418e3d521ee51840a5e23424, \< 0cf80f924aecb5b2bebd4f4ad11b2efc676a0b78; \>= 467f432a521a284c418e3d521ee51840a5e23424, \< df45ae2a4f1cdfda00c032839e12092e1f32c05e; \>= 467f432a521a284c418e3d521ee51840a5e23424, \< c14d9704f5d77a7c7fa46e2114b64a4f75b64e17; \>= 467f432a521a284c418e3d521ee51840a5e23424, \< 6682da5d8fd578a5068531d01633c9d2e4c8f12b; \>= 467f432a521a284c418e3d521ee51840a5e23424, \< a1ecb30f90856b0be4168ad51b8875148e285c1f; Linux 5.14.

### Is there a fix for CVE-2025-22089?

Yes. Fixed in Linux 9a5b7f8842a90a5e6eeff37f9f6d814e61ea3529, Linux 0cf80f924aecb5b2bebd4f4ad11b2efc676a0b78, Linux 6682da5d8fd578a5068531d01633c9d2e4c8f12b. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2025-22089?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/9a5b7f8842a90a5e6eeff37f9f6d814e61ea3529>
- patch: <https://git.kernel.org/stable/c/d5212b99649c5740154f307e9e3d7fee9bf62773>
- patch: <https://git.kernel.org/stable/c/0cf80f924aecb5b2bebd4f4ad11b2efc676a0b78>
- patch: <https://git.kernel.org/stable/c/df45ae2a4f1cdfda00c032839e12092e1f32c05e>
- patch: <https://git.kernel.org/stable/c/c14d9704f5d77a7c7fa46e2114b64a4f75b64e17>
- patch: <https://git.kernel.org/stable/c/6682da5d8fd578a5068531d01633c9d2e4c8f12b>
- patch: <https://git.kernel.org/stable/c/a1ecb30f90856b0be4168ad51b8875148e285c1f>
- other: <https://lists.debian.org/debian-lts-announce/2025/05/msg00045.html>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-22089>

HTML: <https://flawdb.com/CVE-2025-22089> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-22089>
