From cb253a3f970b373df4390a0e7a17610556f920f3 Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Thu, 9 May 2019 11:58:15 -0700 Subject: Allow up to 2 KiB of arguments Closes #161 --- pk/pk.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pk') diff --git a/pk/pk.c b/pk/pk.c index a149a42..b8b0b1c 100644 --- a/pk/pk.c +++ b/pk/pk.c @@ -29,7 +29,7 @@ static void handle_option(const char* s) } } -#define MAX_ARGS 64 +#define MAX_ARGS 256 typedef union { uint64_t buf[MAX_ARGS]; char* argv[MAX_ARGS]; @@ -38,6 +38,9 @@ typedef union { static size_t parse_args(arg_buf* args) { long r = frontend_syscall(SYS_getmainvars, va2pa(args), sizeof(*args), 0, 0, 0, 0, 0); + if (r != 0) + panic("args must not exceed %d bytes", (int)sizeof(arg_buf)); + kassert(r == 0); uint64_t* pk_argv = &args->buf[1]; // pk_argv[0] is the proxy kernel itself. skip it and any flags. -- cgit v1.1