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

Re: [Minios-devel] [UNIKRAFT PATCH v2] lib/ukboot: Fix handling of main arguments



Reviewed-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>

On 08.06.19 10:06, Costin Lupu wrote:
When the command line is parsed and split into arguments, each argument is saved
in an array of pointers allocated on the stack ('argv' array in
ukplat_entry_argp()). This means that the array can be overwritten anytime
before starting the main thread which needs the arguments. This patch fixes that
by making the array static.

Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
---
  lib/ukboot/boot.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/ukboot/boot.c b/lib/ukboot/boot.c
index 4dcc0afb..97c7d18b 100644
--- a/lib/ukboot/boot.c
+++ b/lib/ukboot/boot.c
@@ -145,7 +145,7 @@ static void main_thread_func(void *arg)
  /* defined in <uk/plat.h> */
  void ukplat_entry_argp(char *arg0, char *argb, __sz argb_len)
  {
-       char *argv[CONFIG_LIBUKBOOT_MAXNBARGS];
+       static char *argv[CONFIG_LIBUKBOOT_MAXNBARGS];
        int argc = 0;
if (arg0) {


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