Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Nov 2020 19:17:29 +0000
From:      Brooks Davis <brooks@freebsd.org>
To:        Brooks Davis <brooks@FreeBSD.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r367577 - in head: share/mk sys/conf tools/build/options
Message-ID:  <20201110191729.GC1959@spindle.one-eyed-alien.net>
In-Reply-To: <202011101915.0AAJFEWf059408@repo.freebsd.org>
References:  <202011101915.0AAJFEWf059408@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--98e8jtXdkpgskNou
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Nov 10, 2020 at 07:15:14PM +0000, Brooks Davis wrote:
> Author: brooks
> Date: Tue Nov 10 19:15:13 2020
> New Revision: 367577
> URL: https://svnweb.freebsd.org/changeset/base/367577
>=20
> Log:
>   Support initializing stack variables on function entry
>  =20
>   There are two options:
>    - WITH_INIT_ALL_ZERO: Zero all variables on the stack.
>    - WITH_INIT_ALL_PATTERN: Initialize variables with well-defined patter=
ns.
>  =20
>   The exact pattern are a compiler implementation detail and vary by type.
>   They are somewhat documented in the LLVM commit message:
>   https://reviews.llvm.org/rL349442
>   I've used WITH_INIT_ALL_* to match Microsoft's InitAll feature rather
>   than naming them after the LLVM specific compiler flags.
>  =20
>   In a range of consumer products, options like these are used in
>   both debug and production builds with debugs builds using patterns
>   (intended to provoke crashes on use of uninitialized values) and
>   production using zeros (deemed more likely to lead to harmless
>   misbehavior or NULL-pointer dereferences).

We've tested this extensively in CheriBSD on RISC-V, in the wild it's
probably most tested on Arm64 and x86.

Despite the silly compiler flag you'll spot in the code, the zeroing
option isn't going away in practice as Apple, Google, and Microsoft all
ship with this feature in some of their products.

-- Brooks

--98e8jtXdkpgskNou
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEcBAEBAgAGBQJfqudIAAoJEKzQXbSebgfAZ0sH/iQCtyUtdmDHgMiLUzFvYXtO
jdpgwX2AjFMdXB7seJtGjhPthfwIb57byFp5AJ85vQ3MLMxw8Om+Fsi0MVuZwzeq
t59+fiaxE2vmusYI3882duQw/0MHuPzxE54R7Euxo1tIaBk8rPQ1mP2r3j+p6cyk
dlLjT8hJBM/k0Hx35FTTis3PRJQwS36atpS5csduL/yRi7rq8vExeNtyJwGVZdRe
lQ0WDgZBhIgFyOpaZ+/iK2IhnOZjHKgmXYXfrfRVHfCQ7yRi+Xrrk+6HfcXW3yxa
hjO3PhhDng0z8dlqDWmvMLUm49Hu9fmlzrjJ9ALK55C99F39ds9vIZW4p2jRuVw=
=t2cp
-----END PGP SIGNATURE-----

--98e8jtXdkpgskNou--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20201110191729.GC1959>