diff options
author | Olaf Hering <olaf@aepfle.de> | 2007-10-17 02:30:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 11:43:00 -0400 |
commit | 4f9a58d75bfe82ab2b8ba5b8506dfb190a267834 (patch) | |
tree | 791843f8cd609cb626a65c4004009084d87170d4 /include | |
parent | f77e34987070a20e4b3e06b868cb39eb73670467 (diff) |
increase AT_VECTOR_SIZE to terminate saved_auxv properly
include/asm-powerpc/elf.h has 6 entries in ARCH_DLINFO. fs/binfmt_elf.c
has 14 unconditional NEW_AUX_ENT entries and 2 conditional NEW_AUX_ENT
entries. So in the worst case, saved_auxv does not get an AT_NULL entry at
the end.
The saved_auxv array must be terminated with an AT_NULL entry. Make the
size of mm_struct->saved_auxv arch dependend, based on the number of
ARCH_DLINFO entries.
Signed-off-by: Olaf Hering <olh@suse.de>
Cc: Roland McGrath <roland@redhat.com>
Cc: Jakub Jelinek <jakub@redhat.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-alpha/elf.h | 1 | ||||
-rw-r--r-- | include/asm-alpha/system.h | 1 | ||||
-rw-r--r-- | include/asm-ia64/elf.h | 1 | ||||
-rw-r--r-- | include/asm-ia64/system.h | 2 | ||||
-rw-r--r-- | include/asm-powerpc/elf.h | 1 | ||||
-rw-r--r-- | include/asm-powerpc/system.h | 1 | ||||
-rw-r--r-- | include/asm-sh/elf.h | 1 | ||||
-rw-r--r-- | include/asm-sh/system.h | 1 | ||||
-rw-r--r-- | include/asm-x86/elf_32.h | 1 | ||||
-rw-r--r-- | include/asm-x86/system_32.h | 1 | ||||
-rw-r--r-- | include/linux/auxvec.h | 4 | ||||
-rw-r--r-- | include/linux/elf.h | 1 | ||||
-rw-r--r-- | include/linux/mm_types.h | 7 |
13 files changed, 20 insertions, 3 deletions
diff --git a/include/asm-alpha/elf.h b/include/asm-alpha/elf.h index 6c2d78fba264..4b518e3b952c 100644 --- a/include/asm-alpha/elf.h +++ b/include/asm-alpha/elf.h | |||
@@ -155,6 +155,7 @@ extern int alpha_l1d_cacheshape; | |||
155 | extern int alpha_l2_cacheshape; | 155 | extern int alpha_l2_cacheshape; |
156 | extern int alpha_l3_cacheshape; | 156 | extern int alpha_l3_cacheshape; |
157 | 157 | ||
158 | /* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */ | ||
158 | #define ARCH_DLINFO \ | 159 | #define ARCH_DLINFO \ |
159 | do { \ | 160 | do { \ |
160 | NEW_AUX_ENT(AT_L1I_CACHESHAPE, alpha_l1i_cacheshape); \ | 161 | NEW_AUX_ENT(AT_L1I_CACHESHAPE, alpha_l1i_cacheshape); \ |
diff --git a/include/asm-alpha/system.h b/include/asm-alpha/system.h index 620c4d86cbf4..fd9dc889f36c 100644 --- a/include/asm-alpha/system.h +++ b/include/asm-alpha/system.h | |||
@@ -48,6 +48,7 @@ | |||
48 | 48 | ||
49 | #ifndef __ASSEMBLY__ | 49 | #ifndef __ASSEMBLY__ |
50 | #include <linux/kernel.h> | 50 | #include <linux/kernel.h> |
51 | #define AT_VECTOR_SIZE_ARCH 4 /* entries in ARCH_DLINFO */ | ||
51 | 52 | ||
52 | /* | 53 | /* |
53 | * This is the logout header that should be common to all platforms | 54 | * This is the logout header that should be common to all platforms |
diff --git a/include/asm-ia64/elf.h b/include/asm-ia64/elf.h index 25f9835d5459..f10e29b60b00 100644 --- a/include/asm-ia64/elf.h +++ b/include/asm-ia64/elf.h | |||
@@ -192,6 +192,7 @@ extern int dump_task_fpu (struct task_struct *, elf_fpregset_t *); | |||
192 | 192 | ||
193 | #define GATE_EHDR ((const struct elfhdr *) GATE_ADDR) | 193 | #define GATE_EHDR ((const struct elfhdr *) GATE_ADDR) |
194 | 194 | ||
195 | /* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */ | ||
195 | #define ARCH_DLINFO \ | 196 | #define ARCH_DLINFO \ |
196 | do { \ | 197 | do { \ |
197 | extern char __kernel_syscall_via_epc[]; \ | 198 | extern char __kernel_syscall_via_epc[]; \ |
diff --git a/include/asm-ia64/system.h b/include/asm-ia64/system.h index 91bb8e00066c..595112bca3cc 100644 --- a/include/asm-ia64/system.h +++ b/include/asm-ia64/system.h | |||
@@ -32,6 +32,8 @@ | |||
32 | #include <linux/kernel.h> | 32 | #include <linux/kernel.h> |
33 | #include <linux/types.h> | 33 | #include <linux/types.h> |
34 | 34 | ||
35 | #define AT_VECTOR_SIZE_ARCH 2 /* entries in ARCH_DLINFO */ | ||
36 | |||
35 | struct pci_vector_struct { | 37 | struct pci_vector_struct { |
36 | __u16 segment; /* PCI Segment number */ | 38 | __u16 segment; /* PCI Segment number */ |
37 | __u16 bus; /* PCI Bus number */ | 39 | __u16 bus; /* PCI Bus number */ |
diff --git a/include/asm-powerpc/elf.h b/include/asm-powerpc/elf.h index 8925c2813667..6bd07ef78ac4 100644 --- a/include/asm-powerpc/elf.h +++ b/include/asm-powerpc/elf.h | |||
@@ -291,6 +291,7 @@ extern int arch_setup_additional_pages(struct linux_binprm *bprm, | |||
291 | * AT_IGNOREPPC is used for that. | 291 | * AT_IGNOREPPC is used for that. |
292 | * - for compatibility with glibc ARCH_DLINFO must always be defined on PPC, | 292 | * - for compatibility with glibc ARCH_DLINFO must always be defined on PPC, |
293 | * even if DLINFO_ARCH_ITEMS goes to zero or is undefined. | 293 | * even if DLINFO_ARCH_ITEMS goes to zero or is undefined. |
294 | * update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes | ||
294 | */ | 295 | */ |
295 | #define ARCH_DLINFO \ | 296 | #define ARCH_DLINFO \ |
296 | do { \ | 297 | do { \ |
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h index d10e99bf5001..87be8c3bc9cb 100644 --- a/include/asm-powerpc/system.h +++ b/include/asm-powerpc/system.h | |||
@@ -40,6 +40,7 @@ | |||
40 | #define set_mb(var, value) do { var = value; mb(); } while (0) | 40 | #define set_mb(var, value) do { var = value; mb(); } while (0) |
41 | 41 | ||
42 | #ifdef __KERNEL__ | 42 | #ifdef __KERNEL__ |
43 | #define AT_VECTOR_SIZE_ARCH 6 /* entries in ARCH_DLINFO */ | ||
43 | #ifdef CONFIG_SMP | 44 | #ifdef CONFIG_SMP |
44 | #define smp_mb() mb() | 45 | #define smp_mb() mb() |
45 | #define smp_rmb() rmb() | 46 | #define smp_rmb() rmb() |
diff --git a/include/asm-sh/elf.h b/include/asm-sh/elf.h index 43ca244564b1..12cc4b392bf0 100644 --- a/include/asm-sh/elf.h +++ b/include/asm-sh/elf.h | |||
@@ -133,6 +133,7 @@ extern void __kernel_vsyscall; | |||
133 | #define VDSO_BASE ((unsigned long)current->mm->context.vdso) | 133 | #define VDSO_BASE ((unsigned long)current->mm->context.vdso) |
134 | #define VDSO_SYM(x) (VDSO_BASE + (unsigned long)(x)) | 134 | #define VDSO_SYM(x) (VDSO_BASE + (unsigned long)(x)) |
135 | 135 | ||
136 | /* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */ | ||
136 | #define ARCH_DLINFO \ | 137 | #define ARCH_DLINFO \ |
137 | do { \ | 138 | do { \ |
138 | if (vdso_enabled) \ | 139 | if (vdso_enabled) \ |
diff --git a/include/asm-sh/system.h b/include/asm-sh/system.h index 9d849e6df268..4faa2fb88616 100644 --- a/include/asm-sh/system.h +++ b/include/asm-sh/system.h | |||
@@ -15,6 +15,7 @@ | |||
15 | struct task_struct *__switch_to(struct task_struct *prev, | 15 | struct task_struct *__switch_to(struct task_struct *prev, |
16 | struct task_struct *next); | 16 | struct task_struct *next); |
17 | 17 | ||
18 | #define AT_VECTOR_SIZE_ARCH 1 /* entries in ARCH_DLINFO */ | ||
18 | /* | 19 | /* |
19 | * switch_to() should switch tasks to task nr n, first | 20 | * switch_to() should switch tasks to task nr n, first |
20 | */ | 21 | */ |
diff --git a/include/asm-x86/elf_32.h b/include/asm-x86/elf_32.h index af45f315435b..b3f694eaaf37 100644 --- a/include/asm-x86/elf_32.h +++ b/include/asm-x86/elf_32.h | |||
@@ -153,6 +153,7 @@ extern int arch_setup_additional_pages(struct linux_binprm *bprm, | |||
153 | 153 | ||
154 | extern unsigned int vdso_enabled; | 154 | extern unsigned int vdso_enabled; |
155 | 155 | ||
156 | /* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */ | ||
156 | #define ARCH_DLINFO \ | 157 | #define ARCH_DLINFO \ |
157 | do if (vdso_enabled) { \ | 158 | do if (vdso_enabled) { \ |
158 | NEW_AUX_ENT(AT_SYSINFO, VDSO_ENTRY); \ | 159 | NEW_AUX_ENT(AT_SYSINFO, VDSO_ENTRY); \ |
diff --git a/include/asm-x86/system_32.h b/include/asm-x86/system_32.h index e7e5d426fef5..d84e593b7dfc 100644 --- a/include/asm-x86/system_32.h +++ b/include/asm-x86/system_32.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <asm/cmpxchg.h> | 7 | #include <asm/cmpxchg.h> |
8 | 8 | ||
9 | #ifdef __KERNEL__ | 9 | #ifdef __KERNEL__ |
10 | #define AT_VECTOR_SIZE_ARCH 2 /* entries in ARCH_DLINFO */ | ||
10 | 11 | ||
11 | struct task_struct; /* one of the stranger aspects of C forward declarations.. */ | 12 | struct task_struct; /* one of the stranger aspects of C forward declarations.. */ |
12 | extern struct task_struct * FASTCALL(__switch_to(struct task_struct *prev, struct task_struct *next)); | 13 | extern struct task_struct * FASTCALL(__switch_to(struct task_struct *prev, struct task_struct *next)); |
diff --git a/include/linux/auxvec.h b/include/linux/auxvec.h index d2bc0d66e65d..ad895455ab72 100644 --- a/include/linux/auxvec.h +++ b/include/linux/auxvec.h | |||
@@ -26,6 +26,8 @@ | |||
26 | 26 | ||
27 | #define AT_SECURE 23 /* secure mode boolean */ | 27 | #define AT_SECURE 23 /* secure mode boolean */ |
28 | 28 | ||
29 | #define AT_VECTOR_SIZE 44 /* Size of auxiliary table. */ | 29 | #ifdef __KERNEL__ |
30 | #define AT_VECTOR_SIZE_BASE (14 + 2) /* NEW_AUX_ENT entries in auxiliary table */ | ||
31 | #endif | ||
30 | 32 | ||
31 | #endif /* _LINUX_AUXVEC_H */ | 33 | #endif /* _LINUX_AUXVEC_H */ |
diff --git a/include/linux/elf.h b/include/linux/elf.h index 0eb9ed2f4189..576e83bd6d88 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h | |||
@@ -2,7 +2,6 @@ | |||
2 | #define _LINUX_ELF_H | 2 | #define _LINUX_ELF_H |
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/auxvec.h> | ||
6 | #include <linux/elf-em.h> | 5 | #include <linux/elf-em.h> |
7 | #include <asm/elf.h> | 6 | #include <asm/elf.h> |
8 | 7 | ||
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 877667918452..f4c03e0b355e 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef _LINUX_MM_TYPES_H | 1 | #ifndef _LINUX_MM_TYPES_H |
2 | #define _LINUX_MM_TYPES_H | 2 | #define _LINUX_MM_TYPES_H |
3 | 3 | ||
4 | #include <linux/auxvec.h> /* For AT_VECTOR_SIZE */ | 4 | #include <linux/auxvec.h> |
5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
6 | #include <linux/threads.h> | 6 | #include <linux/threads.h> |
7 | #include <linux/list.h> | 7 | #include <linux/list.h> |
@@ -13,6 +13,11 @@ | |||
13 | #include <asm/page.h> | 13 | #include <asm/page.h> |
14 | #include <asm/mmu.h> | 14 | #include <asm/mmu.h> |
15 | 15 | ||
16 | #ifndef AT_VECTOR_SIZE_ARCH | ||
17 | #define AT_VECTOR_SIZE_ARCH 0 | ||
18 | #endif | ||
19 | #define AT_VECTOR_SIZE (2*(AT_VECTOR_SIZE_ARCH + AT_VECTOR_SIZE_BASE + 1)) | ||
20 | |||
16 | struct address_space; | 21 | struct address_space; |
17 | 22 | ||
18 | #if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS | 23 | #if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS |