From nobody Tue Jan 24 22:09:48 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 4P1h3J5yKNz3bdZK; Tue, 24 Jan 2023 22:09:48 +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 4P1h3J4shGz4H7T; Tue, 24 Jan 2023 22:09:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674598188; 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=vt4h6m38cvS1hne+8S4rVan8Qye2SsJC3eDgGCDi1YU=; b=KjGX37LTskp+nx9UFyZ9bMhkOQnSpEmR0vdCiAcfgAfOdTqBs24wxGrmLkTm7e4LSHYCtE GNK9A420Kofht6IZBcy8UrugiIKqqZ1pTQKDIEf1wPIManVBJiekij2m54Dqvpd0SWmyqg 492V/lftuDIoRmhfG9oOTkwvFEQQD/YP6Bb2zy38DJqoB5WIUhzeVt/utjz+Y5YqVMa2rA qYrKYALLLuMhwqcqzJJ8EdkztMR9gKlkLBCiH0yhlhw8NTi1O0jeehxVx9LIR7gSaxtmOG nb8pwVxu0WpwS8+JtF4rZ+0T01e5QQAeWTCixmxcvDfldfo7fh6MmyzgblOqOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674598188; 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=vt4h6m38cvS1hne+8S4rVan8Qye2SsJC3eDgGCDi1YU=; b=n4XLFuCyjzA9o3MkOf3v6CCMhkALPZHyEnmevHPXXlpaMlKxXnWjW12YKmzcYgzftezytS 7DAVGD+PmNyhYGvsx4mqy+EV/RXYvJAGrHfLukDnoOWCj4QrTihAZdc018HiAVhd1v7UXo 3+NPvUiB0RgyVjGpMSZTv/fuFljWGxhfsrBkniIoTtO+nzZEQXuJkujZQjegdrU+zwVfbL SrmhAowjsMJ4fLg/15i/Ig83qshdGpE0HRlIxo+sf33huVrdZceTe7l3QGvJItNY7EGk5t TVQ0sG/og2Ow1DvdmV7qMmANVHbHQKKAVWtoAkTjGeAkmoslXXt0AVJUp/gDMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674598188; a=rsa-sha256; cv=none; b=WE57G8ccqJ7pfI8vjnUso+0BZlFFcMMPVoZdrh3MCgMNvTCwRqxP8O99fppVmZDIC+S6aZ NWeIVKl/G6og6264/S8IGmNQmw5FINb7Vvzg2wKp9976064T0xa597KYrPH/5cvMWaGnQX ruItKysHNZ3X65CUlsg2uWbve/bx9s53Qxm+Rt0FObnZQEWgWpU5CPO0B/cXep7r2AyY/4 7Qa4ea0Ko5CVDUDfF5cfj03zs81m61WjRVLBVx5pkCQr6jp/3vbfvtqWuPcKc3oX+dKKo2 3MSCcTdUZk5rTV+B3tsv6shgUPuIz7qO3acKv0QnLWJo+giuXxZmpvXdsDOkkQ== 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 4P1h3J3wr4zQ1B; Tue, 24 Jan 2023 22:09:48 +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 30OM9md2070798; Tue, 24 Jan 2023 22:09:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30OM9m2f070797; Tue, 24 Jan 2023 22:09:48 GMT (envelope-from git) Date: Tue, 24 Jan 2023 22:09:48 GMT Message-Id: <202301242209.30OM9m2f070797@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 90c1ca326de1 - stable/13 - EFI secure boot VECTX related changes 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 90c1ca326de1931c87632fa0351b7fd39e26fe91 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=90c1ca326de1931c87632fa0351b7fd39e26fe91 commit 90c1ca326de1931c87632fa0351b7fd39e26fe91 Author: Eric van Gyzen AuthorDate: 2021-04-30 17:53:45 +0000 Commit: Warner Losh CommitDate: 2023-01-24 21:49:16 +0000 EFI secure boot VECTX related changes When VECTX is enabled as a kernel option and non-EFI loaders are built, many reads will fail due to the mis-match of whether LOADER_VERIEXEC_VECTX or not in readin.h. Source that includes bootstrap.h must ensure the kernel option agrees with the compile time CFLAGS in the various make related files. Submitted by: bret_ketchum@dell.com (original revision) Reviewed by: sjg, bdrewery, dab, bret_ketchum@dell.com MFC after: 1 week Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D29993 (cherry picked from commit eda28feb2e070e21db3d50b3fc177f88380b8fb4) --- stand/efi/boot1/Makefile | 2 ++ stand/efi/fdt/Makefile | 2 ++ stand/efi/libefi/Makefile | 2 ++ stand/fdt/Makefile | 2 ++ stand/ficl.mk | 4 +--- stand/i386/libfirewire/Makefile | 2 ++ stand/i386/libi386/Makefile | 2 ++ stand/liblua/Makefile | 5 ++--- stand/loader.mk | 11 +---------- stand/veriexec.mk | 9 +++++++++ 10 files changed, 25 insertions(+), 16 deletions(-) diff --git a/stand/efi/boot1/Makefile b/stand/efi/boot1/Makefile index 6ed777727552..7e3d762c768d 100644 --- a/stand/efi/boot1/Makefile +++ b/stand/efi/boot1/Makefile @@ -53,6 +53,8 @@ CFLAGS+= -DEFI_UFS_BOOT CFLAGS+= -DEFI_DEBUG .endif +.include "${BOOTSRC}/veriexec.mk" + # Always add MI sources and REGULAR efi loader bits .PATH: ${EFISRC}/loader/arch/${MACHINE} .PATH: ${EFISRC}/loader diff --git a/stand/efi/fdt/Makefile b/stand/efi/fdt/Makefile index 8166f481dc99..7f69ce1b3f11 100644 --- a/stand/efi/fdt/Makefile +++ b/stand/efi/fdt/Makefile @@ -9,6 +9,8 @@ WARNS?= 6 SRCS= efi_fdt.c +.include "${BOOTSRC}/veriexec.mk" + # EFI library headers CFLAGS+= -I${EFISRC}/include CFLAGS+= -I${EFISRC}/include/${MACHINE} diff --git a/stand/efi/libefi/Makefile b/stand/efi/libefi/Makefile index 88f6d3fa0826..8f1a30d86900 100644 --- a/stand/efi/libefi/Makefile +++ b/stand/efi/libefi/Makefile @@ -68,4 +68,6 @@ CFLAGS+= ${FORMAT_EXTENSIONS} CFLAGS+= -DTERM_EMU +.include "${BOOTSRC}/veriexec.mk" + .include diff --git a/stand/fdt/Makefile b/stand/fdt/Makefile index 3eee143a9433..e0fd2dbb4e8d 100644 --- a/stand/fdt/Makefile +++ b/stand/fdt/Makefile @@ -17,4 +17,6 @@ CFLAGS+= -I${SYSDIR}/contrib/libfdt/ -I${LDRSRC} CFLAGS+= -Wformat -Wall +.include "${BOOTSRC}/veriexec.mk" + .include diff --git a/stand/ficl.mk b/stand/ficl.mk index caa4aab951c3..2adbccb34f9d 100644 --- a/stand/ficl.mk +++ b/stand/ficl.mk @@ -17,6 +17,4 @@ CFLAGS+= -fPIC CFLAGS+= -I${FICLSRC} -I${FICLSRC}/${FICL_CPUARCH} -I${LDRSRC} CFLAGS+= -DBF_DICTSIZE=30000 -.if ${MK_LOADER_VERIEXEC} != "no" -CFLAGS+= -DLOADER_VERIEXEC -I${SRCTOP}/lib/libsecureboot/h -.endif +.include "${BOOTSRC}/veriexec.mk" diff --git a/stand/i386/libfirewire/Makefile b/stand/i386/libfirewire/Makefile index 6a34efd0acb3..bf42c26a918f 100644 --- a/stand/i386/libfirewire/Makefile +++ b/stand/i386/libfirewire/Makefile @@ -8,6 +8,8 @@ LIB= firewire SRCS+= firewire.c fwohci.c dconsole.c SRCS+= dcons.c fwcrom.c +.include "${BOOTSRC}/veriexec.mk" + CFLAGS+= -D_BOOT CFLAGS+= -I${LDRSRC} diff --git a/stand/i386/libi386/Makefile b/stand/i386/libi386/Makefile index 3dea78f16929..1b23cd53d137 100644 --- a/stand/i386/libi386/Makefile +++ b/stand/i386/libi386/Makefile @@ -17,6 +17,8 @@ CFLAGS+= -I${ZFSSRC} .PATH: ${SYSDIR}/teken SRCS+= teken.c +.include "${BOOTSRC}/veriexec.mk" + BOOT_COMCONSOLE_PORT?= 0x3f8 CFLAGS+= -DCOMPORT=${BOOT_COMCONSOLE_PORT} diff --git a/stand/liblua/Makefile b/stand/liblua/Makefile index 68fa2da64fdb..385f1493bd38 100644 --- a/stand/liblua/Makefile +++ b/stand/liblua/Makefile @@ -40,8 +40,7 @@ CFLAGS.lutils.c+= -I${SRCTOP}/sys/teken -I${SRCTOP}/contrib/pnglite .if ${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 0 CFLAGS+= -fPIC .endif -.if ${MK_LOADER_VERIEXEC} == "yes" -CFLAGS+= -I${SRCTOP}/lib/libsecureboot/h -DLOADER_VERIEXEC -.endif + +.include "${BOOTSRC}/veriexec.mk" .include diff --git a/stand/loader.mk b/stand/loader.mk index 2246b42b91d8..e71508a1cefc 100644 --- a/stand/loader.mk +++ b/stand/loader.mk @@ -90,16 +90,7 @@ SRCS+= interp_simple.c .error Unknown interpreter ${LOADER_INTERP} .endif -.if ${MK_LOADER_VERIEXEC} != "no" -CFLAGS+= -DLOADER_VERIEXEC -I${SRCTOP}/lib/libsecureboot/h -.if ${MK_LOADER_VERIEXEC_VECTX} != "no" -CFLAGS+= -DLOADER_VERIEXEC_VECTX -.endif -.endif - -.if ${MK_LOADER_VERIEXEC_PASS_MANIFEST} != "no" -CFLAGS+= -DLOADER_VERIEXEC_PASS_MANIFEST -I${SRCTOP}/lib/libsecureboot/h -.endif +.include "${BOOTSRC}/veriexec.mk" .if defined(BOOT_PROMPT_123) CFLAGS+= -DBOOT_PROMPT_123 diff --git a/stand/veriexec.mk b/stand/veriexec.mk new file mode 100644 index 000000000000..930e933be0a9 --- /dev/null +++ b/stand/veriexec.mk @@ -0,0 +1,9 @@ +.if ${MK_LOADER_VERIEXEC} != "no" +CFLAGS+= -DLOADER_VERIEXEC -I${SRCTOP}/lib/libsecureboot/h +.if ${MK_LOADER_VERIEXEC_VECTX} != "no" +CFLAGS+= -DLOADER_VERIEXEC_VECTX +.endif +.if ${MK_LOADER_VERIEXEC_PASS_MANIFEST} != "no" +CFLAGS+= -DLOADER_VERIEXEC_PASS_MANIFEST +.endif +.endif