staticbool is_fault_expected(int fault_code)
{ if (fault_code == SEGV_ACCERR) returntrue;
/* Assume any pkey error is fine since pkey_exec_prot test covers them */ if (fault_code == SEGV_PKUERR && pkeys_supported) returntrue;
returnfalse;
}
staticvoid trap_handler(int signum, siginfo_t *sinfo, void *ctx)
{ /* Check if this fault originated from the expected address */ if (sinfo->si_addr != (void *)fault_addr)
sigsafe_err("got a fault for an unexpected address\n");
/* Check if this fault originated from the expected address */ if (sinfo->si_addr != (void *)fault_addr) {
sigsafe_err("got a fault for an unexpected address\n");
_exit(1);
}
/* Check if too many faults have occurred for a single test case */ if (!remaining_faults) {
sigsafe_err("got too many faults for the same address\n");
_exit(1);
}
/* Restore permissions in order to continue */ if (is_fault_expected(fault_code)) { if (mprotect(insns, pgsize, PROT_READ | PROT_WRITE | PROT_EXEC)) {
sigsafe_err("failed to set access permissions\n");
_exit(1);
}
} else {
sigsafe_err("got a fault with an unexpected code\n");
_exit(1);
}
int main(void)
{ return test_harness(test, "exec_prot");
}
Messung V0.5 in Prozent
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.12Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-10-12)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.