# CVE-2024-40970: Avoid hw\_desc array overrun in dw-axi-dmac

> 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.33% (percentile 18, 2026-11-26)
- **Published:** 2024-07-12T12:32:08.788Z
- **Modified:** 2026-08-05T11:34:18.464Z

## Who should check

- Anyone running Linux \>= ef6fb2d6f1abd56cc067c694253ea362159b5ac3, \< 7c3bb96a20cd8db3b8824b2ff08b6cde4505c7e5; \>= ef6fb2d6f1abd56cc067c694253ea362159b5ac3, \< dd42570018f5962c10f215ad9c21274ed5d3541e; \>= ef6fb2d6f1abd56cc067c694253ea362159b5ac3, \< e151ae1ee065cf4b8ce4394ddb9d9c8df6370c66; \>= ef6fb2d6f1abd56cc067c694253ea362159b5ac3, \< 9004784e8d68bcd1ac1376407ba296fa28f04dbe; \>= ef6fb2d6f1abd56cc067c694253ea362159b5ac3, \< 333e11bf47fa8d477db90e2900b1ed3c9ae9b697
- Anyone running Linux 5.12

## Description

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

Avoid hw\_desc array overrun in dw-axi-dmac

I have a use case where nr\_buffers = 3 and in which each descriptor is composed by 3
segments, resulting in the DMA channel descs\_allocated to be 9. Since axi\_desc\_put()
handles the hw\_desc considering the descs\_allocated, this scenario would result in a
kernel panic (hw\_desc array will be overrun).

To fix this, the proposal is to add a new member to the axi\_dma\_desc structure,
where we keep the number of allocated hw\_descs (axi\_desc\_alloc()) and use it in
axi\_desc\_put() to handle the hw\_desc array correctly.

Additionally I propose to remove the axi\_chan\_start\_first\_queued() call after completing
the transfer, since it was identified that unbalance can occur (started descriptors can
be interrupted and transfer ignored due to DMA channel not being enabled).

## Affected and fixed versions

- Linux: \>= ef6fb2d6f1abd56cc067c694253ea362159b5ac3, \< 7c3bb96a20cd8db3b8824b2ff08b6cde4505c7e5; \>= ef6fb2d6f1abd56cc067c694253ea362159b5ac3, \< dd42570018f5962c10f215ad9c21274ed5d3541e; \>= ef6fb2d6f1abd56cc067c694253ea362159b5ac3, \< e151ae1ee065cf4b8ce4394ddb9d9c8df6370c66; \>= ef6fb2d6f1abd56cc067c694253ea362159b5ac3, \< 9004784e8d68bcd1ac1376407ba296fa28f04dbe; \>= ef6fb2d6f1abd56cc067c694253ea362159b5ac3, \< 333e11bf47fa8d477db90e2900b1ed3c9ae9b697 (cvelist)
- Linux: 5.12 (cvelist)

## Mitigation

- Upgrade Linux to 333e11bf47fa8d477db90e2900b1ed3c9ae9b697 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2024-40970.md
Affected: Linux >= ef6fb2d6f1abd56cc067c694253ea362159b5ac3, < 7c3bb96a20cd8db3b8824b2ff08b6cde4505c7e5; >= ef6fb2d6f1abd56cc067c694253ea362159b5ac3, < dd42570018f5962c10f215ad9c21274ed5d3541e; >= ef6fb2d6f1abd56cc067c694253ea362159b5ac3, < e151ae1ee065cf4b8ce4394ddb9d9c8df6370c66; >= ef6fb2d6f1abd56cc067c69…
Fixed in: Linux 7c3bb96a20cd8db3b8824b2ff08b6cde4505c7e5, Linux 9004784e8d68bcd1ac1376407ba296fa28f04dbe, Linux 333e11bf47fa8d477db90e2900b1ed3c9ae9b697

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

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

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

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

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

Linux \>= ef6fb2d6f1abd56cc067c694253ea362159b5ac3, \< 7c3bb96a20cd8db3b8824b2ff08b6cde4505c7e5; \>= ef6fb2d6f1abd56cc067c694253ea362159b5ac3, \< dd42570018f5962c10f215ad9c21274ed5d3541e; \>= ef6fb2d6f1abd56cc067c694253ea362159b5ac3, \< e151ae1ee065cf4b8ce4394ddb9d9c8df6370c66; \>= ef6fb2d6f1abd56cc067c694253ea362159b5ac3, \< 9004784e8d68bcd1ac1376407ba296fa28f04dbe; \>= ef6fb2d6f1abd56cc067c694253ea362159b5ac3, \< 333e11bf47fa8d477db90e2900b1ed3c9ae9b697; Linux 5.12.

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

Yes. Fixed in Linux 7c3bb96a20cd8db3b8824b2ff08b6cde4505c7e5, Linux 9004784e8d68bcd1ac1376407ba296fa28f04dbe, Linux 333e11bf47fa8d477db90e2900b1ed3c9ae9b697. Upgrade Linux to 333e11bf47fa8d477db90e2900b1ed3c9ae9b697 or later.

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

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/7c3bb96a20cd8db3b8824b2ff08b6cde4505c7e5>
- patch: <https://git.kernel.org/stable/c/dd42570018f5962c10f215ad9c21274ed5d3541e>
- patch: <https://git.kernel.org/stable/c/e151ae1ee065cf4b8ce4394ddb9d9c8df6370c66>
- patch: <https://git.kernel.org/stable/c/9004784e8d68bcd1ac1376407ba296fa28f04dbe>
- patch: <https://git.kernel.org/stable/c/333e11bf47fa8d477db90e2900b1ed3c9ae9b697>
- other: <https://lists.debian.org/debian-lts-announce/2025/01/msg00001.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-2024-40970>

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