git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
arch
/
um
/
os-Linux
/
elf_aux.c
diff --git
a/arch/um/os-Linux/elf_aux.c
b/arch/um/os-Linux/elf_aux.c
index
f0d6060
..
13c6cb5
100644
(file)
--- a/
arch/um/os-Linux/elf_aux.c
+++ b/
arch/um/os-Linux/elf_aux.c
@@
-11,8
+11,11
@@
#include <stddef.h>
#include "init.h"
#include "elf_user.h"
#include <stddef.h>
#include "init.h"
#include "elf_user.h"
+#include "mem_user.h"
+#include <kern_constants.h>
-#if ELF_CLASS == ELFCLASS32
+/* Use the one from the kernel - the host may miss it, if having old headers. */
+#if UM_ELF_CLASS == UM_ELFCLASS32
typedef Elf32_auxv_t elf_auxv_t;
#else
typedef Elf64_auxv_t elf_auxv_t;
typedef Elf32_auxv_t elf_auxv_t;
#else
typedef Elf64_auxv_t elf_auxv_t;
@@
-37,9
+40,15
@@
__init void scan_elf_aux( char **envp)
switch ( auxv->a_type ) {
case AT_SYSINFO:
__kernel_vsyscall = auxv->a_un.a_val;
switch ( auxv->a_type ) {
case AT_SYSINFO:
__kernel_vsyscall = auxv->a_un.a_val;
+ /* See if the page is under TASK_SIZE */
+ if (__kernel_vsyscall < (unsigned long) envp)
+ __kernel_vsyscall = 0;
break;
case AT_SYSINFO_EHDR:
vsyscall_ehdr = auxv->a_un.a_val;
break;
case AT_SYSINFO_EHDR:
vsyscall_ehdr = auxv->a_un.a_val;
+ /* See if the page is under TASK_SIZE */
+ if (vsyscall_ehdr < (unsigned long) envp)
+ vsyscall_ehdr = 0;
break;
case AT_HWCAP:
elf_aux_hwcap = auxv->a_un.a_val;
break;
case AT_HWCAP:
elf_aux_hwcap = auxv->a_un.a_val;
@@
-49,7
+58,8
@@
__init void scan_elf_aux( char **envp)
* a_un, so we have to use a_val, which is
* all that's left.
*/
* a_un, so we have to use a_val, which is
* all that's left.
*/
- elf_aux_platform = (char *) auxv->a_un.a_val;
+ elf_aux_platform =
+ (char *) (long) auxv->a_un.a_val;
break;
case AT_PAGESZ:
page_size = auxv->a_un.a_val;
break;
case AT_PAGESZ:
page_size = auxv->a_un.a_val;