spi: spidev: fix lock inversion between spi_lock and buf_lock
In the Linux kernel, the following vulnerability has been resolved: spi: spidev: fix lock inversion between spi_lock and buf_lock The spidev driver previously used two mutexes, spi_lock and buf_lock, but acquired them in different orders depending on the code path: write()/read(): buf_lock -> spi_lock ioctl(): spi_lock -> buf_lock This AB-BA locking pattern triggers lockdep warnings and can cause real deadlocks: WARNING: possible circular locking dependency detected spidev_ioctl() -> mutex_lock(&spidev->buf_lock) spidev_sync_write() -> mutex_lock(&spidev->spi_lock) *** DEADLOCK *** The issue is reproducible with a simple userspace program that performs write() and SPI_IOC_WR_MAX_SPEED_HZ ioctl() calls from separate threads on the same spidev file descriptor. Fix this by simplifying the locking model and removing the lock inversion entirely. spidev_sync() no longer performs any locking, and all callers serialize access using spi_lock. buf_lock is removed since its functionality is fully covered by spi_lock, eliminating the possibility of lock ordering issues. This removes the lock inversion and prevents deadlocks without changing userspace ABI or behaviour.
- Products
- Kernel
- Affected versions
- Not specified
- Fixed versions
- 6.12.75, 6.18.16, 6.19.6, 6.6.142
- CVEs
- CVE-2026-43319
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 3 Nov 2026, 05:26 UTC · Revision 1
Source evidence
spi: spidev: fix lock inversion between spi_lock and buf_lock
core-osv · Original sourcePublished 8 May 2026, 13:26 UTC
In the Linux kernel, the following vulnerability has been resolved: spi: spidev: fix lock inversion between spi_lock and buf_lock The spidev driver previously used two mutexes, spi_lock and buf_lock, but acquired them in different orders depending on the code path: write()/read(): buf_lock -> spi_lock ioctl(): spi_lock -> buf_lock This AB-BA locking pattern triggers lockdep warnings and can cause real deadlocks: WARNING: possible circular locking dependency detected spidev_ioctl() -> mutex_lock(&spidev->buf_lock) spidev_sync_write() -> mutex_lock(&spidev->spi_lock) *** DEADLOCK *** The issue is reproducible with a simple userspace program that performs write() and SPI_IOC_WR_MAX_SPEED_HZ ioctl() calls from separate threads on the same spidev file descriptor. Fix this by simplifying the locking model and removing the lock inversion entirely. spidev_sync() no longer performs any locking, and all callers serialize access using spi_lock. buf_lock is removed since its functionality is fully covered by spi_lock, eliminating the possibility of lock ordering issues. This removes the lock inversion and prevents deadlocks without changing userspace ABI or behaviour.
osv:CVE-2026-43319
Kernel
Fixed versions: 6.6.142, 6.12.75, 6.18.16, 6.19.6
Complete source record
{
"id": "7f4e7cc970913bba3a7e713a84d51a8314ed5c78964c63cca5f0fece1bc9f704",
"url": "https://osv.dev/vulnerability/CVE-2026-43319",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "spi: spidev: fix lock inversion between spi_lock and buf_lock",
"summary": "In the Linux kernel, the following vulnerability has been resolved: spi: spidev: fix lock inversion between spi_lock and buf_lock The spidev driver previously used two mutexes, spi_lock and buf_lock, but acquired them in different orders depending on the code path: write()/read(): buf_lock -> spi_lock ioctl(): spi_lock -> buf_lock This AB-BA locking pattern triggers lockdep warnings and can cause real deadlocks: WARNING: possible circular locking dependency detected spidev_ioctl() -> mutex_lock(&spidev->buf_lock) spidev_sync_write() -> mutex_lock(&spidev->spi_lock) *** DEADLOCK *** The issue is reproducible with a simple userspace program that performs write() and SPI_IOC_WR_MAX_SPEED_HZ ioctl() calls from separate threads on the same spidev file descriptor. Fix this by simplifying the locking model and removing the lock inversion entirely. spidev_sync() no longer performs any locking, and all callers serialize access using spi_lock. buf_lock is removed since its functionality is fully covered by spi_lock, eliminating the possibility of lock ordering issues. This removes the lock inversion and prevents deadlocks without changing userspace ABI or behaviour.",
"evidence": "osv:CVE-2026-43319",
"products": [
{
"name": {
"value": "Kernel",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "6.6.142",
"evidence": "/affected/1/ranges"
},
{
"value": "6.12.75",
"evidence": "/affected/1/ranges"
},
{
"value": "6.18.16",
"evidence": "/affected/1/ranges"
},
{
"value": "6.19.6",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
}
],
"severity": "unknown",
"structured": {
"id": "CVE-2026-43319",
"aliases": [
"CVE-2026-43319"
],
"affected": [
{
"ranges": [
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "a720416d94634068951773cb9e9d6f1b73769e5b"
},
{
"fixed": "fabfed1afe273717ea33b8aee46b767360edbb80"
},
{
"fixed": "f8431b8672231d378b03176fe74c95adfd3522cf"
},
{
"fixed": "e341e18215030af2136836b78508e0d798916df7"
},
{
"fixed": "41ccfac7d302968a4f32b5f7b012d066c5f5cdf8"
},
{
"fixed": "40534d19ed2afb880ecf202dab26a8e7a5808d16"
}
]
}
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-43319.json"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.2.0"
},
{
"fixed": "6.6.142"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.7.0"
},
{
"fixed": "6.12.75"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.13.0"
},
{
"fixed": "6.18.16"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.19.0"
},
{
"fixed": "6.19.6"
}
]
}
],
"package": {
"name": "Kernel",
"ecosystem": "Linux"
},
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-43319.json"
}
}
],
"modified": "2026-10-28T02:30:26.468917643Z",
"provider": "osv",
"references": [
"https://git.kernel.org/stable/c/40534d19ed2afb880ecf202dab26a8e7a5808d16",
"https://git.kernel.org/stable/c/41ccfac7d302968a4f32b5f7b012d066c5f5cdf8",
"https://git.kernel.org/stable/c/e341e18215030af2136836b78508e0d798916df7",
"https://git.kernel.org/stable/c/f8431b8672231d378b03176fe74c95adfd3522cf",
"https://git.kernel.org/stable/c/fabfed1afe273717ea33b8aee46b767360edbb80",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/43xxx/CVE-2026-43319.json",
"https://nvd.nist.gov/vuln/detail/CVE-2026-43319",
"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
],
"provider_metadata": {
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/43xxx/CVE-2026-43319.json"
}
},
"related_cves": [
{
"value": "CVE-2026-43319",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": null
},
"source_id": "core-osv",
"document_id": 492691,
"published_at": "2026-05-08T13:26:14.231+00:00"
}