| Message ID | 20260928185535.1353957-1-adhemerval.zanella@linaro.org (mailing list archive) |
|---|---|
| Headers |
Return-Path: <libc-alpha-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 375394B99F64 for <patchwork@sourceware.org>; Mon, 28 Sep 2026 18:56:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 375394B99F64 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=uYx3iDoD X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-vs2-x0c.google.com (mail-vs2-x0c.google.com [IPv6:2a00:1450:4864:3a::c]) by sourceware.org (Postfix) with ESMTPS id E11464BA79B6 for <libc-alpha@sourceware.org>; Mon, 28 Sep 2026 18:55:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E11464BA79B6 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E11464BA79B6 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:3a::c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1790621741; cv=none; b=GAska1CCK/T5o/XruFc8gB4TUhW/mAKnPfsWGNpoLLk8Z3ABRfp96snJJcmMSiCqmujeMg4phjiA/g0GIul1qslTiGZxvoRrjbnH+/pZ2q+/KvBPC0vVfeRw+M0Q4SPLOEwycx1q6WFRV9IvXJ6vGQ6OFSIY0ks/T6VSCUsnQ/M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1790621741; c=relaxed/simple; bh=hZvSoEPoEs0ChpYFO2mxySTm2yA4GRwMBy6c90McWtM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=dbwh9t33cHlm/essZAGHBERu/yxKPTZbEEY21qkWf3lKaDVtHK+kAr3t3uq3vMp7RAJV6ZOkDu/JftFUwhPy92qMwN9VCDfEI8xOzRJVl7rx0UtgUQ1LzTuEDU94UCn1KieRVNYFOLR83h3TyLKQmxsZdHXQM2ifuoQ4CpXZCGw= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=uYx3iDoD DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E11464BA79B6 Received: by mail-vs2-x0c.google.com with SMTP id ada2fe7eead31-7a4fb331cc0so869983137.3 for <libc-alpha@sourceware.org>; Mon, 28 Sep 2026 11:55:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1790621740; x=1791226540; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=uxQJtHxozp5zRZ9XxHttnPDRL/w8i4WDQRKXs3jboVY=; b=uYx3iDoDchpJOl42d9ZZkJeOPWCtbDC0Bh0Rj76Y0iWkPGVSaBkFQmrm2S9qQhm3ub mlf4Z28yZPuSFMgfEe5/qbaXS0T3EX2HR1FF5rf+h1DI9/5obQhu2wYavo2nvg0UHMOn u9bF1SBCJ3kpXs5OMCwGaQwyETGfK0utQJVp4eEHoOWdQGgbu0N38zZHqwh/OYaJUkYw U1O3GrPXGvA/q7JfkV9Z9ci1sL7cu0Y2uUHExQsR/E3sTH0+ejziUkk9f1a2/bSVZhan svSHGk+aSZo5695LzQRR8cBjADAlOjUExe+g9IdXjyTYlgupzfWp+yiH/rzAylKuatbJ 2RLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790621740; x=1791226540; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=uxQJtHxozp5zRZ9XxHttnPDRL/w8i4WDQRKXs3jboVY=; b=tGf586DjTRHAn494FmNhzbGgq7WuiAPu0/hZ5KQnqyt6Jf+3E4Bn4JCqsAb27h8Emu ciRqw7tDYuJRmthH30oFT4k9ihTLylSLdBHasDsSwoZofrZ12I/be3nGYEm1dY9lu4yC WF89sKps0G5z9GWthkzxIPg3fQ4RhQmVhdactN2mEXr6vOsgsfOAsSfIpchfeH8pQCFD yAtbOynoYq/Ivt7OGbnSg+lzLVMCngGWFO2/IWs/ES4UDYBQXonUKnPFvktYuaWSUV+A U4YLESikMQDdVXBLmX4WEUpbHHlc7+vFKNauRl9E+CwSARGRbtRySU0tkyIFU/TQATeN 9tZA== X-Gm-Message-State: AFq9FYITCNLIxbVjqIw85bZpAuJgiY5aiMcicejM1eMLaVBv96h1vGFi Ie2h4/Ri/bu4MqvRFfoAKHtRstIf0qm40NQFQ42J0F1q95y/fr7PbPQp59WohhrmOSgA4zv9PaY HHSOw X-Gm-Gg: AYBFou1BqInutfc9a1aeybqVV4YlKw3+EK6I6ZV6LIcPucvnSW3MAnIeOB76x+6RaWY trxyPSljkpA1bG1JD+fryX+4Se68qRF7cvMCyZnTEPklIgLGbe7cpeRurGB0OsJz+g0MvIsIkeX PeKRwRXdwU2Souxd4Us/eh3xpRg3ox+RKAZcBoe/IgmHcY7Gi3L6NMmHOd7jB4/U2e1amQNbs6y 03mwU1dRMT4r66LykaTW4SXOYO9zSKAE23MGm7H0Y4kqX37G0G1yZVlF7PBmhliYel+sdNo6egQ 4QxZ/tHizgHbqgU8jlVxpTwBo8Plyx1RKiEUBYJpJkA40h10eV8xkukfIPHHxuZbQYmCAlpS99A mS8cxesihCskCi5PO8QT2vpEB05+LhTjndrQ0lvr1E/wTKpAvX5fQTPXBJ36r846HWBu0BQX8ON UheYX/IV92viApJERa0Mo0+z+c35C3QSjErKdoDuicGZLjzE/7zvrQ7KbvQnBLBgIwsFQ3JDxsl zMfpZdA1BVlDbyn8zqz3pDCg9z10taD6SMj/zk= X-Received: by 2002:a05:6102:5707:b0:7a4:85a8:fbc5 with SMTP id ada2fe7eead31-7af1d1bb461mr4527668137.16.1790621740244; Mon, 28 Sep 2026 11:55:40 -0700 (PDT) Received: from mandiga ([2804:1b3:a7c1:43a:4422:b237:80b0:bad8]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-988b86d6058sm887554241.0.2026.09.28.11.55.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Sep 2026 11:55:39 -0700 (PDT) From: Adhemerval Zanella <adhemerval.zanella@linaro.org> To: libc-alpha@sourceware.org Cc: DJ Delorie <dj@redhat.com> Subject: [PATCH 0/8] [PATCH 0/8] elf: Fix auditing with multiple auditors and la_pltexit Date: Mon, 28 Sep 2026 15:55:04 -0300 Message-ID: <20260928185535.1353957-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.53.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_STOCKGEN, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP shortcircuit=no autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org |
| Series |
elf: Fix auditing with multiple auditors and la_pltexit
|
|
Message
Adhemerval Zanella Netto
Sept. 28, 2026, 6:55 p.m. UTC
While reviewing the rtld-audit documentation patch, I found three issues
in ld.so when more than one auditor is loaded:
- dlsym bindings are passed to the wrong auditor's la_symbind
(BZ 34684).
- la_symbind and la_pltenter flags set by one auditor leak into the
next ones (BZ 34687).
- LA_SYMB_NOPLTENTER and LA_SYMB_NOPLTEXIT are not honored per
auditor (BZ 34688).
The first three patches fix these. The test for the last one,
tst-audit-plt-flags, also exercises the la_pltexit path of
_dl_runtime_profile. That path turned out to be broken on aarch64
(with BTI), alpha, LoongArch, and RISC-V. On hppa the path was never
taken. The remaining five patches fix each ABI and remove its XFAIL.
The LoongArch and RISC-V fixes are essentially the same, since both
trampolines share the same code and the same bugs.
Checked on x86_64-linux-gnu, i686-linux-gnu, aarch64-linux-gnu,
arm-linux-gnueabihf, alpha-linux-gnu, hppa-linux-gnu,
loongarch64-linux-gnu, mips64el-linux-gnu, powerpc64-linux-gnu,
powerpc64le-linux-gnu, riscv64-linux-gnu, s390x-linux-gnu, and
sparc64-linux-gnu.
Adhemerval Zanella (8):
elf: Fix auditor iteration in _dl_audit_symbind_alt (BZ 34684)
elf: Keep la_symbind and la_pltenter flags per auditor (BZ 34687)
elf: Honor LA_SYMB_NOPLTENTER/NOPLTEXIT per auditor (BZ 34688)
aarch64: Return with ret from the la_pltexit path of
_dl_runtime_profile
alpha: Fix the la_pltexit path of _dl_runtime_profile
LoongArch: Fix the la_pltexit path of _dl_runtime_profile
riscv: Fix the la_pltexit path of _dl_runtime_profile
hppa: Fix the la_pltexit path of _dl_runtime_profile
elf/Makefile | 31 +++++++
elf/dl-audit.c | 40 +++++----
elf/tst-audit-plt-flags-mod.c | 35 ++++++++
elf/tst-audit-plt-flags.c | 124 ++++++++++++++++++++++++++
elf/tst-audit-symbind-dlsym-mod.c | 19 ++++
elf/tst-audit-symbind-dlsym.c | 35 ++++++++
elf/tst-audit-symbind-flags-mod.c | 29 ++++++
elf/tst-audit-symbind-flags.c | 137 +++++++++++++++++++++++++++++
elf/tst-auditmod-plt-flags-a.c | 85 ++++++++++++++++++
elf/tst-auditmod-plt-flags-b.c | 22 +++++
elf/tst-auditmod-symbind-dlsym-a.c | 50 +++++++++++
elf/tst-auditmod-symbind-dlsym-b.c | 50 +++++++++++
elf/tst-auditmod-symbind-flags-a.c | 64 ++++++++++++++
elf/tst-auditmod-symbind-flags-b.c | 64 ++++++++++++++
sysdeps/aarch64/dl-trampoline.S | 4 +-
sysdeps/alpha/dl-trampoline.S | 26 ++++--
sysdeps/hppa/dl-trampoline.S | 53 ++++++-----
sysdeps/loongarch/dl-trampoline.h | 35 ++++----
sysdeps/mips/Makefile | 1 +
sysdeps/riscv/dl-trampoline.S | 17 ++--
20 files changed, 853 insertions(+), 68 deletions(-)
create mode 100644 elf/tst-audit-plt-flags-mod.c
create mode 100644 elf/tst-audit-plt-flags.c
create mode 100644 elf/tst-audit-symbind-dlsym-mod.c
create mode 100644 elf/tst-audit-symbind-dlsym.c
create mode 100644 elf/tst-audit-symbind-flags-mod.c
create mode 100644 elf/tst-audit-symbind-flags.c
create mode 100644 elf/tst-auditmod-plt-flags-a.c
create mode 100644 elf/tst-auditmod-plt-flags-b.c
create mode 100644 elf/tst-auditmod-symbind-dlsym-a.c
create mode 100644 elf/tst-auditmod-symbind-dlsym-b.c
create mode 100644 elf/tst-auditmod-symbind-flags-a.c
create mode 100644 elf/tst-auditmod-symbind-flags-b.c