Introduction
Modern System-on-Chip (SoC) designs, particularly Apple’s M-series, have introduced complex memory hierarchies to balance performance and energy efficiency. A central component of this architecture is the System-Level Cache (SLC), a large, shared buffer designed to facilitate communication between various hardware blocks, including CPU clusters and the Graphics Processing Unit (GPU). While traditional cache occupancy attacks have focused on inclusive Last-Level Caches (LLC), Apple’s move toward an "exclusive" SLC architecture was thought to provide a natural defense against such side-channel exploits.
This paper introduces EXAM, the first suite of cache occupancy attacks specifically targeting the SLC in Apple Silicon. By reverse-engineering the unique properties of the SLC, researchers have demonstrated that the transition to an exclusive architecture does not eliminate side-channel risks. Instead, it creates new vulnerabilities that allow attackers to fingerprint websites, steal pixels from cross-origin iframes, and snoop on screen content by monitoring the competition for cache space between the CPU and GPU.
The Challenge of Exclusive Architectures
In traditional inclusive cache hierarchies, the LLC contains a copy of all data present in the smaller L1 and L2 caches. This allows an attacker to monitor a victim's memory activity by simply observing evictions in the LLC. Apple’s M-series chips (M1, M2, and M3) deviate from this model by using an exclusive SLC. In this design, the SLC primarily stores data that has been evicted from the L2 cache, rather than mirroring it. This architectural choice effectively breaks standard occupancy attacks, as the attacker can no longer directly observe the victim's active working set in the shared cache.
Reverse Engineering the SLC
To overcome these architectural hurdles, the researchers performed extensive reverse engineering on the Apple M1 chip using high-resolution counting-thread timers. Their investigation revealed three critical properties of the SLC:
- Hybrid Inclusivity: While the SLC is exclusive to CPU caches, it remains inclusive to the GPU cache. This creates a "bridge" where GPU activity is mirrored in the SLC, making it visible to a CPU-based attacker.
- Non-Standard Set Indexing: Unlike the L2 cache, the SLC ignores the lowest 13 bits of a physical address for indexing, utilizing bits from the 14th position and above. This discovery was vital for accurately targeting specific cache sets.
- Replacement Policy: The SLC employs a pseudo-random replacement policy rather than a strict Least Recently Used (LRU) approach, necessitating more sophisticated measurement techniques.
The EXAM Attack Methodology
Using these insights, the authors developed a novel SLC Occupancy Channel. To bypass the L2 cache and interact directly with the SLC, the attack uses a specific memory access stride of 8192 bytes. Furthermore, to mitigate "self-eviction"—a common source of noise where the attacker's own accesses clear their monitored data—the researchers introduced an Alternated-Order Access Pattern, which switches between sequential and reverse memory access.
The GPU Side-Channel Bridge
Because the SLC is inclusive for the GPU, it acts as a side-channel conduit. When the GPU renders frames, its data is cached in the SLC. An attacker running on a CPU core can monitor the occupancy levels of the SLC to infer GPU activity. This is further amplified by Data-Dependent Compression; Apple’s GPU uses less memory when rendering "zero" values (black pixels). Consequently, the SLC occupancy level correlates directly with the brightness and color composition of the victim's screen.
Experimental Results
The researchers evaluated EXAM across multiple generations of Apple hardware (M1, M1 Pro, and M3 Pro) and various browsers (Chrome, Safari, and Firefox).
- Website Fingerprinting: EXAM achieved a 90.5% accuracy rate in identifying websites from a closed-world dataset of the Alexa Top 100. Notably, the attack remained effective in "cross-cluster" scenarios, where the attacker and victim were located on different CPU core types (e.g., Performance vs. Efficiency cores).
- Pixel Stealing: The attack successfully retrieved pixels from cross-origin iframes with 92% accuracy. EXAM is approximately 2.5x faster than "GPU-ZIP," the only other known pixel-stealing attack for M1, and it successfully bypasses Apple's previous security patches (CVE-2023-38599).
- Screen Display Snooping: By aligning measurements with the macOS
Vsyncsignal, the researchers identified that screen rendering occurs in 28 distinct horizontal "epochs." This allowed them to reconstruct text and images from the screen with a granularity of 57 vertical pixels.
Countermeasures and Limitations
The researchers proposed an enhanced "cache masking" technique to defend against EXAM. By utilizing a larger buffer and the identified 8KB stride, they demonstrated that an automated defense could hide victim activity with a performance overhead of less than 5% for single-core tasks.
However, EXAM does have limitations. The screen-snooping component currently requires the target content to remain static for several minutes to achieve high-fidelity reconstruction, as rapid movement or video playback introduces significant noise. Additionally, heavy background tasks that saturate the SLC can interfere with signal extraction.
Conclusion
EXAM demonstrates that exclusive cache architectures in modern SoCs do not inherently provide security against side-channel attacks. By exploiting the hybrid inclusivity of the System-Level Cache and the data-dependent nature of GPU compression, EXAM reveals a potent new class of vulnerabilities in Apple Silicon. As SoCs continue to integrate heterogeneous components, understanding the security implications of shared, exclusive caches will be paramount for future hardware design.
Summary updated