Abstract
SMoTherSpectre is a novel speculative execution attack that abandons the traditional cache-timing side channel in favor of port contention. By measuring how a victim's speculative instructions compete for specific execution units in a shared CPU core, an attacker can leak secrets from standard libraries like glibc and libcrypto with high precision and without injecting any custom code. This approach bypasses many proposed defenses that focus exclusively on isolating or rolling back the CPU cache state.
Introduction: Beyond the Cache
Since the discovery of Spectre and Meltdown, defensive research has largely focused on the CPU cache. Most proposed mitigations aim to roll back or isolate cache states after a processor realizes it has mispredicted a branch. SMoTherSpectre identifies a critical gap in this strategy by demonstrating that the very act of executing instructions—even if they are later discarded—creates measurable interference on hardware execution ports.
In Simultaneous Multithreading (SMT) environments, such as Intel’s Hyper-Threading, two threads share the same execution units. If both threads attempt to use the same port simultaneously, one must wait. This "tug-of-war" for resources provides a side channel that is independent of the memory hierarchy and potentially invisible to cache-centric defenses.
The SMoTherSpectre Attack Primitive
The researchers combined two well-known concepts into a new attack primitive:
- SMoTher (Port Contention Side Channel): The attacker runs a "timing loop" of instructions targeting a specific execution port (e.g., Port 1, which handles integer math). By measuring the loop's duration, the attacker can infer if a co-located victim thread is using that same port.
- Spectre v2 (Branch Target Injection): The attacker "poisons" the CPU's Branch Target Buffer (BTB) to trick the victim into speculatively jumping to a "gadget" located in a common library.
To facilitate this, the authors built a tool to scan binaries for "SMoTher-gadgets"—conditional branches where the "true" and "false" paths have different "port fingerprints" (i.e., they use different execution ports). By triggering a speculative jump where the path taken depends on a secret bit, the attacker uses the SMoTher channel to detect which port was contested, thereby revealing the secret.
Key Insights and Results
The attack was evaluated on Intel Skylake, Haswell, and Broadwell processors using standard libraries such as glibc, libcrypto (OpenSSL), and zlib.
- Gadget Ubiquity: Standard libraries are "target-rich environments." The researchers found over 12,000 usable gadgets in
libcryptoalone, meaning attackers do not need to inject custom code (like eBPF) to find targets. - Bypassing Rollback Defenses: Because port contention happens during the execution of the instruction, it doesn't matter if the CPU later "undoes" the architectural changes (like register updates). The timing delay has already occurred and been measured by the attacker.
- Real-world Impact: The authors demonstrated a proof-of-concept attack against an OpenSSH server, creating an oracle that could leak 4 bits of the host's RSA private key. They also created an oracle for OpenSSL capable of differentiating a bit of plaintext during encryption with 95% confidence.
- Performance: In an ideal covert channel setup, they achieved a leakage rate of 24,000 bits per second with over 98% accuracy.
Conclusion and Future Work
SMoTherSpectre highlights that speculative execution attacks are not limited to the memory hierarchy. While existing "heavyweight" defenses like retpolines (which stop branch injection) or disabling SMT (which stops port sharing) are effective against this specific implementation, they come with significant performance penalties. The authors suggest that future research should investigate gadgets triggered by other speculative mechanisms, such as Return Stack Buffer (RSB) overflows, which might bypass current Branch Target Injection defenses.
Summary updated