Nvidia Ampere GPUs got unlocked/exploited
Researchers have discovered and exploited a fundamental flaw in Nvidia's Ampere GPU boot process, enabling memory unlocks on professional cards.
In recent months, multiple exploits targeting Nvidia's Ampere generation GPUs have emerged, all leveraging the same fundamental vulnerability in the boot process. The most prominent example, developed by Amogh Munikote, enables unlocking 8GB and 10GB CMP 170hx professional cards to 64GB and 40GB respectively, gaining significant attention in tech media.
The vulnerability exists in the secure boot preparation phase of the Ampere boot sequence. During this stage, the GPU's Security Engine 2 (SEC2) processes firmware loaded via hardware DMA that decrypts and verifies the GPU System Processor (GSP) firmware before execution.
Boot Process Vulnerability
The exploit targets a buffer overflow in the booter firmware running on the SEC2 security processor. This vulnerability allows attackers to execute arbitrary code through Return Oriented Programming (ROP), a technique that manipulates the program's return address to string together existing code pieces called 'gadgets'.
ROPs basically exploit a common functionality in many CPU architectures to have dedicated instructions for calling and returning from functions. The call instruction will jump to code at a specific address but before doing so push the address of the instruction right after itself onto the stack.
Researchers discovered this vulnerability by analyzing Nvidia's debug firmware blobs, which were accidentally encrypted with a known public test-key scheme. This oversight allowed security experts to decrypt the firmware, disassemble it, and identify the vulnerable code paths.
The Unlock Mechanism
The v67 payload developed by researchers exploits this vulnerability to manipulate GPU memory configuration registers. Specifically, it targets registers that control the issue rate of various instructions, which are normally protected by privilege level masks (PLM).
By writing to the FEAT_OVR_PLM register from within the ROP gadget, the exploit removes write restrictions, allowing manipulation of critical memory configuration settings. This enables the dramatic memory increases observed in unlocked cards.
The process involves precise manipulation of 4-bit fields that govern instruction rates, with the ultimate goal of writing specific values to the SS0 and SS1 registers to achieve the memory configuration changes.