Linux Patched For A New AMD Zen 4 CPU Bug - Erratum #1485
Merged today to Linux 6.6 Git is a new patch for fixing an AMD erratum CPU bug affecting Zen 4 based processors like the Ryzen 7000 series and EPYC 8004/9004 series.
Merged to the Linux kernel is a patch adding around a dozen lines of code for fixing a recently uncovered Zen 4 bug. The issue is an undefined instruction (#UD) exception potentially occurring when running Zen 4 without the Single Threaded Indirect Branch Predictors (STIBP) enabled. STIBP is needed for Zen 4 as part of the default security mitigations. STIBP is used as part of Spectre Variant Two protections. But for those booting their Linux kernel with "mitigations=off" or more selectively disabling the CPU security mitigations in trying to enhance performance, this undefined instruction exception can erroneously appear in such configuration.
The erratum was discovered when the T2 Linux distribution crew reported random illegal instruction build errors while compiling code. As part of the report, mitigations=off was reported and that when not disabling mitigations, these spurious illegal instructions did not appear.
After research/testing by AMD, it's now been confirmed to be a Zen 4 bug and identified as Erratum #1485. The good news is that with this fix the performance impact is negligible. Additionally, as mentioned, this bug only occurs if you end up disabling the STIBP security feature. So those running AMD Ryzen 7000 series or EPYC 8004/9004 series out-of-the-box won't encounter these spurious illegal instructions errors unless you are disabling the default security protections -- which isn't recommended for production systems and the "mitigations=off" benefits these days tend to be quite small anyways for most workloads.
While in Linux 6.6 Git as of today, the small erratum bug fix is marked for back-porting to existing stable Linux kernel series as well. This is a CPU hardware bug so other operating systems are presumably affected as well, but outside of Linux with the easy "mitigations=off" knob it's even less common on other operating systems for going through the steps to disable CPU security mitigations.
Merged to the Linux kernel is a patch adding around a dozen lines of code for fixing a recently uncovered Zen 4 bug. The issue is an undefined instruction (#UD) exception potentially occurring when running Zen 4 without the Single Threaded Indirect Branch Predictors (STIBP) enabled. STIBP is needed for Zen 4 as part of the default security mitigations. STIBP is used as part of Spectre Variant Two protections. But for those booting their Linux kernel with "mitigations=off" or more selectively disabling the CPU security mitigations in trying to enhance performance, this undefined instruction exception can erroneously appear in such configuration.
The erratum was discovered when the T2 Linux distribution crew reported random illegal instruction build errors while compiling code. As part of the report, mitigations=off was reported and that when not disabling mitigations, these spurious illegal instructions did not appear.
After research/testing by AMD, it's now been confirmed to be a Zen 4 bug and identified as Erratum #1485. The good news is that with this fix the performance impact is negligible. Additionally, as mentioned, this bug only occurs if you end up disabling the STIBP security feature. So those running AMD Ryzen 7000 series or EPYC 8004/9004 series out-of-the-box won't encounter these spurious illegal instructions errors unless you are disabling the default security protections -- which isn't recommended for production systems and the "mitigations=off" benefits these days tend to be quite small anyways for most workloads.
While in Linux 6.6 Git as of today, the small erratum bug fix is marked for back-porting to existing stable Linux kernel series as well. This is a CPU hardware bug so other operating systems are presumably affected as well, but outside of Linux with the easy "mitigations=off" knob it's even less common on other operating systems for going through the steps to disable CPU security mitigations.
13 Comments