This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC] [PATCH] Support explicit_bzero, memset_s, memzero_explicit, or similar.
- From: Rich Felker <dalias at libc dot org>
- To: Alexander Monakov <amonakov at ispras dot ru>
- Cc: Richard Henderson <rth at twiddle dot net>, Nick Mathewson <nickm at torproject dot org>, libc-alpha at sourceware dot org
- Date: Tue, 16 Dec 2014 14:19:00 -0500
- Subject: Re: [RFC] [PATCH] Support explicit_bzero, memset_s, memzero_explicit, or similar.
- Authentication-results: sourceware.org; auth=none
- References: <CAKDKvuzWYf3GcXYs4ED8XLyy58nzmvxRV84xwsKKZjPpVSFQug at mail dot gmail dot com> <20141215173527 dot GJ4574 at brightrain dot aerifal dot cx> <CAKDKvuyhgr4CmkkD+0LzSNqRUW=gUhpERoknAT3e3H7ooqpaDw at mail dot gmail dot com> <20141216052617 dot GL4574 at brightrain dot aerifal dot cx> <54905CB1 dot 3070000 at twiddle dot net> <20141216180126 dot GN4574 at brightrain dot aerifal dot cx> <alpine dot LNX dot 2 dot 00 dot 1412162105460 dot 6595 at monopod dot intra dot ispras dot ru>
On Tue, Dec 16, 2014 at 09:08:55PM +0300, Alexander Monakov wrote:
> > But in the case of a function like:
> >
> > int foo = 42;
> > memset(&foo, 0, sizeof foo);
> > __asm__ __volatile__ ( "" : : : "memory" );
>
> Note that the asm in the proposed patch is written in a different way: it
> accepts the address of the memset 'dest' pointer. I don't understand why you
> said "as long the asm has no way of observing the output of memset" while it
> clearly can do so via the passed pointer.
I looked at the asm a couple times and somehow missed seeing that.
Sorry for the noise. I believe it's correct as written then.
Rich
- References:
- [RFC] [PATCH] Support explicit_bzero, memset_s, memzero_explicit, or similar.
- Re: [RFC] [PATCH] Support explicit_bzero, memset_s, memzero_explicit, or similar.
- Re: [RFC] [PATCH] Support explicit_bzero, memset_s, memzero_explicit, or similar.
- Re: [RFC] [PATCH] Support explicit_bzero, memset_s, memzero_explicit, or similar.
- Re: [RFC] [PATCH] Support explicit_bzero, memset_s, memzero_explicit, or similar.
- Re: [RFC] [PATCH] Support explicit_bzero, memset_s, memzero_explicit, or similar.
- Re: [RFC] [PATCH] Support explicit_bzero, memset_s, memzero_explicit, or similar.