summaryrefslogtreecommitdiff
path: root/regress/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2020-07-20 17:37:18 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2020-07-20 17:37:18 +0000
commit0aef3b947640d407a8f4a91bb24e3f4880c34c2d (patch)
treef2cf6f8e52d7a7e3146d21fd3971a365e7a72282 /regress/sys
parent788f4353d8b7de2b659e6b3d5c0f0cc30715a5d9 (diff)
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;