swage_core/lib.rs
1//! # Swage Core
2//!
3//! `swage-core` is the foundational library for the Swage Rowhammer attack framework.
4//! It provides a modular, trait-based architecture that enables composable implementations
5//! of memory allocation strategies, hammering techniques, and victim orchestration.
6//!
7//! ## Architecture Overview
8//!
9//! The framework is built around three core traits that define the interface for
10//! each component:
11//!
12//! - [`allocator::ConsecAllocator`] - Defines memory allocation strategies for obtaining
13//! consecutive physical memory blocks required for Rowhammer attacks.
14//!
15//! - [`hammerer::Hammering`] - Defines the interface for different hammering implementations
16//! that perform the actual memory access patterns to trigger bit flips.
17//!
18//! - [`victim::VictimOrchestrator`] - Defines the interface for victim applications or
19//! memory regions that are targeted by the attack and checked for bit flips.
20//!
21//! ## Main Components
22//!
23//! - [`Swage`] - The main orchestrator that combines an allocator, hammerer, and victim
24//! to execute complete Rowhammer experiments with profiling and reproducibility checks.
25//!
26//! - [`memory`] module - Provides memory management abstractions including [`memory::Memory`],
27//! [`memory::ConsecBlocks`], and various traits for memory initialization and checking.
28//!
29//! - [`util`] module - Contains utility types and functions including [`util::Size`]
30//! for memory size representations and various helper traits.
31//!
32//! ## Platform Support
33//!
34//! This framework is designed for x86_64 Linux systems with access to physical memory
35//! information through `/proc/self/pagemap` and related interfaces. Some operations and modules
36//! require elevated privileges (root access) or custom kernel modules.
37
38#![warn(missing_docs)]
39
40pub mod allocator;
41pub mod hammerer;
42mod mem_check;
43pub mod memory;
44pub mod page_inject;
45mod swage;
46pub mod util;
47pub mod victim;
48
49pub use crate::mem_check::HammerVictimTargetCheck;
50pub use crate::mem_check::{ExcludeFromInit, MemCheck};
51
52pub use swage::{DataPatternKind, ExperimentData, RoundProfile, Swage, SwageConfig};