Hi, On 17 September 2017 at 19:36, Michael Biebl <bi...@debian.org> wrote: > Am 17.09.2017 um 20:13 schrieb Guillem Jover: > >> Reassigning both to gcc-7 to get this fixed there (assuming this is >> not a binutils problem?), and to network-manager to workaround the >> issue for now. > > Please elaborate what I'm supposed to do with this bug report in > network-manager. >
network-manager source tree includes a check whether or not glibc has explicit_bzero function (introduced in 2.25) which is then used by ./src/systemd/src/basic/string-util.c which is then optimized out as network-manager never uses that bit of code. However, when the call to GBLIC's explicit_bzero is optimized out, the toolchain doesn't drop version reference to GLIBC 2.25 and still demands that 2.25 is used, even though none of the functions from 2.25 are still in use. And worse off dpkg-shlibdeps generates dependency on 2.17, yet at runtime the binaries fail and linker demands that GLIBC 2.25 is installed. The symptoms are that: when network-manager is built against glibc from experimental, it as dpkg-shlibdeps generated dependency libc6 (>= 2.17), yet at runtime it fails with glibc << 2.25 like so: # ldd /usr/sbin/NetworkManager /usr/sbin/NetworkManager: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /usr/sbin/NetworkManager) Thus one cannot exec NetworkManager. I have two workarounds for this - (a) one-liner to configure.ac to force not to use explicit_bzero (b) drop all code that uses explicit_bzero. Either one of these will do. Neither should be necessary, if the toolchain would at the same time as optimising out the call to that function would also correctly drop the version reference as well. (a) avoid-explicit-bzero.patch (b) glibc-2.25-abi-drop.patch -- Regards, Dimitri.
Description: Avoid using explicit_bzero from GLIBC 2.25+ Avoid using explicit_bzero from GLIBC 2.25+, it is optimised out, yet a version reference persist in the resulting binaries, errorsly demanding a higher glibc version than otherwise is available / required by shlibdeps. Author: Dimitri John Ledkov <x...@ubuntu.com> Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=876037 --- a/configure.ac +++ b/configure.ac @@ -67,6 +67,7 @@ [], [], [[ #include <string.h> ]]) +AC_DEFINE([HAVE_DECL_EXPLICIT_BZERO], [0]) dnl dnl translation support
Description: Drop code referencing explicit_bzero Author: Dimitri John Ledkov <x...@ubuntu.com> Bug-Debian: https://bugs.debian.org/876037 --- a/configure.ac +++ b/configure.ac @@ -62,12 +62,6 @@ AC_CHECK_SIZEOF(dev_t) AC_CHECK_SIZEOF(time_t) -AC_CHECK_DECLS([ - explicit_bzero], - [], [], [[ -#include <string.h> -]]) - dnl dnl translation support dnl --- a/config.h.in +++ b/config.h.in @@ -34,10 +34,6 @@ */ #undef HAVE_DCGETTEXT -/* Define to 1 if you have the declaration of `explicit_bzero', and to 0 if - you don't. */ -#undef HAVE_DECL_EXPLICIT_BZERO - /* Define to 1 if you have the <dlfcn.h> header file. */ #undef HAVE_DLFCN_H --- a/src/systemd/src/basic/string-util.c +++ b/src/systemd/src/basic/string-util.c @@ -825,36 +825,6 @@ return 1; } -#if !HAVE_DECL_EXPLICIT_BZERO -/* - * Pointer to memset is volatile so that compiler must de-reference - * the pointer and can't assume that it points to any function in - * particular (such as memset, which it then might further "optimize") - * This approach is inspired by openssl's crypto/mem_clr.c. - */ -typedef void *(*memset_t)(void *,int,size_t); - -static volatile memset_t memset_func = memset; - -void explicit_bzero(void *p, size_t l) { - memset_func(p, '\0', l); -} -#endif - -char* string_erase(char *x) { - if (!x) - return NULL; - - /* A delicious drop of snake-oil! To be called on memory where - * we stored passphrases or so, after we used them. */ - explicit_bzero(x, strlen(x)); - return x; -} - -char *string_free_erase(char *s) { - return mfree(string_erase(s)); -} - bool string_is_safe(const char *p) { const char *t; --- a/src/systemd/src/basic/string-util.h +++ b/src/systemd/src/basic/string-util.h @@ -189,14 +189,4 @@ return memmem(haystack, haystacklen, needle, needlelen); } -#if !HAVE_DECL_EXPLICIT_BZERO -void explicit_bzero(void *p, size_t l); -#endif - -char *string_erase(char *x); - -char *string_free_erase(char *s); -DEFINE_TRIVIAL_CLEANUP_FUNC(char *, string_free_erase); -#define _cleanup_string_free_erase_ _cleanup_(string_free_erasep) - bool string_is_safe(const char *p) _pure_; --- a/src/systemd/src/basic/strv.c +++ b/src/systemd/src/basic/strv.c @@ -92,15 +92,6 @@ return mfree(l); } -char **strv_free_erase(char **l) { - char **i; - - STRV_FOREACH(i, l) - string_erase(*i); - - return strv_free(l); -} - char **strv_copy(char * const *l) { char **r, **k; --- a/src/systemd/src/basic/strv.h +++ b/src/systemd/src/basic/strv.h @@ -37,10 +37,6 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(char**, strv_free); #define _cleanup_strv_free_ _cleanup_(strv_freep) -char **strv_free_erase(char **l); -DEFINE_TRIVIAL_CLEANUP_FUNC(char**, strv_free_erase); -#define _cleanup_strv_free_erase_ _cleanup_(strv_free_erasep) - void strv_clear(char **l); char **strv_copy(char * const *l);