Commit bb262c63 authored by David Mosberger's avatar David Mosberger

ia64: Update for elf_read_implies_exec() macro changes in mainline tree.

parent ee1611d4
...@@ -41,6 +41,8 @@ static void elf32_set_personality (void); ...@@ -41,6 +41,8 @@ static void elf32_set_personality (void);
#undef SET_PERSONALITY #undef SET_PERSONALITY
#define SET_PERSONALITY(ex, ibcs2) elf32_set_personality() #define SET_PERSONALITY(ex, ibcs2) elf32_set_personality()
#define elf_read_implies_exec(ex, have_pt_gnu_stack) (!(have_pt_gnu_stack))
/* Ugly but avoids duplication */ /* Ugly but avoids duplication */
#include "../../../fs/binfmt_elf.c" #include "../../../fs/binfmt_elf.c"
...@@ -163,7 +165,8 @@ ia32_setup_arg_pages (struct linux_binprm *bprm, int executable_stack) ...@@ -163,7 +165,8 @@ ia32_setup_arg_pages (struct linux_binprm *bprm, int executable_stack)
if (!mpnt) if (!mpnt)
return -ENOMEM; return -ENOMEM;
if (security_vm_enough_memory((IA32_STACK_TOP - (PAGE_MASK & (unsigned long) bprm->p))>>PAGE_SHIFT)) { if (security_vm_enough_memory((IA32_STACK_TOP - (PAGE_MASK & (unsigned long) bprm->p))
>> PAGE_SHIFT)) {
kmem_cache_free(vm_area_cachep, mpnt); kmem_cache_free(vm_area_cachep, mpnt);
return -ENOMEM; return -ENOMEM;
} }
...@@ -210,7 +213,6 @@ elf32_set_personality (void) ...@@ -210,7 +213,6 @@ elf32_set_personality (void)
set_personality(PER_LINUX32); set_personality(PER_LINUX32);
current->thread.map_base = IA32_PAGE_OFFSET/3; current->thread.map_base = IA32_PAGE_OFFSET/3;
current->thread.task_size = IA32_PAGE_OFFSET; /* use what Linux/x86 uses... */ current->thread.task_size = IA32_PAGE_OFFSET; /* use what Linux/x86 uses... */
current->thread.flags |= IA64_THREAD_XSTACK; /* data must be executable */
set_fs(USER_DS); /* set addr limit for new TASK_SIZE */ set_fs(USER_DS); /* set addr limit for new TASK_SIZE */
} }
......
...@@ -616,16 +616,6 @@ sys_execve (char *filename, char **argv, char **envp, struct pt_regs *regs) ...@@ -616,16 +616,6 @@ sys_execve (char *filename, char **argv, char **envp, struct pt_regs *regs)
return error; return error;
} }
void
ia64_set_personality (struct elf64_hdr *elf_ex, int ibcs2_interpreter)
{
set_personality(PER_LINUX);
if (elf_ex->e_flags & EF_IA_64_LINUX_EXECUTABLE_STACK)
current->thread.flags |= IA64_THREAD_XSTACK;
else
current->thread.flags &= ~IA64_THREAD_XSTACK;
}
pid_t pid_t
kernel_thread (int (*fn)(void *), void *arg, unsigned long flags) kernel_thread (int (*fn)(void *), void *arg, unsigned long flags)
{ {
......
...@@ -128,7 +128,7 @@ ia64_init_addr_space (void) ...@@ -128,7 +128,7 @@ ia64_init_addr_space (void)
vma->vm_start = current->thread.rbs_bot & PAGE_MASK; vma->vm_start = current->thread.rbs_bot & PAGE_MASK;
vma->vm_end = vma->vm_start + PAGE_SIZE; vma->vm_end = vma->vm_start + PAGE_SIZE;
vma->vm_page_prot = protection_map[VM_DATA_DEFAULT_FLAGS & 0x7]; vma->vm_page_prot = protection_map[VM_DATA_DEFAULT_FLAGS & 0x7];
vma->vm_flags = VM_READ|VM_WRITE|VM_MAYREAD|VM_MAYWRITE|VM_GROWSUP; vma->vm_flags = VM_DATA_DEFAULT_FLAGS | VM_GROWSUP;
insert_vm_struct(current->mm, vma); insert_vm_struct(current->mm, vma);
} }
......
...@@ -185,9 +185,9 @@ extern void ia64_elf_core_copy_regs (struct pt_regs *src, elf_gregset_t dst); ...@@ -185,9 +185,9 @@ extern void ia64_elf_core_copy_regs (struct pt_regs *src, elf_gregset_t dst);
#define AT_SYSINFO_EHDR 33 #define AT_SYSINFO_EHDR 33
#ifdef __KERNEL__ #ifdef __KERNEL__
struct elf64_hdr; #define SET_PERSONALITY(ex, ibcs2) set_personality(PER_LINUX)
extern void ia64_set_personality (struct elf64_hdr *elf_ex, int ibcs2_interpreter); #define elf_read_implies_exec(ex, have_pt_gnu_stack) \
#define SET_PERSONALITY(ex, ibcs2) ia64_set_personality(&(ex), ibcs2) (!(have_pt_gnu_stack) && ((ex).e_flags & EF_IA_64_LINUX_EXECUTABLE_STACK) != 0)
struct task_struct; struct task_struct;
......
...@@ -184,7 +184,7 @@ get_order (unsigned long size) ...@@ -184,7 +184,7 @@ get_order (unsigned long size)
#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | \ #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | \
VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC | \ VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC | \
(((current->thread.flags & IA64_THREAD_XSTACK) != 0) \ (((current->personality & READ_IMPLIES_EXEC) != 0) \
? VM_EXEC : 0)) ? VM_EXEC : 0))
#endif /* _ASM_IA64_PAGE_H */ #endif /* _ASM_IA64_PAGE_H */
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#define _ASM_IA64_PROCESSOR_H #define _ASM_IA64_PROCESSOR_H
/* /*
* Copyright (C) 1998-2003 Hewlett-Packard Co * Copyright (C) 1998-2004 Hewlett-Packard Co
* David Mosberger-Tang <davidm@hpl.hp.com> * David Mosberger-Tang <davidm@hpl.hp.com>
* Stephane Eranian <eranian@hpl.hp.com> * Stephane Eranian <eranian@hpl.hp.com>
* Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com> * Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com>
...@@ -61,7 +61,6 @@ ...@@ -61,7 +61,6 @@
/* bit 5 is currently unused */ /* bit 5 is currently unused */
#define IA64_THREAD_FPEMU_NOPRINT (__IA64_UL(1) << 6) /* don't log any fpswa faults */ #define IA64_THREAD_FPEMU_NOPRINT (__IA64_UL(1) << 6) /* don't log any fpswa faults */
#define IA64_THREAD_FPEMU_SIGFPE (__IA64_UL(1) << 7) /* send a SIGFPE for fpswa faults */ #define IA64_THREAD_FPEMU_SIGFPE (__IA64_UL(1) << 7) /* send a SIGFPE for fpswa faults */
#define IA64_THREAD_XSTACK (__IA64_UL(1) << 8) /* stack executable by default? */
#define IA64_THREAD_UAC_SHIFT 3 #define IA64_THREAD_UAC_SHIFT 3
#define IA64_THREAD_UAC_MASK (IA64_THREAD_UAC_NOPRINT | IA64_THREAD_UAC_SIGBUS) #define IA64_THREAD_UAC_MASK (IA64_THREAD_UAC_NOPRINT | IA64_THREAD_UAC_SIGBUS)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment