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/linux/auxvec.h | 4 +++- include/linux/elf.h | 1 - include/linux/mm_types.h | 7 ++++++- 3 files changed, 9 insertions(+), 3 deletions(-) (limited to 'include/linux') 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 @@ #define AT_SECURE 23 /* secure mode boolean */ -#define AT_VECTOR_SIZE 44 /* Size of auxiliary table. */ +#ifdef __KERNEL__ +#define AT_VECTOR_SIZE_BASE (14 + 2) /* NEW_AUX_ENT entries in auxiliary table */ +#endif #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 @@ #define _LINUX_ELF_H #include -#include #include #include 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 @@ #ifndef _LINUX_MM_TYPES_H #define _LINUX_MM_TYPES_H -#include /* For AT_VECTOR_SIZE */ +#include #include #include #include @@ -13,6 +13,11 @@ #include #include +#ifndef AT_VECTOR_SIZE_ARCH +#define AT_VECTOR_SIZE_ARCH 0 +#endif +#define AT_VECTOR_SIZE (2*(AT_VECTOR_SIZE_ARCH + AT_VECTOR_SIZE_BASE + 1)) + struct address_space; #if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS -- cgit v1.2.3