Re: [musl] Compiler support for erasure of sensitive data

2015-10-22 Thread Denys Vlasenko
On Wed, Sep 9, 2015 at 6:36 PM, Zack Weinberg wrote: > The first, simpler problem is strictly optimization. explicit_bzero > can be optimized to memset followed by a vacuous use of the memory > region (generating no machine instructions, but preventing the stores > from being deleted as dead); th

Re: [musl] Compiler support for erasure of sensitive data

2015-09-09 Thread Rich Felker
On Wed, Sep 09, 2015 at 02:48:22PM -0400, Zack Weinberg wrote: > On 09/09/2015 01:13 PM, Rich Felker wrote: > > On Wed, Sep 09, 2015 at 12:47:10PM -0400, Zack Weinberg wrote: > >> On Wed, Sep 9, 2015 at 12:42 PM, Rich Felker wrote: > >>> You're making this harder than it needs to be. The "m" const

Re: [musl] Compiler support for erasure of sensitive data

2015-09-09 Thread Zack Weinberg
On 09/09/2015 01:13 PM, Rich Felker wrote: > On Wed, Sep 09, 2015 at 12:47:10PM -0400, Zack Weinberg wrote: >> On Wed, Sep 9, 2015 at 12:42 PM, Rich Felker wrote: >>> You're making this harder than it needs to be. The "m" constraint is >>> the wrong thing to use here. Simply use: >>> >>> _

Re: [musl] Compiler support for erasure of sensitive data

2015-09-09 Thread Rich Felker
On Wed, Sep 09, 2015 at 12:47:10PM -0400, Zack Weinberg wrote: > On Wed, Sep 9, 2015 at 12:42 PM, Rich Felker wrote: > > You're making this harder than it needs to be. The "m" constraint is > > the wrong thing to use here. Simply use: > > > > __asm__(""::"r"(ptr):"memory"); > > Please rev

Re: [musl] Compiler support for erasure of sensitive data

2015-09-09 Thread Zack Weinberg
On Wed, Sep 9, 2015 at 12:42 PM, Rich Felker wrote: > You're making this harder than it needs to be. The "m" constraint is > the wrong thing to use here. Simply use: > > __asm__(""::"r"(ptr):"memory"); Please review my earlier conversation with Adhemerval on exactly this point. zw

Re: [musl] Compiler support for erasure of sensitive data

2015-09-09 Thread Rich Felker
On Wed, Sep 09, 2015 at 12:36:01PM -0400, Zack Weinberg wrote: > The first, simpler problem is strictly optimization. explicit_bzero > can be optimized to memset followed by a vacuous use of the memory > region (generating no machine instructions, but preventing the stores > from being deleted as