pub struct MemoryProtection { /* private fields */ }Expand description
Memory protection manager
Implementations§
Source§impl MemoryProtection
impl MemoryProtection
Sourcepub fn new() -> Result<Self, KernelError>
pub fn new() -> Result<Self, KernelError>
Create new memory protection manager
Sourcepub fn set_stack_canaries(&mut self, enabled: bool)
pub fn set_stack_canaries(&mut self, enabled: bool)
Enable/disable stack canaries
Sourcepub fn stack_canaries_enabled(&self) -> bool
pub fn stack_canaries_enabled(&self) -> bool
Check if stack canaries are enabled
Sourcepub fn set_guard_pages(&mut self, enabled: bool)
pub fn set_guard_pages(&mut self, enabled: bool)
Enable/disable guard pages
Sourcepub fn guard_pages_enabled(&self) -> bool
pub fn guard_pages_enabled(&self) -> bool
Check if guard pages are enabled
Sourcepub fn dep_enabled(&self) -> bool
pub fn dep_enabled(&self) -> bool
Check if DEP is enabled
Sourcepub fn create_canary(&self) -> Option<StackCanary>
pub fn create_canary(&self) -> Option<StackCanary>
Create stack canary if enabled
Sourcepub fn create_guard_page(
&self,
address: usize,
size: usize,
) -> Option<GuardPage>
pub fn create_guard_page( &self, address: usize, size: usize, ) -> Option<GuardPage>
Create guard page if enabled
Sourcepub fn dep_enforcement(&self) -> &DepEnforcement
pub fn dep_enforcement(&self) -> &DepEnforcement
Get DEP enforcement reference