⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

randomize_stack

Function randomize_stack 

Source
pub fn randomize_stack(base: usize) -> usize
Expand description

Randomize a thread’s stack base by subtracting a random offset.

Given a stack base address (top of stack), returns a new address with a random downward offset applied (up to 16 KB, 16-byte aligned).

Returns the base unchanged if KASLR is not initialized.