summaryrefslogtreecommitdiffstats
path: root/regress/sys
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2020-07-20 17:37:17 +0000
committerderaadt <deraadt@openbsd.org>2020-07-20 17:37:17 +0000
commit505ee9ea3b177e2387d907a91ca7da069f3f14d8 (patch)
treeaca415cc576a1efa7fa859d1e5fd4367bae5d81d /regress/sys
parentAdd uvm_map_inentry call, to detect stack pivots at trap time. (diff)
downloadwireguard-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.c4
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;