/* Ensure that all executions from hereon are *securebysettingalocalstoragewhichisreadby *thebprm_creds_for_exechookandsetsbprm->secureexec.
*/
ret = update_storage(map_fd, secureexec); if (ret) exit(ret);
/* If the binary is executed with securexec=1, the dynamic *loaderignoresandunsetscertainvariableslikeLD_PRELOAD, *TMPDIRetc.TMPDIRisusedheretosimplifytheexample,as *LD_PRELOADrequiresareal.sofile. * *IfthevalueofTMPDIRisset,thebashcommandreturns10 *andifthevalueisunset,itreturns20.
*/
execle("/bin/bash", "bash", "-c", "[[ -z \"${TMPDIR}\" ]] || exit 10 && exit 20", NULL,
bash_envp); exit(errno);
} elseif (child_pid > 0) {
waitpid(child_pid, &child_status, 0);
ret = WEXITSTATUS(child_status);
/* If a secureexec occurred, the exit status should be 20 */ if (secureexec && ret == 20) return0;
/* If normal execution happened, the exit code should be 10 */ if (!secureexec && ret == 10) return0;
}
/* Run the test with the secureexec bit unset */
err = run_set_secureexec(bpf_map__fd(skel->maps.secure_exec_task_map), 0/* secureexec */); if (CHECK(err, "run_set_secureexec:0", "err = %d\n", err)) goto close_prog;
/* Run the test with the secureexec bit set */
err = run_set_secureexec(bpf_map__fd(skel->maps.secure_exec_task_map), 1/* secureexec */); if (CHECK(err, "run_set_secureexec:1", "err = %d\n", err)) goto close_prog;
close_prog:
bprm_opts__destroy(skel);
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet am 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.