# CVE-2023-52570: vfio/mdev: Fix a null-ptr-deref bug for mdev\_unregister\_parent()

> 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 16, 2026-11-26)
- **CWE:** CWE-476
- **Published:** 2024-03-02T21:59:40.724Z
- **Modified:** 2026-06-17T06:43:03.060Z

## Who should check

- Anyone running Linux \>= da44c340c4fe9d9653ae84fa6a60f406bafcffce, \< c01b2e0ee22ef8b4dd7509a93aecc0ac0826bae4; \>= da44c340c4fe9d9653ae84fa6a60f406bafcffce, \< 52093779b1830ac184a23848d971f06404cf513e; \>= da44c340c4fe9d9653ae84fa6a60f406bafcffce, \< c777b11d34e0f47dbbc4b018ef65ad030f2b283a
- Anyone running Linux 6.1

## Description

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

vfio/mdev: Fix a null-ptr-deref bug for mdev\_unregister\_parent()

Inject fault while probing mdpy.ko, if kstrdup() of create\_dir() fails in
kobject\_add\_internal() in kobject\_init\_and\_add() in mdev\_type\_add()
in parent\_create\_sysfs\_files(), it will return 0 and probe successfully.
And when rmmod mdpy.ko, the mdpy\_dev\_exit() will call
mdev\_unregister\_parent(), the mdev\_type\_remove() may traverse uninitialized
parent-\>types\[i\] in parent\_remove\_sysfs\_files(), and it will cause
below null-ptr-deref.

If mdev\_type\_add() fails, return the error code and kset\_unregister()
to fix the issue.

 general protection fault, probably for non-canonical address 0xdffffc0000000002: 0000 \[\#1\] PREEMPT SMP KASAN
 KASAN: null-ptr-deref in range \[0x0000000000000010-0x0000000000000017\]
 CPU: 2 PID: 10215 Comm: rmmod Tainted: G        W        N 6.6.0-rc2+ \#20
 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
 RIP: 0010:\_\_kobject\_del+0x62/0x1c0
 Code: 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 51 01 00 00 48 b8 00 00 00 00 00 fc ff df 48 8b 6b 28 48 8d 7d 10 48 89 fa 48 c1 ea 03 \<80\> 3c 02 00 0f 85 24 01 00 00 48 8b 75 10 48 89 df 48 8d 6b 3c e8
 RSP: 0018:ffff88810695fd30 EFLAGS: 00010202
 RAX: dffffc0000000000 RBX: ffffffffa0270268 RCX: 0000000000000000
 RDX: 0000000000000002 RSI: 0000000000000004 RDI: 0000000000000010
 RBP: 0000000000000000 R08: 0000000000000001 R09: ffffed10233a4ef1
 R10: ffff888119d2778b R11: 0000000063666572 R12: 0000000000000000
 R13: fffffbfff404e2d4 R14: dffffc0000000000 R15: ffffffffa0271660
 FS:  00007fbc81981540(0000) GS:ffff888119d00000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
 CR2: 00007fc14a142dc0 CR3: 0000000110a62003 CR4: 0000000000770ee0
 DR0: ffffffff8fb0bce8 DR1: ffffffff8fb0bce9 DR2: ffffffff8fb0bcea
 DR3: ffffffff8fb0bceb DR6: 00000000fffe0ff0 DR7: 0000000000000600
 PKRU: 55555554
 Call Trace:
  \<TASK\>
  ? die\_addr+0x3d/0xa0
  ? exc\_general\_protection+0x144/0x220
  ? asm\_exc\_general\_protection+0x22/0x30
  ? \_\_kobject\_del+0x62/0x1c0
  kobject\_del+0x32/0x50
  parent\_remove\_sysfs\_files+0xd6/0x170 \[mdev\]
  mdev\_unregister\_parent+0xfb/0x190 \[mdev\]
  ? mdev\_register\_parent+0x270/0x270 \[mdev\]
  ? find\_module\_all+0x9d/0xe0
  mdpy\_dev\_exit+0x17/0x63 \[mdpy\]
  \_\_do\_sys\_delete\_module.constprop.0+0x2fa/0x4b0
  ? module\_flags+0x300/0x300
  ? \_\_fput+0x4e7/0xa00
  do\_syscall\_64+0x35/0x80
  entry\_SYSCALL\_64\_after\_hwframe+0x46/0xb0
 RIP: 0033:0x7fbc813221b7
 Code: 73 01 c3 48 8b 0d d1 8c 2c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 b0 00 00 00 0f 05 \<48\> 3d 01 f0 ff ff 73 01 c3 48 8b 0d a1 8c 2c 00 f7 d8 64 89 01 48
 RSP: 002b:00007ffe780e0648 EFLAGS: 00000206 ORIG\_RAX: 00000000000000b0
 RAX: ffffffffffffffda RBX: 00007ffe780e06a8 RCX: 00007fbc813221b7
 RDX: 000000000000000a RSI: 0000000000000800 RDI: 000055e214df9b58
 RBP: 000055e214df9af0 R08: 00007ffe780df5c1 R09: 0000000000000000
 R10: 00007fbc8139ecc0 R11: 0000000000000206 R12: 00007ffe780e0870
 R13: 00007ffe780e0ed0 R14: 000055e214df9260 R15: 000055e214df9af0
  \</TASK\>
 Modules linked in: mdpy(-) mdev vfio\_iommu\_type1 vfio \[last unloaded: mdpy\]
 Dumping ftrace buffer:
    (ftrace buffer empty)
 ---\[ end trace 0000000000000000 \]---
 RIP: 0010:\_\_kobject\_del+0x62/0x1c0
 Code: 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 51 01 00 00 48 b8 00 00 00 00 00 fc ff df 48 8b 6b 28 48 8d 7d 10 48 89 fa 48 c1 ea 03 \<80\> 3c 02 00 0f 85 24 01 00 00 48 8b 75 10 48 89 df 48 8d 6b 3c e8
 RSP: 0018:ffff88810695fd30 EFLAGS: 00010202
 RAX: dffffc0000000000 RBX: ffffffffa0270268 RCX: 0000000000000000
 RDX: 0000000000000002 RSI: 0000000000000004 RDI: 0000000000000010
 RBP: 0000000000000000 R08: 0000000000000001 R09: ffffed10233a4ef1
 R10: ffff888119d2778b R11: 0000000063666572 R12: 0000000000000000
 R13: fffffbfff404e2d4 R14: dffffc0000000000 R15: ffffffffa0271660
 FS:  00007fbc81981540(0000) GS:ffff888119d00000(000
---truncated---

## Affected and fixed versions

- Linux: \>= da44c340c4fe9d9653ae84fa6a60f406bafcffce, \< c01b2e0ee22ef8b4dd7509a93aecc0ac0826bae4; \>= da44c340c4fe9d9653ae84fa6a60f406bafcffce, \< 52093779b1830ac184a23848d971f06404cf513e; \>= da44c340c4fe9d9653ae84fa6a60f406bafcffce, \< c777b11d34e0f47dbbc4b018ef65ad030f2b283a (cvelist)
- Linux: 6.1 (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-2023-52570. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2023-52570.md
Affected: Linux >= da44c340c4fe9d9653ae84fa6a60f406bafcffce, < c01b2e0ee22ef8b4dd7509a93aecc0ac0826bae4; >= da44c340c4fe9d9653ae84fa6a60f406bafcffce, < 52093779b1830ac184a23848d971f06404cf513e; >= da44c340c4fe9d9653ae84fa6a60f406bafcffce, < c777b11d34e0f47dbbc4b018ef65ad030f2b283a; Linux 6.1
Fixed in: Linux 52093779b1830ac184a23848d971f06404cf513e

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-2023-52570 being exploited?

There is no confirmed exploitation: CVE-2023-52570 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-26).

### How serious is CVE-2023-52570?

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

### Which versions are affected by CVE-2023-52570?

Linux \>= da44c340c4fe9d9653ae84fa6a60f406bafcffce, \< c01b2e0ee22ef8b4dd7509a93aecc0ac0826bae4; \>= da44c340c4fe9d9653ae84fa6a60f406bafcffce, \< 52093779b1830ac184a23848d971f06404cf513e; \>= da44c340c4fe9d9653ae84fa6a60f406bafcffce, \< c777b11d34e0f47dbbc4b018ef65ad030f2b283a; Linux 6.1.

### Is there a fix for CVE-2023-52570?

Yes. Fixed in Linux 52093779b1830ac184a23848d971f06404cf513e. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2023-52570?

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/c01b2e0ee22ef8b4dd7509a93aecc0ac0826bae4>
- patch: <https://git.kernel.org/stable/c/52093779b1830ac184a23848d971f06404cf513e>
- patch: <https://git.kernel.org/stable/c/c777b11d34e0f47dbbc4b018ef65ad030f2b283a>

## 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-2023-52570>

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