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

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



On 04.12.19 16:14, Vlad-Andrei BĂDOIU (78692) wrote:
From: Vlad-Andrei BĂDOIU (78692) <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>

We initialize the canary value at boot with a random variable.

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

diff --git a/lib/ukboot/boot.c b/lib/ukboot/boot.c
index 3f5046ca..34f6aa8b 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 <uksp/stackprotector.h>
+#endif
int main(int argc, char *argv[]) __weak; @@ -190,6 +193,10 @@ void ukplat_entry(int argc, char *argv[])
                uk_ctortab[i]();
        }
+#if CONFIG_LIBUKSP
+       boot_init_stack_canary();
+#endif
+

I would use system constructors instead (see my comment in patch 1/3).

  #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®.