[arch-commits] Commit in glibc/trunk (3 files)

Sven-Hendrik Haase svenstaro at archlinux.org
Thu Apr 11 11:52:47 UTC 2019


    Date: Thursday, April 11, 2019 @ 11:52:46
  Author: svenstaro
Revision: 350578

upgpkg: glibc 2.28-6

Add patch file-truncated-while-reading-soname-after-patchelf.patch for FS#62282

Added:
  glibc/trunk/file-truncated-while-reading-soname-after-patchelf.patch
Modified:
  glibc/trunk/0001-Revert-elf-Correct-absolute-SHN_ABS-symbol-run-time-.patch
  glibc/trunk/PKGBUILD

-----------------------------------------------------------------+
 0001-Revert-elf-Correct-absolute-SHN_ABS-symbol-run-time-.patch |   27 +--
 PKGBUILD                                                        |   18 +-
 file-truncated-while-reading-soname-after-patchelf.patch        |   85 ++++++++++
 3 files changed, 109 insertions(+), 21 deletions(-)

Modified: 0001-Revert-elf-Correct-absolute-SHN_ABS-symbol-run-time-.patch
===================================================================
--- 0001-Revert-elf-Correct-absolute-SHN_ABS-symbol-run-time-.patch	2019-04-11 11:21:27 UTC (rev 350577)
+++ 0001-Revert-elf-Correct-absolute-SHN_ABS-symbol-run-time-.patch	2019-04-11 11:52:46 UTC (rev 350578)
@@ -1,6 +1,6 @@
 From 2cbf10ae2ea9e378ff91b8f5c4d8cb77ed05378e Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Bart=C5=82omiej=20Piotrowski?= <bpiotrowski at archlinux.org>
-Date: Fri, 10 Aug 2018-2019 14:12:40 +0000
+Date: Fri, 10 Aug 2018 14:12:40 +0000
 Subject: [PATCH] Revert "elf: Correct absolute (SHN_ABS) symbol run-time
  calculation [BZ #19818]"
 
@@ -25,21 +25,22 @@
  	 tst-tlsalign tst-tlsalign-extern tst-nodelete-opened \
  	 tst-nodelete2 tst-audit11 tst-audit12 tst-dlsym-error tst-noload \
  	 tst-latepthread tst-tls-manydynamic tst-nodelete-dlclose \
--	 tst-debug1 tst-main1 tst-absolute-sym tst-absolute-zero tst-big-note \
-+	 tst-debug1 tst-main1 \
- 	 tst-unwind-ctor tst-unwind-main
+-	 tst-debug1 tst-main1 tst-absolute-sym tst-absolute-zero tst-big-note
++	 tst-debug1 tst-main1
  #	 reldep9
  tests-internal += loadtest unload unload2 circleload1 \
-@@ -272,8 +272,7 @@ modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
+ 	 neededtest neededtest2 neededtest3 neededtest4 \
+@@ -272,9 +272,7 @@ modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
  		tst-audit12mod1 tst-audit12mod2 tst-audit12mod3 tst-auditmod12 \
  		tst-latepthreadmod $(tst-tls-many-dynamic-modules) \
  		tst-nodelete-dlclose-dso tst-nodelete-dlclose-plugin \
 -		tst-main1mod tst-libc_dlvsym-dso tst-absolute-sym-lib \
--		tst-absolute-zero-lib tst-big-note-lib tst-unwind-ctor-lib
-+		tst-main1mod tst-libc_dlvsym-dso tst-unwind-ctor-lib
- # Most modules build with _ISOMAC defined, but those filtered out
- # depend on internal headers.
- modules-names-tests = $(filter-out ifuncmod% tst-libc_dlvsym-dso tst-tlsmod%,\
+-		tst-absolute-zero-lib tst-big-note-lib
+-
++		tst-main1mod tst-libc_dlvsym-dso
+ ifeq (yes,$(have-mtls-dialect-gnu2))
+ tests += tst-gnu2-tls1
+ modules-names += tst-gnu2-tls1mod
 @@ -1465,14 +1463,6 @@ tst-main1-no-pie = yes
  LDLIBS-tst-main1 = $(libsupport)
  tst-main1mod.so-no-z-defs = yes
@@ -82,7 +83,7 @@
 +++ /dev/null
 @@ -1,25 +0,0 @@
 -/* BZ #19818 absolute symbol calculation shared module.
--   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+-   Copyright (C) 2018 Free Software Foundation, Inc.
 -   This file is part of the GNU C Library.
 -
 -   The GNU C Library is free software; you can redistribute it and/or
@@ -113,7 +114,7 @@
 +++ /dev/null
 @@ -1,19 +0,0 @@
 -/* BZ #19818 absolute symbol calculation linker script.
--   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+-   Copyright (C) 2018 Free Software Foundation, Inc.
 -   This file is part of the GNU C Library.
 -
 -   The GNU C Library is free software; you can redistribute it and/or
@@ -138,7 +139,7 @@
 +++ /dev/null
 @@ -1,38 +0,0 @@
 -/* BZ #19818 absolute symbol calculation main executable.
--   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+-   Copyright (C) 2018 Free Software Foundation, Inc.
 -   This file is part of the GNU C Library.
 -
 -   The GNU C Library is free software; you can redistribute it and/or

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2019-04-11 11:21:27 UTC (rev 350577)
+++ PKGBUILD	2019-04-11 11:52:46 UTC (rev 350578)
@@ -2,25 +2,26 @@
 # Contributor: Allan McRae <allan at archlinux.org>
 
 # toolchain build order: linux-api-headers->glibc->binutils->gcc->binutils->glibc
-# NOTE: valgrind requires rebuilt with each major glibc version
+# NOTE: valgrind requires rebuild with each major glibc version
 
 pkgbase=glibc
 pkgname=(glibc lib32-glibc)
-pkgver=2.29
-pkgrel=1
+pkgver=2.28
+pkgrel=6
 arch=(x86_64)
 url='http://www.gnu.org/software/libc'
 license=(GPL LGPL)
-makedepends=(git gd lib32-gcc-libs python)
+makedepends=(git gd lib32-gcc-libs)
 options=(!strip staticlibs)
 #source=(https://ftp.gnu.org/gnu/glibc/glibc-$pkgver.tar.xz{,.sig}
-_commit=067fc32968b601493f4b247a3ac00caeea3f3d61
+_commit=5a74abda201907cafbdabd1debf98890313ff71e
 source=(git+https://sourceware.org/git/glibc.git#commit=$_commit
         locale.gen.txt
         locale-gen
         lib32-glibc.conf
         bz20338.patch
-        0001-Revert-elf-Correct-absolute-SHN_ABS-symbol-run-time-.patch)
+        0001-Revert-elf-Correct-absolute-SHN_ABS-symbol-run-time-.patch
+        file-truncated-while-reading-soname-after-patchelf.patch)
 validpgpkeys=(7273542B39962DF7B299931416792B4EA25340F8) # Carlos O'Donell
 md5sums=('SKIP'
          '07ac979b6ab5eeb778d55f041529d623'
@@ -27,12 +28,13 @@
          '476e9113489f93b348b21e144b6a8fcf'
          '6e052f1cb693d5d3203f50f9d4e8c33b'
          'dc0d3ad59aeaaf591b085a77de6e03e9'
-         'af5d3c5227ac639effe39667a43879a1')
+         '58ffe75a9c5a1b22c535a5c2e725db22'
+         '0820504d2e83ee15f74a656771361872')
 
 prepare() {
   mkdir -p glibc-build lib32-glibc-build
 
-  [[ -d glibc-$pkgver ]] && ln -s glibc-$pkgver glibc 
+  [[ -d glibc-$pkgver ]] && ln -s glibc-$pkgver glibc
   cd glibc
 
   local i; for i in ${source[@]}; do

Added: file-truncated-while-reading-soname-after-patchelf.patch
===================================================================
--- file-truncated-while-reading-soname-after-patchelf.patch	                        (rev 0)
+++ file-truncated-while-reading-soname-after-patchelf.patch	2019-04-11 11:52:46 UTC (rev 350578)
@@ -0,0 +1,85 @@
+[PATCH] ldconfig: file truncated while reading soname after patchelf [BZ #23964]
+
+The way loadaddr is computed from the first LOAD segment in process_elf_file
+assumes .dynstr is also contained in that segment. That is not necessarily
+true, especially for libraries that have been touched by patchelf.
+
+With this patch, the address read from the dynamic segment is checked against
+all applicable segments instead of only the first one.
+
+       [BZ #23964]
+       * elf/readelflib.c: Fix resolving of loadaddr for .dynstr vaddr.
+---
+ elf/readelflib.c | 33 ++++++++++++++++-----------------
+ 1 file changed, 16 insertions(+), 17 deletions(-)
+
+diff --git a/elf/readelflib.c b/elf/readelflib.c
+index 5a1e2dc2df..bc1195c175 100644
+--- a/elf/readelflib.c
++++ b/elf/readelflib.c
+@@ -98,11 +98,6 @@ process_elf_file (const char *file_name, const char *lib, int *flag,
+ 
+       switch (segment->p_type)
+ 	{
+-	case PT_LOAD:
+-	  if (loadaddr == (ElfW(Addr)) -1)
+-	    loadaddr = segment->p_vaddr - segment->p_offset;
+-	  break;
+-
+ 	case PT_DYNAMIC:
+ 	  if (dynamic_addr)
+ 	    error (0, 0, _("more than one dynamic segment\n"));
+@@ -176,11 +171,6 @@ process_elf_file (const char *file_name, const char *lib, int *flag,
+ 	}
+ 
+     }
+-  if (loadaddr == (ElfW(Addr)) -1)
+-    {
+-      /* Very strange. */
+-      loadaddr = 0;
+-    }
+ 
+   /* Now we can read the dynamic sections.  */
+   if (dynamic_size == 0)
+@@ -190,22 +180,31 @@ process_elf_file (const char *file_name, const char *lib, int *flag,
+   check_ptr (dynamic_segment);
+ 
+   /* Find the string table.  */
+-  dynamic_strings = NULL;
+   for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
+        ++dyn_entry)
+     {
+       check_ptr (dyn_entry);
+       if (dyn_entry->d_tag == DT_STRTAB)
+-	{
+-	  dynamic_strings = (char *) (file_contents + dyn_entry->d_un.d_val - loadaddr);
+-	  check_ptr (dynamic_strings);
+-	  break;
+-	}
++        break;
+     }
+ 
+-  if (dynamic_strings == NULL)
++  for (i = 0, segment = elf_pheader;i < elf_header->e_phnum; i++, segment++)
++  {
++    ElfW(Addr) vaddr = dyn_entry->d_un.d_ptr;
++    if (segment->p_type == PT_LOAD &&
++        vaddr >= segment->p_vaddr &&
++        vaddr < segment->p_vaddr + segment->p_filesz)
++    {
++      loadaddr = segment->p_vaddr - segment->p_offset;
++      break;
++    }
++  }
++  if (loadaddr == (ElfW(Addr)) -1)
+     return 1;
+ 
++  dynamic_strings = (char *) (file_contents + dyn_entry->d_un.d_val - loadaddr);
++  check_ptr (dynamic_strings);
++
+   /* Now read the DT_NEEDED and DT_SONAME entries.  */
+   for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
+        ++dyn_entry)
+-- 
+2.19.2
+



More information about the arch-commits mailing list