CVE-2024-42249
published high CVSS 3.1 · 7.8spi: don't unoptimize message in spi_async()
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Linux | — | Linux7b1d87af14d9ae902ed0c5dc5fabf4eea5abdf02 to < 8b9af6d67517ce4a0015928b3cf35bfd2b1bc1c2 · 7b1d87af14d9ae902ed0c5dc5fabf4eea5abdf02 to < c86a918b1bdba78fb155184f8d88dfba1e63335d · Other versions: unaffected | Affected | Not stated | Linux |
| Linux | — | Linux6.9 (affected) · 0 to < 6.9 (unaffected · semver) · 6.9.10 through 6.9.* (unaffected · semver) · 6.10 and later (unaffected · original_commit_for_fix) · Other versions: affected | Version-specific | Not stated | Linux |
| Amazon Linux | AL2 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
| Amazon Linux | AL2023 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
Description
In the Linux kernel, the following vulnerability has been resolved: spi: don't unoptimize message in spi_async() Calling spi_maybe_unoptimize_message() in spi_async() is wrong because the message is likely to be in the queue and not transferred yet. This can corrupt the message while it is being used by the controller driver. spi_maybe_unoptimize_message() is already called in the correct place in spi_finalize_current_message() to balance the call to spi_maybe_optimize_message() in spi_async().
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.8 / 10
- Severity
- high
- Provider
- Linux · cna
- Vector string
- CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Scenarios
- en: AV:L - The flaw is in the SPI core and is reached by causing local SPI traffic — a `/dev/spidevB.C` SPI_IOC_MESSAGE ioctl behind spi-mux, IIO buffer enable, regmap-async firmware download via an ALSA device, or netdev TX on an SPI transceiver. No network protocol parses attacker data here, so exploitation requires local system access. AC:L - The attacker controls both sides of the race — they submit the `spi_async()` messages that queue the work and simultaneously trigger the unsynchronized teardown, and can repeat this thousands of times per second from multiple threads to widen the window and groom the freed slab. On spi-axi-spi-engine the free reliably wins, yielding a deterministic NULL deref of `msg->opt_state`. PR:L - An ordinary unprivileged local user suffices: spidev nodes are commonly group-readable/writable on embedded and SBC images, IIO buffer sysfs and ALSA PCM/firmware-download paths are similarly group-accessible, and CAN/802.15.4 socket TX drives `spi_async()` too. No root or capability in the init namespace is needed. UI:N - The attacker's own syscalls generate the SPI messages that race with the controller worker; no action by any other user is required. S:U - The corruption is confined to kernel slab memory and the SPI core's own data structures, all within the same security authority; no VM, IOMMU, or sandbox boundary is crossed. C:H - The use-after-free lets the controller read `tx_buf`/`rx_buf`/`len` out of a freed and reallocatable `struct spi_transfer`, so arbitrary kernel memory can be clocked out on the SPI bus and received data DMA'd to an attacker-influenced address; the freed spi-engine program is likewise pushed byte-for-byte into the hardware command FIFO. I:H - `spi_res_release()` can run twice on the same message (the unlocked `msg->optimized` check-and-clear races with `spi_finalize_current_message()`), giving a double free of a kmalloc'd object plus concurrent `list_splice`/`list_del` against live list traversal — SLUB freelist and linked-list corruption that yields a write primitive. A:H - In the common case the free wins and `spi_engine_transfer_one_message()` dereferences a NULL `msg->opt_state`, and list corruption or a restored oversized transfer likewise oopses the kernel — an immediate panic that an unprivileged user can trigger at will.
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Linux | Linux | 7b1d87af14d9ae902ed0c5dc5fabf4eea5abdf02 to < 8b9af6d67517ce4a0015928b3cf35bfd2b1bc1c2 (affected · git)7b1d87af14d9ae902ed0c5dc5fabf4eea5abdf02 to < c86a918b1bdba78fb155184f8d88dfba1e63335d (affected · git)Default: unaffected | Linux · cna |
| Linux | Linux | 6.9 (affected)0 to < 6.9 (unaffected · semver)6.9.10 through 6.9.* (unaffected · semver)6.10 and later (unaffected · original_commit_for_fix)Default: affected | Linux · cna |
Weaknesses
0No weakness assertions.
References
2Provider assertions
2Linux · cna
spi: don't unoptimize message in spi_async()
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 25d6dcdaa49e4dd69edef2b10b26854aa234d0efa69de6e38bea1c2f4a0f88ca
- Ingested
- 23 Sep 2026, 08:26:31 UTC
- Source record
- Official CVE record