diff options
author | 2020-07-25 19:31:33 +0000 | |
---|---|---|
committer | 2020-07-25 19:31:33 +0000 | |
commit | 4627c47af1c3f2c55cc902ac976c6f6f1960dab3 (patch) | |
tree | 27af3660fcf3eed886c645b90e001963d7fb711a /regress/sys/kern/stackpivot/pagefault/stackpivot.c | |
parent | Handle SSL_MODE_AUTO_RETRY being changed during a TLSv1.3 session. (diff) | |
download | wireguard-openbsd-4627c47af1c3f2c55cc902ac976c6f6f1960dab3.tar.xz wireguard-openbsd-4627c47af1c3f2c55cc902ac976c6f6f1960dab3.zip |
Add stackpivot asm for ppc and ppc64 regress test.
Also tweak the pagefault test to work better on arches
that do not modify the stack pointer on return.
Diffstat (limited to 'regress/sys/kern/stackpivot/pagefault/stackpivot.c')
-rw-r--r-- | regress/sys/kern/stackpivot/pagefault/stackpivot.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/regress/sys/kern/stackpivot/pagefault/stackpivot.c b/regress/sys/kern/stackpivot/pagefault/stackpivot.c index 39e6ecd967b..bf730df06f8 100644 --- a/regress/sys/kern/stackpivot/pagefault/stackpivot.c +++ b/regress/sys/kern/stackpivot/pagefault/stackpivot.c @@ -17,6 +17,7 @@ #include <stdio.h> #include <stdlib.h> #include <stdint.h> +#include <unistd.h> #include <sys/mman.h> #include "../pivot.h" @@ -31,15 +32,14 @@ size_t dowork() { size_t i; for (i = 0; i < scansize; ++i) b += *scan++; + + // We should be killed before we get here + pivot(realstack); return b; } void doexit() { - exit(0); -} - -void unpivot() { - pivot(realstack); + _exit(0); } int main() { @@ -55,7 +55,6 @@ int main() { /* set up a basic alt stack on the heap that does some work */ size_t *newstack = calloc(10, sizeof(size_t)); newstack[0] = (size_t)dowork; - newstack[1] = (size_t)unpivot; pivot(newstack); return 0; } |