Linux Kernel Keyring Flaw: Local Root, No Fix Yet
A local user can become root through a Linux kernel associative-array bug; the fix is not merged and no released kernel carries it.
TL;DR
- A local unprivileged user can corrupt a keyring's associative array and gain root capabilities on Linux kernels that carry the original code. Researcher Daniel Wade published a working exploit on 2026-11-15.
- Every kernel since commit 3cb989501c26 (2013-09-24) is affected in principle. On 2026-11-16, mainline 7.4-rc3 and every stable branch checked still carry the vulnerable code.
- No CVE or CVSS score is assigned, no exploitation in the wild is known, and the flaw is not in CISA KEV as of 2026-11-16.
- No released kernel carries the fix. Apply commit 48691075b0ad if you build your own kernel, and restrict unprivileged AF_ALG sockets, which the researcher says removes the heap oracle the published chain needs.
Am I affected?
All of these must hold for a host to be exposed:
- The running kernel was built from source that does not contain commit 48691075b0ad. On 2026-11-16, that included mainline 7.4-rc3 and every release in the table's stable branches.
- The kernel was built with the keyrings subsystem (
CONFIG_KEYS), which is the default on general-purpose distributions. - An attacker can run code as an unprivileged local user on the host. No capabilities, user namespace or special group is needed.
- Unprivileged
AF_ALGsockets are available, which the published exploit uses as a heap-grooming oracle. Blocking them raises the bar for this chain but does not fix the bug.
The flaw lives in lib/assoc_array.c, the generic associative array that the keyrings code under security/keys/ uses to store keys. Any kernel that carries that file and CONFIG_KEYS is affected in principle. The public exploit is written for one kernel image, so a different build may need different tuning, but the corrupt tree state is not build-specific.
| Branch | Affected versions | Fixed version |
|---|---|---|
| mainline | 7.4-rc3 and earlier | None on 2026-11-16 |
| 7.3.y | 7.3.4 and earlier | None on 2026-11-16 |
| 6.18.y | 6.18.63 and earlier | None on 2026-11-16 |
| 6.12.y | 6.12.117 and earlier | None on 2026-11-16 |
| 6.6.y | 6.6.162 and earlier | None on 2026-11-16 |
| 6.1.y | 6.1.192 and earlier | None on 2026-11-16 |
| 5.15.y | 5.15.225 and earlier | None on 2026-11-16 |
| 5.10.y | 5.10.274 and earlier | None on 2026-11-16 |
| 4.19.y | Every release | None on 2026-11-16 |
Each branch tip in the table was checked on 2026-11-16: each one still declares excised_meta[1], the array the fix enlarges. Distribution kernels need their vendor's changelog, because a vendor can carry the commit without changing the version string.
Check the running kernel:
uname -r
For a kernel you build yourself, check whether the fix is in the tree. The first command prints the fix commit if it is present; the second prints [2] when the fixed header is in place and [1] when it is not:
git -C /path/to/linux log --oneline --all --grep="assoc_array: don't chain a new shortcut"
grep -n 'excised_meta' include/linux/assoc_array_priv.h
Check whether an unprivileged user can open an AF_ALG socket. Run this as the unprivileged user, not as root:
python3 - <<'PY'
import socket
s = socket.socket(socket.AF_ALG, socket.SOCK_SEQPACKET, 0)
print("AF_ALG is available to this user")
s.close()
PY
How do I fix it?
No vendor kernel update exists. The fix is a two-file patch committed to a kernel tree but not merged to mainline. The remediation is to apply it yourself or wait for your distribution.
- If you build your own kernel, apply commit 48691075b0ad, or cherry-pick it onto your branch, and rebuild. The commit changes
include/linux/assoc_array_priv.handlib/assoc_array.c. - If you run a distribution kernel, track the vendor's kernel advisory. No distribution had published a fixed kernel as of 2026-11-16.
- Where you cannot patch, restrict unprivileged access to the
AF_ALGsocket interface. The researcher recommends this because the published chain usesAF_ALGas a heap-grooming oracle. Trade-off: it raises the cost of this particular chain, but the keyring code stays reachable and the bug stays open. - Treat local shell access on an unpatched host as equivalent to root. Trade-off: this is an operational control, not a fix, and it does not help against an attacker who already has an account.
The fix closes the state that the exploit creates. It does not remove the BUG_ON() in assoc_array_apply_edit(), which stays as a guard against a malformed tree.
What is the root cause?
The associative array assumed that a shortcut always leads to a node. Deletion followed by insertion could install one shortcut behind another, a state the walker and the edit accounting do not handle.
lib/assoc_array.c is an RCU-safe radix tree. A node has 16 slots. A shortcut compresses a single-occupant branch into one hop and stores the skipped index bits inline. The design guarantee is that a shortcut's parent is always a node, never another shortcut, because the first shortcut would have absorbed the second one's bits.
Deletion can break that guarantee. When the subtree under a shortcut shrinks enough, assoc_array_delete() collapses it into a single node under the shortcut. A plain node now sits where the shortcut's target used to be.
Insertion can then put a shortcut behind that shortcut. When a full node's leaves and the new key all share the node's segment, assoc_array_insert_into_terminal_node() replaces the node with a shortcut by calling assoc_array_insert_shortcut(). If the node is itself the target of a shortcut, the new shortcut is installed as the old shortcut's next_node.
The vulnerable code sets the new shortcut's back pointer to the node's back pointer, which is the old shortcut:
new_s0->back_pointer = node->back_pointer;
new_s0->parent_slot = node->parent_slot;
new_s0->next_node = assoc_array_node_to_ptr(new_n0);
Two things then go wrong. assoc_array_walk() follows a shortcut by reading shortcut->next_node. When that pointer is another shortcut, the walker treats it as a node and indexes the skipped bits as a slot. A reader then follows a pointer from the wrong level of the tree.
Separately, assoc_array_apply_edit() walks the back pointers to adjust nr_leaves_on_branch. It follows a shortcut's back_pointer and asserts that the result is a node:
if (assoc_array_ptr_is_shortcut(ptr)) {
shortcut = assoc_array_ptr_to_shortcut(ptr);
ptr = shortcut->back_pointer;
if (!ptr)
break;
}
BUG_ON(!assoc_array_ptr_is_node(ptr));
With two chained shortcuts, ptr is a shortcut and the assertion fires. The inserting thread dies in the kernel BUG. A reader that was already walking the tree at that moment survives and processes the corrupted structure.
The trigger is small. The fix commit gives the recipe. It needs sixteen keys that agree on bits 0 to 11, one that diverges at bit 8 and is then deleted, and one more that rejoins the sixteen. That is eighteen insertions and one deletion, followed by the final add_key().
How is it exploited?
A local user drives the keyring into the broken state with eighteen key insertions and one deletion, then wins a race against the thread that crashes.
- The attacker runs as an unprivileged local user and creates a keyring with
add_key()andkeyctl(). - The attacker performs the eighteen insertions and the deletion that the fix commit describes. The deletion collapses the subtree under a shortcut into one node.
- The final
add_key()finds the full node and the new key sharing the node's segment.assoc_array_insert_shortcut()replaces the node with a shortcut, and because the node was already a shortcut's target, the new shortcut lands behind the old one. - The inserting thread reaches
assoc_array_apply_edit()and hits theBUG_ON(). The kernel kills that thread. The exploit has parked a second thread inkey_link, walking the same tree, so the reader survives. - The reader treats an attacker-controlled allocation as a
struct key. The chain places the fake key'suserpointer eight bytes before a realstruct cred, so the kernel's per-UID key-quota accounting writes into the credential's capability words. - The write sets the low 32 bits of
cred->cap_effective, which includeCAP_DAC_OVERRIDEandCAP_SETUID. The process keeps its original user ID but can now read root-only files. - The exploit calls
setresuid(0, 0, 0)andexecve()to start a root shell. The kernel grants the full capability set atexecvebecause the effective user ID is 0.
The public proof of concept records the crash at the insertion:
kernel BUG at lib/assoc_array.c:1387!
assoc_array_apply_edit+0x221/0x230
__key_link+0x51/0x80
__key_instantiate_and_link+0xc0/0x140
__key_create_or_update+0x51a/0x580
key_create_or_update+0x14/0x30
__se_sys_add_key+0x1d0/0x240
The exploit is a lab artifact. It is built against Google's hardened kernelCTF 7.2-rc5 image and needs the matching image and a kernelCTF-style initramfs, neither of which the repository ships.
The fix was written on 2026-10-11 and committed on 2026-10-13. The public exploit appeared on 2026-11-15, 35 days after the fix was written.
How does the attack flow?
A local user drives the keyring's associative array into a shortcut-behind-a-shortcut state. A concurrent reader survives the inserting thread's crash, and the kernel's own quota accounting becomes a capability write.
then a final add_key()"] B --> C["shortcut behind a shortcut
no check for that state"] C --> D["assoc_array_apply_edit()
BUG_ON kills the inserting thread"] C --> E["reader parked in key_link()
walks the broken tree"] E --> F["fake struct key
aliases a struct cred"] F --> G["key-quota write
sets CapEff"] G --> H["CAP_SETUID then setresuid(0)
root shell"]
What can an attacker do?
The demonstrated impact is a local privilege escalation to root. The exploit needs a local unprivileged account, no capabilities, no user namespace and no special group. It does not need a network position.
The first stage is a capability escalation, not a user-ID change. The process keeps uid 1000 and gains CapEff=00000000ffffffff, the low 32 bits of the aliased quota counter. CAP_DAC_OVERRIDE in that set makes root-only files readable. The second stage uses CAP_SETUID to call setresuid(0,0,0) and execve(), at which point the kernel grants the full set and the process is root.
The reliability figures are the researcher's, measured on the one pinned image with two vCPUs. The root-shell build succeeded 7 times in 8; the flag-read build succeeded 14 times in 20. The failures are the race itself, not a missing primitive. A different kernel build has different allocation behaviour, so the same binary is not expected to work unchanged.
No remote path is demonstrated. The bug is reached through local keyring operations, and the published chain needs local code execution. No exploitation in the wild is known, and no source reports a compromise.
Why does the fix work?
The patch makes a new shortcut replace the shortcut in front of the node as well, so the tree never contains a shortcut that leads to another shortcut.
new_s0->back_pointer = node->back_pointer;
new_s0->parent_slot = node->parent_slot;
+
+ /* A shortcut has to lead to a node, so a node at the end of a shortcut
+ * is replaced together with that shortcut. The new one holds the index
+ * key from the root, so it covers what the old one did.
+ */
+ if (node->back_pointer &&
+ assoc_array_ptr_is_shortcut(node->back_pointer)) {
+ struct assoc_array_shortcut *above =
+ assoc_array_ptr_to_shortcut(node->back_pointer);
+
+ new_s0->back_pointer = above->back_pointer;
+ new_s0->parent_slot = above->parent_slot;
+ edit->excised_meta[1] = node->back_pointer;
+ }
new_s0->next_node = assoc_array_node_to_ptr(new_n0);
new_n0->back_pointer = assoc_array_shortcut_to_ptr(new_s0);
new_n0->parent_slot = 0;
The new shortcut inherits the old shortcut's back pointer and parent slot, so it is installed where the old one was. The old shortcut is recorded in the second slot of excised_meta, which is why the header changes from excised_meta[1] to excised_meta[2].
The old shortcut is removed in the same edit, so the walker always reaches a node and the edit accounting never sees a shortcut where it expects a node.
The patch covers the insertion path that creates the state. There is one implementation of assoc_array in the kernel, so there is no second copy to fix. The BUG_ON() stays as a guard.
How do I check if I was compromised?
No indicators of compromise are published, and no in-the-wild exploitation is known. The only public observable is the kernel BUG from a failed attempt.
Check the kernel log for the assertion. A hit means the vulnerable insertion ran and the inserting thread died; it does not prove that the capability write succeeded:
dmesg -T | grep -i "assoc_array"
Check the audit log for a non-root process that called setresuid(0) or gained capabilities it did not have before. The capability write itself leaves no file. Treat a host as suspect if an unprivileged user could run the exploit and a root shell appears without a matching login record.
An attempt that fails before the BUG can leave no trace. The absence of a log entry is not evidence that the host was not targeted.
Timeline
- 2013-09-24: commit 3cb989501c26 adds the generic associative array implementation.
- 2026-10-11: Linus Torvalds writes the fix.
- 2026-10-13: the fix is committed to a kernel tree.
- 2026-11-15: Daniel Wade publishes the exploit.
- 2026-11-16: mainline 7.4-rc3 and the stable branches still carry the vulnerable code.
FAQ
Is there a CVE?
No. No CVE identifier or CVSS score is assigned as of 2026-11-16. The fix commit, the exploit repository and the researcher's write-up are the public record.
Does this affect my distribution?
Yes, in principle. Any distribution kernel built from a tree without commit 48691075b0ad carries the bug. No distribution had published a fixed kernel as of 2026-11-16, so check the vendor's kernel advisory rather than the version string.
Is the exploit reliable?
On the published target it is. The researcher reports 7 root shells in 8 runs and 14 flag reads in 20 runs on the kernelCTF 7.2-rc5 image with two vCPUs. It needs that matching image and initramfs; a different build needs retuning.
Can a remote attacker use it?
No remote path is demonstrated. The exploit needs a local unprivileged account, and the bug is reached through local keyring operations.
Does blocking AF_ALG fix it?
No. It removes the heap-grooming oracle that the published chain uses, which the researcher recommends, but the keyring code remains reachable and the bug remains. Only the kernel patch closes it.
How urgent is it?
There is no in-the-wild exploitation and the exploit is a lab artifact. A local user on an unpatched host can still become root, so patch your own kernels or restrict local access while you wait for a distribution update.
References
- Fix commit, "assoc_array: don't chain a new shortcut onto an existing one", https://github.com/torvalds/linux/commit/48691075b0adc590a6831390723e3603dfca76fc (checked November 16, 2026)
- Introduced commit, "Add a generic associative array implementation", https://github.com/torvalds/linux/commit/3cb989501c26 (checked November 16, 2026)
- Exploit repository and technical write-up, Daniel Wade, https://github.com/Rat5ak/ASSOC_ARRAY_SHORTCUT-CHAIN-EoP (checked November 16, 2026)
lib/assoc_array.cat v7.4-rc3, https://github.com/gregkh/linux/blob/v7.4-rc3/lib/assoc_array.c (checked November 16, 2026)include/linux/assoc_array_priv.hat v7.4-rc3, https://github.com/gregkh/linux/blob/v7.4-rc3/include/linux/assoc_array_priv.h (checked November 16, 2026)- Cyber Kendra, "Unpatched Linux Kernel Keyring Flaw Gives Local Root", https://www.cyberkendra.com/2026/11/linux-kernel-assoc-array-keyring-root-exploit.html (checked November 16, 2026)
- CISA Known Exploited Vulnerabilities catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog (checked November 16, 2026)
- CVE-2016-7914, an earlier bug in the same function, https://www.cve.org/CVERecord?id=CVE-2016-7914 (checked November 16, 2026)
- CVE-2017-12193, another earlier bug in the same function, https://www.cve.org/CVERecord?id=CVE-2017-12193 (checked November 16, 2026)