projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
NFS: Remove BKL from the readdir code
[firefly-linux-kernel-4.4.55.git]
/
fs
/
binfmt_elf_fdpic.c
diff --git
a/fs/binfmt_elf_fdpic.c
b/fs/binfmt_elf_fdpic.c
index 32649f2a16544502c8affe2d147ac89d1e02ae50..d051a32e6270ec31975da904476e1cefbaa9be1f 100644
(file)
--- a/
fs/binfmt_elf_fdpic.c
+++ b/
fs/binfmt_elf_fdpic.c
@@
-136,8
+136,8
@@
static int elf_fdpic_fetch_phdrs(struct elf_fdpic_params *params,
retval = kernel_read(file, params->hdr.e_phoff,
(char *) params->phdrs, size);
retval = kernel_read(file, params->hdr.e_phoff,
(char *) params->phdrs, size);
- if (
retval < 0
)
- return retval;
+ if (
unlikely(retval != size)
)
+ return retval
< 0 ? retval : -ENOEXEC
;
/* determine stack size for this binary */
phdr = params->phdrs;
/* determine stack size for this binary */
phdr = params->phdrs;
@@
-218,8
+218,11
@@
static int load_elf_fdpic_binary(struct linux_binprm *bprm,
phdr->p_offset,
interpreter_name,
phdr->p_filesz);
phdr->p_offset,
interpreter_name,
phdr->p_filesz);
- if (retval < 0)
+ if (unlikely(retval != phdr->p_filesz)) {
+ if (retval >= 0)
+ retval = -ENOEXEC;
goto error;
goto error;
+ }
retval = -ENOENT;
if (interpreter_name[phdr->p_filesz - 1] != '\0')
retval = -ENOENT;
if (interpreter_name[phdr->p_filesz - 1] != '\0')
@@
-245,8
+248,11
@@
static int load_elf_fdpic_binary(struct linux_binprm *bprm,
retval = kernel_read(interpreter, 0, bprm->buf,
BINPRM_BUF_SIZE);
retval = kernel_read(interpreter, 0, bprm->buf,
BINPRM_BUF_SIZE);
- if (retval < 0)
+ if (unlikely(retval != BINPRM_BUF_SIZE)) {
+ if (retval >= 0)
+ retval = -ENOEXEC;
goto error;
goto error;
+ }
interp_params.hdr = *((struct elfhdr *) bprm->buf);
break;
interp_params.hdr = *((struct elfhdr *) bprm->buf);
break;
@@
-384,7
+390,7
@@
static int load_elf_fdpic_binary(struct linux_binprm *bprm,
}
/* expand the stack mapping to use up the entire allocation granule */
}
/* expand the stack mapping to use up the entire allocation granule */
- fullsize = ksize((char *) current->mm->start_brk);
+ fullsize = k
obj
size((char *) current->mm->start_brk);
if (!IS_ERR_VALUE(do_mremap(current->mm->start_brk, stack_size,
fullsize, 0, 0)))
stack_size = fullsize;
if (!IS_ERR_VALUE(do_mremap(current->mm->start_brk, stack_size,
fullsize, 0, 0)))
stack_size = fullsize;