This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 0/3] explicit_bzero v5
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Zack Weinberg <zackw at panix dot com>
- Cc: <libc-alpha at sourceware dot org>, <carlos at redhat dot com>, <fweimer at redhat dot com>
- Date: Wed, 16 Nov 2016 02:03:31 +0000
- Subject: Re: [PATCH 0/3] explicit_bzero v5
- Authentication-results: sourceware.org; auth=none
- References: <20161115155509.12692-1-zackw@panix.com>
On Tue, 15 Nov 2016, Zack Weinberg wrote:
> * libc.so now exports __explicit_bzero as well as explicit_bzero; the
> implementation-namespace symbol is used by libcrypt.so, and the
> user-namespace symbol is weak. (Requested by Joseph, iirc.)
Requested by Florian (together with header pieces to cause normal calls to
explicit_bzero to end up calling the implementation-namespace version)
because of concerns about interposition.
> The impl-namespace symbol is versioned GLIBC_2.25 instead of
> GLIBC_PRIVATE, because that seems to be what was done for other
> impl-namespace aliases for string functions. I wasn't able to find
> anything definitive about when GLIBC_PRIVATE should be used.
We need an implementation-namespace export for libcrypt use for namespace
reasons [*].
If it's only for libcrypt use, GLIBC_PRIVATE would suffice. If we want to
support it for other libraries limiting the namespace they use, with or
without header pieces to protect against accidental interposition, a
GLIBC_2.25 export is needed.
[*] I had thought libcrypt was irrelevant for linknamespace issues, but
actually I just missed that it should be included in the linknamespace
tests because I took the list of libraries to consider there from the
POSIX rules for which functions require which libraries for linking with
the POSIX c99 utility. glibc has separate libdl and libcrypt libraries
for some POSIX functions, although POSIX does not mention such libraries,
so a correct implementation of that utility with glibc would need to
handle linking with those libraries automatically. The only existing
namespace bug I see on x86_64 or x86 when adding libcrypt / libdl to the
libraries checked in the linknamespace tests is use of snprintf in crypt
functions when not reserved by XPG3/XPG4; I'll deal with that before
committing the linknamespace support. crypt.h is indeed non-POSIX, but
XSI POSIX has the functions in unistd.h.
> Zack Weinberg (3):
> New string function explicit_bzero (from OpenBSD).
> Add fortification and inline optimization of explicit_bzero.
> Use explicit_bzero where appropriate
I'd expect a NEWS entry to be included somewhere in the patch series.
--
Joseph S. Myers
joseph@codesourcery.com