fscrypt: Fix missing barrier in fscrypt_find_mode_key()
- CVE-2026-99909
- GHSA-r784-8f26-3964
- EUVD-2026-138397
Description
Show the whole descriptionHide the whole description
In the Linux kernel, the following vulnerability has been resolved: fscrypt: Fix missing barrier in fscrypt_find_mode_key() fscrypt_find_mode_key() walks an RCU list and hands out a per-mode key without an acquire: setup task ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ setup_per_mode_enc_key() ├─ fscrypt_prepare_key() │ └─ fscrypt_prepare_inline_crypt_key() │ └─ blk_crypto_start_using_key() │ └─ blk_crypto_fallback_start_using_mode() │ ├─ init profile, keyslots, tfms[] │ └─ smp_store_release(tfms_inited[mode]) # init order └─ list_add_tail_rcu(&new_node->link, ...) # release -> finder finding task (later submits the I/O itself) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fscrypt_find_mode_key() ├─ list_for_each_entry_rcu(node, ...) └─ return &node->key # no acquire, chain breaks ... blk_crypto_fallback_bio_prep() # WRITE path ├─ tfms_inited[mode] # addr-dep, reads true ├─ blk_crypto_fallback_profile # no dependency ├─ blk_crypto_keyslots # no dependency └─ slotp->tfms[mode] # no dependency RCU publishes the node and the key reachable from it, so tfms_inited[mode] reads true through the address dependency. The independent fallback globals are not covered by it and can be read as uninitialized. On a weakly ordered machine, a WRITE bio can crash in blk_crypto_get_keyslot() or crypto_sync_skcipher_setkey(). Other tasks reach the key through fscrypt_inode_info's cmpxchg_release()/smp_load_acquire(), which is already ordered after the list walk; only the finding task's own later I/O was not. Fix this by upgrading the control dependency to an acquire with smp_acquire__after_ctrl_dep() once a matching entry has been found.
Text from the CVE.org record.
Recommendation
Linux
- If you run 6.18.xupdate to 6.18.63 or laterPatch update: breaking changes are unlikely
- If you run 6.12.xupdate to 6.12.117 or laterPatch update: breaking changes are unlikely
Some affected versions have no stated fix.
Taken from the version ranges of the CVE.org record. Check the vendor advisory: nothing is said about versions the ranges do not list. Breaking-change risk is read from the version numbers only.
Affected
Linux
Affected versions Fixed in from 6.18.39 to before 6.18.63 6.18.63 from 6.12.97 to before 6.12.117 6.12.117 from 7.1.3 to before 7.2 none stated 7.2 none stated before 7.2: not affected none stated from 6.12.117 up to 6.12.*: not affected none stated from 6.18.63 up to 6.18.*: not affected none stated from 7.3.4 up to 7.3.*: not affected none stated and 1 more
Product versions from the CVE.org record.
Timeline
- Published
Related news
No article from the followed outlets names this vulnerability.