diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-08-31 22:56:02 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-08-31 22:56:02 +0000 |
commit | 531a9f8317493da4fb9480f053564447122eafbd (patch) | |
tree | cb4a64f949b13ca37f56f8a9a3e4da26de574868 /regress/sys/kern/nxstack/nxstack.c | |
parent | dae4b41c76cfa54cf5d55464c49b7ac86176378b (diff) |
a combined non-exec test set.
allows reusing same testing code for:
- text & mprotect (not finished, not enabled);
- data, data & mprotect;
- bss, bss & mprotect;
- heap, heap & mprotect;
- stack, stack & mprotect.
also a test for mmaping pages in those areas
and see how it allows execution (suggested by art@),
not enabled yet.
all tested on i386 and hppa.
Diffstat (limited to 'regress/sys/kern/nxstack/nxstack.c')
-rw-r--r-- | regress/sys/kern/nxstack/nxstack.c | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/regress/sys/kern/nxstack/nxstack.c b/regress/sys/kern/nxstack/nxstack.c deleted file mode 100644 index 83c64b31599..00000000000 --- a/regress/sys/kern/nxstack/nxstack.c +++ /dev/null @@ -1,55 +0,0 @@ -/* $OpenBSD: nxstack.c,v 1.2 2002/07/01 19:37:57 art Exp $ */ - -/* - * Copyright (c) 2002 Michael Shalayeff - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include <stdio.h> -#include <signal.h> -#include <string.h> - -void -testfly() -{ -} - -void -sigsegv(int sig) -{ - _exit(0); -} - -int -main(void) -{ - u_int64_t buf[256]; /* assuming the testfly() will fit */ - - signal(SIGSEGV, sigsegv); - memcpy(buf, &testfly, sizeof(buf)); - ((void (*)(void))&buf)(); - exit(1); -} |