From nobody Tue Oct 10 09:53:15 2023 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 4S4WRv2n7qz4wVMd; Tue, 10 Oct 2023 09:53:15 +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 4S4WRv1wYJz3R5G; Tue, 10 Oct 2023 09:53:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696931595; 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=BOd2oUA+919l7AiVpCjSi3Nx33eSr+WFSSNIsobvsrY=; b=g6UNR+V0WTjhvoM5s9O6LzNrCCwrjxsEV69uEHBRZuAgfT+gc3CR4H099Dv18mgwhPlv3a Nw5IHZ4ZL0aoeXPNNqAA7C1T22b+lEMR/Uu2SoaACw9jmN1dLn1JE2ECR4u/h/O0IDlwGt dfrbrs+eREeNI41g3HDISNay+0lcvE3kS0oqs9FQ25sGy5Ye1O3c+Kze9NuBkXybV4BcC4 1T9dcFaTh4/mGepR6BWaxFvVdWCczFJQMqb+943jLuBp4CEzyDpB90Hg5axVv7zMjM8PMp oi9DCHucPVnFZ1QzDzxz7D5DCMtpRqCBTFCk35nq4Evyuz8y7z82QUh43l84HA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696931595; a=rsa-sha256; cv=none; b=pY6CTGHI9epoGfb7o8uuQZf8oAkOn7Te7rAPU68+5Edhy7yCb5XCh570e5n+dIsTxWG7Mq kRBG3NFPuODs5ahS7svSen9ylwyP3SBQ0AdKyBLE8z+Vmry/jeM3wSoJU5j16jQ4GZHsZ9 ZyFRpLAnSksrNISHfB2gXnuaRCKnm6L2Gt/d4WsLni04VuahTv14l31S1hUbeAyvugYPFA ebhspzyCRE7zylVBujy0GKwys/sBW07PiacAhhFNU3p/MXjVSeGyOEEOHGgemo9XEzTmLE ncnEjjFNlCIfyWmlpSt7ZCfaFgLJGbFVqcrZeANNTXgxx+G0ifrzUS9eEl5A3Q== 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=1696931595; 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=BOd2oUA+919l7AiVpCjSi3Nx33eSr+WFSSNIsobvsrY=; b=ZC83G02JSi7zAwwI4pjxt/SMmV5oVFRoUjXl6Za4uJtGU4U5VPqITM6ZFyS8og6joyxR0h OZ/Hd7/RBYE0r+zSmwJzh2x6bSmBPBrBzoZAMnHc54z/XfWLn6RbtmBl0JCdEE+eWPW4Vs mlOPwvH5KtPWhrdYXu3fJTOv3wkmPPHBY/V9vkXug/tWMiLUpHdhI0Q42RD9oJxPGpzKIl 2hK8oQ6W5cdi8mQUPvRGY2zUqpU+yCPpgJ9blI5oHZIffuy4Dxn2Zx2GTLTgEHfEzWa+XP ttf7vUpNtur1Uu+r9AW7OOWPEaof/4Q+1yGO/lqWf8w1IgvzbBjSzbNtgRg/CA== 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 4S4WRv0yqxzZSG; Tue, 10 Oct 2023 09:53:15 +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 39A9rFZH036838; Tue, 10 Oct 2023 09:53:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39A9rFWk036835; Tue, 10 Oct 2023 09:53:15 GMT (envelope-from git) Date: Tue, 10 Oct 2023 09:53:15 GMT Message-Id: <202310100953.39A9rFWk036835@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: d09a64e15d8f - main - arm64: Enable kernel branch protection 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: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d09a64e15d8fad6588b9aad62979f20afa8441df Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=d09a64e15d8fad6588b9aad62979f20afa8441df commit d09a64e15d8fad6588b9aad62979f20afa8441df Author: Andrew Turner AuthorDate: 2023-10-02 15:55:31 +0000 Commit: Andrew Turner CommitDate: 2023-10-10 09:52:16 +0000 arm64: Enable kernel branch protection Add the build flags to enable branch protection on arm64. This enable the use of PAC and BTI in the kernel. For PAC we already install the kernel keys when entering the kernel from userspace so this will start using these to sign the stack. For BTI we need to mark the kernel page tables with a new guarded page field. As this will require all code that could be reached through a function pointer with an appropriate branch target instruction we are enabling this before setting the field. As the pointer authentication support shouldn't be reached via a function pointer it is safe to not enable the use of BTI there. Reviewed by: markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42079 --- sys/conf/kern.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index b508bc81b5f0..72b7387d3959 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -140,6 +140,8 @@ INLINE_LIMIT?= 8000 CFLAGS += -mgeneral-regs-only # Reserve x18 for pcpu data CFLAGS += -ffixed-x18 +# Build with BTI+PAC +CFLAGS += -mbranch-protection=standard INLINE_LIMIT?= 8000 .endif