From nobody Thu Mar 07 00:35:00 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 4Tqr111G3vz5DjmV; Thu, 7 Mar 2024 00:35:01 +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 4Tqr106tLRz4l36; Thu, 7 Mar 2024 00:35:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709771701; 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=GEPi8eq2kJ//ppzVg56m5lBVbfsr0oul4jKdtRD38M8=; b=XJMoPH0jurS0kC7QUEwztPrpH5uNFzz9jh0QAGuqtEKKonG6c5T39QC6IqPSOv8DPi91KJ h92d/wGnZpAmmPQ0Bfd+bczVILFtnuRIoVn4EdBsV0uTzS0z2NWCJP0+2dRKH4qUCf68s4 VimMljKSlClK4Y0+L0A3JXB6Y7PBZJ6829PH2fyFSP/Zwqza+halNdrkBWLx9yY1EAouJi pmNcSDZvqMtaUfVbWf5SyR8tnCKw28/n4AUp7Aae1cb36pt0ISdu3T0BS+t1PTU5/KmPIG YRSLqikdq7ADr89JYrtoWRqhvwJcWP/DhtDNvUNZ0VC8ZQzYY+hIMy9lFQzvag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1709771701; a=rsa-sha256; cv=none; b=HGWCDx5ut0bOEb0Wwt0T8QNeFme5/dV1CLLF+E/ZKQ6PhHuSDeoIcrXBb4kUvAK6yzaYbV m03TpRwW8oUE0L9l+dlEKHKl1iIL8+mQyHhGddCnARuHR0rtZTjjTEoVC5oPv4cL5SwDBn rMJwz8rleVhZBVmmMMulZc63wJeBKoIaj5q1teaLbk/fIhNPMy9NIXDoL4aOBM14A7gylK DoulpsiyYHTND2IjX/U4oGssafk8tiN44Bz/PiHrjLal5gAfxT5hrxvszo723exv2VWk5Y 8KIXHxU0y9zpw5gUoZ88+u5lfA7kBcjhfmk+C6rv2z6x36JAzZwDHpSab2eM2Q== 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=1709771701; 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=GEPi8eq2kJ//ppzVg56m5lBVbfsr0oul4jKdtRD38M8=; b=wvG7LRFKq3+n32kIlXdKb+L8i83LXY6LnamPxX6In4GKqwvGDbwkTkv+/xwx1co/itFRDB apbTtJBn0uYmRb2IM041b1kwL6AmxalwevyjHmMLyZhnhl/G5YvtVqaB85ZNBA83vFrexJ /XjMjBzBTyUiQ8XRsVxlBJ9jkJLWlEBDYH7pDCP5qFiBcCrg6o2Gwy7exPwk2r6BLPZh3d +CBDhPHTAemglMdoC8pokKGIPQW9yKQCXIlegEuq5we/wNWnWqd7WgcQ/aVQHzTX0xYUAi qY0uCJrtOYmGvUKEhbkh6zeSJp/2O6isMuDkXM26RwB/BUgUAR52YC+0tHrIWw== 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 4Tqr106V2Hz1B7s; Thu, 7 Mar 2024 00:35:00 +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 4270Z0fn055246; Thu, 7 Mar 2024 00:35:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4270Z0VL055243; Thu, 7 Mar 2024 00:35:00 GMT (envelope-from git) Date: Thu, 7 Mar 2024 00:35:00 GMT Message-Id: <202403070035.4270Z0VL055243@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: 3cce838c60fc - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: 3cce838c60fcda9aacf249d1172bff7f78c4bf3b Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3cce838c60fcda9aacf249d1172bff7f78c4bf3b commit 3cce838c60fcda9aacf249d1172bff7f78c4bf3b Author: Konstantin Belousov AuthorDate: 2024-02-28 23:40:41 +0000 Commit: Konstantin Belousov CommitDate: 2024-03-07 00:34:34 +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 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: