pub fn disable_smap_temporarily()Expand description
Temporarily disable SMAP to allow kernel access to user-space memory.
On x86_64 this executes STAC (Set AC Flag). On AArch64, clears PSTATE.PAN. On RISC-V, sets the SUM bit in sstatus.
The caller must call restore_smap after the user-memory access.
§Safety
This function is safe to call, but the window between
disable_smap_temporarily and restore_smap permits kernel code to
access user-mapped pages. Keep this window as short as possible.