From patchwork Thu Feb 10 12:17:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 51000 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 986823858405 for ; Thu, 10 Feb 2022 12:18:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 986823858405 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1644495509; bh=aot59PIQbyiIs2todIAtCA97mqZnbsaA21/VVOtVKHA=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=akVi6PxMDyX5D8PqtCTh+x6b1Vr4045BUAt68piAZPAL0tXj8AK8xdBdnkp+9HAh4 PhozW1UwOUH/7a94avf2/BCac6zjF8nbtXW7ZOGKxvjdJ7/uNGYFQqIaLbHR0E8wVP F2IY+dFXpClSQxYGXFq4QKAQLwNldasshlQNWitc= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-ot1-x334.google.com (mail-ot1-x334.google.com [IPv6:2607:f8b0:4864:20::334]) by sourceware.org (Postfix) with ESMTPS id 258DC3858D28 for ; Thu, 10 Feb 2022 12:18:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 258DC3858D28 Received: by mail-ot1-x334.google.com with SMTP id x52-20020a05683040b400b0059ea92202daso3628976ott.7 for ; Thu, 10 Feb 2022 04:18:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=aot59PIQbyiIs2todIAtCA97mqZnbsaA21/VVOtVKHA=; b=fdkjWVbR4lHXGxArBvwzjyEaH9E0wFfbGCiy5dRMAi9OgL5/74H1Ws8U967zcvyk9U 7kFJkChQcVrZxi1yZyMmjZIi8ANFfnTRmB6lYDwZSCLATLIkcQ/wWiujNjTP0Fxm9XKS xJQCi+meT1JGcV3znan93YNbwVjzobZEnXVt/TWyaIfM4cEueNtuRU0FJ//N4IyVYuGH eri2VbgT7NRGeI7Zw12Uaa78HpE0RQ7KyVkFdMEazKxTPjgo3hDU+/LEDMXI4BdH10o4 PIWU+9VPCApi3Az+smMKGGMQDyFpQ0SRO8Th/dPio9ArwEEdtrf25aDzmF6tkLsIjlrp +Psw== X-Gm-Message-State: AOAM5329YTqvnUjy5O6oaOCt6NpWtvTx9RZmRU247O3Gky9c+LTYNua6 YwYYIxIIcPBGemuKMjQ4R0lm/J0p26+Tgw== X-Google-Smtp-Source: ABdhPJyR5HK5A/7nd01T+WwsnNxd0IG+JIk+1tW1LFf3kcTb8wJ6aBGgZkc71G19bkgxuIimzIUs0Q== X-Received: by 2002:a05:6830:2709:: with SMTP id j9mr2750106otu.3.1644495487362; Thu, 10 Feb 2022 04:18:07 -0800 (PST) Received: from birita.. ([2804:431:c7ca:733:a925:765e:3799:3d34]) by smtp.gmail.com with ESMTPSA id n47sm7695104ota.74.2022.02.10.04.18.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 04:18:07 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH v3 0/3] Remove prelink support Date: Thu, 10 Feb 2022 09:17:51 -0300 Message-Id: <20220210121754.862331-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" As discussed recently on maillist [1], prelink is deprecated in practice: * There is no active development neither maintainace. * It misses supports for some architectures, even for architecture wildly deployed such as aarch64 [2]. * It does not work with recent security hardening such as PIE. * Nor it will work on future ABI additions such as DT_RELR. * Even when PIE is not enabled its coverity if flacky, with some binaries showing corrupted state [3]. * Recent glibc changes to support different tools (such as lld) showed inherent issue with current prelink support. The first patch removes both prelink support by the loader and the LD_TRACE_PRELINKING. The remove of mtrace TRACE_PRELINKING usage is on its own patch because it changes LD_TRACE_LOADED_OBJECTS semantic to support dumping the executable loading address and fixes mtrace for non PIE similar to BZ#22716. Finally the third part removed LD_USE_LOAD_BIAS, which is used solely for try support prelink with PIE. (This is the version I will commit shortly) [1] https://sourceware.org/pipermail/libc-alpha/2022-January/135520.html [2] https://sourceware.org/pipermail/libc-alpha/2022-January/135522.html [3] https://embed.endfa.net/yocto-cross-prelink-1/ Adhemerval Zanella (3): elf: Remove prelink support malloc: Remove LD_TRACE_PRELINKING usage from mtrace elf: Remove LD_USE_LOAD_BIAS NEWS | 11 +- elf/Makefile | 16 -- elf/dl-conflict.c | 77 ------- elf/dl-deps.c | 66 ------ elf/dl-error-skeleton.c | 4 +- elf/dl-load.c | 3 +- elf/dl-lookup.c | 161 -------------- elf/dl-main.h | 3 + elf/dl-map-segments.h | 3 +- elf/dl-support.c | 1 - elf/do-rel.h | 3 - elf/rtld.c | 283 ++++++------------------- elf/tst-prelink-cmp.c | 49 ----- elf/tst-prelink.c | 29 --- include/link.h | 4 - malloc/mtrace.pl | 55 ++--- sysdeps/alpha/dl-machine.h | 15 -- sysdeps/arm/dl-machine.h | 4 - sysdeps/generic/ldsodefs.h | 16 -- sysdeps/generic/unsecvars.h | 1 - sysdeps/i386/dl-machine.h | 16 +- sysdeps/or1k/dl-machine.h | 4 - sysdeps/powerpc/powerpc32/dl-machine.h | 31 +-- sysdeps/powerpc/powerpc64/dl-machine.h | 37 ---- sysdeps/s390/s390-32/dl-machine.h | 22 +- sysdeps/s390/s390-64/dl-machine.h | 22 +- sysdeps/sh/dl-machine.h | 2 +- sysdeps/sparc/sparc32/dl-machine.h | 52 +---- sysdeps/sparc/sparc64/dl-machine.h | 72 +------ sysdeps/x86_64/dl-machine.h | 48 ++--- 30 files changed, 171 insertions(+), 939 deletions(-) delete mode 100644 elf/dl-conflict.c delete mode 100644 elf/tst-prelink-cmp.c delete mode 100644 elf/tst-prelink.c