Skip to main content
QUICK REVIEW

[Paper Review] LeftoverLocals: Listening to LLM Responses Through Leaked GPU Local Memory

Tyler Sorensen, Heidy Khlaaf|arXiv (Cornell University)|Jan 29, 2024
Advanced Neural Network ApplicationsComputer Science4 citations
TL;DR

This paper introduces LeftoverLocals, a side-channel vulnerability enabling remote recovery of sensitive data—particularly LLM responses—from GPU local memory across process or container boundaries on Apple, AMD, Qualcomm, and Imagination GPUs. By exploiting residual data in optimized GPU memory regions, the authors demonstrate a proof-of-concept attack that reconstructs LLM outputs with high fidelity, leaking up to 181 MB per query on an AMD Radeon RX 7900 XT.

ABSTRACT

This paper describes LeftoverLocals: a vulnerability that allows data recovery from GPU memory created by another process on Apple, Qualcomm, and AMD GPUs. LeftoverLocals impacts the security posture of GPU applications, with particular significance to LLMs and ML models that run on impacted GPUs. By recovering local memory, an optimized GPU memory region, we built a PoC where an attacker can listen into another user's interactive LLM session (e.g., llama.cpp) across process or container boundaries.

Motivation & Objective

  • To identify and demonstrate a novel side-channel vulnerability in GPU memory management that allows co-resident processes to recover sensitive data from local memory regions.
  • To investigate the security implications of GPU memory isolation in machine learning workloads, particularly for privacy-sensitive LLM inference.
  • To evaluate the feasibility of recovering full LLM responses from residual GPU memory after process termination.
  • To coordinate responsible disclosure with major GPU vendors and promote stronger security specifications across GPU ecosystems.
  • To advocate for formalized threat models and rigorous security testing of GPU systems, especially in AI/ML workloads.

Proposed method

  • Exploiting GPU local memory—optimized for low-latency access and not zero-initialized after use—by measuring residual data in memory regions after a process terminates.
  • Using OpenCL, Vulkan, or Metal to launch GPU kernels that read from memory locations previously used by a victim process.
  • Designing memory access patterns to maximize signal-to-noise ratio and reconstruct data with high fidelity using statistical and pattern-matching techniques.
  • Building a proof-of-concept (PoC) application that runs on the same GPU as a victim LLM inference process (e.g., llama.cpp) and recovers output tokens from leaked local memory.
  • Validating the attack across multiple GPU architectures (AMD, Apple M2/A17, Qualcomm, Imagination) and measuring data recovery accuracy and volume.
  • Engaging in coordinated disclosure with CERT/CC and vendors, including testing firmware patches and monitoring mitigation status.
Figure 1 . An example of an LLM response that an attacker was able to reconstruct utilizing LeftoverLocals. The victim terminal is on the left (black background), and the attacker terminal is on the right (white backgroun). We can see that the attacker is able to reconstruct the response with relati
Figure 1 . An example of an LLM response that an attacker was able to reconstruct utilizing LeftoverLocals. The victim terminal is on the left (black background), and the attacker terminal is on the right (white backgroun). We can see that the attacker is able to reconstruct the response with relati

Experimental results

Research questions

  • RQ1To what extent can residual data in GPU local memory be recovered by a co-resident process after a GPU kernel completes?
  • RQ2How much LLM output data can be reconstructed from GPU local memory leaks, and with what fidelity?
  • RQ3Which GPU architectures (Apple, AMD, Qualcomm, Imagination) are vulnerable to this type of memory leakage?
  • RQ4What are the practical implications of this vulnerability for privacy-sensitive machine learning applications?
  • RQ5How effective are current GPU specifications and system stacks in preventing such cross-process memory leaks?

Key findings

  • LeftoverLocals enables recovery of up to 181 MB of LLM response data per query on an AMD Radeon RX 7900 XT, due to 5.5 MB of local memory leakage per GPU invocation.
  • The attack successfully reconstructs full LLM responses with high fidelity, as demonstrated in a real-time PoC where an attacker terminal reconstructs output from a victim's interactive LLM session.
  • Apple’s M2-based MacBook Air remains vulnerable, despite patches on some devices like the iPad Air 3rd Gen, and only the A17 and M3 series are confirmed fixed.
  • AMD and Qualcomm have confirmed ongoing investigation and patching, with Qualcomm releasing a firmware update (v2.07) that mitigates the issue on some devices.
  • Imagination GPUs were found to be impacted in some configurations, though not in all tested models; a fix was released in DDK 23.3.
  • NVIDIA and ARM GPUs were confirmed not to be affected, likely due to prior hardening and security awareness.
Figure 2 . A simplified view of the GPU architecture: processing elements are partitioned into compute unites. All processing elements have access to global memory (often located in VRAM for discrete GPUs), while only processing elements in the same compute unit share the same local memory.
Figure 2 . A simplified view of the GPU architecture: processing elements are partitioned into compute unites. All processing elements have access to global memory (often located in VRAM for discrete GPUs), while only processing elements in the same compute unit share the same local memory.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.