The Nanosecond Gap That Breaks CPU Defenses: Inside the TONTOU Attack

The Nanosecond Gap That Breaks CPU Defenses: Inside the TONTOU Attack

By Reggi, 07 Aug 2026

Hardware security mitigations look rock solid on paper until you realize they still depend on temporal assumptions. A research team from MIT CSAIL just demonstrated that scrubbing the branch predictor is not enough if an attacker can wedge an interrupt into the exact nanosecond gap between the cleanup routine and actual instruction execution. The attack, named TONTOU (Time-of-Neutralization to Time-of-Use), successfully bypasses hardware-isolated enclaves like AMD SEV-SNP and Intel TDX, bringing Spectre v2 straight back to fully patched Linux kernels.

At its core, TONTOU is the hardware counterpart to software TOCTOU race conditions. The kernel invokes a mitigation sequence to wipe or sanitize the branch predictor state before executing sensitive code. However, if an attacker fires a hardware interrupt after that neutralization routine finishes but before the kernel actually runs the protected operation, the interrupt handler executes. That handler re-poisons the branch predictor state. By the time execution returns to the kernel path, the sanitization work is undone, completely compromising stock mitigations.

Widening a Two-Instruction Race Window

On AMD Zen 2 processors, the vulnerable window is microarchitecturally tiny: just two instructions spanning roughly six bytes. Hitting that target by chance is nearly impossible under normal conditions.

To overcome this, the researchers engineered a cache-eviction strategy. By using a sibling hyperthread to evict those critical target instructions from the L1 and L2 caches, they forced the core to stall on memory fetches, dramatically stretching out the execution window.

[Attacker Thread (Sibling SMT)] ---> Evicts L1/L2 Cache
                                           |
[Kernel Scrubbing Phase]                   v
1. Neutralize Branch Predictor --------> [Stall: Fetch from Memory]
                                           |
                                  << Interrupt Injected Here >>
                                           |
2. Interrupt Handler Executes ---------> Branch Predictor Re-Poisoned
3. Resume Kernel Execution ------------> Speculative Hijack (Spectre v2)

Pairing this cache latency trick with a standard write syscall to control two critical registers yielded remarkable consistency. The injected interrupt successfully hit the target window between 5% and 12% of the time. Once inside the window, the kernel's own interrupt handler trained the return stack buffer toward attacker-controlled speculative targets.

On an AMD Zen 2 system running Linux 6.14 with every upstream mitigation enabled, the attack leaked arbitrary kernel memory at 5.47 bytes per second with 91.97% accuracy. In empirical testing, this throughput was sufficient to locate and dump the contents of /etc/shadow in 5 out of 10 attempts.

Cross-Architecture Impact Breakdown

The vulnerability does not manifest equally across all microarchitectures. While some platforms showed active data exfiltration, others exhibited zero observed mispredictions despite theoretical exposure.

CPU ModelMisprediction RateEnd-to-End Data LeakSpecial Notes
AMD Zen 20.75%Success (5.47 bytes/sec)Read /etc/shadow in 5/10 runs
AMD Zen 40.00%Not DetectedListed as affected by AMD, but triggered zero mispredictions in testing
Intel Arrow Lake0.22%Not ProvenRequires additional disclosure gadget (present in kernel)
Intel Cascade Lake Refresh0.037%Not ProvenRequires additional disclosure gadget (present in kernel)

AMD Zen 4 produced zero measurable mispredictions in testing, even though AMD's advisory acknowledges the architecture as affected. For Intel platforms like Arrow Lake and Cascade Lake Refresh, the researchers proved the branch predictor could be influenced via interrupts, but end-to-end data exfiltration still relies on chaining an additional disclosure gadget that is already present in the kernel.

Vendor Divergence: Safe-RET vs. INTEL-SA-00598

The industry response highlights a familiar split in hardware mitigation philosophies.

AMD acknowledged the issue across Zen 1 through Zen 4 with a security bulletin titled Safe RET Interrupt Vulnerability. In tandem with the upstream Linux community, they introduced a software fix titled x86/bugs: Make Safe-RET robust against interrupt injection. This patch alters the register restoration process so the CPU state mirrors an already-completed Safe-RET sequence while stripping out the risky RET instruction when returning from the interrupt.

Intel took an entirely different route. While Intel awarded a bug bounty to the research team, they declined to release an explicit, targeted patch. Intel asserted that existing guidance under INTEL-SA-00598 already covers the threat model. However, an analysis of the May 2025 revision of that advisory reveals no mention or operational analysis of interrupt-driven branch predictor retraining.

Operational Headaches for Fleet Management

For systems engineers and infrastructure operators, this vulnerability presents a distinct auditing challenge. There is no designated CVE tracking the fix, and standard kernel version tagging remains vague.

System administrators cannot simply rely on the standard sysfs vulnerability interface to verify coverage:

bash
cat /sys/devices/system/cpu/vulnerabilities/spec_rstack_overflow

Because the sysfs reporting nodes have not been updated to reflect interrupt injection edge cases, this interface provides a false sense of security. Verifying fleet-wide protection requires manually inspecting kernel commit logs to ensure the Safe-RET interrupt robustness patches have been backported into your specific distribution kernel.

Until those commits are confirmed across your hosts, any multi-tenant bare-metal or shared virtualization infrastructure running affected silicon remains exposed to low-and-slow side-channel exfiltration from unprivileged local users.


Popular Reads