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
PMIC:rk818.dtsi: remove rk818_reg_ldo2 aways-on,
[firefly-linux-kernel-4.4.55.git]
/
fs
/
binfmt_elf.c
diff --git
a/fs/binfmt_elf.c
b/fs/binfmt_elf.c
index 3aac8e9edac32e41795484d890f81e114ca3e26e..53f620a4350e3d02272c721a6bf3647e5f4757c7 100644
(file)
--- a/
fs/binfmt_elf.c
+++ b/
fs/binfmt_elf.c
@@
-552,11
+552,12
@@
out:
static unsigned long randomize_stack_top(unsigned long stack_top)
{
static unsigned long randomize_stack_top(unsigned long stack_top)
{
- unsigned
int
random_variable = 0;
+ unsigned
long
random_variable = 0;
if ((current->flags & PF_RANDOMIZE) &&
!(current->personality & ADDR_NO_RANDOMIZE)) {
if ((current->flags & PF_RANDOMIZE) &&
!(current->personality & ADDR_NO_RANDOMIZE)) {
- random_variable = get_random_int() & STACK_RND_MASK;
+ random_variable = (unsigned long) get_random_int();
+ random_variable &= STACK_RND_MASK;
random_variable <<= PAGE_SHIFT;
}
#ifdef CONFIG_STACK_GROWSUP
random_variable <<= PAGE_SHIFT;
}
#ifdef CONFIG_STACK_GROWSUP
@@
-755,6
+756,7
@@
static int load_elf_binary(struct linux_binprm *bprm)
i < loc->elf_ex.e_phnum; i++, elf_ppnt++) {
int elf_prot = 0, elf_flags;
unsigned long k, vaddr;
i < loc->elf_ex.e_phnum; i++, elf_ppnt++) {
int elf_prot = 0, elf_flags;
unsigned long k, vaddr;
+ unsigned long total_size = 0;
if (elf_ppnt->p_type != PT_LOAD)
continue;
if (elf_ppnt->p_type != PT_LOAD)
continue;
@@
-819,10
+821,16
@@
static int load_elf_binary(struct linux_binprm *bprm)
#else
load_bias = ELF_PAGESTART(ELF_ET_DYN_BASE - vaddr);
#endif
#else
load_bias = ELF_PAGESTART(ELF_ET_DYN_BASE - vaddr);
#endif
+ total_size = total_mapping_size(elf_phdata,
+ loc->elf_ex.e_phnum);
+ if (!total_size) {
+ error = -EINVAL;
+ goto out_free_dentry;
+ }
}
error = elf_map(bprm->file, load_bias + vaddr, elf_ppnt,
}
error = elf_map(bprm->file, load_bias + vaddr, elf_ppnt,
- elf_prot, elf_flags,
0
);
+ elf_prot, elf_flags,
total_size
);
if (BAD_ADDR(error)) {
send_sig(SIGKILL, current, 0);
retval = IS_ERR((void *)error) ?
if (BAD_ADDR(error)) {
send_sig(SIGKILL, current, 0);
retval = IS_ERR((void *)error) ?