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

fscrypt: Avoid dynamic allocation in fscrypt_get_devices()

When a blk_crypto_key starts being used or is evicted, fs/crypto/ calls
fscrypt_get_devices() to get the filesystem's list of block devices,
then iterates over them and calls blk_crypto_config_supported(),
blk_crypto_start_using_key(), or blk_crypto_evict_key() on each one.

Currently, the block device pointers are placed in a dynamically
allocated array. This dynamic allocation is problematic because:

- It can fail, especially at the fscrypt_destroy_inline_crypt_key() call
site when it's invoked for inode eviction under direct reclaim.

- fscrypt_destroy_inline_crypt_key() doesn't handle the failure. It
just zeroizes and frees the blk_crypto_key without calling
blk_crypto_evict_key(). That causes a use-after-free.

For now, let's fix this in the straightforward and easily-backportable
way by switching to an on-stack array. Currently the fscrypt
multi-device functionality is used only by f2fs, which has a hardcoded
limit of 8 block devices. An on-stack array works fine for that.

(Of course, this solution won't scale up to large number of block
devices. For that we'd need a different solution, like moving the block
device iteration into the filesystem. Or in the case of btrfs, which
will only support blk-crypto-fallback, we should make it just call
blk-crypto-fallback directly, so the block devices won't be needed.)
Published: 2026-08-10
Score: n/a
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The fault lies in the fscrypt subsystem of the Linux kernel, where a dynamically allocated array is used to store block–device pointers during key usage or eviction. The allocation can fail, and the code does not detect this failure; when the key is subsequently destroyed, the code attempts to free the unused array without having performed the proper eviction call, leading to a use‑after‑free situation. If an attacker can induce the eviction path (for instance, by manipulating file‑system quanta or triggering inline key destruction), they could corrupt kernel memory, potentially resulting in local privilege escalation or denial of service.

Affected Systems

The defect exists in any Linux kernel image that has not yet incorporated the commit that replaces the dynamic allocation with an on‑stack array. In practice, the vulnerable path is exercised only when the f2fs filesystem is present, as it is the only filesystem that currently invokes this multi‑device code. Therefore any system running a pre‑patch kernel with f2fs mounted may be impacted.

Risk and Exploitability

No CVSS score is provided and the EPSS score is unavailable; the vulnerability is not listed in CISA KEV. Nevertheless, a use‑after‑free that can corrupt kernel memory is a high‑impact flaw that can be exploited locally if an attacker can trigger the key eviction workflow. While exploitation requires kernel access, it could allow arbitrary kernel code execution or a forced kernel panic, depending on the attacker’s goals and the system state.

Generated by OpenCVE AI on August 10, 2026 at 14:05 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Apply a Linux kernel update that includes the fscrypt_get_devices fix (the commit identified in the references), which replaces the on‑heap allocation with an on‑stack array.
  • Reboot the system to ensure the updated kernel is active.
  • After reboot, verify that any f2fs filesystems are needed; if not, remount or convert them to another filesystem and monitor kernel logs (e.g., dmesg or journalctl) for signs of memory corruption or panics.

Generated by OpenCVE AI on August 10, 2026 at 14:05 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Mon, 10 Aug 2026 14:30:00 +0000

Type Values Removed Values Added
Weaknesses CWE-416

Mon, 10 Aug 2026 12:30:00 +0000

Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: fscrypt: Avoid dynamic allocation in fscrypt_get_devices() When a blk_crypto_key starts being used or is evicted, fs/crypto/ calls fscrypt_get_devices() to get the filesystem's list of block devices, then iterates over them and calls blk_crypto_config_supported(), blk_crypto_start_using_key(), or blk_crypto_evict_key() on each one. Currently, the block device pointers are placed in a dynamically allocated array. This dynamic allocation is problematic because: - It can fail, especially at the fscrypt_destroy_inline_crypt_key() call site when it's invoked for inode eviction under direct reclaim. - fscrypt_destroy_inline_crypt_key() doesn't handle the failure. It just zeroizes and frees the blk_crypto_key without calling blk_crypto_evict_key(). That causes a use-after-free. For now, let's fix this in the straightforward and easily-backportable way by switching to an on-stack array. Currently the fscrypt multi-device functionality is used only by f2fs, which has a hardcoded limit of 8 block devices. An on-stack array works fine for that. (Of course, this solution won't scale up to large number of block devices. For that we'd need a different solution, like moving the block device iteration into the filesystem. Or in the case of btrfs, which will only support blk-crypto-fallback, we should make it just call blk-crypto-fallback directly, so the block devices won't be needed.)
Title fscrypt: Avoid dynamic allocation in fscrypt_get_devices()
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References

Subscriptions

Linux Linux Kernel
cve-icon MITRE

Status: PUBLISHED

Assigner: Linux

Published:

Updated: 2026-08-10T11:59:12.308Z

Reserved: 2026-07-30T09:28:09.371Z

Link: CVE-2026-68147

cve-icon Vulnrichment

No data.

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-10T14:15:03Z

Weaknesses