From 1bce9e120e52f0e150d8d710618576b3fd95ff8f Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sun, 26 Sep 2004 20:25:11 +0000 Subject: (check_elf_phdr): Tweak last change. --- exec/exec.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'exec') diff --git a/exec/exec.c b/exec/exec.c index 0e555145..a4dcc375 100644 --- a/exec/exec.c +++ b/exec/exec.c @@ -918,6 +918,8 @@ check_elf_phdr (struct execdata *e, const ElfW(Phdr) *mapped_phdr) break; case PT_LOAD: /* Sanity check. */ + if ((phdr->p_offset & -phdr->p_align) == 0) + e->info.elf.phdr_addr += phdr->p_vaddr - phdr->p_offset; if (e->file_size <= (off_t) (phdr->p_offset + phdr->p_filesz)) e->error = ENOEXEC; -- cgit v1.2.3