Search CVEs and advisories

Search CVEs and Linux security advisories by vendor, product, package, or severity, and see which vulnerabilities each advisory addresses.

CVE

CVE-2022-49899

published high CVSS 3.1 · 7.8

fscrypt: stop using keyrings subsystem for fscrypt_master_key

Published
01 May 2025, 14:10:45 UTC
Updated
05 Aug 2026, 08:56:37 UTC
Language
en

Package status and fixes

Distro / vendorReleasePackage / productPublisher statusFixed buildSource
Linux — Linux22d94f493bfb408fdd764f7b1d0363af2122fba5 to < 391cceee6d435e616f68631e68f5b32d480b1e67 · 22d94f493bfb408fdd764f7b1d0363af2122fba5 to < e6f4fd85ef1ee6ab356bfbd64df28c1cb73aee7e · 22d94f493bfb408fdd764f7b1d0363af2122fba5 to < 68d15d6558a386f46d815a6ac39edecad713a1bf · 22d94f493bfb408fdd764f7b1d0363af2122fba5 to < d7e7b9af104c7b389a0c21eb26532511bce4b510 · Other versions: unaffected Affected Not stated Linux
Linux — Linux5.4 (affected) · 0 to < 5.4 (unaffected · semver) · 5.10.154 through 5.10.* (unaffected · semver) · 5.15.78 through 5.15.* (unaffected · semver) · 6.0.8 through 6.0.* (unaffected · semver) · 6.1 and later (unaffected · original_commit_for_fix) · Other versions: affected Version-specific Not stated Linux
Amazon Linux AL2 Release evaluation Not Affected; No Fix Planned Not stated Amazon Linux assessment
Amazon Linux AL2 Release evaluationALAS2KERNEL-5.10-2022-023 Fixed Not stated Amazon Linux assessment
Amazon Linux AL2 Release evaluationALAS2KERNEL-5.15-2022-011 Fixed Not stated Amazon Linux assessment
Amazon Linux AL2023 Release evaluation Not Affected Not required Amazon Linux assessment
Amazon Linux AL2 kernelaarch64 Listed in advisory Not stated ALAS2KERNEL-5.10-2022-023
Amazon Linux AL2 kernelaarch64 Listed in advisory Not stated ALAS2KERNEL-5.15-2022-011
Show 6 more entries
Distro / vendorReleasePackage / productPublisher statusFixed buildSource
Amazon Linux AL2 kerneli686 Listed in advisory Not stated ALAS2KERNEL-5.10-2022-023
Amazon Linux AL2 kerneli686 Listed in advisory Not stated ALAS2KERNEL-5.15-2022-011
Amazon Linux AL2 kernelsrc Listed in advisory Not stated ALAS2KERNEL-5.10-2022-023
Amazon Linux AL2 kernelsrc Listed in advisory Not stated ALAS2KERNEL-5.15-2022-011
Amazon Linux AL2 kernelx86_64 Listed in advisory Not stated ALAS2KERNEL-5.10-2022-023
Amazon Linux AL2 kernelx86_64 Listed in advisory Not stated ALAS2KERNEL-5.15-2022-011

Description

In the Linux kernel, the following vulnerability has been resolved: fscrypt: stop using keyrings subsystem for fscrypt_master_key The approach of fs/crypto/ internally managing the fscrypt_master_key structs as the payloads of "struct key" objects contained in a "struct key" keyring has outlived its usefulness. The original idea was to simplify the code by reusing code from the keyrings subsystem. However, several issues have arisen that can't easily be resolved: - When a master key struct is destroyed, blk_crypto_evict_key() must be called on any per-mode keys embedded in it. (This started being the case when inline encryption support was added.) Yet, the keyrings subsystem can arbitrarily delay the destruction of keys, even past the time the filesystem was unmounted. Therefore, currently there is no easy way to call blk_crypto_evict_key() when a master key is destroyed. Currently, this is worked around by holding an extra reference to the filesystem's request_queue(s). But it was overlooked that the request_queue reference is *not* guaranteed to pin the corresponding blk_crypto_profile too; for device-mapper devices that support inline crypto, it doesn't. This can cause a use-after-free. - When the last inode that was using an incompletely-removed master key is evicted, the master key removal is completed by removing the key struct from the keyring. Currently this is done via key_invalidate(). Yet, key_invalidate() takes the key semaphore. This can deadlock when called from the shrinker, since in fscrypt_ioctl_add_key(), memory is allocated with GFP_KERNEL under the same semaphore. - More generally, the fact that the keyrings subsystem can arbitrarily delay the destruction of keys (via garbage collection delay, or via random processes getting temporary key references) is undesirable, as it means we can't strictly guarantee that all secrets are ever wiped. - Doing the master key lookups via the keyrings subsystem results in the key_permission LSM hook being called. fscrypt doesn't want this, as all access control for encrypted files is designed to happen via the files themselves, like any other files. The workaround which SELinux users are using is to change their SELinux policy to grant key search access to all domains. This works, but it is an odd extra step that shouldn't really have to be done. The fix for all these issues is to change the implementation to what I should have done originally: don't use the keyrings subsystem to keep track of the filesystem's fscrypt_master_key structs. Instead, just store them in a regular kernel data structure, and rework the reference counting, locking, and lifetime accordingly. Retain support for RCU-mode key lookups by using a hash table. Replace fscrypt_sb_free() with fscrypt_sb_delete(), which releases the keys synchronously and runs a bit earlier during unmount, so that block devices are still available. A side effect of this patch is that neither the master keys themselves nor the filesystem keyrings will be listed in /proc/keys anymore. ("Master key users" and the master key users keyrings will still be listed.) However, this was mostly an implementation detail, and it was intended just for debugging purposes. I don't know of anyone using it. This patch does *not* change how "master key users" (->mk_users) works; that still uses the keyrings subsystem. That is still needed for key quotas, and changing that isn't necessary to solve the issues listed above. If we decide to change that too, it would be a separate patch. I've marked this as fixing the original commit that added the fscrypt keyring, but as noted above the most important issue that this patch fixes wasn't introduced until the addition of inline encryption support.

