[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>
Showing
- arch/x86_64/ia32/ia32_binfmt.c 1 addition, 4 deletionsarch/x86_64/ia32/ia32_binfmt.c
- arch/x86_64/kernel/process.c 2 additions, 2 deletionsarch/x86_64/kernel/process.c
- arch/x86_64/kernel/ptrace.c 10 additions, 7 deletionsarch/x86_64/kernel/ptrace.c
- arch/x86_64/kernel/sys_x86_64.c 4 additions, 10 deletionsarch/x86_64/kernel/sys_x86_64.c
- arch/x86_64/mm/fault.c 1 addition, 1 deletionarch/x86_64/mm/fault.c
- include/asm-x86_64/a.out.h 1 addition, 1 deletioninclude/asm-x86_64/a.out.h
- include/asm-x86_64/processor.h 6 additions, 5 deletionsinclude/asm-x86_64/processor.h
Loading
Please register or sign in to comment