From owner-svn-src-head@freebsd.org Fri Mar 31 19:12:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EC05D26C40; Fri, 31 Mar 2017 19:12:06 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E88DB685; Fri, 31 Mar 2017 19:12:05 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 6BC4C5A9F14; Fri, 31 Mar 2017 19:11:58 +0000 (UTC) Date: Fri, 31 Mar 2017 19:11:58 +0000 From: Brooks Davis To: John Baldwin Cc: Peter Grehan , Ian Lepore , Allan Jude , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316311 - in head: lib/libstand sys/boot/geli sys/boot/i386/gptboot sys/boot/i386/loader sys/boot/i386/zfsboot Message-ID: <20170331191158.GA76402@spindle.one-eyed-alien.net> References: <201703310004.v2V04W3A043449@repo.freebsd.org> <1490973411.64669.121.camel@freebsd.org> <11865010.raXmoPpVZB@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="FCuugMFkClbJLl1L" Content-Disposition: inline In-Reply-To: <11865010.raXmoPpVZB@ralph.baldwin.cx> User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 19:12:06 -0000 --FCuugMFkClbJLl1L Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 31, 2017 at 11:29:20AM -0700, John Baldwin wrote: > On Friday, March 31, 2017 09:04:51 AM Peter Grehan wrote: > > > So... can anyone provide a clue what's "explicit" (or different in any > > > way) between explicit_bzero() and normal bzero()? > >=20 > > =20 > > https://www.freebsd.org/cgi/man.cgi?query=3Dexplicit_bzero&sektion=3D3&= manpath=3DFreeBSD+12-current >=20 > It should be called 'bzero_now_I_mean_it()' >=20 > (but then we would need some other function called anybody_want_a_peanut(= )) It's sole purpose is to prevent the compiler from observing a pattern like: char a_secret_key[len]; ... bzero(a_secret_key, len); return; or char *a_secret_key =3D malloc(len); ... bzero(a_secret_key, len); free(a_secret_key); And optimizing away bzero() because it knows what bzero() does and that nothing will ever access it as far as the C language is concerned.. The moment you enable LTO all bets are off because it can pattern match the code for explicit_bzero(), realize that it is that same as bzero() and combine them. Declaring a_secret_key volatile likely makes things work, but the C language is deficient in not providing a way to express something like explicit_bzero() sanely and reliable. -- Brooks --FCuugMFkClbJLl1L Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJY3qn9AAoJEKzQXbSebgfAyGgH/ikmplOVu4qvBRFWua0KdtWp ksMZZAASA3Yo3DK/rNmkU3jwGqHpthX9TmRfMmN4TgvNlUskgCZ4Co1oaMgMIZET hVVYbLEapiLjAOAwqGyWwsQ789Zy3R48BvmF+7NLoGGcoU6XqJ8qwQ24yNxSH4fh JpmNPqd0+Kr4FKSKmLDdJXY836vF2RuTgb/rLV8xDdOn7qpP40kuoIjCv5GnsJpI YtF3COIkWO5KyoiDxD6724MzlyQ5fG8IfftNgjBClcq+v4xKu6j84FvcYjU0tmNW 5eVOeARRwYd6LaZ5DPdBwpM6dcleW3MQs4psC3HNjieGrVJjEbiRZUGJVNCvnfA= =D/9W -----END PGP SIGNATURE----- --FCuugMFkClbJLl1L--