HIGH Introduced in 2.6.30
keys KeyUser UAF
CVE-2026-99226
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
01Description
In the Linux kernel, the following vulnerability has been resolved: keys: Avoid the owner account dereference in named keyring lookup Named keyring lookup must keep the storage containing the owner UID alive through the namespace mapping check. find_keyring_by_name() reads keyring->user->uid under keyring_name_lock, but that lock protects the keyring's name entry and allocation, not its separate key_user. A named session-keyring join can overlap a privileged KEYCTL_CHOWN on another CPU. If the keyring holds the last reference to its old dynamic key_user and the ownership transfer succeeds, the following ordering is possible: Named join Chown find_keyring_by_name() keyctl_chown_key() read_lock(keyring_name_lock) down_write(key->sem) load old keyring->user replace key->user and key->uid up_write(key->sem) key_put(key) key_user_put(old user): free read old user->uid read_unlock(keyring_name_lock) Chown neither takes keyring_name_lock nor key_session_mutex, so it can free the old account between the pointer load and the UID read. The lookup then reads freed memory even though the keyring itself is alive. Use keyring->uid for the mapping check. key_alloc() initializes this inline owner UID and keyctl_chown_key() updates it on chown. The existing name lock keeps its containing keyring allocated throughout the check, so lookup no longer depends on the account's lifetime. This also matches the owner UID used by the permission check. KASAN report as below: BUG: KASAN: slab-use-after-free in find_keyring_by_name+0x577/0x5d0 Read of size 4 at addr ffff8881128ae2ec by task keycase/500
02KernelScan AI Analysis
Risk summary
A local unprivileged user can trigger a use-after-free read in the kernel's keyring subsystem by racing a named session keyring join against a privileged ownership change (KEYCTL_CHOWN). The bug allows reading freed kernel heap memory, potentially leaking kernel pointers (defeating KASLR) or escalating to arbitrary write with heap grooming. The vulnerability affects all Linux kernels from 2.6.30 onward and is reachable from containers and user namespaces.
Vulnerability analysis
The kernel's named keyring lookup reads the owner UID via a pointer to a separate key_user structure while holding only the keyring name lock. That lock protects the keyring object itself but not the key_user, which can be freed by a concurrent KEYCTL_CHOWN operation that replaces the key's ownership. If the chown completes and drops the last reference to the old key_user between the lookup loading the pointer and dereferencing it for the UID, the lookup reads freed memory. The fix changes the lookup to use the keyring's inline uid field, which is updated atomically with the chown and remains valid for the keyring's lifetime, eliminating the dependency on the key_user's lifetime. An unprivileged local user can trigger the vulnerable path via keyctl(KEYCTL_JOIN_SESSION_KEYRING); the race window requires a concurrent privileged chown (CAP_SYS_ADMIN in the relevant user namespace), which a compromised service or a user-namespace root could provide.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 5.10 | 2.6.30 | 5.10.273 | 77249d4b1bb5 |
| 5.15 | 2.6.30 | 5.15.224 | 0b865fa477d9 |
| 6.1 | 2.6.30 | 6.1.191 | 6763329f673d |
| 6.12 | 2.6.30 | 6.12.115 | c9664f780f86 |
| 6.18 | 2.6.30 | 6.18.60 | b0830a26e2c3 |
| 6.6 | 2.6.30 | 6.6.161 | aa03c8fb4334 |
| 7.2 | 2.6.30 | 7.2.14 | 5c6a9512887a |
| 7.3 | 2.6.30 | 7.3.1 | 40b12b93ae4a |
| mainline | 2.6.30 | 7.4-rc1 | 51409aaa01f8 |
| cip/6.12 | 2.6.30 | 6.12.117-cip35 | c9664f780f86 |
04CIP Kernels
State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.
| CIP tree | State |
|---|---|
| cip/6.12 | Fixed in 6.12.117-cip35 |
| cip/6.1 | Affected — no CIP fix yet (latest 6.1.190-cip62) |
| cip/6.1-rt | Affected — no CIP fix yet (latest 6.1.189-cip61-rt32) |
| cip/5.10 | Affected — no CIP fix yet (latest 5.10.272-cip79) |
| cip/5.10-rt | Affected — no CIP fix yet (latest 5.10.272-cip79-rt35) |
| cip/4.19 | Affected — no CIP fix yet (latest 4.19.325-cip137) |
| cip/4.19-rt | Affected — no CIP fix yet (latest 4.19.325-cip137-rt51) |
| cip/4.4 | Affected — no CIP fix yet (latest 4.4.302-cip116) |
| cip/4.4-rt | Affected — no CIP fix yet (latest 4.4.302-cip115-rt63) |