CVE-2023-53810
Description
In the Linux kernel, the following vulnerability has been resolved:
blk-mq: release crypto keyslot before reporting I/O complete
Once all I/O using a blk_crypto_key has completed, filesystems can call blk_crypto_evict_key(). However, the block layer currently doesn't call blk_crypto_put_keyslot() until the request is being freed, which happens after upper layers have been told (via bio_endio()) the I/O has completed. This causes a race condition where blk_crypto_evict_key() can see 'slot_refs != 0' without there being an actual bug.
This makes __blk_crypto_evict_key() hit the 'WARN_ON_ONCE(atomic_read(&slot->slot_refs) != 0)' and return without doing anything, eventually causing a use-after-free in blk_crypto_reprogram_all_keys(). (This is a very rare bug and has only been seen when per-file keys are being used with fscrypt.)
There are two options to fix this: either release the keyslot before bio_endio() is called on the request's last bio, or make __blk_crypto_evict_key() ignore slot_refs. Let's go with the first solution, since it preserves the ability to report bugs (via WARN_ON_ONCE) where a key is evicted while still in-use.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
A race condition in Linux kernel's block layer releases crypto keyslots after I/O completion, allowing use-after-free when evicting file-based encryption keys.
Root
Cause
The vulnerability resides in the Linux kernel's block multi-queue (blk-mq) subsystem. When I/O operations using a blk_crypto_key complete, the kernel invokes bio_endio() to notify upper layers. However, the crypto keyslot associated with the request is not released until the request is freed, which occurs after the I/O completion notification. This creates a race condition where a filesystem may call blk_crypto_evict_key() after seeing the I/O complete, but before the keyslot is released. The eviction function then sees a non-zero slot reference count (slot_refs != 0) and triggers a WARN_ON_ONCE, returning without actually evicting the key.
Exploitation and
Attack Surface
Exploitation requires a user or process with the ability to set up per-file encryption keys (e.g., using fscrypt) and to trigger concurrent I/O and key eviction operations. No special privileges beyond normal file access are needed; the race is triggered by timing-dependent file operations. The attack surface is limited to systems using inline encryption hardware and file-based encryption, typically Android or Linux systems with fscrypt and a block device that supports blk-crypto.
Impact
If the keyslot is not properly released, the subsequent failure to evict the key can lead to a use-after-free condition when blk_crypto_reprogram_all_keys() is called. This can result in system crashes, data corruption, or potential privilege escalation if an attacker can orchestrate the timing. The bug is described as very rare, but when triggered it may allow an attacker to corrupt kernel memory.
Mitigation
The fix was applied in Linux kernel stable branches via commits [1] and [2]. The resolution releases the crypto keyslot before calling bio_endio() on the request's last bio, ensuring that blk_crypto_evict_key() sees a correct reference count. Users should update to a kernel containing these commits. No workaround is documented; affected systems using per-file keys with fscrypt should prioritize patching.
AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
2Patches
67d206ec7a04eb278570e2c5992d5d233b9ff9cd1e566676b874bdf43b4a7d206f79d9cd6Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
6- git.kernel.org/stable/c/7d206ec7a04e8545828191b6ea8b49d3ea61391fnvd
- git.kernel.org/stable/c/874bdf43b4a7dc5463c31508f62b3e42eb237b08nvd
- git.kernel.org/stable/c/92d5d233b9ff531cf9cc36ab4251779e07adb633nvd
- git.kernel.org/stable/c/9cd1e566676bbcb8a126acd921e4e194e6339603nvd
- git.kernel.org/stable/c/b278570e2c59d538216f8b656e97680188a8fba4nvd
- git.kernel.org/stable/c/d206f79d9cd658665b37ce8134c6ec849ac7af0cnvd
News mentions
0No linked articles in our index yet.