GCC Compiler Lands Mitigation For Arm's Straight Line Speculation Vulnerability
Written by Michael Larabel in Arm on 9 July 2020 at 06:38 AM EDT. 5 Comments
ARM --
It took a month after Arm disclosed the CPU "SLS" vulnerability and when the LLVM compiler landed their initial mitigation, but the GNU Compiler Collection (GCC) now has mitigations as well for this Straight Line Speculation vulnerability.

The Straight Line Speculation vulnerability could lead to instructions on ARMv8 processors being executed following a change in control flow. Mitigating SLS involves using SB instructions for a speculation barrier following vulnerable instructions.

Arm has merged into GCC Git today its initial SLS mitigation covering RET and BR instructions. The SB instruction is used on supported SoCs for the speculation barrier otherwise a DSB SY + ISB sequence. Another commit mitigated SLS for the BLR instruction.

Enabling the Arm SLS mitigation for GCC can be done with the -mharden-sls= where a value of "all" mitigates all vulnerable instructions, "retbr" to insert speculation barriers on just RET and BR instructions, or "blr" for mitigating just BLR usage. Mitigating on a per-function basis isn't yet supported.

Benchmarks of the Arm SLS mitigation impact to come as time allows.
Related News
About The Author
Author picture

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter or contacted via MichaelLarabel.com.

Popular News This Week