summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/dl-execstack.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-01-13 15:35:20 +0000
committerUlrich Drepper <drepper@redhat.com>2004-01-13 15:35:20 +0000
commit0a182a286d84451b70a40948247319ac9723decb (patch)
tree504cf83c29f381c5668faea85dfd33927dbe01b1 /sysdeps/unix/sysv/linux/dl-execstack.c
parentdc927809b187986876a69419df68c83623b79ab3 (diff)
Change interface. Add challenge for caller.
Diffstat (limited to 'sysdeps/unix/sysv/linux/dl-execstack.c')
-rw-r--r--sysdeps/unix/sysv/linux/dl-execstack.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sysdeps/unix/sysv/linux/dl-execstack.c b/sysdeps/unix/sysv/linux/dl-execstack.c
index aafa2df1b1..d93dc8585f 100644
--- a/sysdeps/unix/sysv/linux/dl-execstack.c
+++ b/sysdeps/unix/sysv/linux/dl-execstack.c
@@ -1,5 +1,5 @@
/* Stack executability handling for GNU dynamic linker. Linux version.
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -30,8 +30,13 @@ extern void *__libc_stack_end;
int
internal_function
-_dl_make_stack_executable (void)
+_dl_make_stack_executable (void **stack_endp)
{
+ /* Challenge the caller. */
+ if (*stack_endp != __libc_stack_end)
+ return EPERM;
+ *stack_endp = NULL;
+
#if _STACK_GROWS_DOWN
/* This gives us the highest page that needs to be changed. */
uintptr_t page = (uintptr_t) __libc_stack_end & -(intptr_t) GL(dl_pagesize);