diff options
author | Suresh Siddha <suresh.b.siddha@intel.com> | 2005-06-21 20:14:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-21 21:46:12 -0400 |
commit | 84929801e14d968caeb84795bfbb88f04283fbd9 (patch) | |
tree | 248fa9fd6cfb411a6df3b7f7fb42aa4f9ceca2bf /arch/x86_64/ia32 | |
parent | 589777eab7360894b7ca1c4ba9d252e03b51225b (diff) |
[PATCH] x86_64: TASK_SIZE fixes for compatibility mode processes
Appended patch will setup compatibility mode TASK_SIZE properly. This will
fix atleast three known bugs that can be encountered while running
compatibility mode apps.
a) A malicious 32bit app can have an elf section at 0xffffe000. During
exec of this app, we will have a memory leak as insert_vm_struct() is
not checking for return value in syscall32_setup_pages() and thus not
freeing the vma allocated for the vsyscall page. And instead of exec
failing (as it has addresses > TASK_SIZE), we were allowing it to
succeed previously.
b) With a 32bit app, hugetlb_get_unmapped_area/arch_get_unmapped_area
may return addresses beyond 32bits, ultimately causing corruption
because of wrap-around and resulting in SEGFAULT, instead of returning
ENOMEM.
c) 32bit app doing this below mmap will now fail.
mmap((void *)(0xFFFFE000UL), 0x10000UL, PROT_READ|PROT_WRITE,
MAP_FIXED|MAP_PRIVATE|MAP_ANON, 0, 0);
Signed-off-by: Zou Nan hai <nanhai.zou@intel.com>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Andi Kleen <ak@muc.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64/ia32')
-rw-r--r-- | arch/x86_64/ia32/ia32_binfmt.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/x86_64/ia32/ia32_binfmt.c b/arch/x86_64/ia32/ia32_binfmt.c index 99b522052d16..c8131f342cfc 100644 --- a/arch/x86_64/ia32/ia32_binfmt.c +++ b/arch/x86_64/ia32/ia32_binfmt.c | |||
@@ -46,7 +46,7 @@ struct elf_phdr; | |||
46 | 46 | ||
47 | #define IA32_EMULATOR 1 | 47 | #define IA32_EMULATOR 1 |
48 | 48 | ||
49 | #define ELF_ET_DYN_BASE (TASK_UNMAPPED_32 + 0x1000000) | 49 | #define ELF_ET_DYN_BASE (TASK_UNMAPPED_BASE + 0x1000000) |
50 | 50 | ||
51 | #undef ELF_ARCH | 51 | #undef ELF_ARCH |
52 | #define ELF_ARCH EM_386 | 52 | #define ELF_ARCH EM_386 |
@@ -307,9 +307,6 @@ MODULE_AUTHOR("Eric Youngdale, Andi Kleen"); | |||
307 | 307 | ||
308 | #define elf_addr_t __u32 | 308 | #define elf_addr_t __u32 |
309 | 309 | ||
310 | #undef TASK_SIZE | ||
311 | #define TASK_SIZE 0xffffffff | ||
312 | |||
313 | static void elf32_init(struct pt_regs *); | 310 | static void elf32_init(struct pt_regs *); |
314 | 311 | ||
315 | #define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1 | 312 | #define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1 |