Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 16981
b: refs/heads/master
c: dda6ebd
h: refs/heads/master
i:
  16979: 9b9a6f0
v: v3
  • Loading branch information
David Gibson authored and Linus Torvalds committed Jan 9, 2006
1 parent 0d7103a commit 8b0f682
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cc398c2eae35b13d77b77337136325edc6ca94ca
refs/heads/master: dda6ebde96044e9b5f1b14588659b39b4e6c08e7
12 changes: 9 additions & 3 deletions trunk/fs/binfmt_elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,17 @@ static unsigned long elf_map(struct file *filep, unsigned long addr,
struct elf_phdr *eppnt, int prot, int type)
{
unsigned long map_addr;
unsigned long pageoffset = ELF_PAGEOFFSET(eppnt->p_vaddr);

down_write(&current->mm->mmap_sem);
map_addr = do_mmap(filep, ELF_PAGESTART(addr),
eppnt->p_filesz + ELF_PAGEOFFSET(eppnt->p_vaddr), prot, type,
eppnt->p_offset - ELF_PAGEOFFSET(eppnt->p_vaddr));
/* mmap() will return -EINVAL if given a zero size, but a
* segment with zero filesize is perfectly valid */
if (eppnt->p_filesz + pageoffset)
map_addr = do_mmap(filep, ELF_PAGESTART(addr),
eppnt->p_filesz + pageoffset, prot, type,
eppnt->p_offset - pageoffset);
else
map_addr = ELF_PAGESTART(addr);
up_write(&current->mm->mmap_sem);
return(map_addr);
}
Expand Down

0 comments on commit 8b0f682

Please sign in to comment.