X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=fs%2Fbinfmt_elf.c;h=d4b15576e584fc1fb1ffcd7ff019f9e7031a577f;hb=2c0b381467bc2997be9d741a152f3fc75785eedc;hp=c374be51b041a698341ddbda6b9fc5fe1329df46;hpb=140fedb5f2efd1f23b26afb2d812004556ba9515;p=powerpc.git diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index c374be51b0..d4b15576e5 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -775,6 +775,7 @@ static int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs) change some of these later */ set_mm_counter(current->mm, rss, 0); current->mm->free_area_cache = current->mm->mmap_base; + current->mm->cached_hole_size = 0; retval = setup_arg_pages(bprm, randomize_stack_top(STACK_TOP), executable_stack); if (retval < 0) { @@ -904,7 +905,7 @@ static int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs) send_sig(SIGKILL, current, 0); goto out_free_dentry; } - if (padzero(elf_bss)) { + if (likely(elf_bss != elf_brk) && unlikely(padzero(elf_bss))) { send_sig(SIGSEGV, current, 0); retval = -EFAULT; /* Nobody gets to see this, but.. */ goto out_free_dentry; @@ -1125,7 +1126,7 @@ static int dump_write(struct file *file, const void *addr, int nr) return file->f_op->write(file, addr, nr, &file->f_pos) == nr; } -static int dump_seek(struct file *file, off_t off) +static int dump_seek(struct file *file, loff_t off) { if (file->f_op->llseek) { if (file->f_op->llseek(file, off, 0) != off)