diff -Nur modutils-2.4.7/ChangeLog modutils-2.4.8/ChangeLog --- modutils-2.4.7/ChangeLog Thu Aug 16 22:12:26 2001 +++ modutils-2.4.8/ChangeLog Wed Aug 29 11:23:48 2001 @@ -1,3 +1,12 @@ +2001-08-29 Keith Owens + + modutils 2.4.8 + + * Always define flag_unresolved_error. Debian #108934. + * Check for symindx out of bounds. H. J. Lu. + * Archdata for MIPS, dbe table. Maciej W. Rozycki. + * Archdata for PPC, ftr fixup. + 2001-08-15 Keith Owens modutils 2.4.7 diff -Nur modutils-2.4.7/depmod/depmod.c modutils-2.4.8/depmod/depmod.c --- modutils-2.4.7/depmod/depmod.c Wed Aug 15 22:33:27 2001 +++ modutils-2.4.8/depmod/depmod.c Wed Aug 22 15:13:56 2001 @@ -23,7 +23,7 @@ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ident "$Id: depmod.c 1.7 Wed, 15 Aug 2001 22:33:27 +1000 kaos $" +#ident "$Id: depmod.c 1.8 Wed, 22 Aug 2001 15:13:56 +1000 kaos $" #include #include @@ -222,6 +222,8 @@ static SYMBOL *symavail; static SYMBOL *maxsyms; static LIST_SYMBOL *chunk; + +extern int flag_unresolved_error; static int quiet; /* Don't print errors */ static int showerror; /* Shows undefined symbols */ diff -Nur modutils-2.4.7/include/version.h modutils-2.4.8/include/version.h --- modutils-2.4.7/include/version.h Tue May 8 21:34:09 2001 +++ modutils-2.4.8/include/version.h Wed Aug 22 15:10:38 2001 @@ -1 +1 @@ -#define MODUTILS_VERSION "2.4.7" +#define MODUTILS_VERSION "2.4.8" diff -Nur modutils-2.4.7/modutils.spec modutils-2.4.8/modutils.spec --- modutils-2.4.7/modutils.spec Tue May 8 21:34:09 2001 +++ modutils-2.4.8/modutils.spec Wed Aug 22 15:10:38 2001 @@ -1,6 +1,6 @@ Summary: Module utilities Name: modutils -Version: 2.4.7 +Version: 2.4.8 Release: 1 Copyright: GPL Group: Utilities/System diff -Nur modutils-2.4.7/obj/obj_load.c modutils-2.4.8/obj/obj_load.c --- modutils-2.4.7/obj/obj_load.c Wed Mar 21 12:45:58 2001 +++ modutils-2.4.8/obj/obj_load.c Wed Aug 22 15:19:15 2001 @@ -21,7 +21,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ident "$Id: obj_load.c 1.2 Wed, 21 Mar 2001 12:45:58 +1100 kaos $" +#ident "$Id: obj_load.c 1.3 Wed, 22 Aug 2001 15:19:15 +1000 kaos $" #include #include @@ -257,7 +257,7 @@ { case SHT_RELM: { - unsigned long nrel, j; + unsigned long nrel, j, nsyms; ElfW(RelM) *rel; struct obj_section *symtab; char *strtab; @@ -273,6 +273,7 @@ nrel = sec->header.sh_size / sizeof(ElfW(RelM)); rel = (ElfW(RelM) *) sec->contents; symtab = f->sections[sec->header.sh_link]; + nsyms = symtab->header.sh_size / symtab->header.sh_entsize; strtab = f->sections[symtab->header.sh_link]->contents; /* Save the relocate type in each symbol entry. */ @@ -284,6 +285,13 @@ symndx = ELFW(R_SYM)(rel->r_info); if (symndx) { + if (symndx >= nsyms) + { + error("%s: Bad symbol index: %08lx >= %08lx", + filename, symndx, nsyms); + continue; + } + extsym = ((ElfW(Sym) *) symtab->contents) + symndx; if (ELFW(ST_BIND)(extsym->st_info) == STB_LOCAL) { diff -Nur modutils-2.4.7/obj/obj_mips.c modutils-2.4.8/obj/obj_mips.c --- modutils-2.4.7/obj/obj_mips.c Fri Jan 5 12:45:19 2001 +++ modutils-2.4.8/obj/obj_mips.c Wed Aug 29 11:27:47 2001 @@ -18,7 +18,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ident "$Id: obj_mips.c 1.1 Fri, 05 Jan 2001 12:45:19 +1100 kaos $" +#ident "$Id: obj_mips.c 1.3 Wed, 29 Aug 2001 11:27:47 +1000 kaos $" #include #include @@ -232,7 +232,25 @@ } int -arch_archdata (struct obj_file *fin, struct obj_section *sec) +arch_archdata (struct obj_file *f, struct obj_section *archdata_sec) { + struct archdata { + unsigned tgt_long __start___dbe_table; + unsigned tgt_long __stop___dbe_table; + } *ad; + struct obj_section *sec; + + if (archdata_sec->contents) + free(archdata_sec->contents); + archdata_sec->header.sh_size = 0; + sec = obj_find_section(f, "__dbe_table"); + if (sec) { + ad = (struct archdata *) (archdata_sec->contents) = xmalloc(sizeof(*ad)); + memset(ad, 0, sizeof(*ad)); + archdata_sec->header.sh_size = sizeof(*ad); + ad->__start___dbe_table = sec->header.sh_addr; + ad->__stop___dbe_table = sec->header.sh_addr + sec->header.sh_size; + } + return 0; } diff -Nur modutils-2.4.7/obj/obj_ppc.c modutils-2.4.8/obj/obj_ppc.c --- modutils-2.4.7/obj/obj_ppc.c Fri Jan 5 12:45:19 2001 +++ modutils-2.4.8/obj/obj_ppc.c Wed Aug 29 11:23:48 2001 @@ -20,7 +20,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ident "$Id: obj_ppc.c 1.1 Fri, 05 Jan 2001 12:45:19 +1100 kaos $" +#ident "$Id: obj_ppc.c 1.2 Wed, 29 Aug 2001 11:23:48 +1000 kaos $" #include #include @@ -249,7 +249,25 @@ } int -arch_archdata (struct obj_file *fin, struct obj_section *sec) +arch_archdata (struct obj_file *f, struct obj_section *archdata_sec) { + struct archdata { + unsigned tgt_long __start___ftr_fixup; + unsigned tgt_long __stop___ftr_fixup; + } *ad; + struct obj_section *sec; + + if (archdata_sec->contents) + free(archdata_sec->contents); + archdata_sec->header.sh_size = 0; + sec = obj_find_section(f, "__ftr_fixup"); + if (sec) { + ad = (struct archdata *) (archdata_sec->contents) = xmalloc(sizeof(*ad)); + memset(ad, 0, sizeof(*ad)); + archdata_sec->header.sh_size = sizeof(*ad); + ad->__start___ftr_fixup = sec->header.sh_addr; + ad->__stop___ftr_fixup = sec->header.sh_addr + sec->header.sh_size; + } + return 0; } diff -Nur modutils-2.4.7/obj/obj_reloc.c modutils-2.4.8/obj/obj_reloc.c --- modutils-2.4.7/obj/obj_reloc.c Fri Jan 5 12:45:19 2001 +++ modutils-2.4.8/obj/obj_reloc.c Wed Aug 22 15:19:15 2001 @@ -19,7 +19,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ident "$Id: obj_reloc.c 1.1 Fri, 05 Jan 2001 12:45:19 +1100 kaos $" +#ident "$Id: obj_reloc.c 1.2 Wed, 22 Aug 2001 15:19:15 +1000 kaos $" #include #include @@ -284,6 +284,7 @@ ElfW(RelM) *rel, *relend; ElfW(Sym) *symtab; const char *strtab; + unsigned long nsyms; relsec = f->sections[i]; if (relsec->header.sh_type != SHT_RELM) @@ -296,6 +297,7 @@ rel = (ElfW(RelM) *)relsec->contents; relend = rel + (relsec->header.sh_size / sizeof(ElfW(RelM))); symtab = (ElfW(Sym) *)symsec->contents; + nsyms = symsec->header.sh_size / symsec->header.sh_entsize; strtab = (const char *)strsec->contents; for (; rel < relend; ++rel) @@ -312,6 +314,13 @@ if (symndx) { /* Note we've already checked for undefined symbols. */ + + if (symndx >= nsyms) + { + error("Bad symbol index: %08lx >= %08lx", + symndx, nsyms); + continue; + } extsym = &symtab[symndx]; if (ELFW(ST_BIND)(extsym->st_info) == STB_LOCAL)