[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#824362: marked as done (glibc: Fix failure of debug/backtrace-tst on hppa)



Your message dated Wed, 01 Jun 2016 10:00:24 +0000
with message-id <E1b82wq-0007kU-QV@franck.debian.org>
and subject line Bug#824362: fixed in glibc 2.22-10
has caused the Debian Bug report #824362,
regarding glibc: Fix failure of debug/backtrace-tst on hppa
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 owner@bugs.debian.org
immediately.)


-- 
824362: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=824362
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Source: glibc
Version: 2.22
Severity: normal
Tags: patch

Dear Maintainer,

The failure of the debug/backtrace-tst was introduced by the
hppa/submitted-dladdr.diff patch.  The code was not prepared to handle
being passed an arbitrary address.  As a result, _dl_lookup_address
generates a segmentation fault.

I believe this fixes one or two other tests as well.

This is BZ 20098:
https://sourceware.org/bugzilla/show_bug.cgi?id=20098

A patch to fix this problem in the upstream source is here:
https://sourceware.org/ml/libc-alpha/2016-05/txti8b7kcvurW.txt

Attached is a replacement for the current hppa/submitted-dladdr.diff patch.

Please update current patch.

Thanks,
Dave

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 3.18.29+ (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_CA.utf8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
2016-01-02  John David Anglin  <danglin@gcc.gnu.org>

	[BZ #19415]
	* sysdeps/hppa/dl-fptr.c (_dl_fixup): Declare.
	(elf_machine_resolve): New.  Return address of _dl_runtime_resolve.
	(_dl_lookup_address): Rewrite using function resolver trampoline.
	* sysdeps/hppa/dl-lookupcfg.h (DL_LOOKUP_ADDRESS): Don't clear bottom
	two bits in address.

Index: glibc-2.22/sysdeps/hppa/dl-fptr.c
===================================================================
--- glibc-2.22.orig/sysdeps/hppa/dl-fptr.c
+++ glibc-2.22/sysdeps/hppa/dl-fptr.c
@@ -321,23 +321,76 @@ _dl_unmap (struct link_map *map)
   map->l_mach.fptr_table = NULL;
 }
 
+extern ElfW(Addr) _dl_fixup (struct link_map *, ElfW(Word)) attribute_hidden;
+
+static inline Elf32_Addr
+elf_machine_resolve (void)
+{
+  Elf32_Addr addr;
+
+  asm ("b,l     1f,%0\n"
+"	depi	0,31,2,%0\n"
+"1:	addil	L'_dl_runtime_resolve - ($PIC_pcrel$0 - 8),%0\n"
+"	ldo	R'_dl_runtime_resolve - ($PIC_pcrel$0 - 12)(%%r1),%0\n"
+       : "=r" (addr) : : "r1");
+
+  return addr;
+}
+
+static inline int
+_dl_read_access_allowed (unsigned int *addr)
+{
+  int result;
+
+  asm ("proberi        (%1),3,%0" : "=r" (result) : "r" (addr) : );
+
+  return result;
+}
 
 ElfW(Addr)
 _dl_lookup_address (const void *address)
 {
   ElfW(Addr) addr = (ElfW(Addr)) address;
-  struct fdesc_table *t;
-  unsigned long int i;
+  unsigned int *desc, *gptr;
 
-  for (t = local.root; t != NULL; t = t->next)
-    {
-      i = (struct fdesc *) addr - &t->fdesc[0];
-      if (i < t->first_unused && addr == (ElfW(Addr)) &t->fdesc[i])
-	{
-	  addr = t->fdesc[i].ip;
-	  break;
-	}
-    }
+  /* Return ADDR if the least-significant two bits of ADDR are not consistent
+     with ADDR being a linker defined function pointer.  The normal value for
+     a code address in a backtrace is 3.  */
+  if (((unsigned int) addr & 3) != 2)
+    return addr;
 
-  return addr;
+  /* Handle special case where ADDR points to page 0.  */
+  if ((unsigned int) addr < 4096)
+    return addr;
+
+  /* Clear least-significant two bits from descriptor address.  */
+  desc = (unsigned int *) ((unsigned int) addr & ~3);
+  if (!_dl_read_access_allowed (desc))
+    return addr;
+
+  /* Load first word of candidate descriptor.  It should be a pointer
+     with word alignment and point to memory that can be read.  */
+  gptr = (unsigned int *) desc[0];
+  if (((unsigned int) gptr & 3) != 0
+      || !_dl_read_access_allowed (gptr))
+    return addr;
+
+  /* See if descriptor requires resolution.  The following trampoline is
+     used in each global offset table for function resolution:
+
+		ldw 0(r20),r22
+		bv r0(r22)
+		ldw 4(r20),r21
+     tramp:	b,l .-12,r20
+		depwi 0,31,2,r20
+		.word _dl_runtime_resolve
+		.word "_dl_runtime_resolve ltp"
+     got:	.word _DYNAMIC
+		.word "struct link map address" */
+  if (gptr[0] == 0xea9f1fdd			/* b,l .-12,r20     */
+      && gptr[1] == 0xd6801c1e			/* depwi 0,31,2,r20 */
+      && (ElfW(Addr)) gptr[2] == elf_machine_resolve ())
+    _dl_fixup ((struct link_map *) gptr[5], (ElfW(Word)) desc[1]);
+
+  return (ElfW(Addr)) desc[0];
 }
Index: glibc-2.22/sysdeps/hppa/dl-lookupcfg.h
===================================================================
--- glibc-2.22.orig/sysdeps/hppa/dl-lookupcfg.h
+++ glibc-2.22/sysdeps/hppa/dl-lookupcfg.h
@@ -31,9 +31,7 @@ rtld_hidden_proto (_dl_symbol_address)
 
 Elf32_Addr _dl_lookup_address (const void *address);
 
-/* Clear the bottom two bits so generic code can find the fdesc entry */
-#define DL_LOOKUP_ADDRESS(addr) \
-  (_dl_lookup_address ((void *)((unsigned long)addr & ~3)))
+#define DL_LOOKUP_ADDRESS(addr) _dl_lookup_address ((const void *) addr)
 
 void attribute_hidden _dl_unmap (struct link_map *map);
 

--- End Message ---
--- Begin Message ---
Source: glibc
Source-Version: 2.22-10

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 824362@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Aurelien Jarno <aurel32@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 ftpmaster@ftp-master.debian.org)


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

Format: 1.8
Date: Tue, 31 May 2016 23:48:20 +0200
Source: glibc
Binary: libc-bin libc-dev-bin libc-l10n glibc-doc glibc-source locales locales-all nscd multiarch-support libc6 libc6-dev libc6-dbg libc6-pic libc6-udeb libc6.1 libc6.1-dev libc6.1-dbg libc6.1-pic libc6.1-udeb libc0.3 libc0.3-dev libc0.3-dbg libc0.3-pic libc0.3-udeb libc0.1 libc0.1-dev libc0.1-dbg libc0.1-pic libc0.1-udeb libc6-i386 libc6-dev-i386 libc6-sparc libc6-dev-sparc libc6-sparc64 libc6-dev-sparc64 libc6-s390 libc6-dev-s390 libc6-amd64 libc6-dev-amd64 libc6-powerpc libc6-dev-powerpc libc6-ppc64 libc6-dev-ppc64 libc6-mips32 libc6-dev-mips32 libc6-mipsn32 libc6-dev-mipsn32 libc6-mips64 libc6-dev-mips64 libc0.1-i386 libc0.1-dev-i386 libc6-x32 libc6-dev-x32 libc6-xen libc0.3-xen libc6.1-alphaev67
Architecture: source all
Version: 2.22-10
Distribution: unstable
Urgency: medium
Maintainer: GNU Libc Maintainers <debian-glibc@lists.debian.org>
Changed-By: Aurelien Jarno <aurel32@debian.org>
Description:
 glibc-doc  - GNU C Library: Documentation
 glibc-source - GNU C Library: sources
 libc-bin   - GNU C Library: Binaries
 libc-dev-bin - GNU C Library: Development binaries
 libc-l10n  - GNU C Library: localization files
 libc0.1    - GNU C Library: Shared libraries
 libc0.1-dbg - GNU C Library: detached debugging symbols
 libc0.1-dev - GNU C Library: Development Libraries and Header Files
 libc0.1-dev-i386 - GNU C Library: 32bit development libraries for AMD64
 libc0.1-i386 - GNU C Library: 32bit shared libraries for AMD64
 libc0.1-pic - GNU C Library: PIC archive library
 libc0.1-udeb - GNU C Library: Shared libraries - udeb (udeb)
 libc0.3    - GNU C Library: Shared libraries
 libc0.3-dbg - GNU C Library: detached debugging symbols
 libc0.3-dev - GNU C Library: Development Libraries and Header Files
 libc0.3-pic - GNU C Library: PIC archive library
 libc0.3-udeb - GNU C Library: Shared libraries - udeb (udeb)
 libc0.3-xen - GNU C Library: Shared libraries [Xen version]
 libc6      - GNU C Library: Shared libraries
 libc6-amd64 - GNU C Library: 64bit Shared libraries for AMD64
 libc6-dbg  - GNU C Library: detached debugging symbols
 libc6-dev  - GNU C Library: Development Libraries and Header Files
 libc6-dev-amd64 - GNU C Library: 64bit Development Libraries for AMD64
 libc6-dev-i386 - GNU C Library: 32-bit development libraries for AMD64
 libc6-dev-mips32 - GNU C Library: o32 Development Libraries for MIPS
 libc6-dev-mips64 - GNU C Library: 64bit Development Libraries for MIPS64
 libc6-dev-mipsn32 - GNU C Library: n32 Development Libraries for MIPS64
 libc6-dev-powerpc - GNU C Library: 32bit powerpc development libraries for ppc64
 libc6-dev-ppc64 - GNU C Library: 64bit Development Libraries for PowerPC64
 libc6-dev-s390 - GNU C Library: 32bit Development Libraries for IBM zSeries
 libc6-dev-sparc - GNU C Library: 32bit Development Libraries for SPARC
 libc6-dev-sparc64 - GNU C Library: 64bit Development Libraries for UltraSPARC
 libc6-dev-x32 - GNU C Library: X32 ABI Development Libraries for AMD64
 libc6-i386 - GNU C Library: 32-bit shared libraries for AMD64
 libc6-mips32 - GNU C Library: o32 Shared libraries for MIPS
 libc6-mips64 - GNU C Library: 64bit Shared libraries for MIPS64
 libc6-mipsn32 - GNU C Library: n32 Shared libraries for MIPS64
 libc6-pic  - GNU C Library: PIC archive library
 libc6-powerpc - GNU C Library: 32bit powerpc shared libraries for ppc64
 libc6-ppc64 - GNU C Library: 64bit Shared libraries for PowerPC64
 libc6-s390 - GNU C Library: 32bit Shared libraries for IBM zSeries
 libc6-sparc - GNU C Library: 32bit Shared libraries for SPARC
 libc6-sparc64 - GNU C Library: 64bit Shared libraries for UltraSPARC
 libc6-udeb - GNU C Library: Shared libraries - udeb (udeb)
 libc6-x32  - GNU C Library: X32 ABI Shared libraries for AMD64
 libc6-xen  - GNU C Library: Shared libraries [Xen version]
 libc6.1    - GNU C Library: Shared libraries
 libc6.1-alphaev67 - GNU C Library: Shared libraries (EV67 optimized)
 libc6.1-dbg - GNU C Library: detached debugging symbols
 libc6.1-dev - GNU C Library: Development Libraries and Header Files
 libc6.1-pic - GNU C Library: PIC archive library
 libc6.1-udeb - GNU C Library: Shared libraries - udeb (udeb)
 locales    - GNU C Library: National Language (locale) data [support]
 locales-all - GNU C Library: Precompiled locale data
 multiarch-support - Transitional package to ensure multiarch compatibility
 nscd       - GNU C Library: Name Service Cache Daemon
Closes: 824127 824344 824362 824363 825421
Changes:
 glibc (2.22-10) unstable; urgency=medium
 .
   [ Aurelien Jarno ]
   * Update from upstream stable branch:
     - Fix a stack overflow in Sun RPC clntudp_call() (CVE-2016-4429).
   * debian/control.in/main: build-depends on dpkg (>= 1.18.7) instead of
     dpkg-dev (>= 1.18.7) as the cputable file is in dpkg, not dpkg-dev.
     Closes: #824127.
   * debian/debhelper.in/libc.NEWS: add an entry about the dropped libc6-i686,
     libc0.1-i686 and libc0.3-i686 packages.  Closes: #825421.
 .
   [ Samuel Thibault ]
   * patches/hurd-i386/cvs-i686-link.diff: Fix link of i686 build.
   * sysdeps/hurd-i386.mk: Disable ifunc, not working yet.
   * sysdeps/hurd-i386.mk: Fix and re-enable xen build.
   * control: Re-introduce libc0.3-xen package.
   * patches/hurd-i386/cvs-check-local-headers.diff: Update exclusion list.
 .
   [ John David Anglin ]
   * debian/patches/hppa/submitted-setcontext.diff: new patch to fix setcontext
     return code on hppa.  Closes: #824344.
   * debian/patches/hppa/submitted-dladdr.diff: update patch to fix
     debug/backtrace-tst test failure.  Closes: #824362.
   * debian/testsuite-xfail-debian.mk: update expected testsuite results.
     Closes: #824363.
