From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 70DF73858D20 for ; Wed, 31 Jan 2024 13:45:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 70DF73858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 70DF73858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706708728; cv=none; b=K0gYih7nTMDVdzKs+FPWOrPe4yA2PDGGA7vGBz5Fys//0zZqX5xO0rt5KRi1KdtazKZHwcjRPy+hXyMWSaPjuK4z7jYdrcTXpq4/FRaJPcIZvezJCdc7x12o4TsZo0qTvjBrOXo607+OXb/8A0aJ/hwSjPnyxyjuoGOPa32GCkU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706708728; c=relaxed/simple; bh=gg6Heq6xiA9Ds2d33KUmLfKfwj94jSEwV1hgwk2M9+0=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=Hr2BYu448AILAlrGISmYG7bXl+dUFXKfhjOu4tlRVgDzs+aOEqt9Dwr0OH75qeYJseamPXQYyr0VEtVj3zb52qHYYeWhdwbrTBjYrnXdfu66/LveKYWdGvX2ZpTYEiBJvFcMW7gV0GwubQw9Z2z/xOLSQVPUBNkDHfGN+i2jWsI= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706708723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vTO8TnB9L24JpKanpX/hdIzuzFKnbVTISa7PK4L2hgc=; b=Zkfg1k5fbomOsnQxzuMieUw67qYBJyuxHDrrQX7LHBlZWAAL2Fe3fgIBc2MauOFbM+V5Dt CuiHmx7KOZ2TAxqdn/JSSBgcP0NRjjOPKAjYsA0BvfLIk+OBsN0Isbxd3cdDwhLYPtJD8q 4K4+LL5Tn6TilYy49T//Ofylp8ZeUIM= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-84-V6AV7UKzNTiOYcXIfKN4wg-1; Wed, 31 Jan 2024 08:45:21 -0500 X-MC-Unique: V6AV7UKzNTiOYcXIfKN4wg-1 Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-68c4e69e121so69663316d6.2 for ; Wed, 31 Jan 2024 05:45:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706708721; x=1707313521; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=vTO8TnB9L24JpKanpX/hdIzuzFKnbVTISa7PK4L2hgc=; b=ZSaAFVWswYIJttx1tEDnJ3cKmlxZBIYhrLWC4T12m2Zr3nbD2GvciZjPp/faWW3SI2 wx7ZVobFA13Y9ExQ3i5lsuXyWb6g443lyBY2GoU8S0fgZWffeeA9rb2WBZ16JqCKmKRs yGKAlchbnE6/9s4EHJ/koTnw/BGYAAseNXFgKpdpkZF5AQT9SDQO+Z1miKtaAaDqStJr cjhftHpJMXsmhrGNo7Ef6i32U5l83SO4fOzzJMEEktCj6g/rnd6W+VngIM9IN0ZeQlnu Y/NXr75JvI5DeG7yEJiVrpoqJmCC87/IBBibvzSF8p55fnjsELh9Q2YX7ptORDwkeTyD d4FQ== X-Gm-Message-State: AOJu0YwI6C5f0pf55O9BkFkbex1ckJhroWu/D9jukh+BeXmD6xJc65aZ AgZ1sA0/fl2xEnW+AcNagRwORb3+B7ukillsU5VMGeqjS1eSAWSPAbB4yUlSEFFyyRxgcAx9ARA p0OmNT6F7nIubKFvo3PBo4dslQFDIFXbdRWKGgGfM3CKl1YazO3B+F2w= X-Received: by 2002:ad4:5190:0:b0:68c:6ef2:4736 with SMTP id b16-20020ad45190000000b0068c6ef24736mr1156121qvp.3.1706708721461; Wed, 31 Jan 2024 05:45:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IH1I6JcfZFSgl2wdGtMphaaS5cF/8bIyN4gWs7FXANP11zpKcNelFr7/FgrjxPPXg522wcGHw== X-Received: by 2002:ad4:5190:0:b0:68c:6ef2:4736 with SMTP id b16-20020ad45190000000b0068c6ef24736mr1156105qvp.3.1706708721191; Wed, 31 Jan 2024 05:45:21 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCXO2MYhE/3qJcicJqTngs0eYpXRmMXnr/nUhs7QZSThdkKJDFwfNOE4UFq0h8FX8Ut72Y9qjf+1xsYsXNYpR8J6 Received: from [192.168.1.146] (130-44-146-16.s12558.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.146.16]) by smtp.gmail.com with ESMTPSA id of10-20020a056214434a00b0068c560eaf8fsm2415709qvb.134.2024.01.31.05.45.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 31 Jan 2024 05:45:20 -0800 (PST) Message-ID: <2d573b2b-2c23-4634-94e5-66806b0ebfc0@redhat.com> Date: Wed, 31 Jan 2024 08:45:20 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RFA] asan: poisoning promoted statics [PR113531] To: Richard Biener Cc: gcc-patches@gcc.gnu.org, Jakub Jelinek References: <20240131033759.2236614-1-jason@redhat.com> From: Jason Merrill In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 1/31/24 03:51, Richard Biener wrote: > On Wed, Jan 31, 2024 at 4:38 AM Jason Merrill 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