메뉴
BL
Ars Technica 58일 전

엔비디아 GPU 대상 로우해머 공격으로 시스템 장악 가능

IMP
8/10
핵심 요약

최근 두 개의 독립적인 연구팀이 엔비디아 고성능 GPU를 대상으로 하는 새로운 로우해머(Rowhammer) 공격 기법을 발표했습니다. 이 공격은 GPU 메모리(GDDR)에서 비트 플립을 유발하여 공격자가 호스트 시스템의 CPU 메모리에 대한 무단 읽기/쓰기 권한을 얻고 결국 시스템 전체를 완전히 장악할 수 있게 합니다. 클라우드 환경에서 고가의 GPU 자원을 공유하는 보안 모델에 심각한 위협이 될 수 있어 실무적인 대응이 요구됩니다.

번역된 본문

고성능 GPU의 가격은 보통 8,000달러 이상이기 때문에 클라우드 환경에서는 수십 명의 사용자가 이를 공유하는 경우가 많습니다. 두 가지 새로운 공격 기법은 악의적인 사용자가 엔비디아(Nvidia)가 제작한 고성능 GPU 카드에 대해 새로운 로우해머(Rowhammer) 공격을 수행하여 호스트 머신의 완전한 루트(root) 제어 권한을 얻을 수 있는 방법을 보여줍니다.

이 공격은 메모리 하드웨어가 비트 플립(0이 1로, 또는 1이 0으로 변하는 현상)에 점점 더 취약해지는 현상을 악용합니다. 2014년, 연구자들은 DRAM이라는 메모리 하드웨어에 반복적이고 빠른 접근, 즉 '해머링(hammering)'을 가하면 전기적 교란이 발생하여 비트가 뒤집힌다는 것을 처음으로 입증했습니다. 1년 후, 다른 연구팀은 민감한 데이터가 저장된 특정 DRAM 행(row)을 표적으로 삼아 이 현상을 악용하면, 권한이 없는 사용자가 루트 권한으로 권한을 상승시키거나 보안 샌드박스 보호를 회피할 수 있다는 것을 보여주었습니다. 이 두 공격은 모두 DDR3 세대의 DRAM을 표적으로 삼았습니다.

CPU에서 GPU로: 로우해머의 10년 여정 지난 10년 동안 수십 가지의 새로운 로우해머 공격이 진화하면서 다음과 같은 성과를 냈습니다:

  • 오류 정정 코드(ECC) 보호 기능이 있는 DDR3 및 DDR4 세대를 포함하여 더 다양한 유형의 DRAM 표적화
  • 로우해머 풍수(feng shui) 및 RowPress와 같은 새로운 해머링 기술을 사용하여 민감한 데이터가 저장된 극히 작은 메모리 영역을 정밀 타격
  • 이러한 기술을 활용하여 로컬 네트워크를 통한 공격, 안드로이드 기기 루팅, 2048비트 암호화 키 탈취 등 수행
  • 작년에 처음으로 고성능 엔비디아 GPU에 사용되는 GDDR DRAM에 대한 공격 성공

마지막 성과는 GDDR이 로우해머 공격에 취약하다는 것을 증명했지만, 그 결과는 미미했습니다. 연구진은 8회의 비트 플립만을 달성했으며, 이는 CPU DRAM에서 가능했던 것에 비하면 극히 일부에 불과했습니다. 또한 피해는 표적 GPU에서 실행 중인 신경망의 출력 성능을 저하시키는 데 그쳤습니다.

목요일, 독립적으로 작업한 두 연구팀이 엔비디아 암페어(Ampere) 세대의 두 그래픽 카드를 표적으로 삼아 GPU 로우해머링을 새롭고 잠재적으로 훨씬 더 심각한 결과를 초래할 수 있는 수준으로 발전시켰습니다. 이는 공격자가 CPU 메모리를 완전히 제어할 수 있게 만드는 GDDR 비트 플립을 유발하여 결과적으로 호스트 머신의 시스템을 완전히 장악하게 만듭니다. 이 공격이 작동하려면 IOMMU 메모리 관리가 비활성화되어 있어야 하며, 이는 BIOS 설정의 기본값과 같습니다.

논문 중 하나의 공동 저자인 앤드루 콩(Andrew Kwong)은 “우리의 연구는 CPU에서 광범위하게 연구된 로우해머가 GPU에도 심각한 위협이 된다는 것을 보여준다”고 말했습니다. 해당 논문의 제목은 'GDDRHammer: Greatly Disturbing DRAM Rows—Cross-Component Rowhammer Attacks from Modern GPUs'입니다. “우리의 연구를 통해… 공격자가 GPU에서 비트 플립을 유도하여 CPU 메모리 전체에 대한 임의의 읽기/쓰기 액세스 권한을 얻어 시스템을 완전히 장악할 수 있는 방법을 보여줍니다.”

등장: GDDRHammer, GeForge 논문에서 시연된 공격은 GDDRHammer이며, 첫 네 글자는 'Graphics DDR'과 'Greatly Disturbing DRAM Rows'를 동시에 의미합니다. 이 공격은 엔비디아의 암페어 아키텍처 기반인 RTX 6000에 대해 작동합니다. 최근 출시된 에이다(Ada) 세대의 RTX 6000 모델에는 작동하지 않는데, 이는 해당 모델이 연구원들이 리버스 엔지니어링하지 않은 새로운 형태의 GDDR을 사용하기 때문입니다.

새로운 해머링 패턴과 '메모리 마사지(memory massaging)'라는 기술을 사용하여 GDDRHammer는 메모리 뱅크당 평균 129회의 플립을 유도했으며, 이는 작년의 앞서 언급된 GPUHammer보다 64배 증가한 수치입니다. 더욱 심각한 것은 GDDRHammer가 메모리 할당자를 조작하여 GPU 페이지 테이블(CPU 페이지 테이블처럼 가상 주소와 물리적 DRAM 주소 간의 매핑을 저장하는 데이터 구조)의 격리와 GPU에 저장된 사용자 데이터의 격리를 깰 수 있다는 점입니다. 그 결과 공격자는 GPU 메모리를 읽고 쓸 수 있는 능력을 갖게 됩니다.

이메일 인터뷰에서 콩은 계속해서 말했습니다. 우리의 연구가 기존 공격과 차별화되는 점은 우리가 로우(Row)…

원문 보기
원문 보기 (영어)
Text settings Story text Size Small Standard Large Width * Standard Wide Links Standard Orange * Subscribers only Learn more Minimize to nav The cost of high-performance GPUs, typically $8,000 or more, means they are frequently shared among dozens of users in cloud environments. Two new attacks demonstrate how a malicious user can gain full root control of a host machine by performing novel Rowhammer attacks on high-performance GPU cards made by Nvidia. The attacks exploit memory hardware’s increasing susceptibility to bit flips, in which 0s stored in memory switch to 1s and vice versa. In 2014 , researchers first demonstrated that repeated, rapid access—or “hammering”—of memory hardware known as DRAM creates electrical disturbances that flip bits. A year later , a different research team showed that by targeting specific DRAM rows storing sensitive data, an attacker could exploit the phenomenon to escalate an unprivileged user to root or evade security sandbox protections. Both attacks targeted DDR3 generations of DRAM. From CPU to GPU: Rowhammer’s decade-long journey Over the past decade, dozens of newer Rowhammer attacks have evolved to, among other things: Target a wider range of DRAM types, such as DDR3 with error correcting code protections and DDR4 generations , including those with Target Row Refresh and ECC protections Use new hammering techniques, such as Rowhammer feng shui and RowPress that zero in on extremely small regions of memory storing sensitive data Use such techniques to make attacks work over local networks , root Android devices , steal 2048-bit encryption keys For the first time last year , work against GDDR DRAM used with high-performance Nvidia GPUs The last feat proved that GDDR was susceptible to Rowhammer attacks, but the results were modest. The researchers achieved only eight bitflips, a small fraction of what has been possible on CPU DRAM, and the damage was limited to degrading the output of a neural network running on the targeted GPU. On Thursday, two research teams, working independently of each other, demonstrated attacks against two cards from Nvidia’s Ampere generation that take GPU rowhammering into new—and potentially much more consequential—territory: GDDR bitflips that give adversaries full control of CPU memory, resulting in full system compromise of the host machine. For the attack to work, IOMMU memory management must be disabled, as is the default in BIOS settings. “Our work shows that Rowhammer, which is well-studied on CPUs, is a serious threat on GPUs as well,” said Andrew Kwong, co-author of one of the papers. “ GDDRHammer: Greatly Disturbing DRAM Rows—Cross-Component Rowhammer Attacks from Modern GPUs .” “With our work, we… show how an attacker can induce bit flips on the GPU to gain arbitrary read/write access to all of the CPU’s memory, resulting in complete compromise of the machine.” Enter: GDDRHammer, GeForge The attack demonstrated in the paper is GDDRHammer, with the first four initials standing for both “Graphics DDR” and “Greatly Disturbing DRAM Rows.” It works against the RTX 6000 from Nvidia’s Ampere generation of architecture. The attack doesn’t work against the RTX 6000 models from the more recent Ada generation because they use a newer form of GDDR that the researchers didn’t reverse-engineer. Using novel hammering patterns and a technique called memory massaging, GDDRHammer induced an average of 129 flips per memory bank, a 64-fold increase over the previously mentioned GPUHammer from last year. More consequentially, GDDRHammer can manipulate the memory allocator to break isolation of GPU page tables—which, like CPU page tables , are the data structures used to store mappings between virtual addresses and physical DRAM addresses—and user data stored on the GPU. The result is that the attacker acquires the ability to both read and write to GPU memory. In an email, Kwong continued: What our work does that separates us from prior attacks is that we uncover that Rowhammer on GPU memory is just as severe of a security consequence as Rowhammer on the CPU and that Rowhammer mitigations on CPU memory are insufficient when they do not also consider the threat from Rowhammering GPU memory. A large body of work exists, both theoretical and widely deployed, on both software and hardware level mitigations against Rowhammer on the CPU. However, we show that an attacker can bypass all of these protections by instead Rowhammering the GPU and using that to compromise the CPU. Thus, going forward, Rowhammer solutions need to take into consideration both the CPU and the GPU memory. The second paper—“GeForge: Hammering GDDR Memory to Forge GPU Page Tables for Fun and Profit”—does largely the same thing, except that instead of exploiting the last-level page table, as GDDRHammer does, it manipulates the last-level page directory. It was able to induce 1,171 bitflips against the RTX 3060 and 202 bitflips against the RTX 6000. GeForge, too, uses novel hammering patterns and memory massaging to corrupt GPU page table mappings in GDDR6 memory to acquire read and write access to the GPU memory space. From there, it acquires the same privileges over host CPU memory. The GeForge proof-of-concept exploit against the RTX 3060 concludes by opening a root shell window that allows the attacker to issue commands that run unfettered privileges on the host machine. The researchers said that both GDDRHammer and GeForge could do the same thing against the RTC 6000. “By manipulating GPU address translation, we launch attacks that breach confidentiality and integrity across GPU contexts,” the authors of the GeForge paper (which currently isn’t available publicly) wrote. “More significantly, we forge system aperture mappings in corrupted GPU page tables to access host physical memory, enabling user-to-root escalation on Linux. To our knowledge, this is the first GPUside Rowhammer exploit that achieves host privilege escalation.” Memory massaging: therapy for GPU exploitation Nvidia’s GPU driver stores page tables in a reserved region of low-level memory where stored bits can’t be flipped by Rowhammering. To work around this design, both GDDRHammer and GeForge steer the tables into regions that aren’t protected against the electrical disturbance. For GDDRHammer, the massaging is accomplished by using Rowhammer to flip bits that allocate access to the protected region. “Since these page tables dictate what memory is accessible, the attacker can modify the page table entry to give himself arbitrary access to all of the GPU’s memory,” Kwong explained by email. “Moreover, we found that an attacker can modify the page table on the GPU to point to memory on the CPU, thereby giving the attacker the ability to read/write all of the CPU’s memory as well, which of course completely compromises the machine.” Meanwhile, Zhenkai Zhang, co-author of the GeForge paper, described the massaging process this way: Given a steering destination, we first isolate the 2 MB page frame containing it. We then use sparse UVM [unified virtual memory] accesses to drain the driver’s default low-memory page-table allocation pool and free the isolated frame at exactly the right moment so it becomes the driver’s new page-table allocation region. Next, we carefully advance allocations so that a page directory entry lands on the vulnerable subpage inside that frame. Finally, we trigger the bit flip so the corrupted page directory entry redirects its pointer into attacker-controlled memory, where a forged page table can be filled with crafted entries. In an email, an Nvidia representative said users seeking guidance on whether they’re vulnerable and what actions they should take can view this page published in July in response to the previous GPUHammer attack. The representative didn’t elaborate. So where do we go now? The researchers said that both the RTX 3060 and RTX 6000 cards are vulnerable. Changing BIOS defaults to enable IOMMU closes the vulnerability,