MCPcopy Create free account
hub / github.com/F-Stack/f-stack / trap_is_smap

Function trap_is_smap

freebsd/amd64/amd64/trap.c:639–655  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

637}
638
639static bool
640trap_is_smap(struct trapframe *frame)
641{
642
643 /*
644 * A page fault on a userspace address is classified as
645 * SMAP-induced if:
646 * - SMAP is supported;
647 * - kernel mode accessed present data page;
648 * - rflags.AC was cleared.
649 * Kernel must never access user space with rflags.AC cleared
650 * if SMAP is enabled.
651 */
652 return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 &&
653 (frame->tf_err & (PGEX_P | PGEX_U | PGEX_I | PGEX_RSV)) ==
654 PGEX_P && (frame->tf_rflags & PSL_AC) == 0);
655}
656
657static bool
658trap_is_pti(struct trapframe *frame)

Callers 1

trap_pfaultFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected