From 0acb5e87d0b6baade234da2f01701003b65f5dda Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sat, 22 Aug 2020 00:41:48 -0500 Subject: unistd: Update execve shim with loader changes Ensure aarch64 bug doesn't appear here either. --- libgcompat/unistd.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libgcompat/unistd.c b/libgcompat/unistd.c index d632eee..e40fb6e 100644 --- a/libgcompat/unistd.c +++ b/libgcompat/unistd.c @@ -210,14 +210,15 @@ int execve(const char *pathname, char *const argv[], char *const envp[]) { return -1; } - new_argv = calloc(argc + 6, sizeof(char *)); + new_argv = calloc(argc + 7, sizeof(char *)); new_argv[0] = LOADER; new_argv[1] = "--argv0"; new_argv[2] = argv[0]; new_argv[3] = "--preload"; new_argv[4] = "/lib/libgcompat.so.0"; - new_argv[5] = target; - for(int j = 1, i = 6; j < argc; ++i, ++j) { + new_argv[5] = "--"; + new_argv[6] = target; + for(int j = 1, i = 7; j < argc; ++i, ++j) { new_argv[i] = argv[j]; } return execve(LINKER, new_argv, envp); -- cgit v1.2.3-70-g09d2