pub struct Aslr { /* private fields */ }Expand description
ASLR (Address Space Layout Randomization) manager
Implementations§
Source§impl Aslr
impl Aslr
Sourcepub fn new() -> Result<Self, KernelError>
pub fn new() -> Result<Self, KernelError>
Create new ASLR instance (lightweight — defers CSPRNG to first use)
Entropy seeding is deferred to ensure_seeded() to avoid deep crypto
call chains during early boot, which can overflow the small x86_64
kernel stack in debug mode.
Sourcepub fn randomize_address(&self, base: usize, region_type: RegionType) -> usize
pub fn randomize_address(&self, base: usize, region_type: RegionType) -> usize
Randomize address for given address space region
Sourcepub fn get_stack_canary(&self) -> u64
pub fn get_stack_canary(&self) -> u64
Get random stack offset for stack canary
Sourcepub fn refresh_entropy(&self)
pub fn refresh_entropy(&self)
Refresh entropy pool