From nobody Thu Feb 29 01:54:48 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TlZ6J1m8wz5BbJZ; Thu, 29 Feb 2024 01:54:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TlZ6J0trjz46Cr; Thu, 29 Feb 2024 01:54:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709171688; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cNYNnHmGDXp1NR+Rvj5+bvpoRpPvbQWpn3T/MM8FHzs=; b=M74IWuhU3wJDW1cGMuk3FciqTuVG96/cpDHo1bIK8aWmV7TtdLqA1wcjHuH/ooAQlgWMNv Ve0JgwrguYgFBx3f1YuTWjdsDiQLvOBATY4rl1Oa5sxmE6MMyKbulFeo/HaiEhfdpVBz7m tJOMpBhEwHRx4rX/6XJo92phRm0hus1F/QkvfT1/FvrNKikUcLuCESj94vZrX8X5Wb+Anw AXQLfzFDlLPnXU6MOfJwl6J7VNeyvkxKxA1ZArwd1yVax5Ha76ou2TWWU2N3/iI4ng5UFV SxuMxfqssxWEA4V/qBzlZV6KzKm8ZPWWGK5S/IAaVCHQQN6DbCfg9BaQnaRGUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1709171688; a=rsa-sha256; cv=none; b=Gr40kDKEfXucOnPwcy4mZMV/25hSptDvWKjhb68WqncSiLJ0XfJdAIeCMiY0N45cqKGrXn IDS+qi7yJI+OJzmXFicYBmrRDX1Y4EoutwX9UOjZc38nrv9frkOvGwvUZIaqw5koMtXBYe 0T2GVwvotlD+xg32Xzknt80pIP2GbT0pcbVTnHjUCXVQYIfWJchwRj3N6dfO/8Csnn1u/+ U9i2xhH69iD3RCOJW1QmAWfyR05QSiLPu0hMSgnsFFGiL64lY9OSBQT0vwD8lsuotUk/DC 00yeMU+KdzhdTjoVbOmV6KSceYZ83MdhEVhTm09nkZENaeKkLmzI2Z6H47Xuxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709171688; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cNYNnHmGDXp1NR+Rvj5+bvpoRpPvbQWpn3T/MM8FHzs=; b=gVWBguT30m9XI1T0bVnnPpffRXeI+3Qqk3IzS9FazK/zGNSO0Aaf8GEtfF1AQqPTYsYqK0 ZT0zTdxLajE/CYMBEg4Ca3nac7hU7lN30SxKfrhgtURabrVpXuybz1VEsD6DQmb4RvcYmI U35Q8oldVLzCRZSa+/DXueiuDabgIGE6UlLzbc486IBgKtJH69cbUQDl5S6IWar6O8XLBI TyChLMfTbzpIs+scwW9q+03ZcBZXkjXuSih5lTEEEBen2dEFgiPLg28QO6Si6RUJos2bTH X2h8mYs0XsaN6f0PkouSyaSiDDNRkON0P3Vu0JoN+s2loCFxA4M/xuCr/HNmcA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TlZ6J0TDgzM6C; Thu, 29 Feb 2024 01:54:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41T1smsx048020; Thu, 29 Feb 2024 01:54:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41T1sml0048017; Thu, 29 Feb 2024 01:54:48 GMT (envelope-from git) Date: Thu, 29 Feb 2024 01:54:48 GMT Message-Id: <202402290154.41T1sml0048017@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 5db5c6c87a75 - main - rtld: use generated map file to check for some leaks from libc into rtld List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5db5c6c87a75f8b1871f021726fc4697253ae5cf Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5db5c6c87a75f8b1871f021726fc4697253ae5cf commit 5db5c6c87a75f8b1871f021726fc4697253ae5cf Author: Konstantin Belousov AuthorDate: 2024-02-28 23:40:41 +0000 Commit: Konstantin Belousov CommitDate: 2024-02-29 01:49:02 +0000 rtld: use generated map file to check for some leaks from libc into rtld Reviewed by: brooks, emaste (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D44136 --- libexec/rtld-elf/Makefile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile index cc40b839024f..37c3840538d5 100644 --- a/libexec/rtld-elf/Makefile +++ b/libexec/rtld-elf/Makefile @@ -79,6 +79,25 @@ MAPFILE= ld-elf.so.1.map LDFLAGS+= -Wl,-Map=${MAPFILE} -Wl,--cref CLEANFILES+= ${MAPFILE} +afterbuild: + @if grep __libsys_interposing ${MAPFILE} >/dev/null ; then \ + echo "libsys_interposing leaked" 1>&2 ; \ + exit 1 ; \ + fi + @if grep __libc_interposing ${MAPFILE} >/dev/null ; then \ + echo "libc_interposing leaked" 1>&2 ; \ + exit 1 ; \ + fi + @if grep xlocale ${MAPFILE} >/dev/null ; then \ + echo "xlocale leaked" 1>&2 ; \ + exit 1 ; \ + fi + @if grep fprintf ${MAPFILE} >/dev/null ; then \ + echo "stdio leaked" 1>&2 ; \ + exit 1 ; \ + fi + + # Since moving rtld-elf to /libexec, we need to create a symlink. # Fixup the existing binary that's there so we can symlink over it. beforeinstall: