This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH RFC] explicit_bzero, again
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- Cc: libc-alpha at sourceware dot org
- Date: Tue, 15 Sep 2015 13:49:42 -0500
- Subject: Re: [PATCH RFC] explicit_bzero, again
- Authentication-results: sourceware.org; auth=none
- References: <55C7E246 dot 3000006 at panix dot com> <55F050D3 dot 2070403 at panix dot com> <CAKCAbMhudB3_J78haR__uw1MrJLnGYw4yH+N82G5b1Ap2gkEXg at mail dot gmail dot com> <55F83002 dot 9040906 at linaro dot org> <CAKCAbMgAuYcSAaaNSk4KQEhF4_3OS9_XvS3b1tVUo8DAZmUfwQ at mail dot gmail dot com> <55F8428C dot 1040008 at linaro dot org>
On Tue, Sep 15, 2015 at 01:08:44PM -0300, Adhemerval Zanella wrote:
> >> Also this can be enabled project by project in a very easy way if it decides
> >> that is worth to implement.
> >
> > This has already happened. codesearch.debian.net reports 597 mentions
> > of explicit_bzero, 645 mentions of OPENSSL_cleanse, 6 mentions of
> > explicit_memset, 721 mentions of memset_s, 328 mentions of
> > memzero_explicit, 216 mentions of memwipe, 295 mentions of wipememory.
> > We wouldn't be having this conversation at all if there weren't a
> > demonstrated demand from the application side.
>
> And as for str{l}cpy it does not really mean they are using the better
> approach to fix its issues it is proposing to fix. Or even, if using
> the API is indeed implement the security fixes they are aiming for.
Neither explicit_bzero in glibc nor something similar in GCC can ever
produce this hoped-for security: there always will remain cases where
data escapes. But it is good for defense-in-depth, as long as the
documentation makes it very clear that there are no promises that every
trace of the secret data will be gone. Although of course many people
will just ignore such warnings and use this as snake oil, as faerie dust
that you sprinkle over your code.
Segher