diff options
author | 2020-07-20 17:37:17 +0000 | |
---|---|---|
committer | 2020-07-20 17:37:17 +0000 | |
commit | 505ee9ea3b177e2387d907a91ca7da069f3f14d8 (patch) | |
tree | aca415cc576a1efa7fa859d1e5fd4367bae5d81d /regress/sys | |
parent | Add uvm_map_inentry call, to detect stack pivots at trap time. (diff) | |
download | wireguard-openbsd-505ee9ea3b177e2387d907a91ca7da069f3f14d8.tar.xz wireguard-openbsd-505ee9ea3b177e2387d907a91ca7da069f3f14d8.zip |
test _exit(2) rather than exit(3) [to keep things simpler], and
print the stack address [for comparison in dmesg post-fault]
Diffstat (limited to 'regress/sys')
-rw-r--r-- | regress/sys/kern/stackpivot/syscall/stackpivot.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/regress/sys/kern/stackpivot/syscall/stackpivot.c b/regress/sys/kern/stackpivot/syscall/stackpivot.c index 2208ff48d31..c6470dba86d 100644 --- a/regress/sys/kern/stackpivot/syscall/stackpivot.c +++ b/regress/sys/kern/stackpivot/syscall/stackpivot.c @@ -16,16 +16,18 @@ #include <stdio.h> #include <stdlib.h> +#include <unistd.h> #include "../pivot.h" void doexit() { - exit(0); + _exit(0); } int main() { /* set up an alt stack on the heap that just calls doexit */ size_t *newstack = calloc(10, sizeof(size_t)); + printf("%p\n", newstack); newstack[0] = (size_t)doexit; pivot(newstack); return 0; |