[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [UNIKRAFT PATCH v5 3/3] lib/ukboot: Initialize the canary value at boot
From: Vlad-Andrei BĂDOIU (78692) <vlad_andrei.badoiu@xxxxxxxxxxxxxxx> We initialize the canary value right after all the internal libraries have loaded. Signed-off-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@xxxxxxxxxxxxxxx> Signed-off-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@xxxxxx> --- lib/ukboot/boot.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/ukboot/boot.c b/lib/ukboot/boot.c index e8a2ac79..3cdeb03b 100644 --- a/lib/ukboot/boot.c +++ b/lib/ukboot/boot.c @@ -61,6 +61,9 @@ #ifdef CONFIG_LIBUKLIBPARAM #include <uk/libparam.h> #endif /* CONFIG_LIBUKLIBPARAM */ +#if CONFIG_LIBUKSP +#include <uk/sp.h> +#endif int main(int argc, char *argv[]) __weak; @@ -185,6 +188,14 @@ void ukplat_entry(int argc, char *argv[]) struct uk_sched *s = NULL; struct uk_thread *main_thread = NULL; #endif + + /* We use a macro because if we were to use a function we + * would not be able to return from the function if we have + * changed the stack protector inside the function */ +#if CONFIG_LIBUKSP + UKSP_INIT_CANARY(); +#endif + uk_ctor_func_t *ctorfn; uk_pr_info("Unikraft constructor table at %p - %p\n", -- 2.20.1
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |