KernelScan.io

HIGH Introduced in 3.18

keys TypeName UAF

CVE-2026-99224

CVSS 7.0 / 10.0 NVD

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

KernelScan AI7.0HIGH

01

In the Linux kernel, the following vulnerability has been resolved: keys: Protect the type name while describing a key keyctl_describe_key() must keep the key type's name alive until kasprintf() has consumed it. The retained key reference keeps the key and its description alive, but does not pin the module providing its type. The name is passed to kasprintf() without holding key->sem. kvasprintf() uses the saved name pointer in two formatting passes, with a GFP_KERNEL allocation between them. With AF_RXRPC=m, a task that passes View permission before type retirement can overlap a privileged module unload in this order: 1. KEYCTL_DESCRIBE looks up the key, saves key->type->name in the kasprintf() arguments and completes the first formatting pass. 2. While the formatter is delayed before its second pass, af_rxrpc_exit() calls unregister_key_type(), which removes the type from the registry and waits for key_gc_keytype(). 3. The collector takes key->sem for writing, retypes the retained key to key_type_dead and completes retirement. Unregistration and module exit return, allowing free_module() to release the type and name. 4. The formatter resumes its second pass and reads the saved name from released module storage, which can fault in string(). Hold key->sem for reading across kasprintf(). The collector then cannot retype the key or complete retirement until both formatting passes have finished. If retirement wins the lock first, formatting uses the core key_type_dead name instead. Release the semaphore immediately after kasprintf(), including on allocation failure, before copying to userspace. Oops report as below: BUG: unable to handle page fault for address: fffffbfff8054794 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page RIP: 0010:string+0x23f/0x470 Call Trace: vsnprintf+0x330/0x1110

02

Engine v0.9.0

Risk summary

A local user with a key of a modular type (such as AF_RXRPC) can trigger a use-after-free by racing keyctl_describe_key() with module unload. The kernel reads a freed module's name string during kasprintf() formatting, leading to kernel memory corruption, potential privilege escalation, or denial of service.

Affectedsecurity/keys/keyctl.c (keys subsystem)

Vulnerability analysis

The key description system call reads the key type's name and passes it to a string formatter without proper locking. The formatter works in two passes with a memory allocation between them, creating a window where the scheduler can switch tasks. If a privileged process unloads the kernel module providing that key type during this window, the module's memory — including the type name string — is freed while the formatter still holds a reference to it. When formatting resumes, it reads from the freed memory, causing a kernel crash or memory corruption. The fix acquires the key's lock for reading across the entire formatting operation, preventing the module cleanup from completing until formatting finishes. A local user with view access to a key backed by a loadable module can trigger this race; the module unload requires administrator privileges, but the attacker only needs to race against a legitimate unload operation.

03

BranchIntroducedFixed inPatch commit
5.103.185.10.27319c4de819e52
5.153.185.15.224a49e6c9a1a5b
6.13.186.1.191916667df7695
6.123.186.12.1153c3cfd9e262a
6.183.186.18.606b613747f7ea
6.63.186.6.161dddd3a1ab7d1
7.23.187.2.14dea367df18e3
7.33.187.3.10461bc8f9111
mainline3.187.4-rc1fced7238b7e8

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-cip137)
cip/4.19-rtAffected — no CIP fix yet (latest 4.19.325-cip136-rt50)
cip/4.4Affected — no CIP fix yet (latest 4.4.302-cip115)
cip/4.4-rtAffected — no CIP fix yet (latest 4.4.302-cip115-rt63)