Linux Lands Fix For AMD Zen 1 Bug That Could Leak Data After A Division By Zero

Written by Michael Larabel in AMD on 9 August 2023 at 02:27 PM EDT. 11 Comments
AMD
After a rather busy Patch Tuesday with the AMD Inception vulnerability and Intel Downfall going public, the Linux kernel saw a new bug fix merged today for a different issue... It turns out original AMD Zen 1 processors could end up leaking data in certain conditions after a divide by zero occurs.

Longtime AMD Linux developer Borislav Petkov authored a kernel patch to workaround this AMD Zen 1 bug for the Ryzen 1000 series and EPYC 7001 series processors. In the commit he explains:
x86/CPU/AMD: Do not leak quotient data after a division by 0

Under certain circumstances, an integer division by 0 which faults, can leave stale quotient data from a previous division operation on Zen1 microarchitectures.

Do a dummy division 0/1 before returning from the #DE exception handler in order to avoid any leaks of potentially sensitive data.

In the code this issue is simply referred to as the "AMD DIV0 speculation bug."

AMD divide by zero bug


The dummy division 0/1 is set to happen only for AMD Zen 1 processors. A kernel message added by this patch also notes that disabling Symmetric Multi-Threading (SMT) is the way to achieve "full" protection against this divide by zero issue.


This patch was merged a few minutes ago for Linux 6.5 Git while is also marked for back-porting to all the stable Linux kernel series.
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