public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Uros Bizjak <uros@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r11-11349] sanitizer/111736 - skip ASAN for globals in alternate address-space
Date: Wed, 24 Apr 2024 14:39:47 +0000 (GMT)	[thread overview]
Message-ID: <20240424143947.8F99B384AB58@sourceware.org> (raw)

https://gcc.gnu.org/g:b86b523fb53f5ffb0e3f3236fc526a587944d9ea

commit r11-11349-gb86b523fb53f5ffb0e3f3236fc526a587944d9ea
Author: Richard Biener <rguenther@suse.de>
Date:   Tue Dec 5 14:00:43 2023 +0100

    sanitizer/111736 - skip ASAN for globals in alternate address-space
    
    gcc/ChangeLog:
    
            PR sanitizer/111736
            * asan.c (asan_protect_global): Do not protect globals
            in non-generic address-space.
    
    (cherry picked from commit 7e40497805c0831596334fe474112f991276e11b)

Diff:
---
 gcc/asan.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/asan.c b/gcc/asan.c
index 2aa2be13bf6..b92c6007c97 100644
--- a/gcc/asan.c
+++ b/gcc/asan.c
@@ -2238,6 +2238,8 @@ asan_protect_global (tree decl, bool ignore_decl_rtl_set_p)
       || (DECL_SECTION_NAME (decl) != NULL
 	  && !symtab_node::get (decl)->implicit_section
 	  && !section_sanitized_p (DECL_SECTION_NAME (decl)))
+      /* Don't protect variables in non-generic address-space.  */
+      || !ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (TREE_TYPE (decl)))
       || DECL_SIZE (decl) == 0
       || ASAN_RED_ZONE_SIZE * BITS_PER_UNIT > MAX_OFILE_ALIGNMENT
       || TREE_CODE (DECL_SIZE_UNIT (decl)) != INTEGER_CST

                 reply	other threads:[~2024-04-24 14:39 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=20240424143947.8F99B384AB58@sourceware.org \
    --to=uros@gcc.gnu.org \
    --cc=gcc-cvs@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).