# CVE-2023-52517: spi: sun6i: fix race between DMA RX transfer completion and RX FIFO drain

> 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.25% (percentile 10, 2026-11-28)
- **CWE:** CWE-362
- **Published:** 2024-03-02T21:52:27.152Z
- **Modified:** 2026-08-05T09:10:21.476Z

## Who should check

- Anyone running Linux \>= 345980a3a5e5e1c99fc621e2ce878fb150ad2287, \< bd1ec7f9983b5cd3c77e0f7cda3fa8aed041af2f; \>= 345980a3a5e5e1c99fc621e2ce878fb150ad2287, \< 36b29974a7ad2ff604c24ad348f940506c7b1209; \>= 345980a3a5e5e1c99fc621e2ce878fb150ad2287, \< 4e149d524678431638ff378ef6025e4e89b71097; \>= 345980a3a5e5e1c99fc621e2ce878fb150ad2287, \< 1f11f4202caf5710204d334fe63392052783876d
- Anyone running Linux 5.11

## Description

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

spi: sun6i: fix race between DMA RX transfer completion and RX FIFO drain

Previously the transfer complete IRQ immediately drained to RX FIFO to
read any data remaining in FIFO to the RX buffer. This behaviour is
correct when dealing with SPI in interrupt mode. However in DMA mode the
transfer complete interrupt still fires as soon as all bytes to be
transferred have been stored in the FIFO. At that point data in the FIFO
still needs to be picked up by the DMA engine. Thus the drain procedure
and DMA engine end up racing to read from RX FIFO, corrupting any data
read. Additionally the RX buffer pointer is never adjusted according to
DMA progress in DMA mode, thus calling the RX FIFO drain procedure in DMA
mode is a bug.
Fix corruptions in DMA RX mode by draining RX FIFO only in interrupt mode.
Also wait for completion of RX DMA when in DMA mode before returning to
ensure all data has been copied to the supplied memory buffer.

## Affected and fixed versions

- Linux: \>= 345980a3a5e5e1c99fc621e2ce878fb150ad2287, \< bd1ec7f9983b5cd3c77e0f7cda3fa8aed041af2f; \>= 345980a3a5e5e1c99fc621e2ce878fb150ad2287, \< 36b29974a7ad2ff604c24ad348f940506c7b1209; \>= 345980a3a5e5e1c99fc621e2ce878fb150ad2287, \< 4e149d524678431638ff378ef6025e4e89b71097; \>= 345980a3a5e5e1c99fc621e2ce878fb150ad2287, \< 1f11f4202caf5710204d334fe63392052783876d (cvelist)
- Linux: 5.11 (cvelist)

## Mitigation

- Upgrade Linux to 1f11f4202caf5710204d334fe63392052783876d or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2023-52517.md
Affected: Linux >= 345980a3a5e5e1c99fc621e2ce878fb150ad2287, < bd1ec7f9983b5cd3c77e0f7cda3fa8aed041af2f; >= 345980a3a5e5e1c99fc621e2ce878fb150ad2287, < 36b29974a7ad2ff604c24ad348f940506c7b1209; >= 345980a3a5e5e1c99fc621e2ce878fb150ad2287, < 4e149d524678431638ff378ef6025e4e89b71097; >= 345980a3a5e5e1c99fc621e…
Fixed in: Linux 36b29974a7ad2ff604c24ad348f940506c7b1209, Linux 4e149d524678431638ff378ef6025e4e89b71097, Linux 1f11f4202caf5710204d334fe63392052783876d

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

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

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

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

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

Linux \>= 345980a3a5e5e1c99fc621e2ce878fb150ad2287, \< bd1ec7f9983b5cd3c77e0f7cda3fa8aed041af2f; \>= 345980a3a5e5e1c99fc621e2ce878fb150ad2287, \< 36b29974a7ad2ff604c24ad348f940506c7b1209; \>= 345980a3a5e5e1c99fc621e2ce878fb150ad2287, \< 4e149d524678431638ff378ef6025e4e89b71097; \>= 345980a3a5e5e1c99fc621e2ce878fb150ad2287, \< 1f11f4202caf5710204d334fe63392052783876d; Linux 5.11.

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

Yes. Fixed in Linux 36b29974a7ad2ff604c24ad348f940506c7b1209, Linux 4e149d524678431638ff378ef6025e4e89b71097, Linux 1f11f4202caf5710204d334fe63392052783876d. Upgrade Linux to 1f11f4202caf5710204d334fe63392052783876d or later.

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

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/bd1ec7f9983b5cd3c77e0f7cda3fa8aed041af2f>
- patch: <https://git.kernel.org/stable/c/36b29974a7ad2ff604c24ad348f940506c7b1209>
- patch: <https://git.kernel.org/stable/c/4e149d524678431638ff378ef6025e4e89b71097>
- patch: <https://git.kernel.org/stable/c/1f11f4202caf5710204d334fe63392052783876d>

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

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