static u64 __init get_kaslr_seed(void *fdt, int node)
{ staticcharconst seed_str[] __initconst = "kaslr-seed";
fdt64_t *prop;
u64 ret; int len;
if (node < 0) return 0;
prop = fdt_getprop_w(fdt, node, seed_str, &len); if (!prop || len != sizeof(u64)) return 0;
ret = fdt64_to_cpu(*prop);
*prop = 0; return ret;
}
u64 __init kaslr_early_init(void *fdt, int chosen)
{
u64 seed, range;
if (kaslr_disabled_cmdline()) return 0;
seed = get_kaslr_seed(fdt, chosen); if (!seed) { if (!__early_cpu_has_rndr() ||
!__arm64_rndr((unsignedlong *)&seed)) return 0;
}
/* * OK, so we are proceeding with KASLR enabled. Calculate a suitable * kernel image offset from the seed. Let's place the kernel in the * 'middle' half of the VMALLOC area, and stay clear of the lower and * upper quarters to avoid colliding with other allocations.
*/
range = (VMALLOC_END - KIMAGE_VADDR) / 2; return range / 2 + (((__uint128_t)range * seed) >> 64);
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet)
¤
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.