CVE-2024-36930

Source
https://cve.org/CVERecord?id=CVE-2024-36930
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-36930.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2024-36930
Downstream
Related
Published
2024-05-30T15:29:22.012Z
Modified
2026-03-14T12:34:16.587738Z
Summary
spi: fix null pointer dereference within spi_sync
Details

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

spi: fix null pointer dereference within spi_sync

If spisync() is called with the non-empty queue and the same spimessage is then reused, the complete callback for the message remains set while the context is cleared, leading to a null pointer dereference when the callback is invoked from spifinalizecurrent_message().

With function inlining disabled, the call stack might look like this:

rawspinlockirqsave from completewithflags+0x18/0x58 completewithflags from spicomplete+0x8/0xc spicomplete from spifinalizecurrentmessage+0xec/0x184 spifinalizecurrentmessage from spitransferonemessage+0x2a8/0x474 spitransferonemessage from __spipumptransfer_message+0x104/0x230 __spipumptransfer_message from __spitransfermessage_noqueue+0x30/0xc4 __spitransfermessage_noqueue from __spi_sync+0x204/0x248 _spisync from spisync+0x24/0x3c spisync from mcp251xfdregmapcrcread+0x124/0x28c [mcp251xfd] mcp251xfdregmapcrcread [mcp251xfd] from regmaprawread+0xf8/0x154 regmaprawread from regmapbusread+0x44/0x70 regmapbusread from regmapread+0x60/0xd8 regmapread from regmapread+0x3c/0x5c regmapread from mcp251xfdalloccanerrskb+0x1c/0x54 [mcp251xfd] mcp251xfdalloccanerrskb [mcp251xfd] from mcp251xfdirq+0x194/0xe70 [mcp251xfd] mcp251xfdirq [mcp251xfd] from irqthreadfn+0x1c/0x78 irqthreadfn from irqthread+0x118/0x1f4 irqthread from kthread+0xd8/0xf4 kthread from retfromfork+0x14/0x28

Fix this by also setting message->complete to NULL when the transfer is complete.

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/36xxx/CVE-2024-36930.json",
    "cna_assigner": "Linux"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
ae7d2346dc89ae89a6e0aabe6037591a11e593c0
Fixed
e005d6754e3e440257006795b687c4ad8733b493
Fixed
a30659f1576d2c8e62e7426232bb18b885fd951a
Fixed
2070d008cc08bff50a58f0f4d30f12d3ebf94c00
Fixed
4756fa529b2f12b7cb8f21fe229b0f6f47190829

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-36930.json"