# CVE-2026-99040: KEYS: Fix add\_key() race with keyring restriction

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** UNSCORED
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **EPSS:** 0.24% (percentile 9, 2026-11-26)
- **Published:** 2026-10-23T12:21:59.288Z
- **Modified:** 2026-10-30T13:21:41.200Z

## Who should check

- Anyone running Linux \>= 5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c, \< 24806fc9bca28fa1433bf938d1424dcb45d80e50; \>= 5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c, \< 9a5c2700336878465a630804a2d21864f22eca9c; \>= 5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c, \< b3e404550dc2b7f3d4bb64b1da8005a1fa9a798d; \>= 5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c, \< 305f1828b871dd46bf41addeb6f11d2c162dcb25; \>= 5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c, \< f99399b48e3edd6851fac34cd329bab9f1f33baf; \>= 5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c, \< 11516a0c402a6c1fa52254aa70d8d65fb921e59e; \>= 5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c, \< da0b595d8e6e2dd798f6e34e09dc51a13b888514; \>= 5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c, \< dd3ea3fcba7c75493760cdbccd35f029597e8d5e
- Anyone running Linux 4.7

## Description

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.

## Affected and fixed versions

- Linux: \>= 5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c, \< 24806fc9bca28fa1433bf938d1424dcb45d80e50; \>= 5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c, \< 9a5c2700336878465a630804a2d21864f22eca9c; \>= 5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c, \< b3e404550dc2b7f3d4bb64b1da8005a1fa9a798d; \>= 5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c, \< 305f1828b871dd46bf41addeb6f11d2c162dcb25; \>= 5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c, \< f99399b48e3edd6851fac34cd329bab9f1f33baf; \>= 5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c, \< 11516a0c402a6c1fa52254aa70d8d65fb921e59e; \>= 5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c, \< da0b595d8e6e2dd798f6e34e09dc51a13b888514; \>= 5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c, \< dd3ea3fcba7c75493760cdbccd35f029597e8d5e (cvelist)
- Linux: 4.7 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-99040. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-99040.md
Affected: Linux >= 5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c, < 24806fc9bca28fa1433bf938d1424dcb45d80e50; >= 5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c, < 9a5c2700336878465a630804a2d21864f22eca9c; >= 5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c, < b3e404550dc2b7f3d4bb64b1da8005a1fa9a798d; >= 5ac7eace2d00eab5ae0e9fd…
Fixed in: Linux 24806fc9bca28fa1433bf938d1424dcb45d80e50, Linux 9a5c2700336878465a630804a2d21864f22eca9c, Linux 305f1828b871dd46bf41addeb6f11d2c162dcb25, Linux 11516a0c402a6c1fa52254aa70d8d65fb921e59e

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-99040 being exploited?

There is no confirmed exploitation: CVE-2026-99040 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.24% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2026-99040?

It has no CVSS score yet. Unknown.

### Which versions are affected by CVE-2026-99040?

Linux \>= 5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c, \< 24806fc9bca28fa1433bf938d1424dcb45d80e50; \>= 5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c, \< 9a5c2700336878465a630804a2d21864f22eca9c; \>= 5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c, \< b3e404550dc2b7f3d4bb64b1da8005a1fa9a798d; \>= 5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c, \< 305f1828b871dd46bf41addeb6f11d2c162dcb25; \>= 5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c, \< f99399b48e3edd6851fac34cd329bab9f1f33baf; \>= 5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c, \< 11516a0c402a6c1fa52254aa70d8d65fb921e59e; \>= 5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c, \< da0b595d8e6e2dd798f6e34e09dc51a13b888514; \>= 5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c, \< dd3ea3fcba7c75493760cdbccd35f029597e8d5e; Linux 4.7.

### Is there a fix for CVE-2026-99040?

Yes. Fixed in Linux 24806fc9bca28fa1433bf938d1424dcb45d80e50, Linux 9a5c2700336878465a630804a2d21864f22eca9c, Linux 305f1828b871dd46bf41addeb6f11d2c162dcb25, Linux 11516a0c402a6c1fa52254aa70d8d65fb921e59e. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2026-99040?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- other: <https://git.kernel.org/stable/c/24806fc9bca28fa1433bf938d1424dcb45d80e50>
- other: <https://git.kernel.org/stable/c/9a5c2700336878465a630804a2d21864f22eca9c>
- other: <https://git.kernel.org/stable/c/b3e404550dc2b7f3d4bb64b1da8005a1fa9a798d>
- other: <https://git.kernel.org/stable/c/305f1828b871dd46bf41addeb6f11d2c162dcb25>
- other: <https://git.kernel.org/stable/c/f99399b48e3edd6851fac34cd329bab9f1f33baf>
- other: <https://git.kernel.org/stable/c/11516a0c402a6c1fa52254aa70d8d65fb921e59e>
- other: <https://git.kernel.org/stable/c/da0b595d8e6e2dd798f6e34e09dc51a13b888514>
- other: <https://git.kernel.org/stable/c/dd3ea3fcba7c75493760cdbccd35f029597e8d5e>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-99040>

HTML: <https://flawdb.com/CVE-2026-99040> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-99040>
