# CVE-2024-47687: vdpa/mlx5: Fix invalid mr resource destroy

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

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; 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.30% (percentile 15, 2026-11-28)
- **CWE:** CWE-908
- **Published:** 2024-10-21T11:53:27.834Z
- **Modified:** 2026-06-17T07:57:32.503Z

## Who should check

- Anyone running Linux \>= 512c0cdd80c19ec11f6dbe769d5899dcfefcd5c9, \< b6fbb1c7801f46a0e5461c02904eab0d7535c790; \>= 512c0cdd80c19ec11f6dbe769d5899dcfefcd5c9, \< 5fe351def237df1ad29aa8af574350bc5340b4cf; \>= 512c0cdd80c19ec11f6dbe769d5899dcfefcd5c9, \< dc12502905b7a3de9097ea6b98870470c2921e09
- Anyone running Linux 6.7

## Description

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

vdpa/mlx5: Fix invalid mr resource destroy

Certain error paths from mlx5\_vdpa\_dev\_add() can end up releasing mr
resources which never got initialized in the first place.

This patch adds the missing check in mlx5\_vdpa\_destroy\_mr\_resources()
to block releasing non-initialized mr resources.

Reference trace:

  mlx5\_core 0000:08:00.2: mlx5\_vdpa\_dev\_add:3274:(pid 2700) warning: No mac address provisioned?
  BUG: kernel NULL pointer dereference, address: 0000000000000000
  \#PF: supervisor read access in kernel mode
  \#PF: error\_code(0x0000) - not-present page
  PGD 140216067 P4D 0
  Oops: 0000 \[\#1\] PREEMPT SMP NOPTI
  CPU: 8 PID: 2700 Comm: vdpa Kdump: loaded Not tainted 5.14.0-496.el9.x86\_64 \#1
  Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
  RIP: 0010:vhost\_iotlb\_del\_range+0xf/0xe0 \[vhost\_iotlb\]
  Code: \[...\]
  RSP: 0018:ff1c823ac23077f0 EFLAGS: 00010246
  RAX: ffffffffc1a21a60 RBX: ffffffff899567a0 RCX: 0000000000000000
  RDX: ffffffffffffffff RSI: 0000000000000000 RDI: 0000000000000000
  RBP: ff1bda1f7c21e800 R08: 0000000000000000 R09: ff1c823ac2307670
  R10: ff1c823ac2307668 R11: ffffffff8a9e7b68 R12: 0000000000000000
  R13: 0000000000000000 R14: ff1bda1f43e341a0 R15: 00000000ffffffea
  FS:  00007f56eba7c740(0000) GS:ff1bda269f800000(0000) knlGS:0000000000000000
  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
  CR2: 0000000000000000 CR3: 0000000104d90001 CR4: 0000000000771ef0
  DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
  DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
  PKRU: 55555554
  Call Trace:

   ? show\_trace\_log\_lvl+0x1c4/0x2df
   ? show\_trace\_log\_lvl+0x1c4/0x2df
   ? mlx5\_vdpa\_free+0x3d/0x150 \[mlx5\_vdpa\]
   ? \_\_die\_body.cold+0x8/0xd
   ? page\_fault\_oops+0x134/0x170
   ? \_\_irq\_work\_queue\_local+0x2b/0xc0
   ? irq\_work\_queue+0x2c/0x50
   ? exc\_page\_fault+0x62/0x150
   ? asm\_exc\_page\_fault+0x22/0x30
   ? \_\_pfx\_mlx5\_vdpa\_free+0x10/0x10 \[mlx5\_vdpa\]
   ? vhost\_iotlb\_del\_range+0xf/0xe0 \[vhost\_iotlb\]
   mlx5\_vdpa\_free+0x3d/0x150 \[mlx5\_vdpa\]
   vdpa\_release\_dev+0x1e/0x50 \[vdpa\]
   device\_release+0x31/0x90
   kobject\_cleanup+0x37/0x130
   mlx5\_vdpa\_dev\_add+0x2d2/0x7a0 \[mlx5\_vdpa\]
   vdpa\_nl\_cmd\_dev\_add\_set\_doit+0x277/0x4c0 \[vdpa\]
   genl\_family\_rcv\_msg\_doit+0xd9/0x130
   genl\_family\_rcv\_msg+0x14d/0x220
   ? \_\_pfx\_vdpa\_nl\_cmd\_dev\_add\_set\_doit+0x10/0x10 \[vdpa\]
   ? \_copy\_to\_user+0x1a/0x30
   ? move\_addr\_to\_user+0x4b/0xe0
   genl\_rcv\_msg+0x47/0xa0
   ? \_\_import\_iovec+0x46/0x150
   ? \_\_pfx\_genl\_rcv\_msg+0x10/0x10
   netlink\_rcv\_skb+0x54/0x100
   genl\_rcv+0x24/0x40
   netlink\_unicast+0x245/0x370
   netlink\_sendmsg+0x206/0x440
   \_\_sys\_sendto+0x1dc/0x1f0
   ? do\_read\_fault+0x10c/0x1d0
   ? do\_pte\_missing+0x10d/0x190
   \_\_x64\_sys\_sendto+0x20/0x30
   do\_syscall\_64+0x5c/0xf0
   ? \_\_count\_memcg\_events+0x4f/0xb0
   ? mm\_account\_fault+0x6c/0x100
   ? handle\_mm\_fault+0x116/0x270
   ? do\_user\_addr\_fault+0x1d6/0x6a0
   ? do\_syscall\_64+0x6b/0xf0
   ? clear\_bhb\_loop+0x25/0x80
   ? clear\_bhb\_loop+0x25/0x80
   ? clear\_bhb\_loop+0x25/0x80
   ? clear\_bhb\_loop+0x25/0x80
   ? clear\_bhb\_loop+0x25/0x80
   entry\_SYSCALL\_64\_after\_hwframe+0x78/0x80

## Affected and fixed versions

- Linux: \>= 512c0cdd80c19ec11f6dbe769d5899dcfefcd5c9, \< b6fbb1c7801f46a0e5461c02904eab0d7535c790; \>= 512c0cdd80c19ec11f6dbe769d5899dcfefcd5c9, \< 5fe351def237df1ad29aa8af574350bc5340b4cf; \>= 512c0cdd80c19ec11f6dbe769d5899dcfefcd5c9, \< dc12502905b7a3de9097ea6b98870470c2921e09 (cvelist)
- Linux: 6.7 (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-2024-47687. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-47687.md
Affected: Linux >= 512c0cdd80c19ec11f6dbe769d5899dcfefcd5c9, < b6fbb1c7801f46a0e5461c02904eab0d7535c790; >= 512c0cdd80c19ec11f6dbe769d5899dcfefcd5c9, < 5fe351def237df1ad29aa8af574350bc5340b4cf; >= 512c0cdd80c19ec11f6dbe769d5899dcfefcd5c9, < dc12502905b7a3de9097ea6b98870470c2921e09; Linux 6.7
Fixed in: Linux 5fe351def237df1ad29aa8af574350bc5340b4cf

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-2024-47687 being exploited?

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

### How serious is CVE-2024-47687?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2024-47687?

Linux \>= 512c0cdd80c19ec11f6dbe769d5899dcfefcd5c9, \< b6fbb1c7801f46a0e5461c02904eab0d7535c790; \>= 512c0cdd80c19ec11f6dbe769d5899dcfefcd5c9, \< 5fe351def237df1ad29aa8af574350bc5340b4cf; \>= 512c0cdd80c19ec11f6dbe769d5899dcfefcd5c9, \< dc12502905b7a3de9097ea6b98870470c2921e09; Linux 6.7.

### Is there a fix for CVE-2024-47687?

Yes. Fixed in Linux 5fe351def237df1ad29aa8af574350bc5340b4cf. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2024-47687?

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/b6fbb1c7801f46a0e5461c02904eab0d7535c790>
- patch: <https://git.kernel.org/stable/c/5fe351def237df1ad29aa8af574350bc5340b4cf>
- patch: <https://git.kernel.org/stable/c/dc12502905b7a3de9097ea6b98870470c2921e09>

## 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-2024-47687>

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