
An unprivileged GPU pod can take root on its host. CVE-2026-47597, one missing condition in NVIDIA's open GPU kernel modules, makes it possible. Daniel Cohen Hillel (@0xDACA) and Noam Trobishi, the original disclosers, demonstrated root at DEF CON 34 in "CUDA've done better: Hacking GPUs for escape and escalation" and withheld the method. Stealthium rebuilt the chain independently on the stock 595.84 driver, and on the kernels we validated it lands on the first attempt. To get there, the exploit shaped the kernel heap with about 2,300 heap-control ioctls a second in our run. In our measurements, a benign CUDA workload issued none.
This post covers the bug, the deterministic chain we built on it, and the unavoidable step in that chain which we built our detection around. Some parameters are withheld to make public exploitation harder.
Unprivileged GPU pod to host root on the stock 595.84 driver. The demo pod mounts the host root only to leave a proof file for the recording; the exploit itself needs only the GPU device nodes.
CVE Status TL;DR
- Affected (Linux): R580 before
580.178.04, R595 before595.91.07, R610 before610.57.04, and R615 before615.71.09. The vGPU 19 and 20 branches and the Windows branches have their own fixed releases, listed in NVIDIA bulletin 5861. NVIDIA's bulletin also says earlier branches may be affected and lists no R575 fix; R575.64.03 carries the same missing guard. - Severity: 7.8 High (CVSS 3.1), CWE-416 use-after-free. Where GPUs are assigned to containers that are not fully trusted, treat as critical: the exploit runs from the pod and modifies host kernel memory.
- Requires: an unprivileged process that can open
/dev/nvidia0and/dev/nvidiactl, which a normal GPU pod already has. No privileged flag, no host PID, no host network. The exploit also needs System V IPC with MSG_COPY, about 28 GiB of address space, and a host whose RAM covers the 4-32 GiB window. - Fix: a one-line change to
refRemoveMapping(), shipped in the September 2026 driver releases. - Action: patch. Until you can, watch per-process heap-control escape rates (see Catching the Allocation Farm).
Where Our Blog Differs From The DEF CON 34 Talk
Hillel and Trobishi found the bug and showed the use-after-free, a timing trick, a physical-memory map and a root video. Their exploit details aren't currently public. The construction below is ours, built independently on the same bug.
| Aspect | DEF CON 34 talk | This post |
|---|---|---|
| Discovery | Hillel and Trobishi | Them, not us. |
| Route to physical memory | Physical-memory map | One aimed pointer write redirects a mapping node's MemoryArea to a range we wrote |
| Reliability | Uses a timing trick | Deterministic placement; first candidate correct on the validated kernels |
| Cost of a wrong guess | Not covered here | One failed mmap on the validated kernels |
| Exploit details | Withheld | Primitives described; allocator parameters and counts withheld |
Bug Background: A Normal Path
A GPU process opens /dev/nvidiactl for control and /dev/nvidia0 for the device, then sends ioctl commands to create a client, a device, a subdevice and a memory object. The driver's Resource Server records each one as a reference, or ref. The memory object is the allocation: the driver reserves backing pages for it in pinned system memory or VRAM.
A second ioctl maps the memory object into a context and allocates two records. The first is the Resource Server's mapping, RsCpuMapping, which joins the memory object (pResourceRef) to the context allowed to use it (pContextRef) and carries the offset, length, flags and an embedded list node, backRefNode. The second is the per-file mapping node, which holds a MemoryArea: a pointer to an array of {start, size} ranges and a count. The mmap handler maps those ranges.
When the process calls mmap on the device fd, the driver's mmap handler walks the node's MemoryArea, remaps the range with remap_pfn_range and installs those pages in the process page table. The mapping length must equal the range size. From then on, CPU loads and stores go straight to those pages without the driver.
The GPU reaches the same physical page through its own page tables or the IOMMU. The exploit never touches that side. It leaves both translations intact and corrupts the per-file MemoryArea, so the mmap handler maps a range the attacker wrote.

