{"api_version":"1","generated_at":"2026-10-23T14:31:09+00:00","cve":"CVE-2026-99040","urls":{"html":"https://cve.report/CVE-2026-99040","api":"https://cve.report/api/cve/CVE-2026-99040.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-99040","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-99040"},"summary":{"title":"KEYS: Fix add_key() race with keyring restriction","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nKEYS: Fix add_key() race with keyring restriction\n\n__key_create_or_update() snapshots keyring->restrict_link before taking\nthe destination keyring's semaphore.  keyring_restrict() installs a\nrestriction while holding that semaphore.\n\nThis allows a writer to observe no restriction, wait for the keyring\nowner to install a reject-all restriction and return successfully, and\nthen link a key using the stale NULL snapshot.  The writer only needs\nwrite permission on the destination keyring.\n\nMove the restrict_link read after __key_link_lock() and\n__key_link_begin().  The read and the subsequent restriction check are\nthen serialized with restriction installation by keyring->sem.\n\nThe race was reproduced on v7.2.8 in 19 executions where restriction\ninstallation returned before the link completed.  All 19 linked the key\ndespite the reject-all restriction.  With this change, 312 executions\nreached the same ordering and every add_key() call failed with -EPERM.\n\nThe issue was found by manual concurrency analysis assisted by AI-based\nanalysis and independently verified with a QEMU reproducer and kernel\ninstrumentation.","state":"PUBLISHED","assigner":"Linux","published_at":"2026-10-23 13:17:27","updated_at":"2026-10-23 13:17:27"},"problem_types":[],"metrics":[],"references":[{"url":"https://git.kernel.org/stable/c/11516a0c402a6c1fa52254aa70d8d65fb921e59e","name":"https://git.kernel.org/stable/c/11516a0c402a6c1fa52254aa70d8d65fb921e59e","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/dd3ea3fcba7c75493760cdbccd35f029597e8d5e","name":"https://git.kernel.org/stable/c/dd3ea3fcba7c75493760cdbccd35f029597e8d5e","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/305f1828b871dd46bf41addeb6f11d2c162dcb25","name":"https://git.kernel.org/stable/c/305f1828b871dd46bf41addeb6f11d2c162dcb25","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/f99399b48e3edd6851fac34cd329bab9f1f33baf","name":"https://git.kernel.org/stable/c/f99399b48e3edd6851fac34cd329bab9f1f33baf","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/da0b595d8e6e2dd798f6e34e09dc51a13b888514","name":"https://git.kernel.org/stable/c/da0b595d8e6e2dd798f6e34e09dc51a13b888514","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-99040","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-99040","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c 305f1828b871dd46bf41addeb6f11d2c162dcb25 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c f99399b48e3edd6851fac34cd329bab9f1f33baf git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c 11516a0c402a6c1fa52254aa70d8d65fb921e59e git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c da0b595d8e6e2dd798f6e34e09dc51a13b888514 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c dd3ea3fcba7c75493760cdbccd35f029597e8d5e git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 4.7","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 4.7 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.6.160 6.6.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.12.113 6.12.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.18.57 6.18.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.2.11 7.2.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.3 * original_commit_for_fix","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[],"vendor_comments":[],"enrichments":{"kev":null,"epss":null,"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"cna":{"affected":[{"defaultStatus":"unaffected","product":"Linux","programFiles":["security/keys/key.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"lessThan":"305f1828b871dd46bf41addeb6f11d2c162dcb25","status":"affected","version":"5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c","versionType":"git"},{"lessThan":"f99399b48e3edd6851fac34cd329bab9f1f33baf","status":"affected","version":"5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c","versionType":"git"},{"lessThan":"11516a0c402a6c1fa52254aa70d8d65fb921e59e","status":"affected","version":"5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c","versionType":"git"},{"lessThan":"da0b595d8e6e2dd798f6e34e09dc51a13b888514","status":"affected","version":"5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c","versionType":"git"},{"lessThan":"dd3ea3fcba7c75493760cdbccd35f029597e8d5e","status":"affected","version":"5ac7eace2d00eab5ae0e9fdee63e38aee6001f7c","versionType":"git"}]},{"defaultStatus":"affected","product":"Linux","programFiles":["security/keys/key.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"status":"affected","version":"4.7"},{"lessThan":"4.7","status":"unaffected","version":"0","versionType":"semver"},{"lessThanOrEqual":"6.6.*","status":"unaffected","version":"6.6.160","versionType":"semver"},{"lessThanOrEqual":"6.12.*","status":"unaffected","version":"6.12.113","versionType":"semver"},{"lessThanOrEqual":"6.18.*","status":"unaffected","version":"6.18.57","versionType":"semver"},{"lessThanOrEqual":"7.2.*","status":"unaffected","version":"7.2.11","versionType":"semver"},{"lessThanOrEqual":"*","status":"unaffected","version":"7.3","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.6.160","versionStartIncluding":"4.7","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.12.113","versionStartIncluding":"4.7","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.18.57","versionStartIncluding":"4.7","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.2.11","versionStartIncluding":"4.7","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.3","versionStartIncluding":"4.7","vulnerable":true}],"negate":false,"operator":"OR"}]}],"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nKEYS: Fix add_key() race with keyring restriction\n\n__key_create_or_update() snapshots keyring->restrict_link before taking\nthe destination keyring's semaphore.  keyring_restrict() installs a\nrestriction while holding that semaphore.\n\nThis allows a writer to observe no restriction, wait for the keyring\nowner to install a reject-all restriction and return successfully, and\nthen link a key using the stale NULL snapshot.  The writer only needs\nwrite permission on the destination keyring.\n\nMove the restrict_link read after __key_link_lock() and\n__key_link_begin().  The read and the subsequent restriction check are\nthen serialized with restriction installation by keyring->sem.\n\nThe race was reproduced on v7.2.8 in 19 executions where restriction\ninstallation returned before the link completed.  All 19 linked the key\ndespite the reject-all restriction.  With this change, 312 executions\nreached the same ordering and every add_key() call failed with -EPERM.\n\nThe issue was found by manual concurrency analysis assisted by AI-based\nanalysis and independently verified with a QEMU reproducer and kernel\ninstrumentation."}],"providerMetadata":{"dateUpdated":"2026-10-23T12:21:59.288Z","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux"},"references":[{"url":"https://git.kernel.org/stable/c/305f1828b871dd46bf41addeb6f11d2c162dcb25"},{"url":"https://git.kernel.org/stable/c/f99399b48e3edd6851fac34cd329bab9f1f33baf"},{"url":"https://git.kernel.org/stable/c/11516a0c402a6c1fa52254aa70d8d65fb921e59e"},{"url":"https://git.kernel.org/stable/c/da0b595d8e6e2dd798f6e34e09dc51a13b888514"},{"url":"https://git.kernel.org/stable/c/dd3ea3fcba7c75493760cdbccd35f029597e8d5e"}],"title":"KEYS: Fix add_key() race with keyring restriction","x_generator":{"engine":"bippy-1.2.0"}}},"cveMetadata":{"assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","assignerShortName":"Linux","cveId":"CVE-2026-99040","datePublished":"2026-10-23T12:21:59.288Z","dateReserved":"2026-09-25T10:25:14.387Z","dateUpdated":"2026-10-23T12:21:59.288Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-10-23 13:17:27","lastModifiedDate":"2026-10-23 13:17:27","problem_types":[],"metrics":[],"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"99040","Ordinal":"1","Title":"KEYS: Fix add_key() race with keyring restriction","CVE":"CVE-2026-99040","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"99040","Ordinal":"1","NoteData":"In the Linux kernel, the following vulnerability has been resolved:\n\nKEYS: Fix add_key() race with keyring restriction\n\n__key_create_or_update() snapshots keyring->restrict_link before taking\nthe destination keyring's semaphore.  keyring_restrict() installs a\nrestriction while holding that semaphore.\n\nThis allows a writer to observe no restriction, wait for the keyring\nowner to install a reject-all restriction and return successfully, and\nthen link a key using the stale NULL snapshot.  The writer only needs\nwrite permission on the destination keyring.\n\nMove the restrict_link read after __key_link_lock() and\n__key_link_begin().  The read and the subsequent restriction check are\nthen serialized with restriction installation by keyring->sem.\n\nThe race was reproduced on v7.2.8 in 19 executions where restriction\ninstallation returned before the link completed.  All 19 linked the key\ndespite the reject-all restriction.  With this change, 312 executions\nreached the same ordering and every add_key() call failed with -EPERM.\n\nThe issue was found by manual concurrency analysis assisted by AI-based\nanalysis and independently verified with a QEMU reproducer and kernel\ninstrumentation.","Type":"Description","Title":"KEYS: Fix add_key() race with keyring restriction"}]}}}