KernelScan.io

HIGH Introduced in 5.7

keys KeyType UAF

CVE-2026-99222

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: Protect the read method check against type removal keyctl_read_key() checks key->type->read without holding key->sem. A reference keeps the key alive, but does not pin the module containing its type. A surviving RxRPC key can therefore be read while AF_RXRPC is being unloaded: KEYCTL_READ task Module unload and key GC ---------------- ------------------------ lookup_user_key() permission / possession checks load key->type af_rxrpc_exit() unregister_key_type() GC: down_write(key->sem) GC: retype to key_type_dead GC: up_write(key->sem) unregister_key_type() returns free_module() read saved type's read member The final access can read freed module storage. The read invocation in __keyctl_read_key() is already protected by key->sem, but the earlier method check is outside that critical section. Move the method check into __keyctl_read_key(), after key_validate() and under its existing read hold on key->sem. The check and invocation then use the same protected type for length queries and every read retry. The GC cannot retype the key until the semaphore is released, and type unregistration waits for that GC pass before the module can be freed. Return -EOPNOTSUPP when validation succeeds and the type has no read method. A temporary buffer may now be allocated before this result; allocation and copying to userspace remain outside the semaphore.

02

Engine v0.9.0

Risk summary

A local attacker with access to a readable key (such as an RxRPC key) can race with module unload to trigger a use-after-free in the kernel's key management subsystem. Successful exploitation allows reading or writing freed kernel memory, leading to privilege escalation, information disclosure, or kernel crash. The vulnerability affects all kernels from v5.7 onward where the AF_RXRPC or similar key-type modules can be loaded and unloaded.

Affectedsecurity/keys/keyctl.c (keys subsystem)

Vulnerability analysis

The key reading system call checked whether a key's type supported reading without holding the key's lock. A reference to the key keeps the key object alive but does not prevent the kernel module containing the key type from being unloaded. If the module is unloaded while a thread is between the check and the actual read, the key's type pointer is changed to a dead type and the module's memory is freed. The thread then dereferences a function pointer in freed memory, causing a use-after-free. The fix moves the method check inside the critical section protected by the key's lock, ensuring the type cannot be changed or freed while the read is in progress.

03

BranchIntroducedFixed inPatch commit
4.144.14.1774.15e5f830ae6611
4.194.19.1184.20ff11cfed85cb
5.105.75.10.2736a36e2a1a017
5.155.75.15.2243edc064069d0
5.45.4.355.51486caee47b4
5.65.6.75.7ff44f1b303aa
6.15.76.1.191cf1af7df80e3
6.125.76.12.115925c84e3cc21
6.185.76.18.60—
6.65.76.6.161e2a2deda08d9
7.25.77.2.14—
7.35.77.3.1—
mainline5.77.4-rc1—

04

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

CIP treeState
cip/6.12Affected — no CIP fix yet (latest 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-cip136)
cip/4.19-rtAffected — no CIP fix yet (latest 4.19.325-cip136-rt50)