public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jan.smets@alcatel-lucent.com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug sanitizer/60861] New: out of bounds access of  global var in .rodata/.bss not detected
Date: Wed, 16 Apr 2014 15:17:00 -0000	[thread overview]
Message-ID: <bug-60861-4@http.gcc.gnu.org/bugzilla/> (raw)

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60861

            Bug ID: 60861
           Summary: out of bounds access of  global var in .rodata/.bss
                    not detected
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jan.smets@alcatel-lucent.com
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org

gcc version 4.8.2 (Debian 4.8.2-16) 
gcc test.c -O2 -fsanitize=address -o test 

int depth = 3;

//int testGlobalOutOfBoundsRODATAVar[2] = {1}; /* data: works
(asan_report_load4 present) */
const int testGlobalOutOfBoundsRODATAVar[1] = {1}; /* rodata: doesn't work (no
asan_report_load4 present) */
//int testGlobalOutOfBoundsRODATAVar[1] = {0}; /* bss : works
(asan_report_load4 present) */
//int testGlobalOutOfBoundsRODATAVar[1];  /* bss : doesn't work !???
(asan_report_load4 present!)  */


int test(void)
{
    return testGlobalOutOfBoundsRODATAVar[depth]; // boom
}

int main(void)
{
    return test();
}


             reply	other threads:[~2014-04-16 15:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-16 15:17 jan.smets@alcatel-lucent.com [this message]
2014-04-16 19:02 ` [Bug sanitizer/60861] " kcc at gcc dot gnu.org
2014-04-16 21:33 ` jan.smets@alcatel-lucent.com
2014-04-17  5:00 ` y.gribov at samsung dot com
2014-04-17  5:04 ` pinskia at gcc dot gnu.org
2014-04-17  6:32 ` y.gribov at samsung dot com
2014-04-17  8:30 ` kcc at gcc dot gnu.org
2014-04-17  9:13 ` jakub at gcc dot gnu.org

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=bug-60861-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).