KernelScan.io

HIGH Introduced in 4.7

keys KeyringRestriction Race

CVE-2026-99040

CVSS 7.1 / 10.0 KernelScan AI

CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H

01

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.

02

Engine v0.9.0

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.

Affectedsecurity/keys/key.c (KEYS subsystem)

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.

03

BranchIntroducedFixed inPatch commit
5.104.75.10.27324806fc9bca2
5.154.75.15.2249a5c27003368
6.14.76.1.191b3e404550dc2
6.124.76.12.113f99399b48e3e
6.184.76.18.5711516a0c402a
6.64.76.6.160305f1828b871
7.24.77.2.11da0b595d8e6e
mainline4.77.3dd3ea3fcba7c
cip/6.124.76.12.114-cip34f99399b48e3e

04

State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.

CIP treeState
cip/6.12Fixed in 6.12.114-cip34
cip/6.1Affected — no CIP fix yet (latest 6.1.190-cip62)
cip/6.1-rtAffected — no CIP fix yet (latest 6.1.189-cip61-rt32)
cip/5.10Affected — no CIP fix yet (latest 5.10.272-cip79)
cip/5.10-rtAffected — no CIP fix yet (latest 5.10.272-cip79-rt35)
cip/4.19Affected — no CIP fix yet (latest 4.19.325-cip137)
cip/4.19-rtAffected — no CIP fix yet (latest 4.19.325-cip136-rt50)