From patchwork Thu Feb 2 18:07:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 19096 Received: (qmail 84993 invoked by alias); 2 Feb 2017 18:07:29 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 84947 invoked by uid 89); 2 Feb 2017 18:07:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=DT_STRTAB, rela, dt_strtab, *reloc X-HELO: mail-qt0-f172.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=kS4SE1KRrnQl8vlf4kStvEMmpeAjkO5l4WSX0JPoUqo=; b=sQHeLeDVwwbP5Xugse7TlAq4sGhvV84hFKmAC3zO34wQv6PcLtbZFGBqRqEn420WdO lIIGpOXRvtgKPt75nx/DGn+maVcM8zE0zn0l5CSaF4iwCKdWXT3JuviVQrGRmRv64pdN 5bH6/DVdk3aIiP5nqDdEPDrBUFlCOovHxu8E7/papj++m727KKJPqBhRaslbeo40iIru gQf7PK2SHooSw/wuOSr+lD5c+FMAA/J1qOede3O4hrdFg7jBjVzefUmV+8F4qruYeuAi 3gVGsM8FVa1LMmqFd+Ox67biwH8HfQd5nqHtKGqnahdQUL+azTAIPTVkUlsuBlZAqx/z JrFQ== X-Gm-Message-State: AIkVDXLmZ3UmoU0iYGY+3UXwzqSh+sSBoMe2N9Pr48iqtq7C9biUGef9gy9VMMyUdDbWmGspdwgnHtHrY9fsPQ== X-Received: by 10.237.36.129 with SMTP id t1mr9319451qtc.202.1486058836594; Thu, 02 Feb 2017 10:07:16 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <799438bb-9570-9b2b-b67b-9a704142daf3@redhat.com> References: <1485771929.506.15.camel@pbcl.net> <22163768-023c-1ed5-b258-6e6d14f45e01@redhat.com> <87a50e42-3e86-3f4a-d470-46393e2af199@redhat.com> <7c124a2b-a82d-4761-7018-d1a488bc1033@redhat.com> <799438bb-9570-9b2b-b67b-9a704142daf3@redhat.com> From: "H.J. Lu" Date: Thu, 2 Feb 2017 10:07:14 -0800 Message-ID: Subject: Re: 2.25 freeze status To: "Carlos O'Donell" Cc: "libc-alpha@sourceware.org" , Florian Weimer , Phil Blundell , Siddhesh Poyarekar On Thu, Feb 2, 2017 at 5:02 AM, Carlos O'Donell wrote: > On 02/01/2017 12:04 PM, H.J. Lu wrote: >> On Tue, Jan 31, 2017 at 12:45 PM, Carlos O'Donell wrote: >>> Solutions: >>> >>> (a) Revert the changes to libpthread which introduced the longjmp IFUNC. >>> >>> (b) Revert the fix for bug 20019 which stops the affected applications from >>> starting. >> >> It just silently ignores the potential crash when longjmp is called. I won't >> call it a solution. > >>> (c) Implement IFUNC relocation ordering such that the applications work >>> correctly in the presence of the libpthread longjmp IFUNC. >>> >>> Florian Weimer has stated that (c) is not ready for glibc 2.25 release which >>> is tomorrow. >> >> d) >> >> Remove IFUNC from libpthread.so. The requirement for that the symbol >> definition at run-time must come from the same shared object at link-time >> is questionable. > > Which of (b) or (d) do you interpret to be less risk given the upcoming release? > > Keeping in mind the success criteria defined earlier for this consensus discussion: > > * Release of glibc 2.25 without the side effect caused by the fix for 20019 > which prevents potentially valid applications from starting. > > This is a time-boxed release. We can delay a fix. Incremental progress is OK. > This is what I propose for 2.25. From 53ebca73097fff387c4263370b9676dbbd6ccaea Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 2 Feb 2017 09:59:21 -0800 Subject: [PATCH] Allow IFUNC relocation against unrelocated shared library IFUNC relocation against definition in unrelocated shared library will lead to segfault when the IFUNC function is called. This patch allows such IFUNC relocations with a warning. This isn't a real fix for https://sourceware.org/bugzilla/show_bug.cgi?id=21041 It simply allows the program to load. The program will segfault when longjmp is called. * sysdeps/i386/dl-machine.h (elf_machine_rel): Replace _dl_fatal_printf with _dl_error_printf for IFUNC relocation against unrelocated shared library. * sysdeps/x86_64/dl-machine.h (elf_machine_rela): Likewise. --- sysdeps/i386/dl-machine.h | 2 +- sysdeps/x86_64/dl-machine.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h index 6eca69d..99a72f6 100644 --- a/sysdeps/i386/dl-machine.h +++ b/sysdeps/i386/dl-machine.h @@ -329,7 +329,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc, { const char *strtab = (const char *) D_PTR (map, l_info[DT_STRTAB]); - _dl_fatal_printf ("\ + _dl_error_printf ("\ %s: Relink `%s' with `%s' for IFUNC symbol `%s'\n", RTLD_PROGNAME, map->l_name, sym_map->l_name, diff --git a/sysdeps/x86_64/dl-machine.h b/sysdeps/x86_64/dl-machine.h index 3e7ae22..daf4d8c 100644 --- a/sysdeps/x86_64/dl-machine.h +++ b/sysdeps/x86_64/dl-machine.h @@ -339,7 +339,7 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc, { const char *strtab = (const char *) D_PTR (map, l_info[DT_STRTAB]); - _dl_fatal_printf ("\ + _dl_error_printf ("\ %s: Relink `%s' with `%s' for IFUNC symbol `%s'\n", RTLD_PROGNAME, map->l_name, sym_map->l_name, -- 2.9.3