From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 320951F5AE for ; Mon, 19 Jul 2021 14:33:35 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6C5D8395100D for ; Mon, 19 Jul 2021 14:33:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6C5D8395100D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1626705214; bh=SxDo260BfUim+6Nz9HyFfq7KO6/c6pVjWj2tYXSdI5k=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=i7IRuOmjN6B0DbWaL0fFX68ts7GgLM56J+QiP+6UAn9p66haqwoJdcj7cw/4m7aUZ DY7f+C6EKkv4rbaY9KvCCmeIGm/yM8S9gC0EAMEKegPoz/q2qW1myNV8GHrCPaSSkL ZBvnTPOqMFM7n9FFl4M2ooYImlwN1CuUrAOm5iuc= Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by sourceware.org (Postfix) with ESMTPS id A5DC9385042B for ; Mon, 19 Jul 2021 14:33:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A5DC9385042B Received: by mail-pg1-x52f.google.com with SMTP id i16so1613742pgi.9 for ; Mon, 19 Jul 2021 07:33:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=SxDo260BfUim+6Nz9HyFfq7KO6/c6pVjWj2tYXSdI5k=; b=ebSuD5uO1OA9AR/ihJ98Riz/T5+RY7LPXrMocmj2DmWFgfQhK+6B6xeidoGnfv9NnM NYzywJqCUr7pBP6SrI6HggFVrdMMCeyxdIvLUNPOI2zLfi9iDDUD0UB9DiUNGmrlEw33 uMlRDoy6aYJqhIJvY0y5Fci8/EpoF39tnAE26r4F31EXEdBojlXLXGO1H7iN92JZwe2N amaZvpyu3RvfH3P+Pmj9RXCGUId20XeK53o0JHcCJ3mbcRCj772YoVjgEcIyjxTPMBot lnSwLLZnZmxgagOeQTF2kwSrkkv9OkQCNN4h1VH+MpgUEGFL1RK49VcK64KtwdqPZbuE PlRA== X-Gm-Message-State: AOAM533MIJosLIF5a7wxgIwsGzBDfXNvAFBoGnRMhPgO/ytKj4rKPejD mkhjNpvXaCw4Cl0obRPSNlHo8A0zAhsoPw== X-Google-Smtp-Source: ABdhPJzZGWbZfJYMiotcwx1b2iHGLCPp5YcC69Q1DCedH4bnFFQUxMCdSR8MhmbHg3argF2x5TPhzg== X-Received: by 2002:a63:3113:: with SMTP id x19mr19625724pgx.328.1626705193530; Mon, 19 Jul 2021 07:33:13 -0700 (PDT) Received: from birita.. ([2804:431:c7ca:1133:c8a4:b05d:5ba9:3665]) by smtp.gmail.com with ESMTPSA id y13sm21461214pgp.16.2021.07.19.07.33.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jul 2021 07:33:13 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v2 0/6] Some rtld-audit fixes Date: Mon, 19 Jul 2021 11:33:03 -0300 Message-Id: <20210719143309.2848878-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: , From: Adhemerval Zanella via Libc-alpha Reply-To: Adhemerval Zanella Cc: John Mellor-Crummey Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" Changes from v1 [1] - 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. --- This patchset fixes some rtld-audit issues brought by John Mellor-Crummey [2] while trying to use it along with the HPCToolkit tool. This should cover the issues listed as 'Tier 1' [3], modulo the aarch64 onexi (which I plan to address in a different patch set) and also an important 'Tier2' issue (BZ#28096) which prevents the use of some glibc function that uses TLS internally on the audir module. The first patch fixes a regression issue introduced by a __libc_early_init() change. The second patch is long-standing issue where the lazy resolution trampolines are used even when the audit modules does not implement the PLT or symbol binding callback. The original patch from Alexander Monakov is incomplete, since it also requires to take la_symbind{32,64} in consideration. The third patch add some tests to check if TLSDESC works along with audit modules. The forth patch fixes an issue when a dlmopen failure in a audit module callback trigger an assert. The fifth patch fixes another dlmopen failure when audit module is used along with dlmopen. This patch was proposed along with RTLD_SHARED support, so I added a regression test. The final patch fixes an issue where the initial-exec TLS are reset after the audit modules is already loader (thus clearing any state that the library might update). [1] https://patchwork.sourceware.org/project/glibc/list/?series=2443 [2] https://sourceware.org/pipermail/libc-alpha/2021-June/127636.html [3] https://docs.google.com/document/d/1dVaDBdzySecxQqD6hLLzDrEF18M1UtjDna9gL5BWWI0/edit# Adhemerval Zanella (5): elf: Fix audit regression elf: Avoid unnecessary slowdown from profiling with audit (BZ#15533) elf: Add audit tests for modules with TLSDESC elf: Do not fail for failed dlopem on audit modules (BZ #28061) elf: Fix initial-exec TLS access on audit modules (BZ #28096) Vivek Das Mohapatra (1): elf: Suppress audit calls when a (new) namespace is empty (BZ #28062) NEWS | 4 ++ elf/Makefile | 43 ++++++++++- elf/dl-load.c | 7 +- elf/dl-object.c | 3 + elf/dl-open.c | 12 +--- elf/dl-reloc.c | 12 +++- elf/dl-tls.c | 16 +++-- elf/rtld.c | 10 +-- elf/tst-audit-tlsdesc-audit.c | 23 ++++++ elf/tst-audit-tlsdesc-dlopen.c | 67 +++++++++++++++++ elf/tst-audit-tlsdesc.c | 60 ++++++++++++++++ elf/tst-audit17.c | 25 +++++++ elf/tst-audit18.c | 39 ++++++++++ elf/tst-audit19.c | 25 +++++++ elf/tst-audit20.c | 128 +++++++++++++++++++++++++++++++++ elf/tst-audit20mod.c | 26 +++++++ elf/tst-audit21.c | 42 +++++++++++ elf/tst-auditmod-tlsdesc1.c | 41 +++++++++++ elf/tst-auditmod-tlsdesc2.c | 33 +++++++++ elf/tst-auditmod17.c | 23 ++++++ elf/tst-auditmod18.c | 24 +++++++ elf/tst-auditmod19.c | 57 +++++++++++++++ elf/tst-auditmod20.c | 73 +++++++++++++++++++ elf/tst-auditmod21.c | 69 ++++++++++++++++++ include/link.h | 4 ++ 25 files changed, 840 insertions(+), 26 deletions(-) create mode 100644 elf/tst-audit-tlsdesc-audit.c create mode 100644 elf/tst-audit-tlsdesc-dlopen.c create mode 100644 elf/tst-audit-tlsdesc.c create mode 100644 elf/tst-audit17.c create mode 100644 elf/tst-audit18.c create mode 100644 elf/tst-audit19.c create mode 100644 elf/tst-audit20.c create mode 100644 elf/tst-audit20mod.c create mode 100644 elf/tst-audit21.c create mode 100644 elf/tst-auditmod-tlsdesc1.c create mode 100644 elf/tst-auditmod-tlsdesc2.c create mode 100644 elf/tst-auditmod17.c create mode 100644 elf/tst-auditmod18.c create mode 100644 elf/tst-auditmod19.c create mode 100644 elf/tst-auditmod20.c create mode 100644 elf/tst-auditmod21.c -- 2.30.2