Checksums-Sha1:
 86359a1bd4e14d3fc365b67566c4ad214f5c1b7f 8082 glibc_2.22-10.dsc
 b43350a101923db3c86ef96ebde26e3d4a530086 1036784 glibc_2.22-10.debian.tar.xz
 07e8590b519002139695cd42de01531baae5f8d5 2422226 glibc-doc_2.22-10_all.deb
 8d1b7a1c297c07352bce1af87c99894999b1f862 25111362 glibc-source_2.22-10_all.deb
 c06bc1bc1cbcb090bbb6d81d911c559d03ab2924 800790 libc-l10n_2.22-10_all.deb
 b2364f41a770a1168e97218ee8100fd464b29d50 3322724 locales_2.22-10_all.deb
Checksums-Sha256:
 abd0c0a1254d8bbad8c45880ae2307453e148999888400571b8e1a55ae1c685e 8082 glibc_2.22-10.dsc
 077478e163c6e02084ac721b409b55573283a994a2b37b6d65464ff4b85a63a4 1036784 glibc_2.22-10.debian.tar.xz
 c9e29227cc8791cede170b7bb3b0a79de2d601aca55bd24c3e8a67085ccced73 2422226 glibc-doc_2.22-10_all.deb
 00252629c302186cfac99e195a3c2854bec5b9b39c0707e9f1d85f3282488f02 25111362 glibc-source_2.22-10_all.deb
 bc14d73a69b80c57532ba41f4e7d8f3c94559cd4e8d50848526a379320cddd1e 800790 libc-l10n_2.22-10_all.deb
 953e03f4ef8b6efa3ba1c7d7b5cfe3614304968b9e9f025bd182339cec2c902e 3322724 locales_2.22-10_all.deb
Files:
 d39aad3bef88e7c33eb3af4b72226cf0 8082 libs required glibc_2.22-10.dsc
 4f2e96c026912f65a34e91898c8f0674 1036784 libs required glibc_2.22-10.debian.tar.xz
 4d2659564b339b7b889363a638776deb 2422226 doc optional glibc-doc_2.22-10_all.deb
 802cf09cba79098e0048565e89175ea0 25111362 devel optional glibc-source_2.22-10_all.deb
 d53c2fcaa97b69892dc45bfa04e9cdc5 800790 localization standard libc-l10n_2.22-10_all.deb
 d0a977c0239cf027a30b49af9ccbb85c 3322724 localization standard locales_2.22-10_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCgAGBQJXTm9lAAoJELqceAYd3YybEpoP/i5ACtBWM3iSKTjRse083W9/
ItWmKPiBasGZ33nl5FAdDbMNWai63uCAB61xe6k82nrE728NO1qZuMXlmtFXYHgE
JWNnBMeBeQOFUrebXl5YQioNLsEjzSAh7MHETRZdRFTrbgnmpyEYDoK3H6QdX83C
fwa7NQnqlCLf4HowqNImGtdmqpmbPb4LR6IChf6MSPeRrvxJMX8CDbB3dLNZyASh
i2uSmnmN9ZL4T5R1j84dpCfQmMrPZOGbksOFzWNzUYRgNFntAH0WZP7hLgthtIrT
lVhe6jq0yFdcPedObPutOBQaWN9HcCkUAHa7NaXKXmfO3B+5H6bFwc5LQXd6XJvu
0vPghWP0m2cLwHbQGi9gCPB7dshJj5Icvcq8Ld/WVowGNfpPTfejJV/AhHgWRzLn
jwI+Do0oonUhU6Ibly9TKx7Yux1OVqt7Se/DfCFUR8B6KREAUAO2mrsRb47GX6/W
iKIqyBhnOXGa/rRtQDR7BaqPFfL2s2VYewzQDrikuuTDCiCMPaUuR4S1a8JXOlPI
6rUwUM5yByQHSmsHqsYb1hEkR8pO172LgClH9Yu2GHyTkF+XD6pGcAMnmF6fvKsc
I5pvUGwsribsgc8REF8pSVckxvNIag13GJeciTMekY6YLYEVixturMalsFlS4+82
fWZ4Nn/h8zjZ5Vt4SLyr
=tixR
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: