2003-09-24 01:56:08 +00:00
|
|
|
/* Test program for executable stacks in an executable itself. */
|
|
|
|
|
|
|
|
#include <dlfcn.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <error.h>
|
|
|
|
|
|
|
|
#include "tst-execstack-mod.c" /* This defines the `tryme' test function. */
|
|
|
|
|
|
|
|
static void deeper (void (*f) (void));
|
|
|
|
|
|
|
|
static int
|
|
|
|
do_test (void)
|
|
|
|
{
|
|
|
|
tryme ();
|
|
|
|
|
|
|
|
/* Test that growing the stack region gets new executable pages too. */
|
|
|
|
deeper (&tryme);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
deeper (void (*f) (void))
|
|
|
|
{
|
|
|
|
char stack[1100 * 1024];
|
2021-10-20 13:38:50 +00:00
|
|
|
explicit_bzero (stack, sizeof stack);
|
2003-09-24 01:56:08 +00:00
|
|
|
(*f) ();
|
|
|
|
memfrob (stack, sizeof stack);
|
|
|
|
}
|
|
|
|
|
2017-04-05 13:34:39 +00:00
|
|
|
#include <support/test-driver.c>
|