--- orig/fs/binfmt_elf.c Mon Mar 17 20:30:17 2003 +++ work/fs/binfmt_elf.c Mon Mar 17 20:30:29 2003 @@ -259,12 +259,26 @@ create_elf_tables(struct linux_binprm *b static inline unsigned long elf_map (struct file *filep, unsigned long addr, struct elf_phdr *eppnt, int prot, int type) { - unsigned long map_addr; + struct mm_struct *mm; + struct vm_area_struct *vma; + unsigned long map_addr, n; down_write(¤t->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)); + + + addr = ELF_PAGESTART(addr); + mm = current->mm; + vma = find_vma(mm, addr); + if(!vma) + goto out; + + for(n = 0; n < eppnt->p_filesz; n+=PAGE_SIZE) + handle_mm_fault(mm, vma, addr + n, 0); + +out: up_write(¤t->mm->mmap_sem); return(map_addr); }