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

verify_stack

Function verify_stack 

Source
pub fn verify_stack(expected: u64, observed: u64)
Expand description

Verify a stack canary value against the expected value.

This is the core verification function called from context switch hooks or periodic stack checks. It compares observed (read from the stack) against expected (from the canary table).

§Panics

Panics with “stack smashing detected” if the values do not match, preventing any further execution of the compromised thread.