Linux Fixes Botched SRSO Mitigation For AMD Zen 3 / Zen 4

Written by Michael Larabel in AMD on 30 March 2024 at 01:15 PM EDT. 19 Comments
AMD
Disclosed last August was the AMD Inception vulnerability also known as SRSO for the Speculative Return Stack Overflow. The kernel-side patches for the AMD SRSO mitigation were quickly merged. Following that were more clean-ups and fixes to the SRSO mitigation code. It's been a quiet few months since while merged on Friday was fixing some of the mitigation code due to being ineffective.

Since November was the last time seeing AMD SRSO / Inception clean-ups while coming as a surprise on Friday was new code from AMD to fix the SRSO mitigation for Zen 3 and Zen 4 processors. AMD Linux engineer Borislav Petkov explained in the commit:
x86/bugs: Fix the SRSO mitigation on Zen3/4

The original version of the mitigation would patch in the calls to the untraining routines directly. That is, the alternative() in UNTRAIN_RET will patch in the CALL to srso_alias_untrain_ret() directly.

However, even if commit e7c25c441e9e ("x86/cpu: Cleanup the untrain mess") meant well in trying to clean up the situation, due to micro-architectural reasons, the untraining routine srso_alias_untrain_ret() must be the target of a CALL instruction and not of a JMP instruction as it is done now.

Reshuffle the alternative macros to accomplish that.

This fixes the SRSO mitigation code that's been mainline since mid-August.

AMD fixes SRSO mitigation for Zen 3  and Zen 4


The patch fixing up the mitigation was merged on Friday ahead of the Linux 6.9-rc2 release on Sunday. The patch is also marked for back-porting to the existing Linux kernel stable series and thus should work its way out to new stable point releases in the days ahead.
Related News
About The Author
Michael Larabel

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, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week