From nobody Thu Mar 07 00:35:34 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 4Tqr1f5ffjz5DjxQ; Thu, 7 Mar 2024 00:35:34 +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 4Tqr1f4vjTz4lK7; Thu, 7 Mar 2024 00:35:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709771734; 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=bPnzlWJUA2TIBkXfoXloJuFTM/cxJSBMDnajsSywThM=; b=KmHre6rGskGwQasULNlNRgeXPjfrgsWTLtJrMao4SUQTCC0RsfNnQOVZQyJVnI9xSXhiFI BRd0gUw26pWj1QT5SetLshcdc2aR2WqB5b0jE4mQYfzOgCLLOybMMJl07LngzHNMeseVgd 3Lz/cIhNG3PzHn7CN5hg3LaatWxPT2W/vv2tTdK7fKd/QuGaJpnd7Xps/65hTmZbkEIWPK un/fsSKXmP3ObEeWFwQhf+3D3UXla6VdL2t1Qn7t3nNOBG/3alB3mA4v2c83LTHKCQEOF8 NcLRQdmY1xgZdLfKvcH5Hn2SwNipPvRIRJ+5jkzNnTZbO9eTG6tiRqBKGz1gYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1709771734; a=rsa-sha256; cv=none; b=h4Lh96AmOmy+QlLtJe8vwoqnrgunsBN6uAc11DjxW6VP3dY0cuKXK5ZOFn2Os/737zYLOi wld9IVYrOrZ9tPOm4PljYUpYjvEWRkFCuqClHLTqHZ/SYaex4TCHEHgdtdRD7ECp4ZdEYZ 5I3aoFBRz7nqhcABFEhV2py7qA7X14pumqNpHDYtL29ViOWap5ySzA4QeL2ryx+EselmKs PS6rPleoJw/3klAKik6NCjiWw1HHzugkXM179AT1FEGmgTWMd6uQroizGLefS2m7ubZ7FB Bj+aSzbgAuOC95lXbIJjuIe4tZBYDcf9884hXcRfsF6+gSFTMM8FL65uhYBJkQ== 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=1709771734; 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=bPnzlWJUA2TIBkXfoXloJuFTM/cxJSBMDnajsSywThM=; b=D/mJwdD7Nf5AXX2jT6gaEC6+jzRONwSI+cUcvkIwEtXY0tICc18dRCLSes2W8pY0PKqNda TQsS0i2ECbXOAGe2/3RB5z5AOnzqgB231LOYHfR3Z8KFsC0ehcpXBKTPha8F+ML+pYoFXp sv3++MIBLu/0tJ3qjN7vGPJtV3YzSotgF0yyImCogOVQPyIJDMopyQTIa5qscXoTsGG7HS XHhM8AfgBhUp6o6zM9fv7WPPiZ3BApSFrYpXv5a0oiBcPlGbY6SeH+2K8FiIa+zotZVeHO qArVzOYvnclX4COb+Pk3TprVSLEZ4r0bTo0hV0/CzudGhcRihJVR7j+fVWS64g== 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 4Tqr1f4W4xz1C6m; Thu, 7 Mar 2024 00:35:34 +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 4270ZYQx055532; Thu, 7 Mar 2024 00:35:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4270ZY8N055529; Thu, 7 Mar 2024 00:35:34 GMT (envelope-from git) Date: Thu, 7 Mar 2024 00:35:34 GMT Message-Id: <202403070035.4270ZY8N055529@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 8b84d2da9aac - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 8b84d2da9aac3a79be02570f2bc1ed301f03ce8e Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8b84d2da9aac3a79be02570f2bc1ed301f03ce8e commit 8b84d2da9aac3a79be02570f2bc1ed301f03ce8e Author: Konstantin Belousov AuthorDate: 2024-02-28 23:40:41 +0000 Commit: Konstantin Belousov CommitDate: 2024-03-06 07:42:42 +0000 rtld: use generated map file to check for some leaks from libc into rtld (cherry picked from commit 5db5c6c87a75f8b1871f021726fc4697253ae5cf) --- libexec/rtld-elf/Makefile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile index def8bb513b3b..4735ad774aa1 100644 --- a/libexec/rtld-elf/Makefile +++ b/libexec/rtld-elf/Makefile @@ -75,6 +75,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: