mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: jeremy@goop.org
Cc: linux-kernel@vger.kernel.org
Subject: potential off by one in vdso reloc_symtab()
Date: Thu, 5 Jul 2012 16:54:25 +0300	[thread overview]
Message-ID: <20120705135425.GA21466@elgon.mountain> (raw)

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


                 reply	other threads:[~2012-07-05 13:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120705135425.GA21466@elgon.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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