potential off by one in vdso reloc_symtab()

From: Dan Carpenter
Date: Thu Jul 05 2012 - 09:54:36 EST


Hi Jeremy,

I'm doing an audit for off by one errors and I had a question about
the code in reloc_symtab().

arch/x86/vdso/vdso32-setup.c
86 for(i = 0; i < nsym; i++, sym++) {
87 if (sym->st_shndx == SHN_UNDEF ||
88 sym->st_shndx == SHN_ABS)
89 continue; /* skip */
90
91 if (sym->st_shndx > SHN_LORESERVE) {
^^^^^^^^^^^^^^^

Should this be >= SHN_LORESERVE? The other comparisons with
SHN_LORESERVE put == SHN_LORESERVE together with the >.

92 printk(KERN_INFO "VDSO: unexpected st_shndx %x\n",
93 sym->st_shndx);
94 continue;
95 }

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/