From 4f9a58d75bfe82ab2b8ba5b8506dfb190a267834 Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Tue, 16 Oct 2007 23:30:12 -0700 Subject: 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 Cc: Roland McGrath Cc: Jakub Jelinek Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: "Luck, Tony" Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Paul Mundt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-x86/elf_32.h | 1 + include/asm-x86/system_32.h | 1 + 2 files changed, 2 insertions(+) (limited to 'include/asm-x86') diff --git a/include/asm-x86/elf_32.h b/include/asm-x86/elf_32.h index af45f315435..b3f694eaaf3 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, extern unsigned int vdso_enabled; +/* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */ #define ARCH_DLINFO \ do if (vdso_enabled) { \ NEW_AUX_ENT(AT_SYSINFO, VDSO_ENTRY); \ diff --git a/include/asm-x86/system_32.h b/include/asm-x86/system_32.h index e7e5d426fef..d84e593b7df 100644 --- a/include/asm-x86/system_32.h +++ b/include/asm-x86/system_32.h @@ -7,6 +7,7 @@ #include #ifdef __KERNEL__ +#define AT_VECTOR_SIZE_ARCH 2 /* entries in ARCH_DLINFO */ struct task_struct; /* one of the stranger aspects of C forward declarations.. */ extern struct task_struct * FASTCALL(__switch_to(struct task_struct *prev, struct task_struct *next)); -- cgit v1.2.3