From nobody Mon Dec 06 18:48:30 2021 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 EE53118B5CEA; Mon, 6 Dec 2021 18:48:33 +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 4J7CB80NF4z4SgP; Mon, 6 Dec 2021 18:48:32 +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 2FA2511178; Mon, 6 Dec 2021 18:48:30 +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 1B6ImUtQ065362; Mon, 6 Dec 2021 18:48:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B6ImURq065361; Mon, 6 Dec 2021 18:48:30 GMT (envelope-from git) Date: Mon, 6 Dec 2021 18:48:30 GMT Message-Id: <202112061848.1B6ImURq065361@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: d49b75d0d67f - main - Enforce that vdso does not contain runtime relocations 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: d49b75d0d67f86265cfe9b8c83d3749c4a8d3e14 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638816512; 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=Lqp6x7Bnng5svUHSWvKASt0B/tTOfenATqAS/wT8LNc=; b=NrzJ3dO3tvr7ahXNphqg5/dKO3I5q/cypaLboRibTceWWUXOItOGye+A9b/Yy2Dz/tiKsg rxKanHPzGxKxbpq5Um9Kia6vptxr9nyLxa3wvJuZyR0ao+e2DdRlbNgkxuL8LX/NH4mSJj VsAGdgSWBSSjIJJzASCCqbPVkBP2S+1P+IJUD13J54t2iV1tvYFHf7WpQO9onu7WggwS9C XboEM7r1RRSWXcv96xGJY+GvwEOQlWAOI/+J9U3vqIVl7gx8ckkkXJsn0jlwdBm+x9mkEP YybDn8Xgn2yf/HfadMXlkS91/ni9adS2nKO/+tTUsuUeh8fqMcoJDDSx1BwZ5w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638816512; a=rsa-sha256; cv=none; b=HkVOfNR7arRKXkOr7QMAeZoG4cFbgTozpnVu20lYFVdKIvvw52bPvyPVOu88YLT1TufL85 5L4P6aPEhJ2MVujyDvVxDLPBCVV6xT26MQrd9ENhd+TRqJJj6wm0rcpDm2BaYAK+R+eJxK qb7tm1W4G6pzHe7RtguSvAYkRlXDHXWVaDVOFOpwnX+9/ezqwyX9AMJiWxnZlSYkImhR6I ZCqZhLM3pq9X7Fa2FRpWVwwGevS+h9iyr7WEs7jR7f7nAbdKXhrp5j5zVevVXyxqXn6FcE P+FCuqCej2sH9Y0oa/xV/38W4rnxpIO9/A58xXGr3nTDAzqQda5BK4koh3e1xA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d49b75d0d67f86265cfe9b8c83d3749c4a8d3e14 commit d49b75d0d67f86265cfe9b8c83d3749c4a8d3e14 Author: Konstantin Belousov AuthorDate: 2021-12-01 00:35:26 +0000 Commit: Konstantin Belousov CommitDate: 2021-12-06 18:47:30 +0000 Enforce that vdso does not contain runtime relocations Reviewed by: emaste Discussed with: jrtc27 Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 month Differential revision: https://reviews.freebsd.org/D32960 --- 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 cfccbe196f72..263032415f53 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 \