Figure D1. The objects the driver keeps for one process. A mapping joins one memory object to one context.
The driver tracks each mapping on two lists. The resource's cpuMappings list records where each object's memory is mapped on the host. The context's backRefs list records what must be unmapped when the context is destroyed. cpuMappings is an ordinary list that stores its own links. backRefs is an intrusive list: it reaches the mapping through backRefNode, which sits at a fixed offset inside the mapping.

Figure D2. One mapping, two lists. The resource's cpuMappings and the context's backRefs both point at the same mapping; a self-map skips the second.
The create path, refAddMapping(), always adds the mapping to the resource's cpuMappings. It adds the mapping to the context's backRefs only when the context is neither the resource itself nor one of its ancestors. A subdevice that maps itself therefore sits in cpuMappings and is absent from backRefs.
Root Cause: One Condition Short
refRemoveMapping() in rs_resource.c should make the same decision as the create path. It checks that the context is not NULL and is not an ancestor of the resource. It never checks that the context is the resource itself.
The create path, simplified:
/* add a mapping to a resource's list */
if (ctx != NULL &&
ctx != res && /* self-reference: do not link */
!refHasAncestor(res, ctx)) {
list_append(&ctx->back_refs, mapping);
}
The cleanup path, simplified:
/* remove a mapping from a resource's list */
if (mapping->ctx != NULL &&
!refHasAncestor(res, mapping->ctx)) { /* the self case is missing */
listRemove(&mapping->ctx->back_refs, mapping);
}
refHasAncestor() starts its walk at the resource's parent, so a ref is never its own ancestor. For a self-mapping the check returns false, and the removal runs on a mapping the create path never inserted.
The removal calls listRemove(&pContextRef->backRefs, mapping). The list is type-erased: it can hold objects of different types, so it stores the distance from each object to its embedded node and computes the node address as object plus distance. It treats the 16 bytes there as a previous and a next pointer in a release build. Here the node is backRefNode, zeroed when the mapping was allocated and never linked.
listRemove(list, obj):
pNode = obj + list->nodeOffset // data-driven address
if (pNode->prev == NULL) list->head = pNode->next; else pNode->prev->next = pNode->next;
if (pNode->next == NULL) list->tail = pNode->prev; else pNode->next->prev = pNode->prev;
pNode->prev = NULL
pNode->next = NULL
list->count--
zeroed node = { NULL, NULL }
│ │
▼ ▼
list->head = NULL list->tail = NULL
A list removal changes the node's two neighbors so they point to each other. If the node's previous pointer is NULL, the write goes to the list's head; if its next pointer is NULL, the write goes to the list's tail. The zeroed node therefore sends both writes to the ends of the list: NULL to the head, NULL to the tail, and the count drops by one. The context's other mappings are still linked to each other, and the list no longer starts at them.

Figure D3. The self-map. Create skips the back-reference; cleanup removes a node that was never inserted, and the list loses its other members.
At teardown, the driver walks backRefs to unmap the context's mappings, finds an empty list and skips them. The context ref is freed while those mappings still point at it. The next removal of one of them reads pContextRef and dereferences the freed ref. That is the use-after-free NVIDIA describes in bulletin 5861.
The upstream fix adds the missing condition (shown against the simplified cleanup path above):
if (mapping->ctx != NULL &&
+ mapping->ctx != res &&
!refHasAncestor(res, mapping->ctx)) {
listRemove(&mapping->ctx->back_refs, mapping);
}
Exploitation Chain
A use-after-free gives a dangling pointer. Turning it into root takes six steps, each built on the one before it:
- Reclaim the freed ref: make the driver read bytes we choose.
- Pivot the list: aim the driver's unlink at a location we pick.
- Leak through three unlinks: learn kernel addresses and read them back.
- Place the target: put a mapping node at a known address, arranged so a miss costs one failed syscall.
- Write and map: land one pointer write that turns
mmapinto a window on physical memory. - Patch the credentials: find our
struct credand become root.
Taken together, the steps give the chain control of the freed ref, an address, a write, a read, and a cheap miss.
The Actor Map
The exploit has no direct read of kernel memory, so it uses a System V message queue as its output buffer: msgsnd sprays messages, the kernel copies each payload into a msg_msg object, and msgrcv with MSG_COPY reads a message back without removing it.
Every step has the same shape:
- Userland frees a driver object.
- The allocator hands the freed slot to a sprayed message.
- The driver's cleanup logic follows a list into that message and writes a kernel value there.
- Userland reads the message.
The steps differ only in how they aim that write.

