maps = fopen("/proc/self/smaps", "r"); if (!maps) {
ksft_test_result_skip( "Could not open /proc/self/smaps, errno=%d\n",
errno);
return 0;
}
if (vdso_sealed(maps)) {
ksft_test_result_skip("vdso is sealed\n"); return 0;
}
fclose(maps);
child = fork(); if (child == -1)
ksft_exit_fail_msg("failed to fork (%d): %m\n", errno);
if (child == 0) { unsignedlong vdso_size = PAGE_SIZE; unsignedlong auxval; int ret = -1;
auxval = getauxval(AT_SYSINFO_EHDR);
ksft_print_msg("AT_SYSINFO_EHDR is %#lx\n", auxval); if (!auxval || auxval == -ENOENT) {
ksft_print_msg("WARN: getauxval failed\n"); return 0;
}
/* Simpler than parsing ELF header */ while (ret < 0) {
ret = try_to_remap((void *)auxval, vdso_size);
vdso_size += PAGE_SIZE;
}
#ifdef __i386__ /* Glibc is likely to explode now - exit with raw syscall */ asmvolatile ("int $0x80" : : "a" (__NR_exit), "b" (!!ret)); #else/* __x86_64__ */
syscall(SYS_exit, ret); #endif
} else { int status;
if (waitpid(child, &status, 0) != child ||
!WIFEXITED(status))
ksft_test_result_fail("mremap() of the vDSO does not work on this kernel!\n"); elseif (WEXITSTATUS(status) != 0)
ksft_test_result_fail("Child failed with %d\n", WEXITSTATUS(status)); else
ksft_test_result_pass("%s\n", __func__);
}
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.