projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
coredump masking: ELF-FDPIC: remove an unused argument
[powerpc.git]
/
fs
/
binfmt_elf_fdpic.c
diff --git
a/fs/binfmt_elf_fdpic.c
b/fs/binfmt_elf_fdpic.c
index
5810aa1
..
1a6c8e2
100644
(file)
--- a/
fs/binfmt_elf_fdpic.c
+++ b/
fs/binfmt_elf_fdpic.c
@@
-30,7
+30,6
@@
#include <linux/personality.h>
#include <linux/ptrace.h>
#include <linux/init.h>
#include <linux/personality.h>
#include <linux/ptrace.h>
#include <linux/init.h>
-#include <linux/smp_lock.h>
#include <linux/elf.h>
#include <linux/elf-fdpic.h>
#include <linux/elfcore.h>
#include <linux/elf.h>
#include <linux/elf-fdpic.h>
#include <linux/elfcore.h>
@@
-179,6
+178,8
@@
static int load_elf_fdpic_binary(struct linux_binprm *bprm,
int executable_stack;
int retval, i;
int executable_stack;
int retval, i;
+ kdebug("____ LOAD %d ____", current->pid);
+
memset(&exec_params, 0, sizeof(exec_params));
memset(&interp_params, 0, sizeof(interp_params));
memset(&exec_params, 0, sizeof(exec_params));
memset(&interp_params, 0, sizeof(interp_params));
@@
-620,8
+621,8
@@
static int create_elf_fdpic_tables(struct linux_binprm *bprm,
p = (char __user *) current->mm->arg_start;
for (loop = bprm->argc; loop > 0; loop--) {
__put_user((elf_caddr_t) p, argv++);
p = (char __user *) current->mm->arg_start;
for (loop = bprm->argc; loop > 0; loop--) {
__put_user((elf_caddr_t) p, argv++);
- len = strnlen_user(p,
PAGE_SIZE * MAX_ARG_PAGES
);
- if (!len || len >
PAGE_SIZE * MAX_ARG_PAGES
)
+ len = strnlen_user(p,
MAX_ARG_STRLEN
);
+ if (!len || len >
MAX_ARG_STRLEN
)
return -EINVAL;
p += len;
}
return -EINVAL;
p += len;
}
@@
-632,8
+633,8
@@
static int create_elf_fdpic_tables(struct linux_binprm *bprm,
current->mm->env_start = (unsigned long) p;
for (loop = bprm->envc; loop > 0; loop--) {
__put_user((elf_caddr_t)(unsigned long) p, envp++);
current->mm->env_start = (unsigned long) p;
for (loop = bprm->envc; loop > 0; loop--) {
__put_user((elf_caddr_t)(unsigned long) p, envp++);
- len = strnlen_user(p,
PAGE_SIZE * MAX_ARG_PAGES
);
- if (!len || len >
PAGE_SIZE * MAX_ARG_PAGES
)
+ len = strnlen_user(p,
MAX_ARG_STRLEN
);
+ if (!len || len >
MAX_ARG_STRLEN
)
return -EINVAL;
p += len;
}
return -EINVAL;
p += len;
}
@@
-941,8
+942,11
@@
static int elf_fdpic_map_file_constdisp_on_uclinux(
if (mm) {
if (phdr->p_flags & PF_X) {
if (mm) {
if (phdr->p_flags & PF_X) {
- mm->start_code = seg->addr;
- mm->end_code = seg->addr + phdr->p_memsz;
+ if (!mm->start_code) {
+ mm->start_code = seg->addr;
+ mm->end_code = seg->addr +
+ phdr->p_memsz;
+ }
} else if (!mm->start_data) {
mm->start_data = seg->addr;
#ifndef CONFIG_MMU
} else if (!mm->start_data) {
mm->start_data = seg->addr;
#ifndef CONFIG_MMU
@@
-1123,8
+1127,10
@@
static int elf_fdpic_map_file_by_direct_mmap(struct elf_fdpic_params *params,
if (mm) {
if (phdr->p_flags & PF_X) {
if (mm) {
if (phdr->p_flags & PF_X) {
- mm->start_code = maddr;
- mm->end_code = maddr + phdr->p_memsz;
+ if (!mm->start_code) {
+ mm->start_code = maddr;
+ mm->end_code = maddr + phdr->p_memsz;
+ }
} else if (!mm->start_data) {
mm->start_data = maddr;
mm->end_data = maddr + phdr->p_memsz;
} else if (!mm->start_data) {
mm->start_data = maddr;
mm->end_data = maddr + phdr->p_memsz;
@@
-1450,8
+1456,8
@@
static int elf_dump_thread_status(long signr, struct elf_thread_status *t)
* dump the segments for an MMU process
*/
#ifdef CONFIG_MMU
* dump the segments for an MMU process
*/
#ifdef CONFIG_MMU
-static int elf_fdpic_dump_segments(struct file *file, s
truct mm_struct *mm
,
-
size_t *size,
unsigned long *limit)
+static int elf_fdpic_dump_segments(struct file *file, s
ize_t *size
,
+ unsigned long *limit)
{
struct vm_area_struct *vma;
{
struct vm_area_struct *vma;
@@
-1473,8
+1479,8
@@
static int elf_fdpic_dump_segments(struct file *file, struct mm_struct *mm,
DUMP_SEEK(file->f_pos + PAGE_SIZE);
}
else if (page == ZERO_PAGE(addr)) {
DUMP_SEEK(file->f_pos + PAGE_SIZE);
}
else if (page == ZERO_PAGE(addr)) {
- DUMP_SEEK(file->f_pos + PAGE_SIZE);
page_cache_release(page);
page_cache_release(page);
+ DUMP_SEEK(file->f_pos + PAGE_SIZE);
}
else {
void *kaddr;
}
else {
void *kaddr;
@@
-1505,8
+1511,8
@@
end_coredump:
* dump the segments for a NOMMU process
*/
#ifndef CONFIG_MMU
* dump the segments for a NOMMU process
*/
#ifndef CONFIG_MMU
-static int elf_fdpic_dump_segments(struct file *file, s
truct mm_struct *mm
,
-
size_t *size,
unsigned long *limit)
+static int elf_fdpic_dump_segments(struct file *file, s
ize_t *size
,
+ unsigned long *limit)
{
struct vm_list_struct *vml;
{
struct vm_list_struct *vml;