Your message dated Tue, 05 Feb 2019 19:37:58 +0000
with message-id <e1gr6xe-000chm...@fasolo.debian.org>
and subject line Bug#908928: fixed in glibc 2.28-6
has caused the Debian Bug report #908928,
regarding Most architectures do not need to check /etc/ld.so.nohwcap
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
908928: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=908928
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: glibc
Version: 2.27-6
Tags: patch

Debian's glibc includes a Debian-specific patch that makes the dynamic
linker check for the existence of /etc/ld.so.nohwcap (multiple times)
before loading a shared library, and disable loading of libraries in
hwcap paths (optimized libraries) if found. This gets created in the
libc6 (or equivalent) package preinst, and removed by the various libc
packages' postinsts once all glibc packages have been upgraded to
identical versions.

However, only two architectures have hwcap-based libc packages: i386
(which has libc6-xen), and alpha (which has libc6.1-alphaev67). Other
architectures don't have any such packages, but still spend time
checking for /etc/ld.so.nohwcap on every dynamic library load.

I measured the impact of this, by running a defconfig kernel build under
strace. These access syscalls took an average of 17us per call, and
comprised 125453 (0.66%) of the 19069475 syscalls during the build.
Overall, they added an estimated 2.1s to the build.

The attached patch makes the check for /etc/ld.so.nohwcap conditional
based on architecture, and only includes it on i386 and alpha. This
removes the overhead from all other architectures.

Note that if any future architecture ever needed to add such libraries
(and we don't have a better mechanism to handle this at that time), we
can easily add the check on that architecture.

- Josh Triplett
diff --git a/debian/patches/any/local-ldso-disable-hwcap.diff b/debian/patches/any/local-ldso-disable-hwcap.diff
index 933032ec..dccbfe6a 100644
--- a/debian/patches/any/local-ldso-disable-hwcap.diff
+++ b/debian/patches/any/local-ldso-disable-hwcap.diff
@@ -24,7 +24,7 @@
 
  #include <dl-procinfo.h>
  #include <dl-hwcaps.h>
-@@ -44,6 +46,7 @@
+@@ -43,6 +46,7 @@
    size_t cnt = platform != NULL;
    size_t n, m;
    size_t total;
@@ -32,10 +32,11 @@
    struct r_strlenpair *result;
    struct r_strlenpair *rp;
    char *cp;
-@@ -113,8 +116,22 @@
+@@ -124,8 +128,24 @@
    /* For TLS enabled builds always add 'tls'.  */
    ++cnt;
  
++#ifdef NEED_LD_SO_NOHWCAP
 +  if (__access_noerrno ("/etc/ld.so.nohwcap", F_OK) == 0)
 +    {
 +      /* If hwcap is disabled, we only have the base directory to search.  */
@@ -49,6 +50,7 @@
 +      *sz = 1;
 +      return result;
 +    }
++#endif
 +
    /* Create temporary data structure to generate result table.  */
 -  struct r_strlenpair temp[cnt];
@@ -56,14 +58,16 @@
    m = 0;
  #ifdef NEED_DL_SYSINFO_DSO
    if (dsocaps != NULL)
-@@ -199,8 +216,11 @@
+@@ -210,8 +230,13 @@
    *sz = 1 << cnt;
    result = (struct r_strlenpair *) malloc (*sz * sizeof (*result) + total);
    if (result == NULL)
 -    _dl_signal_error (ENOMEM, NULL, NULL,
 -		      N_("cannot create capability list"));
 +    {
++#ifdef NEED_LD_SO_NOHWCAP
 +    no_memory:
++#endif
 +      _dl_signal_error (ENOMEM, NULL, NULL,
 +		     	N_("cannot create capability list"));
 +    }
@@ -82,7 +86,7 @@
  
  #ifndef _DL_PLATFORMS_COUNT
  # define _DL_PLATFORMS_COUNT 0
-@@ -248,6 +250,7 @@
+@@ -246,6 +249,7 @@
    if (cache_new != (void *) -1)
      {
        uint64_t platform;
@@ -90,17 +94,19 @@
  
        /* This is where the strings start.  */
        cache_data = (const char *) cache_new;
-@@ -261,6 +264,9 @@
+@@ -259,6 +263,11 @@
  
        uint64_t hwcap_mask = GET_HWCAP_MASK();
  
++#ifdef NEED_LD_SO_NOHWCAP
 +      if (__access_noerrno ("/etc/ld.so.nohwcap", F_OK) == 0)
 +	disable_hwcap = 1;
++#endif
 +
  #define _DL_HWCAP_TLS_MASK (1LL << 63)
        uint64_t hwcap_exclude = ~((GLRO(dl_hwcap) & hwcap_mask)
  				 | _DL_HWCAP_PLATFORM | _DL_HWCAP_TLS_MASK);
-@@ -271,6 +277,8 @@
+@@ -269,6 +278,8 @@
  	continue;							      \
        if (GLRO(dl_osversion) && lib->osversion > GLRO(dl_osversion))	      \
  	continue;							      \
@@ -109,3 +115,25 @@
        if (_DL_PLATFORMS_COUNT						      \
  	  && (lib->hwcap & _DL_HWCAP_PLATFORM) != 0			      \
  	  && (lib->hwcap & _DL_HWCAP_PLATFORM) != platform)		      \
+--- a/sysdeps/alpha/ldsodefs.h
++++ b/sysdeps/alpha/ldsodefs.h
+@@ -37,6 +37,8 @@ struct La_alpha_retval;
+ 				      struct La_alpha_retval *,		\
+ 				      const char *);
+
++#define NEED_LD_SO_NOHWCAP
++
+ #include_next <ldsodefs.h>
+
+ #endif
+--- a/sysdeps/i386/ldsodefs.h
++++ b/sysdeps/i386/ldsodefs.h
+@@ -36,6 +36,8 @@ struct La_i86_retval;
+ 				     uintptr_t *, const struct La_i86_regs *, \
+ 				     struct La_i86_retval *, const char *)
+
++#define NEED_LD_SO_NOHWCAP
++
+ #include_next <ldsodefs.h>
+ 
+ #endif

--- End Message ---
--- Begin Message ---
Source: glibc
Source-Version: 2.28-6

We believe that the bug you reported is fixed in the latest version of
glibc, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 908...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Aurelien Jarno <aure...@debian.org> (supplier of updated glibc package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Tue, 05 Feb 2019 19:55:42 +0100
Source: glibc
Architecture: source
Version: 2.28-6
Distribution: unstable
Urgency: medium
Maintainer: GNU Libc Maintainers <debian-glibc@lists.debian.org>
Changed-By: Aurelien Jarno <aure...@debian.org>
Closes: 761300 908928 920047 921165
Changes:
 glibc (2.28-6) unstable; urgency=medium
 .
   [ Samuel Thibault ]
   * debian/patches/hurd-i386/git-AT_EMPTY_PATH.diff: New patch, fixes qt's
     file size query.
   * debian/patches/hurd-i386/git-altstack.diff: New patch, fixes altstack
     initial state.
 .
   [ Aurelien Jarno ]
   * debian/patches/git-updates.diff: update from upstream stable branch:
     - Fix a buffer overflow in string/memory functions on x32 (CVE-2019-6488).
     - Reject IP addresses with trailing characters (CVE-2016-10739).  Closes:
       #920047.
     - Fix wrong return value for memcmp on amd64 and x32 due to mishandling
       of most significant bit (CVE-2019-7309).
   * Update Russian debconf translation, by Lev Lamberov.  Closes:
     #921165.
   * debian/patches/any/local-ldso-disable-hwcap.diff: only check for
     /etc/ld.so.nohwcap on alpha, hurd-i386 and i386. Based on a patch from
     Josh Triplett.  Closes: #908928.
   * debian/patches/any/git-libio-stdout-putc.diff: fix puts and putchar output
     with change stdout pointer.  Closes: #761300.
   * debhelper.in/locales.bug-presubj: drop obsolete file, the dependency
     mechanism for locales has been changes a lot of time ago.
Checksums-Sha1:
 c09451059d222a7b4615af2f5547437d570f9025 8885 glibc_2.28-6.dsc
 e32156b4d0791ec0af883685e726f618160c1284 873424 glibc_2.28-6.debian.tar.xz
 455f82ecf3fe6c42c28048462e3ee74da2b2ed5c 7303 glibc_2.28-6_source.buildinfo
Checksums-Sha256:
 469d2e7c196f3be89ec55f8cf28a5d8d0ef276ac227be063f782d1b9f85a65a8 8885 
glibc_2.28-6.dsc
 e94e20f890cd3e1b3bcb9e5dc3cc4725b91e9101a8a93c2588b506f73b688924 873424 
glibc_2.28-6.debian.tar.xz
 a1dacf4de9985443c1e80d9332e2e8bea963abbfcffa1b30e33cf637c8b05bf3 7303 
glibc_2.28-6_source.buildinfo
Files:
 9ef64b9ffb224bb9f67441398348154b 8885 libs required glibc_2.28-6.dsc
 fea4aa332e15e9acbe37484470e9e47f 873424 libs required 
glibc_2.28-6.debian.tar.xz
 f219b499b86ca6b5dc46f30347b7f828 7303 libs required 
glibc_2.28-6_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEUryGlb40+QrX1Ay4E4jA+JnoM2sFAlxZ3MMACgkQE4jA+Jno
M2sE7A//T/b1hPRFPGVg3a2kC9WQjpiFjlh0mk2uqYLrNtQ1HVvwHNwl3kMxns28
GWI5TDZNhxulkTAn5xR6PDlRzC1MDcKVq94WTTHvFvLmJWoWb6awr9vnkZ9wo6wh
hS916WJYqZ3Wy27j5uJyz9LWT9q6IBPstnuNmOyame6Koj21R2iCiAD9qvhFUbVL
d7Iug017+P9zKAoriThy2dICGGrRZkpxmIaz5MNmW9jOrtSoZ6gDh1haNY5WMFrU
hbajwiTdoEXeolx69baDwtsl+Wh4vySGxhBz245QHJTyNUaxblOwT1ECAWAtQ3u9
QBcLsR+WFH+h1DJYbbZezkGa1/pXuq6NPv35FP4p831HO3oYOX6LmaVvC7rgwWcf
FgYyy6TpqwkZb3FUJ27gpmRvarw00GWH7pqtvzK3V4VUQa55hC8agLM/eCFgYLJv
oG0WEgI6y/Qfac0dL3J2FYk9IITneLg2qpxcMaPUOEzcCnhmW8+4xKcI+M7LbOsD
XlNzad1ZB91aiwWLc+ruLKdhp/HU0NSJhiThCybHn7bJRrGi3qjY3Mi0LxY8VqcT
wdSMCqu71FEqooa2Qryl0Z42PhjThf41lLFh2ADAjXhvhKz+fC3Zqmghd2epW2LV
OcjyzefmwMkk4IVPKDP2zSSdJMvpxH6pqwjx+LUFK20bmRQN1q0=
=0o+S
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to