From patchwork Wed May 6 19:51:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 11531803 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C804F92A for ; Wed, 6 May 2020 19:54:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A663E20747 for ; Wed, 6 May 2020 19:54:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mRV9ZcUx"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="Q42xFV9o" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A663E20747 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HOsINqjeP/ieZXFJ00tfX5rB4/N+Ah8XifmpAu0ybFs=; b=mRV9ZcUxC/4mVp bhJx7Sl9QQYXP+vOnwh56zUndrvCAE9hHadPngQ/SErup0kdCmMEFgD/0k+H9ZCmzVIjC08aYSeM8 Fw7u+Oth8tcj78LsmqZYYCb2sIfnLDmzUwllKA0Uj7Qjl8yrhuJ9Ps63ItfU17MrskubQvQaV1LQx 1NA76vgV9oLdz3OXK+NmyfTMp+kGxGgoxc9Z4DoJbHdy+kY7zC7RM86Lleq3u9KaENq0gJ6AqlKlf dANQS2oMCNI+MA4C52rIbz8IAS1G/1L9X6DsvE3rVKfwN+Yhxlgemzlzlqe3BxI0Des9bI8YIuakZ 0B7fJ56bAhtJPf292+qQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWQ7c-0006TD-8B; Wed, 06 May 2020 19:54:24 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWQ5e-0004Ls-BK for linux-arm-kernel@lists.infradead.org; Wed, 06 May 2020 19:52:24 +0000 Received: from localhost (fw-tnat.cambridge.arm.com [217.140.96.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DDCFE207DD; Wed, 6 May 2020 19:52:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588794741; bh=xXgAlVQ+fZjjhJDjHBj+kobr7+HqUmOW/gDHHpp5Orw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q42xFV9oKWVToV4ehfxhEpzAqRxn5kIXY5+m+Ishr3DTmPag1Y7IHnT9n0PPCET+F kkwLk+ltcdK87O1Q8XVRlyXCCNPml1EKIE1xR7oS8x+F6xqhC4zVRDw83MGbH3VS6i gK5fzFN3FDIUKeLaNnqsMhmnc3hnpfhMbDzYrFDE= From: Mark Brown To: Vincenzo Frascino , Will Deacon , Catalin Marinas Subject: [PATCH v3 10/11] arm64: vdso: Force the vDSO to be linked as BTI when built for BTI Date: Wed, 6 May 2020 20:51:37 +0100 Message-Id: <20200506195138.22086-11-broonie@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200506195138.22086-1-broonie@kernel.org> References: <20200506195138.22086-1-broonie@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200506_125222_452606_E986CEDC X-CRM114-Status: GOOD ( 11.01 ) X-Spam-Score: -5.2 (-----) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-5.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [198.145.29.99 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kees Cook , Daniel Borkmann , Jean-Philippe Brucker , Mark Brown , Amit Kachhap , Dave Martin , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org When the kernel and hence vDSO are built with BTI enabled force the linker to link the vDSO as BTI. This will cause the linker to warn if any of the input files do not have the BTI annotation, ensuring that we don't silently fail to provide a vDSO that is built and annotated for BTI when the kernel is being built with BTI. Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas --- arch/arm64/kernel/vdso/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kernel/vdso/Makefile b/arch/arm64/kernel/vdso/Makefile index dd2514bb1511..51ad1cce8133 100644 --- a/arch/arm64/kernel/vdso/Makefile +++ b/arch/arm64/kernel/vdso/Makefile @@ -17,8 +17,10 @@ obj-vdso := vgettimeofday.o note.o sigreturn.o targets := $(obj-vdso) vdso.so vdso.so.dbg obj-vdso := $(addprefix $(obj)/, $(obj-vdso)) +btildflags-$(CONFIG_ARM64_BTI_KERNEL) += -z force-bti + ldflags-y := -shared -nostdlib -soname=linux-vdso.so.1 --hash-style=sysv \ - --build-id -n -T + --build-id -n $(btildflags-y) -T ccflags-y := -fno-common -fno-builtin -fno-stack-protector -ffixed-x18 ccflags-y += -DDISABLE_BRANCH_PROFILING