diff options
author | Eric van Gyzen <vangyzen@FreeBSD.org> | 2021-04-30 17:53:45 +0000 |
---|---|---|
committer | Eric van Gyzen <vangyzen@FreeBSD.org> | 2021-04-30 17:53:45 +0000 |
commit | eda28feb2e070e21db3d50b3fc177f88380b8fb4 (patch) | |
tree | fa9b1cf843d5ff1611b0ae7c4b9a2b1b982b426e /stand | |
parent | 619fe095861274576a2cb45628076968051b1585 (diff) | |
download | src-eda28feb2e070e21db3d50b3fc177f88380b8fb4.tar.gz src-eda28feb2e070e21db3d50b3fc177f88380b8fb4.zip |
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
Diffstat (limited to 'stand')
-rw-r--r-- | stand/efi/boot1/Makefile | 2 | ||||
-rw-r--r-- | stand/efi/fdt/Makefile | 2 | ||||
-rw-r--r-- | stand/efi/libefi/Makefile | 2 | ||||
-rw-r--r-- | stand/fdt/Makefile | 2 | ||||
-rw-r--r-- | stand/ficl.mk | 4 | ||||
-rw-r--r-- | stand/i386/libfirewire/Makefile | 2 | ||||
-rw-r--r-- | stand/i386/libi386/Makefile | 2 | ||||
-rw-r--r-- | stand/liblua/Makefile | 5 | ||||
-rw-r--r-- | stand/loader.mk | 11 | ||||
-rw-r--r-- | stand/veriexec.mk | 9 |
10 files changed, 25 insertions, 16 deletions
diff --git a/stand/efi/boot1/Makefile b/stand/efi/boot1/Makefile index 39dc4f8e70ad..af03e395b2a5 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 e838a5a10ac4..99b31338a75d 100644 --- a/stand/efi/libefi/Makefile +++ b/stand/efi/libefi/Makefile @@ -67,4 +67,6 @@ CFLAGS+= ${FORMAT_EXTENSIONS} CFLAGS+= -DTERM_EMU +.include "${BOOTSRC}/veriexec.mk" + .include <bsd.lib.mk> 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 <bsd.lib.mk> 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 <bsd.lib.mk> diff --git a/stand/loader.mk b/stand/loader.mk index 3a38a9bc9e63..9dda8c6535ea 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 |