Interrupt Injection: A Precisely Timed Interrupt Slips Past Spectre v2 Defenses
Translated by a model; the original is in Russian.
MIT CSAIL researchers Daniel Trujillo and Mengjia Yan have described a new class of attacks they call Interrupt Injection. The idea is simple, and that is what makes it so nasty: an unprivileged program schedules a hardware interrupt so that it lands exactly in the interval between the moment the processor clears the branch predictor and the moment the kernel puts that predictor to use. At that instant the defense has already done its job but has not yet been needed — and the predictor can be “poisoned” all over again.
The authors place the technique within a broader class they call TONTOU (Time-of-Neutralization to Time-of-Use), by analogy with the TOCTOU races well known in software. Every existing Spectre v2 mitigation — Intel with eIBRS and its branch history buffer clearing, AMD with saferet — assumes that nothing hostile runs between neutralization and use. Interrupts break that assumption: they can fire almost anywhere, and Linux lets any user schedule them with nanosecond precision.
What was achieved in practice
On a machine with AMD Zen 2 running Linux 6.14, with all the standard Spectre v2 mitigations enabled, the exploit read arbitrary kernel memory at 5.47 bytes per second with 91.97% accuracy. That was enough, in five attempts out of ten, to locate and read /etc/shadow with its password hashes. No privileges are required — only local code execution — so multi-user systems are first in the line of fire.
The window on Zen 2 is just two instructions, six bytes. To improve their odds, the researchers evicted those bytes from the L1 and L2 caches by way of a sibling hyperthread, and they also chose the write system call, which gave them control over two registers. The interrupt hit the target window 5–12% of the time. Inside, the handler itself became a “training gadget,” armed with the Inception vulnerability (CVE-2023-20569) — the very one saferet was built to combat.
The vendors' response
Disclosure took place on February 5. AMD issued advisory AMD-SB-7061, “Safe RET Interrupt Vulnerability,” listing Zen 1 through Zen 4 processors as vulnerable and noting that the problem appears to be tied specifically to the Safe RET implementation in Linux. The fix has already landed in the kernel: a June 2 commit by AMD engineers Borislav Petkov and David Kaplan sets the register state in order as if the Safe-RET sequence had completed, and avoids executing a RET after returning from an interrupt.
Yet neither AMD's advisory nor MIT's announcement references the commit, and no CVE or specific kernel version is named — an administrator has to go by the commit's subject line. Intel, for its part, considers a dedicated defense unnecessary: in the company's view, exploitability “depends on a multitude of factors.” The authors, however, are confident an end-to-end attack is possible on Intel processors too — given a suitable disclosure gadget in the kernel.
The work was presented at Black Hat USA, and the talk is expected at USENIX Security in Baltimore.
Source: The Hacker News
Comments
Sign in, to comment.