Figure D4. The chain is a round trip. The same loop runs from the first leak to the final credential write.
#1 - Reclaim The Freed Ref
Delivers: control.
Each farm frees the subdevice's ref. The allocation is 528 bytes, so the kernel slab allocator places it in kmalloc-1k, and freeing it returns the slot to that cache's free list.
What broke first: our first model put the ref in the wrong cache. The slab counters showed the real one,
kmalloc-1k.
The exploit needs the allocator to hand that slot to an object it controls before the driver reads the ref again. A System V message is that object. The kernel allocates each message as a 48-byte msg_msg header plus the payload, so a 976-byte payload makes a 1,024-byte allocation from the accounted kmalloc-1k cache (kmalloc-cg-1k).
Same size does not mean same cache, so the reclaim is cross-cache: the ref's slab page has to return to the page allocator, which happens when every object on that slab page is free, and be taken by the message cache. The exploit prepares for this by shaping the kernel heap with an allocation farm, a loop of heap-control escapes issued thousands of times. The counts and allocator parameters are withheld. The farm is the step we come back to in the detection section. An attempt runs four farms, one for each cursor mapping (w, x and y) and one for the carrier, so four refs are freed and four fakes are built. The farms' benign frees already leak the cursor and carrier mapping addresses; the three unlinks below add the shot mapping's address and RSUB.

Figure D5a. A spray across two caches. Same size does not mean same cache; the slab page must move through the buddy allocator before a message can take the ref's slot.
The alignment makes the reclaim useful. The driver's pointer to the ref sits 48 bytes into the 528-byte allocation, after a 48-byte header, and the message text also starts 48 bytes in, after the msg_msg header. When the message takes the freed allocation, the driver's ref pointer lands on the first byte of the message text, so the ref's backRefs list, including its node_offset field, is now bytes we choose.

Figure D5b. The leak is a round trip. The message replaces the freed ref, the driver writes one pointer into the text, and MSG_COPY reads it back.
Every sprayed message carries the same bytes, so it does not matter which one wins the slot.
#2 - Pivot The List
Delivers: an aimed write, set up here and landed in #5.
In a real list, node_offset is a constant the driver sets at initialization. In the fake list it is a field in the sprayed message from #1. When the driver removes a mapping, it computes the node as mapping + node_offset and treats the 16 bytes there as a previous and a next pointer, so the exploit chooses both where the node is and what the unlink reads.
What broke first: the first attempt to use the fake list crashed the driver because its node offset was garbage. Writing the offset deliberately fixed the crash and became the pivot.

Figure D6. The pivot. The list finds its node through a distance the message controls, so the unlink can be aimed.
The unlink has a middle case and two end cases, and it zeroes the node after every removal (see the listRemove code in the root cause). The three leak unlinks use the tail branch to write a value into the message, where it can be read; the middle case is the shot in #5.
#3 - Leak Through Three Unlinks
Delivers: an address and a read.
The chain runs the pivot three times against one live mapping, the carrier, which stays open throughout, so its fields are never freed and the values we read from it are safe. Each step frees a different memory object, and the mapping that joins that memory to the freed ref becomes the step's victim. Freeing it runs refRemoveMapping(), which removes the victim from the freed ref's backRefs list: our message. The node lands at victim + node_offset, on a carrier field we chose, and the unlink reads the carrier's values as its previous and next pointers.

