mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* potential off by one in vdso reloc_symtab()
@ 2012-07-05 13:54 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2012-07-05 13:54 UTC (permalink / raw)
  To: jeremy; +Cc: linux-kernel

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-07-05 13:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-05 13:54 potential off by one in vdso reloc_symtab() Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome