aboutsummaryrefslogtreecommitdiffstats
path: root/fs/binfmt_elf.c
diff options
context:
space:
mode:
authorOlaf Hering <olaf@aepfle.de>2007-10-17 02:30:12 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-17 11:43:00 -0400
commit4f9a58d75bfe82ab2b8ba5b8506dfb190a267834 (patch)
tree791843f8cd609cb626a65c4004009084d87170d4 /fs/binfmt_elf.c
parentf77e34987070a20e4b3e06b868cb39eb73670467 (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 'fs/binfmt_elf.c')
-rw-r--r--fs/binfmt_elf.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 4263326ede04..0f55b71ed983 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -175,6 +175,7 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec,
175 175
176 /* Create the ELF interpreter info */ 176 /* Create the ELF interpreter info */
177 elf_info = (elf_addr_t *)current->mm->saved_auxv; 177 elf_info = (elf_addr_t *)current->mm->saved_auxv;
178 /* update AT_VECTOR_SIZE_BASE if the number of NEW_AUX_ENT() changes */
178#define NEW_AUX_ENT(id, val) \ 179#define NEW_AUX_ENT(id, val) \
179 do { \ 180 do { \
180 elf_info[ei_index++] = id; \ 181 elf_info[ei_index++] = id; \
@@ -185,6 +186,8 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec,
185 /* 186 /*
186 * ARCH_DLINFO must come first so PPC can do its special alignment of 187 * ARCH_DLINFO must come first so PPC can do its special alignment of
187 * AUXV. 188 * AUXV.
189 * update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT() in
190 * ARCH_DLINFO changes
188 */ 191 */
189 ARCH_DLINFO; 192 ARCH_DLINFO;
190#endif 193#endif