commit 879002e8baae11cd71aae1bd45ea9c08ea500657 Author: Brandon Bergren Date: Sat Mar 14 11:49:18 2020 -0500 Fix overflow parameters on makecontext(). Reported By: pherde diff --git a/lib/libc/powerpc64/gen/makecontext.c b/lib/libc/powerpc64/gen/makecontext.c index c21e9140d38f..7663b6f82e7d 100644 --- a/lib/libc/powerpc64/gen/makecontext.c +++ b/lib/libc/powerpc64/gen/makecontext.c @@ -102,7 +102,11 @@ __makecontext(ucontext_t *ucp, void (*start)(void), int argc, ...) uint64_t *argp; /* Skip past frame pointer and saved LR */ +#if !defined(_CALL_ELF) || _CALL_ELF == 1 argp = (uint64_t *)sp + 6; +#else + argp = (uint64_t *)sp + 4; +#endif for (i = 0; i < stackargs; i++) *argp++ = va_arg(ap, uint64_t);