pub struct DepEnforcement { /* private fields */ }Expand description
DEP (Data Execution Prevention) / NX enforcement.
Tracks pages that should have the NX bit set and provides helpers for ensuring data pages are not executable.
Implementations§
Source§impl DepEnforcement
impl DepEnforcement
pub fn new() -> Self
Sourcepub fn should_set_nx(&self, region: RegionType) -> bool
pub fn should_set_nx(&self, region: RegionType) -> bool
Determine whether a page at the given address should have NX set.
Data, heap, and stack pages should always be non-executable.
Sourcepub fn enforce_flags(&self, flags: u64, region: RegionType) -> u64
pub fn enforce_flags(&self, flags: u64, region: RegionType) -> u64
Apply NX bit to page table entry flags.
Returns the flags with NO_EXECUTE added if the region type warrants it.