{"id":"CVE-2026-68147","aliases":["CVE-2026-68147"],"related":[],"kind":"vulnerability","state":"published","title":"fscrypt: Avoid dynamic allocation in fscrypt_get_devices()","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nfscrypt: Avoid dynamic allocation in fscrypt_get_devices()\n\nWhen a blk_crypto_key starts being used or is evicted, fs/crypto/ calls\nfscrypt_get_devices() to get the filesystem's list of block devices,\nthen iterates over them and calls blk_crypto_config_supported(),\nblk_crypto_start_using_key(), or blk_crypto_evict_key() on each one.\n\nCurrently, the block device pointers are placed in a dynamically\nallocated array.  This dynamic allocation is problematic because:\n\n- It can fail, especially at the fscrypt_destroy_inline_crypt_key() call\n  site when it's invoked for inode eviction under direct reclaim.\n\n- fscrypt_destroy_inline_crypt_key() doesn't handle the failure.  It\n  just zeroizes and frees the blk_crypto_key without calling\n  blk_crypto_evict_key().  That causes a use-after-free.\n\nFor now, let's fix this in the straightforward and easily-backportable\nway by switching to an on-stack array.  Currently the fscrypt\nmulti-device functionality is used only by f2fs, which has a hardcoded\nlimit of 8 block devices.  An on-stack array works fine for that.\n\n(Of course, this solution won't scale up to large number of block\ndevices.  For that we'd need a different solution, like moving the block\ndevice iteration into the filesystem.  Or in the case of btrfs, which\nwill only support blk-crypto-fallback, we should make it just call\nblk-crypto-fallback directly, so the block devices won't be needed.)","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nfscrypt: Avoid dynamic allocation in fscrypt_get_devices()\n\nWhen a blk_crypto_key starts being used or is evicted, fs/crypto/ calls\nfscrypt_get_devices() to get the filesystem's list of block devices,\nthen iterates over them and calls blk_crypto_config_supported(),\nblk_crypto_start_using_key(), or blk_crypto_evict_key() on each one.\n\nCurrently, the block device pointers are placed in a dynamically\nallocated array.  This dynamic allocation is problematic because:\n\n- It can fail, especially at the fscrypt_destroy_inline_crypt_key() call\n  site when it's invoked for inode eviction under direct reclaim.\n\n- fscrypt_destroy_inline_crypt_key() doesn't handle the failure.  It\n  just zeroizes and frees the blk_crypto_key without calling\n  blk_crypto_evict_key().  That causes a use-after-free.\n\nFor now, let's fix this in the straightforward and easily-backportable\nway by switching to an on-stack array.  Currently the fscrypt\nmulti-device functionality is used only by f2fs, which has a hardcoded\nlimit of 8 block devices.  An on-stack array works fine for that.\n\n(Of course, this solution won't scale up to large number of block\ndevices.  For that we'd need a different solution, like moving the block\ndevice iteration into the filesystem.  Or in the case of btrfs, which\nwill only support blk-crypto-fallback, we should make it just call\nblk-crypto-fallback directly, so the block devices won't be needed.)","source":"cvelist"}],"published":"2026-08-10T11:59:12.308Z","modified":"2026-11-30T16:13:21.673Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"}],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"22e9947a4b2ba255888541bd0111cf00b9b16586","fixed":"bab016bb80d74a9d1f7d4121a7fc1cb529b470e0","status":"affected"},{"type":"git","introduced":"22e9947a4b2ba255888541bd0111cf00b9b16586","fixed":"4462ac3d90e897dda52ce4b6af2d526ddae835a8","status":"affected"},{"type":"git","introduced":"22e9947a4b2ba255888541bd0111cf00b9b16586","fixed":"97a688563be71ec6fefc071aff69a66c69dbe244","status":"affected"},{"type":"git","introduced":"22e9947a4b2ba255888541bd0111cf00b9b16586","fixed":"81ea8e8221853950c47dac7164f27c63a96f8f86","status":"affected"},{"type":"git","introduced":"22e9947a4b2ba255888541bd0111cf00b9b16586","fixed":"bc2d630296e0e049210ec05ff08459a6893ae749","status":"affected"},{"type":"git","introduced":"22e9947a4b2ba255888541bd0111cf00b9b16586","fixed":"6fe4e4b8259e1330945b5f3c9476e08473b8e0e8","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.1","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.1","status":"unaffected"},{"type":"semver","introduced":"6.1.183","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.148","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.101","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.42","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.1.6","lastAffected":"7.1.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.2","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/bab016bb80d74a9d1f7d4121a7fc1cb529b470e0","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/4462ac3d90e897dda52ce4b6af2d526ddae835a8","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/97a688563be71ec6fefc071aff69a66c69dbe244","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/81ea8e8221853950c47dac7164f27c63a96f8f86","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/bc2d630296e0e049210ec05ff08459a6893ae749","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/6fe4e4b8259e1330945b5f3c9476e08473b8e0e8","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-68147","url":"https://www.cve.org/CVERecord?id=CVE-2026-68147","licence":"CVE Terms of Use","modified":"2026-08-19T16:30:11.166Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-68147","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-68147","licence":"Public domain","modified":"2026-11-30T16:13:21.673Z"}],"updatedAt":"2026-11-30T16:17:31.966Z","epss":{"score":0.00135,"percentile":0.03172,"date":"2026-12-01T12:00:22.000Z"}}