# CVE-2024-35814: swiotlb: Fix double-allocation of slots due to broken alignment handling

> 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)
- **CWE:** CWE-415, CWE-119, CWE-1055
- **Published:** 2024-05-17T13:23:19.590Z
- **Modified:** 2026-08-05T11:30:08.016Z

## Who should check

- Anyone running Linux \>= 0eee5ae1025699ea93d44fdb6ef2365505082103, \< 3e7acd6e25ba77dde48c3b721c54c89cd6a10534; \>= 0eee5ae1025699ea93d44fdb6ef2365505082103, \< c88668aa6c1da240ea3eb4d128b7906e740d3cb8; \>= 0eee5ae1025699ea93d44fdb6ef2365505082103, \< 777391743771040e12cc40d3d0d178f70c616491; \>= 0eee5ae1025699ea93d44fdb6ef2365505082103, \< 04867a7a33324c9c562ee7949dbcaab7aaad1fb4
- Anyone running Linux 6.3

## Description

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

swiotlb: Fix double-allocation of slots due to broken alignment handling

Commit bbb73a103fbb ("swiotlb: fix a braino in the alignment check fix"),
which was a fix for commit 0eee5ae10256 ("swiotlb: fix slot alignment
checks"), causes a functional regression with vsock in a virtual machine
using bouncing via a restricted DMA SWIOTLB pool.

When virtio allocates the virtqueues for the vsock device using
dma\_alloc\_coherent(), the SWIOTLB search can return page-unaligned
allocations if 'area-\>index' was left unaligned by a previous allocation
from the buffer:

 \# Final address in brackets is the SWIOTLB address returned to the caller
 \| virtio-pci 0000:00:07.0: orig\_addr 0x0 alloc\_size 0x2000, iotlb\_align\_mask 0x800 stride 0x2: got slot 1645-1649/7168 (0x98326800)
 \| virtio-pci 0000:00:07.0: orig\_addr 0x0 alloc\_size 0x2000, iotlb\_align\_mask 0x800 stride 0x2: got slot 1649-1653/7168 (0x98328800)
 \| virtio-pci 0000:00:07.0: orig\_addr 0x0 alloc\_size 0x2000, iotlb\_align\_mask 0x800 stride 0x2: got slot 1653-1657/7168 (0x9832a800)

This ends badly (typically buffer corruption and/or a hang) because
swiotlb\_alloc() is expecting a page-aligned allocation and so blindly
returns a pointer to the 'struct page' corresponding to the allocation,
therefore double-allocating the first half (2KiB slot) of the 4KiB page.

Fix the problem by treating the allocation alignment separately to any
additional alignment requirements from the device, using the maximum
of the two as the stride to search the buffer slots and taking care
to ensure a minimum of page-alignment for buffers larger than a page.

This also resolves swiotlb allocation failures occuring due to the
inclusion of ~PAGE\_MASK in 'iotlb\_align\_mask' for large allocations and
resulting in alignment requirements exceeding swiotlb\_max\_mapping\_size().

## Affected and fixed versions

- Linux: \>= 0eee5ae1025699ea93d44fdb6ef2365505082103, \< 3e7acd6e25ba77dde48c3b721c54c89cd6a10534; \>= 0eee5ae1025699ea93d44fdb6ef2365505082103, \< c88668aa6c1da240ea3eb4d128b7906e740d3cb8; \>= 0eee5ae1025699ea93d44fdb6ef2365505082103, \< 777391743771040e12cc40d3d0d178f70c616491; \>= 0eee5ae1025699ea93d44fdb6ef2365505082103, \< 04867a7a33324c9c562ee7949dbcaab7aaad1fb4 (cvelist)
- Linux: 6.3 (cvelist)

## Mitigation

- Upgrade Linux to 04867a7a33324c9c562ee7949dbcaab7aaad1fb4 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-35814. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-35814.md
Affected: Linux >= 0eee5ae1025699ea93d44fdb6ef2365505082103, < 3e7acd6e25ba77dde48c3b721c54c89cd6a10534; >= 0eee5ae1025699ea93d44fdb6ef2365505082103, < c88668aa6c1da240ea3eb4d128b7906e740d3cb8; >= 0eee5ae1025699ea93d44fdb6ef2365505082103, < 777391743771040e12cc40d3d0d178f70c616491; >= 0eee5ae1025699ea93d44fd…
Fixed in: Linux 3e7acd6e25ba77dde48c3b721c54c89cd6a10534, Linux 777391743771040e12cc40d3d0d178f70c616491, Linux 04867a7a33324c9c562ee7949dbcaab7aaad1fb4

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

There is no confirmed exploitation: CVE-2024-35814 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-35814?

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

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

Linux \>= 0eee5ae1025699ea93d44fdb6ef2365505082103, \< 3e7acd6e25ba77dde48c3b721c54c89cd6a10534; \>= 0eee5ae1025699ea93d44fdb6ef2365505082103, \< c88668aa6c1da240ea3eb4d128b7906e740d3cb8; \>= 0eee5ae1025699ea93d44fdb6ef2365505082103, \< 777391743771040e12cc40d3d0d178f70c616491; \>= 0eee5ae1025699ea93d44fdb6ef2365505082103, \< 04867a7a33324c9c562ee7949dbcaab7aaad1fb4; Linux 6.3.

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

Yes. Fixed in Linux 3e7acd6e25ba77dde48c3b721c54c89cd6a10534, Linux 777391743771040e12cc40d3d0d178f70c616491, Linux 04867a7a33324c9c562ee7949dbcaab7aaad1fb4. Upgrade Linux to 04867a7a33324c9c562ee7949dbcaab7aaad1fb4 or later.

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

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/3e7acd6e25ba77dde48c3b721c54c89cd6a10534>
- patch: <https://git.kernel.org/stable/c/c88668aa6c1da240ea3eb4d128b7906e740d3cb8>
- patch: <https://git.kernel.org/stable/c/777391743771040e12cc40d3d0d178f70c616491>
- patch: <https://git.kernel.org/stable/c/04867a7a33324c9c562ee7949dbcaab7aaad1fb4>

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

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