Linux Spectre Defenses Can Be Bypassed by Precisely Timed Interrupts, Researchers Find

MIT CSAIL researchers have uncovered a new speculative-execution technique that can potentially undermine Linux protections designed to defend against Spectre v2 attacks. Called INTERRUPT INJECTION, the method allows an unprivileged local attacker to trigger a hardware interrupt during a narrow window between the processor sanitizing its branch predictor and the kernel relying on that protection.

Researchers Daniël Trujillo and Mengjia Yan demonstrated the technique on an AMD Zen 2 processor running Linux 6.14 with the default Spectre v2 mitigations enabled. Their proof-of-concept was able to leak arbitrary kernel memory at a rate of 5.47 bytes per second with 91.97% accuracy. In five out of 10 attempts, the researchers were able to identify and read /etc/shadow, the Linux file containing password hashes.

The attack does not require elevated privileges. It only requires the attacker to execute code locally, making the issue particularly relevant to shared systems where multiple users or workloads operate on the same machine.

The researchers reported the vulnerability to AMD and Intel on February 5. AMD subsequently indicated that a Linux kernel fix was planned, and a corresponding patch has since been incorporated into the kernel and distributed through regular operating-system updates.

The Linux fix is included in the commit titled "x86/bugs: Make Safe-RET robust against interrupt injection", dated June 2. Authored by AMD engineers Borislav Petkov and David Kaplan, the patch specifically addresses the possibility of interrupts interfering with the Safe-RET sequence. The commit warns that interrupt injection "can neutralize the safe return sequence, potentially leading to data leakage through speculative execution."

The fix modifies the processor's register state following an interrupt so that it reflects a completed Safe-RET sequence. It also prevents the system from executing a RET instruction after returning from the interrupt, addressing one of the attack paths outlined by the researchers.

AMD later published security bulletin AMD-SB-7061, titled "Safe RET Interrupt Vulnerability," on August 6. The advisory identifies Zen 1 through Zen 4 processors as affected. AMD says an attacker "could inject an interrupt at a precise moment to disrupt Safe RET," which "could potentially weaken that protection and may result in information disclosure." The company also notes that the vulnerability "appears to be associated with the Linux implementation of the Safe RET mitigation."

According to AMD, the researchers demonstrated the behavior on Zen 1 and Zen 2, while Zen 3 and Zen 4 were identified as potentially affected but were not demonstrated by the researchers. The paper itself describes AMD testing on Zen 2 and Zen 4. However, the advisory's affected-products section does not provide a specific kernel version, patch reference or CVE identifier, potentially making it harder for administrators to determine whether a system has been updated.

The Linux kernel exposes Safe-RET status through /sys/devices/system/cpu/vulnerabilities/spec_rstack_overflow. However, documentation describing the possible values of that file did not reference interrupt-based attacks when The Hacker News reviewed it on August 6.

Intel has taken a different position. In a statement to The Hacker News, Jerry Bryant, Senior Director, Intel Product Assurance and Security, said, "Intel's assessment is that the behavior is related to BHI/IMBTI scenarios which are addressed by Intel's existing Spectre v2 and BHI/IMBTI guidance. Intel has not observed a real-world end-to-end attack on Intel processors and does not plan to add any additional mitigation guidance at this time. Intel's guidance is the same for all supported processor generations."

Arm also responded to the research, stating, "Arm is aware of the TONTOU research paper. While the analysis suggests that some Arm CPUs may exhibit aspects of the behavior described, this behavior would not give an attacker direct deterministic control over the processor’s predicted branch target. Our existing guidance for mitigating Spectre-v2 and Spectre-BHB already addresses the risks identified by this research."

The underlying issue stems from how existing Spectre defenses handle branch predictor state. These protections are designed to prevent attacker-controlled training from influencing speculative execution in kernel code. Intel performs the relevant protections when entering the kernel using eIBRS and, depending on the processor, either a branch history buffer clearing sequence or the BHI_DIS_S control. AMD's Safe-RET mechanism instead operates immediately before returning from the kernel.

The researchers found that these approaches rely on an assumption that no attacker-controlled event can interfere between the predictor state being neutralized and its subsequent use. Their research introduces the term TONTOU, short for "Time-of-Neutralization to Time-of-Use," drawing an analogy with traditional

[…]
Content was trimmed to protect the source. Please visit the original article for the full text.

This article has been indexed from CySecurity News – Latest Information Security and Hacking Incidents

Read the original article: