From: Herbert Xu Subject: Re: [PATCH] Use memzero_explicit to clear local buffers Date: Wed, 7 Jan 2015 07:54:54 +1100 Message-ID: <20150106205454.GA22067@gondor.apana.org.au> References: <1420394744-20268-1-git-send-email-me@mortis.eu> <20150104213538.GA19906@gondor.apana.org.au> <20150104224909.GB4806@salidar.dom.custoft.eu> <20150104233637.GA20757@gondor.apana.org.au> <20150106194226.GM4806@salidar.dom.custoft.eu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, "David S. Miller" , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , "maintainer:X86 ARCHITECTURE..." , Greg Kroah-Hartman , Steve French , Rahul Bedarkar , Thomas Pugliese , Randy Dunlap , Julia Lawall , "open list:CRYPTO API" , "open list:CERTIFIED WIRELES..." , "open list:COMMON INTERNET F..." , "moderated list:COMMON INTERNET F..." , Daniel Borkmann To: Giel van Schijndel Return-path: Content-Disposition: inline In-Reply-To: <20150106194226.GM4806-zsKMh+JvXepbNiWYSlF1AbANlwIBtoSN@public.gmane.org> Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-crypto.vger.kernel.org On Tue, Jan 06, 2015 at 08:42:26PM +0100, Giel van Schijndel wrote: > > Question: are you sure the compiler won't optimize the call to memset(0) > way if it's immediately followed by kfree()? Yes it won't be optimised away. However, you could use kzfree. > Another actually does change a stack-allocated buffer, I'll split that > one off right away. OK. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt