/* wait until first sys_nanosleep ends and second sys_nanosleep starts */ while (READ_ONCE(fexit_skel->bss->fentry_cnt) != 2);
fexit_cnt = READ_ONCE(fexit_skel->bss->fexit_cnt); if (CHECK(fexit_cnt != 1, "fexit_cnt", "%d", fexit_cnt)) goto cleanup;
/* close progs and detach them. That will trigger two nop5->jmp5 rewrites *inthetrampolinestoskipnanosleep_fexitprog. *Thenanosleep_fentryprogwillgetdetachedfirst. *Thenanosleep_fexitprogwillgetdetachedsecond. *DetachingwilltriggerfreeingofbothprogsJITedimages. *Therewillbetwodyingbpf_tramp_image-s,butonlytheinitial *bpf_tramp_image(withboth_fentryand_fexitprogswillbestuck *waitingforpercpu_ref_killtoconfirm).Theotherone *willbefreedquickly.
*/
close(fexit_skel->progs.nanosleep_fentry.prog_fd);
close(fexit_skel->progs.nanosleep_fexit.prog_fd);
fexit_sleep_lskel__detach(fexit_skel);
/* kill the thread to unwind sys_nanosleep stack through the trampoline */
kill(cpid, 9);
if (CHECK(waitpid(cpid, &wstatus, 0) == -1, "waitpid", "%s\n", strerror(errno))) goto cleanup; if (CHECK(WEXITSTATUS(wstatus) != 0, "exitstatus", "failed")) goto cleanup;
/* The bypassed nanosleep_fexit prog shouldn't have executed. *Unlikeprogsthemapswerenotfreedanddirectlyaccessible.
*/
fexit_cnt = READ_ONCE(fexit_skel->bss->fexit_cnt); if (CHECK(fexit_cnt != 1, "fexit_cnt", "%d", fexit_cnt)) goto cleanup;
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.