From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 49DBE3857827 for ; Mon, 11 Apr 2022 12:56:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 49DBE3857827 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-396-JPTMxUxCPtC9DBouZAfg4g-1; Mon, 11 Apr 2022 08:56:23 -0400 X-MC-Unique: JPTMxUxCPtC9DBouZAfg4g-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 43D32296A60E for ; Mon, 11 Apr 2022 12:56:23 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.193.61]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 73FCF4082381 for ; Mon, 11 Apr 2022 12:56:22 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH 0/2] ELF tests in Python and libio vtables/RELRO interaction X-From-Line: 0b6fcd99fc004ad2e21c80c24426efdabe392f95 Mon Sep 17 00:00:00 2001 Message-Id: Date: Mon, 11 Apr 2022 14:56:20 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2022 12:56:31 -0000 The first patch adds a basic ELF file parser (without any external dependencies). The second patch switches to the custom linker script by default, fixing bug 25812. It uses a new Python test to verify that the vtables are indeed covered by PT_GNU_RELRO. I considered moving the vtables to .data.rel.ro instead, but this would still leave some function pointer arrays unprotected. Tested on i686-linux-gnu and x86_64-linux-gnu. Built with build-many-glibcs.py (after fixing the recent Hurd build regression locally). Florian Weimer (2): scripts: Add glibcelf.py module Default to --with-default-link=no (bug 25812) INSTALL | 6 + configure | 65 +- configure.ac | 55 +- elf/Makefile | 33 + elf/tst-relro-symbols.py | 137 +++++ manual/install.texi | 6 + scripts/glibcelf.py | 842 ++++++++++++++++++++++++++ sysdeps/unix/sysv/linux/ia64/Makefile | 6 + 8 files changed, 1032 insertions(+), 118 deletions(-) create mode 100644 elf/tst-relro-symbols.py create mode 100644 scripts/glibcelf.py base-commit: 1a85970f41ea1e5abe6da2298a5e8fedcea26b70 -- 2.35.1