Zenbleed, a vulnerability that affects AMD Zen 2 processors

vulnerability

If exploited, these flaws can allow attackers to gain unauthorized access to sensitive information or generally cause problems

A few days ago , a researcher from Google's security team announced that he had detected a vulnerability (already cataloged under CVE-2023-20593) in AMD processors based on the Zen2 microarchitecture that can be used to detect registers while other processes are running on the same CPU core.

This vulnerability is considered significant because the attack can be carried out from virtual machines and isolated environments. Essentially, the problem resembles classic use-after-free vulnerabilities caused by accessing memory after it has been freed.

The problem occurs with AMD Ryzen 3000, Ryzen PRO 3000, Ryzen Threadripper 3000, Ryzen 4000 with Radeon Graphics, Ryzen PRO 4000, Ryzen 5000 with Radeon Graphics, Ryzen 7020 with Radeon Graphics and the EPYC 7002 series of processors .

About the vulnerability, it is mentioned because in the processors, to store the content of the registers, a register file (RF, Register File) is used, which is an arrangement that is shared in all the tasks in the same core. of the cpu. The Record Allocation Table (RAT) is responsible for attaching records with specific names to the log file resources. In this case, the zero value is stored in the register not by storing an empty value in the register file, but by setting the z-bit flag in the RAT table.

The vulnerability is due to the fact that if the z bit is set during speculative instruction execution , it is not enough to simply reset it in case of an incorrect branch prediction, since the space in the register file can be reallocated from the speculative execution.

The revealed effect occurs when a register is renamed , an instruction for which merge optimization is applied is used, and a speculatively executed vector instruction VZEROUPPER is executed that sets the z bit and releases resources from the register file. If the branch prediction fails and the speculative VZEROUPPER operation is rolled back, the contents of the vector registers can become corrupted, since the z bit is unrolled, but the released resource remains undiscarded.

Through the manipulation of the VZEROUPPER instruction, it is possible to achieve a controlled leakage of processed data in the YMM vector registers used in AVX (Advanced Vector Extensions) and SSE (Streaming SIMD Extensions) modes. These registers are actively used in the memory copy and string processing functions, for example in the Glibc library they are used in the memcpy, strcmp and strlen functions.

To demonstrate the vulnerability, codenamed Zenbleed , a prototype exploit has been prepared that allows an unprivileged user to determine the data processed in AES-NI or REP-MOVS instructions (typically used in the memcpy function). This data can then be used to reconstruct encryption keys and user passwords processed by other processes, including privileged ones. The exploit's data leakage rate is approximately 30 KB per second.

The vulnerability was fixed in the microcode update. A patch for Linux is available for download with the corrected microcode . However, if updating the microcode is not possible, a workaround exists to block the vulnerability, which will result in a performance decrease.

To do this, the control bit DE_CFG[9] must be configured in the CPU and for this, in a terminal, the following command must be typed:

It is worth mentioning that disabling SMT mode does not block the vulnerability and the fix to block the vulnerability was implemented within kernel updates 6.4.6, 6.1.41, 5.15.122, 5.10.187, 5.4.250 and 4.19.289.

For those interested in tracking vulnerability information across different distributions, you can do so on the following pages: Debian , Ubuntu , Gentoo , RHEL , SUSE , Fedora , Arch , OpenBSD , FreeBSD , NetBSD.

Finally, if you are interested in learning more, you can find the details at the following link.


Add as preferred source in Google