From nobody Sun Jan 02 19:08:20 2022 X-Original-To: dev-commits-src-branches@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 2711C191F846; Sun, 2 Jan 2022 19:08:23 +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 4JRpLZ04Y2z4YDY; Sun, 2 Jan 2022 19:08:21 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 E16C01776F; Sun, 2 Jan 2022 19:08:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 202J8KZt057946; Sun, 2 Jan 2022 19:08:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 202J8KRF057945; Sun, 2 Jan 2022 19:08:20 GMT (envelope-from git) Date: Sun, 2 Jan 2022 19:08:20 GMT Message-Id: <202201021908.202J8KRF057945@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: 75d7ca8a10a5 - stable/13 - Enforce that vdso does not contain runtime relocations List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 75d7ca8a10a5a15b70a35a628a06ceef8cdf9e78 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1641150502; 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=x/h3E9OC7hXeiDijx7jlbLL+37H54wC23j9WE/jpDxo=; b=Jp+WWhz8R9AR3ssKX6xszfKO0VHi7YszZ98jqQsEk2lI8ai+Ey2Z47xQZA0USjwlQT9CbD s/kpRCp1mxNZQKknDOCDZrVYvuNtqUCtNbFQ7hrTn63dGofltedVd4pHauvxvix5jkiELg fm38LtKuNCM25sEISGe14OP5DyKiN91Vyg2A+F1ZwsKImwFmi2x2Fw2tpyE5ttivymUwDW Ty+yIlQuo3AkfBvY/0Angr8pm77mzs9S1qlG7iQqKp8tsYvwTXKgo3bBRTBNcQ/+G/0VWL MZtUDF+x4XZREn635t2gklQGfl6ufvyqVBYT7PHntxxGLiIrwtfkvoajHrAzAg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1641150502; a=rsa-sha256; cv=none; b=rZRrn5unkZs9fF6Zs4EXZbNHSMmLCh9XnHmv2R8sK3MQYdnpa1y6pDTXF7umojqbJJYyLG 6RsWPtV+botPRm0xdmgzQpraehaCnJt4ix6JbpNHbnn38GU4uNA1US4fwgQKBFt/LfPjt/ mEV2PTrmgEdXyvWfR5LvNML7axgJFENmenK9cJyncph0V8yQlKNf5O1KFYe7Lgy6WjXYfB xwvUBUYHf5WZCMCBu5DK6/htEi3OU+Ggvxg+kIRGf4noBmtpO0cDmq15MvIaaSaLyMhQ6V qxcpWkRoOcIpVNFJ1Rj0IS6dyYDGZ/7TqR/FowUz9m8Tq6kgXp8+By3oeojy6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=75d7ca8a10a5a15b70a35a628a06ceef8cdf9e78 commit 75d7ca8a10a5a15b70a35a628a06ceef8cdf9e78 Author: Konstantin Belousov AuthorDate: 2021-12-01 00:35:26 +0000 Commit: Konstantin Belousov CommitDate: 2022-01-02 16:43:02 +0000 Enforce that vdso does not contain runtime relocations (cherry picked from commit d49b75d0d67f86265cfe9b8c83d3749c4a8d3e14) --- sys/conf/files.amd64 | 4 ++-- sys/tools/amd64_ia32_vdso.sh | 7 +++++++ sys/tools/amd64_vdso.sh | 7 +++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index 48ca59089ca1..9eed2470c720 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -14,13 +14,13 @@ include "conf/files.x86" # elf-vdso.so.o standard \ dependency "$S/amd64/amd64/sigtramp.S assym.inc $S/tools/amd64_vdso.sh" \ - compile-with "env AWK='${AWK}' NM='${NM}' LD='${LD}' CC='${CC}' OBJCOPY='${OBJCOPY}' S='${S}' sh $S/tools/amd64_vdso.sh" \ + compile-with "env AWK='${AWK}' NM='${NM}' LD='${LD}' CC='${CC}' OBJCOPY='${OBJCOPY}' ELFDUMP='${ELFDUMP}' S='${S}' sh $S/tools/amd64_vdso.sh" \ no-implicit-rule before-depend \ clean "elf-vdso.so.o elf-vdso.so.1 vdso_offsets.h sigtramp.pico" # elf-vdso32.so.o optional compat_freebsd32 \ dependency "$S/amd64/ia32/ia32_sigtramp.S ia32_assym.h $S/tools/amd64_ia32_vdso.sh" \ - compile-with "env AWK='${AWK}' NM='${NM}' LD='${LD}' CC='${CC}' OBJCOPY='${OBJCOPY}' S='${S}' sh $S/tools/amd64_ia32_vdso.sh" \ + compile-with "env AWK='${AWK}' NM='${NM}' LD='${LD}' CC='${CC}' OBJCOPY='${OBJCOPY}' ELFDUMP='${ELFDUMP}' S='${S}' sh $S/tools/amd64_ia32_vdso.sh" \ no-implicit-rule before-depend \ clean "elf-vdso32.so.o elf-vdso32.so.1 vdso_ia32_offsets.h ia32_sigtramp.pico" # diff --git a/sys/tools/amd64_ia32_vdso.sh b/sys/tools/amd64_ia32_vdso.sh index 7ef630dbaac5..d03249dd4940 100644 --- a/sys/tools/amd64_ia32_vdso.sh +++ b/sys/tools/amd64_ia32_vdso.sh @@ -46,6 +46,13 @@ then exit 1 fi +if [ -n "$(${ELFDUMP} -d elf-vdso32.so.1 | \ + ${AWK} '/DT_REL.*SZ/{print "RELOCS"}')" ] +then + echo "elf-vdso32.so.1 contains runtime relocations" 1>&2 + exit 1 +fi + ${CC} -x assembler-with-cpp -DLOCORE -fPIC -nostdinc -c \ -o elf-vdso32.so.o -I. -I"${S}" -include opt_global.h \ -DVDSO_NAME=elf_vdso32_so_1 -DVDSO_FILE=elf-vdso32.so.1 \ diff --git a/sys/tools/amd64_vdso.sh b/sys/tools/amd64_vdso.sh index 0bb351192407..8b9871e86802 100644 --- a/sys/tools/amd64_vdso.sh +++ b/sys/tools/amd64_vdso.sh @@ -55,6 +55,13 @@ then exit 1 fi +if [ -n "$(${ELFDUMP} -d elf-vdso.so.1 | \ + ${AWK} '/DT_REL.*SZ/{print "RELOCS"}')" ] +then + echo "elf-vdso.so.1 contains runtime relocations" 1>&2 + exit 1 +fi + ${CC} -x assembler-with-cpp -DLOCORE -fPIC -nostdinc -c \ -o elf-vdso.so.o -I. -I"${S}" -include opt_global.h \ -DVDSO_NAME=elf_vdso_so_1 -DVDSO_FILE=elf-vdso.so.1 \