From patchwork Mon Jan 3 12:53:02 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: 49465 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 69BDD3858418 for ; Mon, 3 Jan 2022 12:53:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 69BDD3858418 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1641214422; bh=9CK3lkZUrUNnfKSlxZqwr3iyGHD+ESKy9x6EjR/DtJQ=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=ECnnwbeGadua+QyiwhNpOuFcg41Td59NPFuX4R/kfpdc4rPcS5jQZPsNfowMW2x4o mES0ygWxMHFUQhZO6qglAwLLSEzxkD1i/MPUltvE+1+Hqtg6ssNjT+Yhxm8/br8LU1 X/ZAyaXaKQhmt4ipPLfBJSbAM2QNqNqiII7IisnY= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) by sourceware.org (Postfix) with ESMTPS id 29FC9385841A for ; Mon, 3 Jan 2022 12:53:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 29FC9385841A Received: by mail-qt1-x831.google.com with SMTP id v4so27660083qtk.0 for ; Mon, 03 Jan 2022 04:53:11 -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:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9CK3lkZUrUNnfKSlxZqwr3iyGHD+ESKy9x6EjR/DtJQ=; b=xZBpapUueQezQmbYJ+xd8ieGtdODgPQ6BBn/JsoL3i8uLOicxAVWBCvbu5dMeUtUh8 q32rZvvA3grUD3iCSIAL8h9Xeefyyxz4ZdYRLU1Tdl5zIq7poqh8TPiXUb6TQaRNivDr LVVlaAMbzcahjSa46NVhy7L70EvGYdU3Vn98soDlSqzjsZyX0lRRHSdL7gCxDvclpYIC WP/oYUTU7cXwySbjQBxAS8bVoZjjb1NVOz/atXgNP6pBYPmJMw1HMlaMHDGtnNimZ8XK 29RbuwM2KuvK+Gm/nHl6+8sbaqwqOxhHMsWtje2Xy9XbWanwdh+hUsl6ur4gP2/hJFUR HiUg== X-Gm-Message-State: AOAM533VDMRiawcILEuumDLGzpouYVFG6e5x9yQsCj9WFzrVPImseV3c F3VP+V1k7wbJ4Migqyc2+DH0brQKYXY09Q== X-Google-Smtp-Source: ABdhPJz2kGs8uhwqzqOLGO2LkbXiUz7qa7Kc4St5/40YUYXhhN53m7jER9cNq4+YcyfkjkDGjyL9Eg== X-Received: by 2002:a05:622a:3ce:: with SMTP id k14mr40165594qtx.174.1641214390477; Mon, 03 Jan 2022 04:53:10 -0800 (PST) Received: from birita.. ([2804:431:c7ca:a350:6969:50a8:eab8:8f2f]) by smtp.gmail.com with ESMTPSA id c8sm28921141qkp.8.2022.01.03.04.53.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jan 2022 04:53:10 -0800 (PST) To: libc-alpha@sourceware.org, jma14 Subject: [PATCH v9 0/4] Multiple rtld-audit fixes Date: Mon, 3 Jan 2022 09:53:02 -0300 Message-Id: <20220103125306.4151129-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 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 Cc: John Mellor-Crummey Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Changes from v8: - Improved la_activity test coverage. - Fixed BZ#28096 regression. Changes from v7: - Added la_activity tests during application exit. - Refactor _dl_allocate_tls_init to not initialize static TLS. - Changed sotruss to warn instead of error for bind-now. - Added NEWS and changed commit message for aarch64. Changes from v6: - Dropped SVE, main application on main_map l_name, and Run constructors if executable has a soname of a dependency patches. - Bumped LAV_VERSION to 2 on la_symbind bind-now support. - Added extension pointer on aarch64 fix. - Moved the refactor patch at the start of the set. - Changed _dl_audit_objsearch interface. Changes from v5: - Fixed build with --enable-profiling=yes. - Moved la_activity (LA_ACT_ADD) *after* _dl_add_to_namespace_list() for BZ#28062 fix. - Fixed powerpc64 ELFv1 OPD toc setup for bind-now. - Fixed testsuite issues for ia64. - Removed LA_SYMB_BINDNOW now that LA_SYMB_NOPLTENTER and LA_SYMB_NOPLTEXIT is passed for bind-now. Changes from v4: - Added a fix for constructors if executable has a soname of a dependency - Rebased against master. Changes from v3 - Added a aarch64 SVE RFC patch. - Fixed an issue with bind-now fix on powerpc64 ELFv1. - Rebased against master. Changes from v2 - Refactored rtld-audit code to move common come to dl-audit.c. - Issue audit la_objopen() for vDSO. - Isseu la_activity during application exit. - Issue la_symbind() for bind-now (BZ #23734). - Fix runtime linker auditing on aarch64 (BZ #26643) Changes from v1 - Fixed -fstack-protector-all tst-auditmod17. - Simplify the _dl_call_libc_early_init call the 'Fix audit regression' patch. - Remove symbind check fr BZ#15333. - Added the BZ#28096 fix. Adhemerval Zanella (3): elf: Add la_activity during application exit elf: Fix initial-exec TLS access on audit modules (BZ #28096) elf: Issue la_symbind for bind-now (BZ #23734) Ben Woodard (1): elf: Fix runtime linker auditing on aarch64 (BZ #26643) NEWS | 8 ++ bits/link_lavcurrent.h | 2 +- elf/Makefile | 105 +++++++++++++- elf/dl-audit.c | 58 +++++--- elf/dl-fini.c | 10 ++ elf/dl-load.c | 3 + elf/dl-tls.c | 13 +- elf/do-rel.h | 57 ++++++-- elf/rtld.c | 8 +- elf/sotruss-lib.c | 7 + elf/tst-audit21.c | 42 ++++++ elf/tst-audit23.c | 240 +++++++++++++++++++++++++++++++ elf/tst-audit23mod.c | 23 +++ elf/tst-audit24a.c | 36 +++++ elf/tst-audit24amod1.c | 31 ++++ elf/tst-audit24amod2.c | 25 ++++ elf/tst-audit24b.c | 37 +++++ elf/tst-audit24bmod1.c | 31 ++++ elf/tst-audit24bmod2.c | 23 +++ elf/tst-audit24c.c | 2 + elf/tst-audit24d.c | 36 +++++ elf/tst-audit24dmod1.c | 33 +++++ elf/tst-audit24dmod2.c | 28 ++++ elf/tst-audit24dmod3.c | 31 ++++ elf/tst-audit24dmod4.c | 25 ++++ elf/tst-audit25a.c | 127 ++++++++++++++++ elf/tst-audit25b.c | 128 +++++++++++++++++ elf/tst-audit25mod1.c | 30 ++++ elf/tst-audit25mod2.c | 30 ++++ elf/tst-audit25mod3.c | 22 +++ elf/tst-audit25mod4.c | 22 +++ elf/tst-auditmod21a.c | 80 +++++++++++ elf/tst-auditmod21b.c | 22 +++ elf/tst-auditmod23.c | 74 ++++++++++ elf/tst-auditmod24.h | 29 ++++ elf/tst-auditmod24a.c | 114 +++++++++++++++ elf/tst-auditmod24b.c | 104 ++++++++++++++ elf/tst-auditmod24c.c | 3 + elf/tst-auditmod24d.c | 120 ++++++++++++++++ elf/tst-auditmod25.c | 79 ++++++++++ nptl/allocatestack.c | 2 +- sysdeps/aarch64/Makefile | 20 +++ sysdeps/aarch64/bits/link.h | 26 ++-- sysdeps/aarch64/dl-audit-check.h | 28 ++++ sysdeps/aarch64/dl-link.sym | 6 +- sysdeps/aarch64/dl-trampoline.S | 97 ++++++++----- sysdeps/aarch64/tst-audit26.c | 37 +++++ sysdeps/aarch64/tst-audit26mod.c | 33 +++++ sysdeps/aarch64/tst-audit26mod.h | 50 +++++++ sysdeps/aarch64/tst-audit27.c | 64 +++++++++ sysdeps/aarch64/tst-audit27mod.c | 95 ++++++++++++ sysdeps/aarch64/tst-audit27mod.h | 67 +++++++++ sysdeps/aarch64/tst-auditmod26.c | 103 +++++++++++++ sysdeps/aarch64/tst-auditmod27.c | 180 +++++++++++++++++++++++ sysdeps/generic/dl-audit-check.h | 23 +++ sysdeps/generic/dl-lookupcfg.h | 3 + sysdeps/generic/ldsodefs.h | 7 +- sysdeps/hppa/dl-lookupcfg.h | 3 + sysdeps/ia64/dl-lookupcfg.h | 3 + sysdeps/powerpc/dl-lookupcfg.h | 39 +++++ 60 files changed, 2688 insertions(+), 96 deletions(-) create mode 100644 elf/tst-audit21.c create mode 100644 elf/tst-audit23.c create mode 100644 elf/tst-audit23mod.c create mode 100644 elf/tst-audit24a.c create mode 100644 elf/tst-audit24amod1.c create mode 100644 elf/tst-audit24amod2.c create mode 100644 elf/tst-audit24b.c create mode 100644 elf/tst-audit24bmod1.c create mode 100644 elf/tst-audit24bmod2.c create mode 100644 elf/tst-audit24c.c create mode 100644 elf/tst-audit24d.c create mode 100644 elf/tst-audit24dmod1.c create mode 100644 elf/tst-audit24dmod2.c create mode 100644 elf/tst-audit24dmod3.c create mode 100644 elf/tst-audit24dmod4.c create mode 100644 elf/tst-audit25a.c create mode 100644 elf/tst-audit25b.c create mode 100644 elf/tst-audit25mod1.c create mode 100644 elf/tst-audit25mod2.c create mode 100644 elf/tst-audit25mod3.c create mode 100644 elf/tst-audit25mod4.c create mode 100644 elf/tst-auditmod21a.c create mode 100644 elf/tst-auditmod21b.c create mode 100644 elf/tst-auditmod23.c create mode 100644 elf/tst-auditmod24.h create mode 100644 elf/tst-auditmod24a.c create mode 100644 elf/tst-auditmod24b.c create mode 100644 elf/tst-auditmod24c.c create mode 100644 elf/tst-auditmod24d.c create mode 100644 elf/tst-auditmod25.c create mode 100644 sysdeps/aarch64/dl-audit-check.h create mode 100644 sysdeps/aarch64/tst-audit26.c create mode 100644 sysdeps/aarch64/tst-audit26mod.c create mode 100644 sysdeps/aarch64/tst-audit26mod.h create mode 100644 sysdeps/aarch64/tst-audit27.c create mode 100644 sysdeps/aarch64/tst-audit27mod.c create mode 100644 sysdeps/aarch64/tst-audit27mod.h create mode 100644 sysdeps/aarch64/tst-auditmod26.c create mode 100644 sysdeps/aarch64/tst-auditmod27.c create mode 100644 sysdeps/generic/dl-audit-check.h create mode 100644 sysdeps/powerpc/dl-lookupcfg.h