Microarchitectural Attacks and Security

Microarchitectural attacks are a sophisticated class of cybersecurity threats that exploit the physical implementation of a processor's design rather than traditional software vulnerabilities. These attacks leverage side channels—unintended information pathways created by performance-optimizing hardware features like caches, speculative execution, and branch prediction—to leak sensitive information. By observing subtle, measurable effects such as timing differences in memory access, an attacker can infer secret data, like cryptographic keys or passwords, from otherwise isolated and protected processes. The field of microarchitectural security, therefore, focuses on understanding, detecting, and mitigating these hardware-level vulnerabilities through a combination of software patches, compiler-based defenses, and the development of more resilient processor architectures.

  1. Foundations of Microarchitectural Security
    1. Computer Architecture Fundamentals
      1. Instruction Set Architecture (ISA)
        1. Definition and Purpose of ISA
          1. ISA Components
            1. Instruction Formats
              1. Addressing Modes
                1. Register Sets
                  1. Data Types
                  2. Common ISA Examples
                    1. x86-64
                      1. ARM
                        1. RISC-V
                        2. ISA vs Microarchitecture Distinction
                        3. Microarchitectural Implementation
                          1. Definition of Microarchitecture
                            1. Implementation Variations for Same ISA
                              1. Performance vs Security Trade-offs
                              2. Microarchitectural State
                                1. Architectural State
                                  1. Programmer-Visible Registers
                                    1. Memory Contents
                                      1. Program Counter
                                      2. Non-Architectural State
                                        1. Cache Contents
                                          1. Branch Predictor State
                                            1. Pipeline Registers
                                              1. Translation Buffers
                                              2. State Persistence Characteristics
                                                1. State Visibility and Access Control
                                                2. Hardware-Software Abstraction
                                                  1. Abstraction Layer Model
                                                    1. Hardware-Software Contract
                                                      1. Security Assumptions in Abstraction
                                                        1. Abstraction Violations and Security Implications
                                                      2. Performance Optimization Features
                                                        1. Memory Hierarchy and Caches
                                                          1. Cache Fundamentals
                                                            1. Temporal Locality
                                                              1. Spatial Locality
                                                                1. Cache Performance Metrics
                                                                2. Cache Hierarchy Levels
                                                                  1. L1 Instruction Cache
                                                                    1. L1 Data Cache
                                                                      1. L2 Unified Cache
                                                                        1. L3 Shared Cache
                                                                          1. Last Level Cache (LLC)
                                                                          2. Cache Organization Schemes
                                                                            1. Direct-Mapped Caches
                                                                              1. Set-Associative Caches
                                                                                1. Fully-Associative Caches
                                                                                  1. Cache Line Size and Alignment
                                                                                  2. Cache Replacement Policies
                                                                                    1. Least Recently Used (LRU)
                                                                                      1. Random Replacement
                                                                                        1. Pseudo-LRU
                                                                                        2. Cache Coherence in Multi-Core Systems
                                                                                          1. MESI Protocol States
                                                                                            1. MOESI Protocol Extensions
                                                                                              1. Directory-Based Coherence
                                                                                                1. Snooping Protocols
                                                                                                2. Inclusive vs Exclusive Cache Hierarchies
                                                                                                  1. Cache Partitioning and Sharing
                                                                                                  2. Instruction Execution Optimization
                                                                                                    1. Pipelining
                                                                                                      1. Pipeline Stages
                                                                                                        1. Instruction Fetch
                                                                                                          1. Instruction Decode
                                                                                                            1. Execute
                                                                                                              1. Memory Access
                                                                                                                1. Write Back
                                                                                                                2. Pipeline Hazards
                                                                                                                  1. Data Hazards
                                                                                                                    1. Control Hazards
                                                                                                                      1. Structural Hazards
                                                                                                                      2. Hazard Resolution Techniques
                                                                                                                      3. Superscalar Execution
                                                                                                                        1. Multiple Issue Pipelines
                                                                                                                          1. Instruction-Level Parallelism
                                                                                                                            1. Resource Allocation
                                                                                                                            2. Out-of-Order Execution
                                                                                                                              1. Instruction Scheduling
                                                                                                                                1. Reorder Buffer Operation
                                                                                                                                  1. Register Renaming Mechanisms
                                                                                                                                    1. Dependency Tracking
                                                                                                                                      1. Commit and Retirement
                                                                                                                                    2. Speculative Execution Mechanisms
                                                                                                                                      1. Branch Prediction
                                                                                                                                        1. Static Branch Prediction
                                                                                                                                          1. Dynamic Branch Prediction
                                                                                                                                            1. Two-Level Adaptive Predictors
                                                                                                                                              1. Tournament Predictors
                                                                                                                                                1. Perceptron-Based Predictors
                                                                                                                                                2. Branch Target Prediction
                                                                                                                                                  1. Branch Target Buffer (BTB) Structure
                                                                                                                                                    1. BTB Indexing and Tagging
                                                                                                                                                      1. Indirect Branch Prediction
                                                                                                                                                      2. Return Address Prediction
                                                                                                                                                        1. Return Stack Buffer (RSB) Operation
                                                                                                                                                          1. RSB Overflow Handling
                                                                                                                                                          2. Speculative Memory Operations
                                                                                                                                                            1. Load Speculation
                                                                                                                                                              1. Store-to-Load Forwarding
                                                                                                                                                                1. Memory Disambiguation
                                                                                                                                                              2. Simultaneous Multithreading (SMT)
                                                                                                                                                                1. SMT Architecture Principles
                                                                                                                                                                  1. Resource Sharing in SMT
                                                                                                                                                                    1. Execution Units
                                                                                                                                                                      1. Cache Resources
                                                                                                                                                                        1. Branch Predictors
                                                                                                                                                                          1. TLB Sharing
                                                                                                                                                                          2. Thread Scheduling in SMT
                                                                                                                                                                            1. Performance Benefits and Costs
                                                                                                                                                                            2. Memory Management
                                                                                                                                                                              1. Virtual Memory System
                                                                                                                                                                                1. Address Translation Process
                                                                                                                                                                                  1. Page Table Structure
                                                                                                                                                                                    1. Multi-Level Page Tables
                                                                                                                                                                                    2. Translation Lookaside Buffer (TLB)
                                                                                                                                                                                      1. TLB Organization
                                                                                                                                                                                        1. TLB Hierarchy
                                                                                                                                                                                          1. TLB Miss Handling
                                                                                                                                                                                            1. TLB Sharing Models
                                                                                                                                                                                            2. Memory Protection Mechanisms
                                                                                                                                                                                              1. Privilege Levels
                                                                                                                                                                                                1. Page Protection Bits
                                                                                                                                                                                                  1. Segmentation
                                                                                                                                                                                                2. Prefetching Systems
                                                                                                                                                                                                  1. Hardware Prefetchers
                                                                                                                                                                                                    1. Stream Prefetchers
                                                                                                                                                                                                      1. Stride Prefetchers
                                                                                                                                                                                                        1. Pattern-Based Prefetchers
                                                                                                                                                                                                        2. Software Prefetching
                                                                                                                                                                                                          1. Prefetch Instructions
                                                                                                                                                                                                            1. Compiler-Directed Prefetching
                                                                                                                                                                                                            2. Prefetch Buffer Management
                                                                                                                                                                                                          2. Side Channel Fundamentals
                                                                                                                                                                                                            1. Side Channel Definition and Characteristics
                                                                                                                                                                                                              1. Information Leakage Mechanisms
                                                                                                                                                                                                                1. Unintended Information Channels
                                                                                                                                                                                                                  1. Observable vs Exploitable Channels
                                                                                                                                                                                                                  2. Side Channels vs Covert Channels
                                                                                                                                                                                                                    1. Definitional Differences
                                                                                                                                                                                                                      1. Threat Model Distinctions
                                                                                                                                                                                                                        1. Communication vs Observation
                                                                                                                                                                                                                        2. Side Channel Classification
                                                                                                                                                                                                                          1. Timing-Based Channels
                                                                                                                                                                                                                            1. Execution Time Variations
                                                                                                                                                                                                                              1. Cache Access Timing
                                                                                                                                                                                                                                1. Memory Access Timing
                                                                                                                                                                                                                                2. Power-Based Channels
                                                                                                                                                                                                                                  1. Dynamic Power Consumption
                                                                                                                                                                                                                                    1. Static Power Variations
                                                                                                                                                                                                                                    2. Electromagnetic Channels
                                                                                                                                                                                                                                      1. EM Radiation Patterns
                                                                                                                                                                                                                                        1. Near-Field vs Far-Field
                                                                                                                                                                                                                                        2. Acoustic Channels
                                                                                                                                                                                                                                          1. CPU Fan Modulation
                                                                                                                                                                                                                                            1. Coil Whine Patterns
                                                                                                                                                                                                                                            2. Fault-Based Channels
                                                                                                                                                                                                                                              1. Induced Hardware Faults
                                                                                                                                                                                                                                                1. Error Patterns
                                                                                                                                                                                                                                              2. Historical Development
                                                                                                                                                                                                                                                1. Early Timing Attacks
                                                                                                                                                                                                                                                  1. Power Analysis Evolution
                                                                                                                                                                                                                                                    1. Microarchitectural Attack Emergence