Module virtual_memory

Source

Structs§

DualMapping
Dual memory mapping used to map an anonymous memory into two memory regions where one region is read-only, but executable, and the second region is read+write, but not executable. See alloc_dual_mapping for more details.
HardenedRuntimeInfo
Info
Virtual memory information.
MemoryFlags

Enums§

AnonymousMemoryStrategy
HardenedRuntimeFlags
Hardened runtime flags.
ProtectJitAccess
Values that can be used with protect_jit_memory function.

Constants§

DUAL_MAPPING_FILTER

Functions§

alloc
alloc_dual_mapping
Allocates virtual memory and creates two views of it where the first view has no write access. This is an addition to the API that should be used in cases in which the operating system either enforces W^X security policy or the application wants to use this policy by default to improve security and prevent an accidental (or purposed) self-modifying code.
flush_instruction_cache
Flushes instruction cache in the given region.
get_anonymous_memory_strategy
get_hardened_runtime_flags
hardened_runtime_info
has_hardened_runtime
Detects whether the current process is hardened, which means that pages that have WRITE and EXECUTABLE flags cannot be normally allocated. On OSX + AArch64 such allocation requires MAP_JIT flag, other platforms don’t support this combination.
has_map_jit_support
info
map_jit_from_memory_flags
max_access_flags_to_regular_access_flags
mm_max_prot_from_memory_flags
protect
protect_jit_memory
Protects access of memory mapped with MAP_JIT flag for the current thread.
regular_access_flags_to_max_access_flags
release
release_dual_mapping
Releases virtual memory mapping previously allocated by alloc_dual_mapping().