HIGH Introduced in 4.7
keys KeyringRestriction Race
CVE-2026-99040
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
01Description
In the Linux kernel, the following vulnerability has been resolved: KEYS: Fix add_key() race with keyring restriction __key_create_or_update() snapshots keyring->restrict_link before taking the destination keyring's semaphore. keyring_restrict() installs a restriction while holding that semaphore. This allows a writer to observe no restriction, wait for the keyring owner to install a reject-all restriction and return successfully, and then link a key using the stale NULL snapshot. The writer only needs write permission on the destination keyring. Move the restrict_link read after __key_link_lock() and __key_link_begin(). The read and the subsequent restriction check are then serialized with restriction installation by keyring->sem. The race was reproduced on v7.2.8 in 19 executions where restriction installation returned before the link completed. All 19 linked the key despite the reject-all restriction. With this change, 312 executions reached the same ordering and every add_key() call failed with -EPERM. The issue was found by manual concurrency analysis assisted by AI-based analysis and independently verified with a QEMU reproducer and kernel instrumentation.
02KernelScan AI Analysis
Risk summary
A local user with write access to a keyring can exploit a race condition to bypass a reject-all restriction installed by the keyring owner. This allows unauthorized keys to be added to restricted keyrings, potentially compromising system integrity mechanisms such as module signature verification or IMA appraisal.
Vulnerability analysis
The kernel's key management subsystem lets keyrings enforce a restriction that vets new keys before they are added. In the vulnerable code, the code path for adding a key reads the restriction setting before locking the keyring, while the operation that installs a restriction does so while holding that lock. This creates a window where a process with write access to the keyring can see no restriction, wait for the keyring owner to activate a reject-all restriction, and then add a key using the outdated view. The fix moves the restriction check inside the locked section so it stays in sync with any restriction changes. Any local user who has write permission on a keyring — including unprivileged users in containers or on multi-tenant systems — can exploit this race when the keyring owner enables a restriction.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 5.10 | 4.7 | 5.10.273 | 24806fc9bca2 |
| 5.15 | 4.7 | 5.15.224 | 9a5c27003368 |
| 6.1 | 4.7 | 6.1.191 | b3e404550dc2 |
| 6.12 | 4.7 | 6.12.113 | f99399b48e3e |
| 6.18 | 4.7 | 6.18.57 | 11516a0c402a |
| 6.6 | 4.7 | 6.6.160 | 305f1828b871 |
| 7.2 | 4.7 | 7.2.11 | da0b595d8e6e |
| mainline | 4.7 | 7.3 | dd3ea3fcba7c |
| cip/6.12 | 4.7 | 6.12.114-cip34 | f99399b48e3e |
04CIP Kernels
State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.
| CIP tree | State |
|---|---|
| cip/6.12 | Fixed in 6.12.114-cip34 |
| cip/6.1 | Affected — no CIP fix yet (latest 6.1.190-cip62) |
| cip/6.1-rt | Affected — no CIP fix yet (latest 6.1.189-cip61-rt32) |
| cip/5.10 | Affected — no CIP fix yet (latest 5.10.272-cip79) |
| cip/5.10-rt | Affected — no CIP fix yet (latest 5.10.272-cip79-rt35) |
| cip/4.19 | Affected — no CIP fix yet (latest 4.19.325-cip137) |
| cip/4.19-rt | Affected — no CIP fix yet (latest 4.19.325-cip136-rt50) |