[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT PATCH v4 4/4] lib/ukboot: Initialize the canary value at boot



On 04.02.20 15:10, Vlad-Andrei BĂDOIU (78692) wrote:
We initialize the canary value right after all the internal libraries
have loaded.

Signed-off-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>
---
  lib/ukboot/boot.c | 8 ++++++++
  1 file changed, 8 insertions(+)

diff --git a/lib/ukboot/boot.c b/lib/ukboot/boot.c
index e8a2ac79..f7873a12 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; @@ -195,6 +198,11 @@ void ukplat_entry(int argc, char *argv[])
                (*ctorfn)();
        }
+#if CONFIG_LIBUKSP

Can you add a comment here, why we do this here with the boot stack, and why we do this with a macro. The important thing was that we cannot go back to any caller as soon as the canary is changed because GCCs instrumentation code would fire an error.

Btw, we don't need any initialization for thread stacks, right? In case we do (but I don't think so), we should for now remove the library form the menu as soon as uksched is selected:
        depends on !LIBUKSCHED
We could solve this later.

+       INIT_STACK_CANARY();
+#endif
+
+
  #ifdef CONFIG_LIBUKLIBPARAM
        rc = (argc > 1) ? uk_libparam_parse(argv[0], argc - 1, &argv[1]) : 0;
        if (unlikely(rc < 0))


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.