Figure D7. Three unlinks, one carrier. All three take the tail branch: the first and third leave an address in the message, and the second zeroes the pair the third one needs.
- The first unlink aims the fake node at the carrier's
backRefNode. The carrier is last in its list, so its next pointer is NULL and the unlink takes the tail branch: the fake list's tail receives the carrier's previous pointer, the address of the final mapping's node. The mapping sits a fixed distance before its node, so reading the message gives the exploit the final mapping's address. - The second unlink aims the fake node at the carrier's resource pointer. The first unlink left the adjacent backRefNode zeroed, so the pair it reads is the resource pointer followed by NULL. It takes the tail branch, writes the resource pointer into the message, and zeroes both fields of the pair. The carrier's resource pointer is now NULL.
- The third unlink aims the fake node at the carrier's context pointer. Its pair is the carrier's freed ref address followed by the now-NULL resource pointer, so it takes the tail branch. The fake list's tail receives that address. That address is also the first byte of the message text, which holds the fake range the final step needs.
None of the three steps reads freed memory. Every value comes from the live carrier or from a message the exploit wrote. The only freed objects are the four refs, and each step steers the driver's use of its fake into the message.
What broke first: an early plan read the freed chunk directly. It failed because the cleanup freed the chunk again before the read.
#4 - Place The Target
Delivers: a cheap miss, checked after the write in #5.
The final write needs a target whose address is known and whose range field can be overwritten: a per-file mapping node (see Bug Background: A Normal Path). The node is a 112-byte structure in kmalloc-128, the same cache the unlinks returned chunks to. The map ioctl allocates two objects per call, the mapping object first and then the node. The placement is not simple LIFO: with a long free and allocation history, the allocator serves from the current slab and its partial-slab order. The leaked mapping address marks one slot, and the node's slot sits a measured distance from it.
The exploit frees three mapping objects in a known order, then maps a window and three markers whose nodes land in the freed slots.

Figure D8. Placement. The map ioctl's node lands a measured distance from the leaked mapping, and the mmap check proves the guess.
The distance is measured per kernel. On the validated kernels the first candidate is correct; on a kernel with a wider free pool, each candidate is a fresh attempt that reruns the farms, and the chain walks a short candidate list.
mmap acts as the oracle. If the final write hit the marker's range field, mmap of that file succeeds. If it missed, mmap returns an error; on the validated kernels nothing else is written, and a wrong guess costs one failed system call.
#5 - Write & Map
Delivers: the write.
The final unlink frees the final mapping with the fake list aimed at the chosen marker node. The fake node's pair is {node + 0x18, freed ref address}, so the unlink writes the freed ref's address into the node's MemoryArea range pointer, at node + 0x20.
The final, aimed corruption is one 8-byte pointer write to a location computed from a leaked address. The unlink's second write also lands in the range start, so the exploit re-sprays the carrier messages to repair it before the mmap.

Figure D9. One write becomes a window. The last unlink points one node's range field at the message; the driver remaps that range, and the scan patches the credential.
That address points at the message text, whose first bytes are a fake range, {start = 4 GiB, size = 28 GiB}. The next mmap walks it, the driver remaps the range with remap_pfn_range, and the process can now read and write physical memory. The range is large because the credential can sit anywhere in it.
#6 - Patch The Credentials
Uses everything above to reach root.
The last step scans the window for the process's struct cred and patches its id fields.

Figure D10. The credential patch. The scan writes only when all four checks match.
The scan writes only when all four checks pass: four consecutive 8-byte pairs encoding the uid and gid, a plausible usage count, empty securebits, and capability words inside their valid mask. A false positive would corrupt an unrelated object, so the checks are deliberately conservative. The process and its helpers run with the same credentials, so there is more than one target; helper 0 reports once any of them reaches uid 0.
Obvious Detections Fail
Detecting an attack like this is challenging. Many typical host signals miss this chain or catch it too late.
| Signal | Why it fails | What we use |
|---|---|---|
| The exploit binary | A small C program that can be renamed, recompiled, or run from memory | The driver escape pattern |
| A root or credential change | It happens late, may never happen on a hardened kernel, and a detector that waits for it has already lost | The allocation farm, before the final write |
| Every NVIDIA ioctl | A legitimate CUDA workload issues many, so the rate is noise | The specific heap-control escape |
| The exact self-map sequence | Stronger, but it needs more state, has more false positives, and the attacker can vary the order | The rate now; the sequence is the next detector |
The one step the chain cannot skip is the allocation farm from step #1.
Catching the Allocation Farm
The farm issues one Resource Server escape, NV_ESC_RM_VID_HEAP_CONTROL (_IOWR('F', 0x4a)), thousands of times, along with the free that pairs with it. The allocation escape alone identifies the behavior. The measured exploit issues about 2,300 a second for at least two seconds. In our measurements, a benign CUDA workload issued none for its whole life, teardown included.

Figure D13. Catching the allocation farm. The same event feeds the alert and the action.
Stealthium's agent puts a kprobe on nvidia_unlocked_ioctl and counts every heap-control escape per process in the kernel, not on the rate-limited event stream. The counter trips over a short window and raises a critical alert while the farm is still being built. The alert names the process, container, pod and namespace.
The same event drives enforcement. In reaction mode the agent kills the task that crossed the threshold. In deny mode an LSM hook refuses that task's heap-control escapes from the crossing on and leaves the free and every other operation alone, so the farm cannot allocate and the exploit never reaches the final write.
Validation and Limits
The pod path used a runtime class with the NVIDIA container runtime, and the host userspace driver matched the 595.84 module. The chain was validated on the stock, unmodified 595.84 module on Linux 7.0.0-1017-gcp and 6.11.0-1017-gcp, and from an unprivileged GPU pod on 7.0.0-1017-gcp running as uid 1001, which wrote /root/pod-escape-proof.txt on the host.
- Wider free pools: On 6.17.0-1022-gcp the
kmalloc-128free pool is wider, the placement scan misses more often, and a blind guess can touch an object that is not a marker node and oops the kernel (2 oopses in one run). That kernel needs a deterministic-chunk change we identified and have not implemented. - One run per boot: A run leaves the driver holding a range pointer into a message. When the process exits, the driver tears down the damaged client, which oopses or wedges the RM lock, and a second run on the same boot can hang at open(). Each run is followed by a reboot.
- Pacing: The farm uses fixed, measured counts for the validated kernels. An attacker who keeps the rate below the threshold can spread the same allocations over a longer period. The rate is a heuristic. It detects the behavior measured here, not every possible pacing. The causal signal is a self-map followed by a burst of map and free operations on the same context, and that sequence detector is in development.

Figure D11. The work in four phases.
The lab driver printed the ref state at every cleanup, the addresses of the mapping objects and nodes, and the list counts. During development it also carried a gate that performed the removal only when the fake list's count matched a marker, so a cross-cache miss wrote nothing. The final chain was rebuilt on pristine 595.84 source with all instrumentation removed, and has no gate.

Figure D12. The measurement loop.
The measurements that make the chain repeatable are the size class of the ref, the alignment between the ref and the message, the order in which the mappings are freed, the placement of the node relative to the leaked mapping, and the number of candidates the allocator can produce on a given kernel. The loop is to instrument the driver, run the exploit, read the resulting state, and update the model.
Conclusion
The bug is a single missing condition in the driver's map cleanup, and turning it into root takes six steps, each built on the one before it. The detection watches something simpler: the heap farm every run of this exploit needs, which a benign CUDA workload did not produce in our measurements. Patch the driver, and until you can, watch the heap-control escape rate.
Methods and Attribution
Prior work: the vulnerability was found by Daniel Cohen Hillel and Noam Trobishi and presented at DEF CON 34 in "CUDA've done better: Hacking GPUs for escape and escalation". The talk showed the UAF, a timing trick, a physical-memory map and a root video, and withheld the exploit details. This post does not claim the discovery. Hillel's discovery and their presentation were both excellent. We wanted to build on that work and take a Stealthium approach to both exploitation and detection for this UAF. Here, we post our separate construction on the stock driver, the primitives that make it deterministic, and the detection. Pre-publishing we sat down with the original disclosers to showcase our work and get their insights. We got a “very well done” from Trobishi.
This work: we built the ref reclaim, the list pivot and the three unlinks, measured the placement, and used the mmap check as the oracle. We rebuilt the chain on the stock 595.84 driver, validated it on multiple kernels, packaged it, and built the detection and prevention paths in Stealthium.
References: NVIDIA security bulletin 5861 and the DEF CON 34 talk.
We’re hiring at Stealthium
If this is the kind of problem you enjoy spending your time on, come join us.
Related roles
All open roles