en · Linux · cna

Vendor advisories explicitly linked to this CVE.

2

Assessment

CVSS risk assessment and additional context for this vulnerability.

CVSS version
3.1
Base score
7.8 / 10
Severity
high
Provider
Linux · cna
Vector string
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Scenarios
en: AV:L - The vulnerability is reached via local filesystem ioctls (FS_IOC_ADD_ENCRYPTION_KEY / FS_IOC_REMOVE_ENCRYPTION_KEY) on ext4/f2fs/ubifs, not via network packet processing. AC:L - An attacker can reliably drive both the deadlock (add_key under key->sem with GFP_KERNEL vs shrinker key_invalidate) and the UAF setup (populate per-mode inline-crypt keys, then trigger destruction after dm tears down the crypto profile); success does not depend on conditions outside attacker influence on typical Android-like fscrypt+inlinecrypt+dm deployments. PR:L - v2 master keys (FSCRYPT_KEY_SPEC_TYPE_IDENTIFIER) can be added and removed by unprivileged users with no capabilities; only directory ownership is needed to set an encryption policy and exercise the vulnerable key lifetime paths. UI:N - Exploitation requires no separate victim action; the attacker issues the ioctls and I/O themselves on an already-mounted encrypted-capable filesystem. S:U - Impact remains within the local kernel/OS authority (DoS or privilege escalation in the same security domain); this is not a VM/IOMMU/sandbox boundary escape. C:H - The bug includes a use-after-free of struct blk_crypto_profile during blk_crypto_evict_key(); UAF of this heap object can be leveraged for arbitrary kernel memory disclosure. I:H - The freed blk_crypto_profile contains ll_ops function pointers (e.g. keyslot_evict) invoked on the UAF path, enabling heap reuse and control-flow hijacking / arbitrary write primitives. A:H - The UAF can oops/panic the kernel, and the separately fixed shrinker-vs-key-semaphore deadlock can hang the system, so availability impact is high.

Additional Assessments

Additional normalized CVSS assessments
VersionScoreSeverityProviderVectorScenarios
3.1 5.5 medium CISA-ADP · adp CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H —

Publisher product statements

Version ranges and default statuses as reported by each provider.

Affected vendor and product assertions
VendorProductVersion statusSource
Linux Linux 22d94f493bfb408fdd764f7b1d0363af2122fba5 to < 391cceee6d435e616f68631e68f5b32d480b1e67 (affected · git)22d94f493bfb408fdd764f7b1d0363af2122fba5 to < e6f4fd85ef1ee6ab356bfbd64df28c1cb73aee7e (affected · git)22d94f493bfb408fdd764f7b1d0363af2122fba5 to < 68d15d6558a386f46d815a6ac39edecad713a1bf (affected · git)22d94f493bfb408fdd764f7b1d0363af2122fba5 to < d7e7b9af104c7b389a0c21eb26532511bce4b510 (affected · git)Default: unaffected Linux · cna
Linux Linux 5.4 (affected)0 to < 5.4 (unaffected · semver)5.10.154 through 5.10.* (unaffected · semver)5.15.78 through 5.15.* (unaffected · semver)6.0.8 through 6.0.* (unaffected · semver)6.1 and later (unaffected · original_commit_for_fix)Default: affected Linux · cna

Weaknesses

1
  • CWE-noinfo Not enough information (CISA-ADP · adp)

References

4

Provider assertions

2

Linux · cna

fscrypt: stop using keyrings subsystem for fscrypt_master_key

CISA-ADP · adp

CISA ADP Vulnrichment

Provenance

Schema
5.2
Searchable
yes
Content hash
1fc9bd3b4b1551c1d5ea5e4e5cafca84880c4d633c1c4ac8464a2ef7403722a4
Ingested
23 Sep 2026, 08:04:21 UTC
Source record
Official CVE record

Search filters

Match options apply to free text. CVE words match tokens; use contains:"…" for literal substrings.

Text

Words and phrases
buffer overflow "remote code execution"
Word prefix
auth*
Literal substring (title or description)
contains:"use-after-free"
Exclude a term or filter
-test -vendor:example

Affected product

Vendor
vendor:Example
Product
product:"Demo Widget"

Severity and score

Severity · none, low, medium, high, critical, unknown
severity:critical
CWE identifier
cwe:CWE-863
CVSS score (0–10)
cvss:>=7.0

Dates and status

Published date · comparisons, relative days
published:>=2026-01-01
Updated date · comparisons, relative days
updated:<30d
Status · published (default), rejected, unknown
status:rejected