From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 2B4C43858D28 for ; Wed, 29 Sep 2021 10:39:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2B4C43858D28 Received: from relay1.suse.de (relay1.suse.de [149.44.160.133]) by smtp-out1.suse.de (Postfix) with ESMTP id EECA5224F3; Wed, 29 Sep 2021 10:39:38 +0000 (UTC) Received: from murzim.suse.de (murzim.suse.de [10.160.4.192]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay1.suse.de (Postfix) with ESMTPS id D120C25D50; Wed, 29 Sep 2021 10:39:38 +0000 (UTC) Date: Wed, 29 Sep 2021 12:39:38 +0200 (CEST) From: Richard Biener To: Kees Cook cc: Qing Zhao , gcc-patches Nick Alcock via Subject: Re: [patch][gcc12-changes] Add a new item about the support for automatic static variable initialization In-Reply-To: <202109281336.77472FF@keescook> Message-ID: References: <202109281336.77472FF@keescook> MIME-Version: 1.0 X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; CHARSET=UTF-8 Content-Transfer-Encoding: 8BIT X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 10:39:41 -0000 On Tue, 28 Sep 2021, Kees Cook wrote: > On Tue, Sep 28, 2021 at 08:31:13PM +0000, Qing Zhao wrote: > > Hi, > > > > This is the patch for the gcc12 changes per your request. > > > > Kees provided most of the wording. > > > > Please take a look and let’s know whether it’s good for commit? > > > > thanks. > > > > Qing > > > > ================================================ > > > > > > From: qing zhao > > Date: Tue, 28 Sep 2021 12:01:42 -0700 > > Subject: [PATCH] gcc-12/changes.html: Uninitialized stack variables > > initialization update > > > > * htdocs/gcc-12/changes.html (Eliminating uninitialized variables): > > Item about the support for automatic static variable initialization. > > --- > > htdocs/gcc-12/changes.html | 19 +++++++++++++++++++ > > 1 file changed, 19 insertions(+) > > > > diff --git a/htdocs/gcc-12/changes.html b/htdocs/gcc-12/changes.html > > index 1f156a9..8e2979c 100644 > > --- a/htdocs/gcc-12/changes.html > > +++ b/htdocs/gcc-12/changes.html > > @@ -245,6 +245,25 @@ a work-in-progress.

> > > >

Other significant improvements

> > > > +

Eliminating uninitialized variables

> > + > > +
    > > +
  • GCC can now initialize all stack variables implicitly, including > > + padding. This is intended to eliminate all classes of uninitialized > > + stack variable flaws. Lack of explicit initialization will still > > + warn when -Wuninitialized is active. For best > > + debugging, use of the new command-line option > > + -ftrivial-auto-var-init=pattern can be used to fill > > + variables with a repeated 0xFE pattern, which tends to illuminate > > + many bugs (e.g. pointers receive invalid addresses, sizes and indices > > + are very large). For best production results, the new command-line > > + option -ftrivial-auto-var-init=zero can be used to > > + fill variables with 0x00, which tends to provide a safer state for > > + bugs (e.g. pointers are NULL, strings are NULL filled, and sizes > > Minor nit: I've always been corrected that "NULL" refers to a pointer, and > "NUL" refers to the "null character", so the latter use of NULL should be > "NUL": ... pointers are NULL, strings are NUL filled, and size ... > > I mix this up all the time, so apologies if that got introduced by me! > :) Also things like 0xFE and NULL should be wrapped in , otherwise it looks good to me. Thanks, Richard. > -Kees > > > + and indices are 0). > > +
  • > > +
> > + > >

Debugging formats

> > > >
    > > -- > > 1.9.1 > > > > > > -- Richard Biener SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany; GF: Felix Imendörffer; HRB 36809 (AG Nuernberg)