This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / arch / x86_64 / ia32 / ia32_binfmt.c
index 5133a6c..a385759 100644 (file)
@@ -182,7 +182,6 @@ struct elf_prpsinfo
 #define user user32
 
 #define __ASM_X86_64_ELF_H 1
-#define elf_read_implies_exec(ex, have_pt_gnu_stack)   (!(have_pt_gnu_stack))
 //#include <asm/ia32.h>
 #include <linux/elf.h>
 
@@ -364,11 +363,11 @@ int setup_arg_pages(struct linux_binprm *bprm, int executable_stack)
                mpnt->vm_start = PAGE_MASK & (unsigned long) bprm->p;
                mpnt->vm_end = IA32_STACK_TOP;
                if (executable_stack == EXSTACK_ENABLE_X)
-                       mpnt->vm_flags = VM_STACK_FLAGS |  VM_EXEC;
+                       mpnt->vm_flags = vm_stack_flags32 |  VM_EXEC;
                else if (executable_stack == EXSTACK_DISABLE_X)
-                       mpnt->vm_flags = VM_STACK_FLAGS & ~VM_EXEC;
+                       mpnt->vm_flags = vm_stack_flags32 & ~VM_EXEC;
                else
-                       mpnt->vm_flags = VM_STACK_FLAGS;
+                       mpnt->vm_flags = vm_stack_flags32;
                mpnt->vm_page_prot = (mpnt->vm_flags & VM_EXEC) ? 
                        PAGE_COPY_EXEC : PAGE_COPY;
                if ((ret = insert_vm_struct(mm, mpnt))) {
@@ -400,6 +399,9 @@ elf32_map (struct file *filep, unsigned long addr, struct elf_phdr *eppnt, int p
        unsigned long map_addr;
        struct task_struct *me = current; 
 
+       if (prot & PROT_READ) 
+               prot |= vm_force_exec32;
+
        down_write(&me->mm->mmap_sem);
        map_addr = do_mmap(filep, ELF_PAGESTART(addr),
                           eppnt->p_filesz + ELF_PAGEOFFSET(eppnt->p_vaddr), prot,