AMD Discloses a Spectre-Like Vulnerability in Zen 3 CPUs

AMD Discloses a Spectre-Like Vulnerability in Zen 3 CPUs

AMD has published details of a Spectre-like vulnerability that affects Zen 3 CPUs. It’s related to a new feature AMD introduced with its latest architecture called Predictive Store Forwarding (PSF). AMD is not aware of any code exploiting this issue in the wild but is releasing this information preemptively.

PSF is used to guess what the result of a load will be and to execute instructions based on that assumption. PSF builds on an earlier performance improvement known as Store to Load Forwarding (STLF). STLF refers to the practice of transferring data from a store directly to a load without writing it to main memory first. Before the STLF completes, the CPU checks to make sure the load address and the store address match.

PSF builds on STLF by speculating on what the relationship between a load and a store might be without waiting for the address check to complete. PSF watches execution patterns over time to learn the likely outcomes. Once this is done, it may speculatively execute an STLF before confirming one occurs. Any time we talk about a CPU executing an operation without checking to see if the results of that operation will be necessary, we’re referring to a performance-enhancing technique known as speculative execution.

All modern CPUs from every vendor execute instructions speculatively to one degree or another. Back in 2018, Intel got into major PR trouble due to a set of security weaknesses dubbed Spectre and Meltdown. Spectre and Meltdown spawned an entire genre of side-channel attacks, but the majority of these attacks applied solely to Intel. This is the first side-channel attack of its type that we’ve seen hit AMD.

According to AMD, an incorrect PSF prediction can occur for “at least” the following two reasons:

1). The store/load initially had a dependency but stopped having one, due to a change in either the store address or the load address.

2). There’s an alias in the PSF predictor structure. The PSF predictor is supposed to track load/store pairs based on a portion of their relative instruction pointers. AMD writes: “It is possible that a store/load pair which does have a dependency may alias in the predictor with another store/load pair which does not.”

AMD Discloses a Spectre-Like Vulnerability in Zen 3 CPUs

AMD’s security briefing notes that the company has proposed security patches to the Linux kernel that would allow customers to enable and disable the speculation features, which allow PSF to leak data through a side-channel attack. AMD recommends leaving the feature enabled for its performance benefits and states that the risk of attack is believed to be “likely low.”

Side-Channel Attacks Have Not Emerged as a Serious Threat

When Spectre and Meltdown emerged three years ago, it wasn’t clear how much of an issue they would be long term. As far as we’re aware, no public attack has attempted to use these methods to exfiltrate data. Side-channel attacks are difficult and they don’t automatically leak the data the attacker actually wants. That’s its own problem.

Roughly a year ago, we noted that the security disclosures around CPU flaws (mostly, but not entirely, Intel-related) had become increasingly histrionic. In many cases, the tone of the security PR/website and the tone of the actual report copy had nothing to do with one another. It is important that AMD disclose these findings for the same reason that it’s important for Intel to do so, but there hasn’t been any proof that Spectre, Meltdown, Zombieload, Fallout, MDS, RIDL, or any of the rest are being used in the real world.

While this could change in the future, the current risk from side-channel execution attacks on x86 or ARM chips is very low. You’re far more likely to get targeted by a spear-phishing email than you are to run into a security flaw from a side-channel attack.