# CVE-2023-52516: dma-debug: don't call \_\_dma\_entry\_alloc\_check\_leak() under free\_entries\_lock

> 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.23% (percentile 8, 2026-11-28)
- **CWE:** CWE-667
- **Published:** 2024-03-02T21:52:26.517Z
- **Modified:** 2026-06-17T06:42:54.713Z

## Who should check

- Anyone running Linux \>= ceb51173b2b5bd7af0d99079f6bbacdcfc58fe08, \< c79300599923daaa30f417c75555d5566b3d31ae; \>= ceb51173b2b5bd7af0d99079f6bbacdcfc58fe08, \< ac0d068099349cbca3d93f2e3b15bb329364b08c; \>= ceb51173b2b5bd7af0d99079f6bbacdcfc58fe08, \< be8f49029eca3efbad0d74dbff3cb9129994ffab; \>= ceb51173b2b5bd7af0d99079f6bbacdcfc58fe08, \< fe2b811a02c3244ebf6059039e4a9e715e26a9e3; \>= ceb51173b2b5bd7af0d99079f6bbacdcfc58fe08, \< fb5a4315591dae307a65fc246ca80b5159d296e1
- Anyone running Linux 5.0

## Description

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

dma-debug: don't call \_\_dma\_entry\_alloc\_check\_leak() under free\_entries\_lock

\_\_dma\_entry\_alloc\_check\_leak() calls into printk -\> serial console
output (qcom geni) and grabs port-\>lock under free\_entries\_lock
spin lock, which is a reverse locking dependency chain as qcom\_geni
IRQ handler can call into dma-debug code and grab free\_entries\_lock
under port-\>lock.

Move \_\_dma\_entry\_alloc\_check\_leak() call out of free\_entries\_lock
scope so that we don't acquire serial console's port-\>lock under it.

Trimmed-down lockdep splat:

 The existing dependency chain (in reverse order) is:

               -\> \#2 (free\_entries\_lock){-.-.}-{2:2}:
        \_raw\_spin\_lock\_irqsave+0x60/0x80
        dma\_entry\_alloc+0x38/0x110
        debug\_dma\_map\_page+0x60/0xf8
        dma\_map\_page\_attrs+0x1e0/0x230
        dma\_map\_single\_attrs.constprop.0+0x6c/0xc8
        geni\_se\_rx\_dma\_prep+0x40/0xcc
        qcom\_geni\_serial\_isr+0x310/0x510
        \_\_handle\_irq\_event\_percpu+0x110/0x244
        handle\_irq\_event\_percpu+0x20/0x54
        handle\_irq\_event+0x50/0x88
        handle\_fasteoi\_irq+0xa4/0xcc
        handle\_irq\_desc+0x28/0x40
        generic\_handle\_domain\_irq+0x24/0x30
        gic\_handle\_irq+0xc4/0x148
        do\_interrupt\_handler+0xa4/0xb0
        el1\_interrupt+0x34/0x64
        el1h\_64\_irq\_handler+0x18/0x24
        el1h\_64\_irq+0x64/0x68
        arch\_local\_irq\_enable+0x4/0x8
        \_\_\_\_do\_softirq+0x18/0x24
        ...

               -\> \#1 (&port\_lock\_key){-.-.}-{2:2}:
        \_raw\_spin\_lock\_irqsave+0x60/0x80
        qcom\_geni\_serial\_console\_write+0x184/0x1dc
        console\_flush\_all+0x344/0x454
        console\_unlock+0x94/0xf0
        vprintk\_emit+0x238/0x24c
        vprintk\_default+0x3c/0x48
        vprintk+0xb4/0xbc
        \_printk+0x68/0x90
        register\_console+0x230/0x38c
        uart\_add\_one\_port+0x338/0x494
        qcom\_geni\_serial\_probe+0x390/0x424
        platform\_probe+0x70/0xc0
        really\_probe+0x148/0x280
        \_\_driver\_probe\_device+0xfc/0x114
        driver\_probe\_device+0x44/0x100
        \_\_device\_attach\_driver+0x64/0xdc
        bus\_for\_each\_drv+0xb0/0xd8
        \_\_device\_attach+0xe4/0x140
        device\_initial\_probe+0x1c/0x28
        bus\_probe\_device+0x44/0xb0
        device\_add+0x538/0x668
        of\_device\_add+0x44/0x50
        of\_platform\_device\_create\_pdata+0x94/0xc8
        of\_platform\_bus\_create+0x270/0x304
        of\_platform\_populate+0xac/0xc4
        devm\_of\_platform\_populate+0x60/0xac
        geni\_se\_probe+0x154/0x160
        platform\_probe+0x70/0xc0
        ...

               -\> \#0 (console\_owner){-...}-{0:0}:
        \_\_lock\_acquire+0xdf8/0x109c
        lock\_acquire+0x234/0x284
        console\_flush\_all+0x330/0x454
        console\_unlock+0x94/0xf0
        vprintk\_emit+0x238/0x24c
        vprintk\_default+0x3c/0x48
        vprintk+0xb4/0xbc
        \_printk+0x68/0x90
        dma\_entry\_alloc+0xb4/0x110
        debug\_dma\_map\_sg+0xdc/0x2f8
        \_\_dma\_map\_sg\_attrs+0xac/0xe4
        dma\_map\_sgtable+0x30/0x4c
        get\_pages+0x1d4/0x1e4 \[msm\]
        msm\_gem\_pin\_pages\_locked+0x38/0xac \[msm\]
        msm\_gem\_pin\_vma\_locked+0x58/0x88 \[msm\]
        msm\_ioctl\_gem\_submit+0xde4/0x13ac \[msm\]
        drm\_ioctl\_kernel+0xe0/0x15c
        drm\_ioctl+0x2e8/0x3f4
        vfs\_ioctl+0x30/0x50
        ...

 Chain exists of:
   console\_owner --\> &port\_lock\_key --\> free\_entries\_lock

  Possible unsafe locking scenario:

        CPU0                    CPU1
        ----                    ----
   lock(free\_entries\_lock);
                                lock(&port\_lock\_key);
                                lock(free\_entries\_lock);
   lock(console\_owner);

                \*\*\* DEADLOCK \*\*\*

 Call trace:
  dump\_backtrace+0xb4/0xf0
  show\_stack+0x20/0x30
  dump\_stack\_lvl+0x60/0x84
  dump\_stack+0x18/0x24
  print\_circular\_bug+0x1cc/0x234
  check\_noncircular+0x78/0xac
  \_\_lock\_acquire+0xdf8/0x109c
  lock\_acquire+0x234/0x284
  console\_flush\_all+0x330/0x454
  consol
---truncated---

## Affected and fixed versions

- Linux: \>= ceb51173b2b5bd7af0d99079f6bbacdcfc58fe08, \< c79300599923daaa30f417c75555d5566b3d31ae; \>= ceb51173b2b5bd7af0d99079f6bbacdcfc58fe08, \< ac0d068099349cbca3d93f2e3b15bb329364b08c; \>= ceb51173b2b5bd7af0d99079f6bbacdcfc58fe08, \< be8f49029eca3efbad0d74dbff3cb9129994ffab; \>= ceb51173b2b5bd7af0d99079f6bbacdcfc58fe08, \< fe2b811a02c3244ebf6059039e4a9e715e26a9e3; \>= ceb51173b2b5bd7af0d99079f6bbacdcfc58fe08, \< fb5a4315591dae307a65fc246ca80b5159d296e1 (cvelist)
- Linux: 5.0 (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-52516. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2023-52516.md
Affected: Linux >= ceb51173b2b5bd7af0d99079f6bbacdcfc58fe08, < c79300599923daaa30f417c75555d5566b3d31ae; >= ceb51173b2b5bd7af0d99079f6bbacdcfc58fe08, < ac0d068099349cbca3d93f2e3b15bb329364b08c; >= ceb51173b2b5bd7af0d99079f6bbacdcfc58fe08, < be8f49029eca3efbad0d74dbff3cb9129994ffab; >= ceb51173b2b5bd7af0d9907…
Fixed in: no fixed version listed yet

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-52516 being exploited?

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

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

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

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

Linux \>= ceb51173b2b5bd7af0d99079f6bbacdcfc58fe08, \< c79300599923daaa30f417c75555d5566b3d31ae; \>= ceb51173b2b5bd7af0d99079f6bbacdcfc58fe08, \< ac0d068099349cbca3d93f2e3b15bb329364b08c; \>= ceb51173b2b5bd7af0d99079f6bbacdcfc58fe08, \< be8f49029eca3efbad0d74dbff3cb9129994ffab; \>= ceb51173b2b5bd7af0d99079f6bbacdcfc58fe08, \< fe2b811a02c3244ebf6059039e4a9e715e26a9e3; \>= ceb51173b2b5bd7af0d99079f6bbacdcfc58fe08, \< fb5a4315591dae307a65fc246ca80b5159d296e1; Linux 5.0.

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

No fixed version is listed in the sources yet. No fix listed yet: follow the vendor advisory.

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

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/c79300599923daaa30f417c75555d5566b3d31ae>
- patch: <https://git.kernel.org/stable/c/ac0d068099349cbca3d93f2e3b15bb329364b08c>
- patch: <https://git.kernel.org/stable/c/be8f49029eca3efbad0d74dbff3cb9129994ffab>
- patch: <https://git.kernel.org/stable/c/fe2b811a02c3244ebf6059039e4a9e715e26a9e3>
- patch: <https://git.kernel.org/stable/c/fb5a4315591dae307a65fc246ca80b5159d296e1>

## 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-52516>

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