public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: Richard Biener <richard.guenther@gmail.com>
Cc: gcc-patches@gcc.gnu.org, Jakub Jelinek <jakub@redhat.com>
Subject: Re: [PATCH RFA] asan: poisoning promoted statics [PR113531]
Date: Wed, 31 Jan 2024 08:45:20 -0500	[thread overview]
Message-ID: <2d573b2b-2c23-4634-94e5-66806b0ebfc0@redhat.com> (raw)
In-Reply-To: <CAFiYyc2eJpsnEJOYoYSteE9jYN=Y6eWi6FhA+fU++Hx2TY25Ng@mail.gmail.com>

On 1/31/24 03:51, Richard Biener wrote:
> On Wed, Jan 31, 2024 at 4:38 AM Jason Merrill <jason@redhat.com> wrote:
>>
>> Tested x86_64-pc-linux-gnu, OK for trunk?
> 
> It's a quite "late" fixup, I suppose you have tried to avoid marking it
> during gimplification?  I see we do parts of this during BIND_EXPR
> processing which is indeed a bit early but possibly difficult to rectify.

I also considered

> diff --git a/gcc/gimplify.cc b/gcc/gimplify.cc
> index 7f79b3cc7e6..c906d927a09 100644
> --- a/gcc/gimplify.cc
> +++ b/gcc/gimplify.cc
> @@ -1249,6 +1249,10 @@ asan_poison_variable (tree decl, bool poison, gimple_stmt_iterator *it,
>    if (zerop (unit_size))
>      return;
> 
> +  /* Or variables in static storage.  */
> +  if (TREE_STATIC (decl))
> +    return;
> +
>    /* It's necessary to have all stack variables aligned to ASAN granularity
>       bytes.  */
>    gcc_assert (!hwasan_sanitize_p () || hwasan_sanitize_stack_p ());

which fixes the bug by avoiding the poison mark, but it's too late to 
avoid the unpoison mark--though the unpoison is still removed by sanopt, 
so the end result is the same.  I decided to send the other patch 
because it applies to both, but I'm happy with either approach.

Jason


      parent reply	other threads:[~2024-01-31 13:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-31  3:37 Jason Merrill
2024-01-31  8:51 ` Richard Biener
2024-01-31  9:07   ` Jakub Jelinek
2024-01-31 11:18     ` [PATCH] gimple-fold: Remove .ASAN_MARK calls on TREE_STATIC variables [PR113531] Jakub Jelinek
2024-01-31 12:04       ` Richard Biener
2024-01-31 15:20         ` [PATCH] gimple-low: " Jakub Jelinek
2024-01-31 17:57           ` Richard Biener
2024-01-31 13:45   ` Jason Merrill [this message]

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=2d573b2b-2c23-4634-94e5-66806b0ebfc0@redhat.com \
    --to=jason@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=richard.guenther@gmail.com \
    /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).