]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Create kernel module to parse Veriexec manifest based on envs
authormw <mw@FreeBSD.org>
Wed, 3 Apr 2019 03:57:37 +0000 (03:57 +0000)
committermw <mw@FreeBSD.org>
Wed, 3 Apr 2019 03:57:37 +0000 (03:57 +0000)
commit7c5d4b81ab4dfa2ba78071857695739af25f3030
tree13fe5d34ad171509d10ef5952b6e6ad4161c70a5
parentacf1cd99b3c85eb59bf6392234965a35bfd63bd3
Create kernel module to parse Veriexec manifest based on envs

The current approach of injecting manifest into mac_veriexec is to
verify the integrity of it in userspace (veriexec (8)) and pass its
entries into kernel using a char device (/dev/veriexec).
This requires verifying root partition integrity in loader,
for example by using memory disk and checking its hash.
Otherwise if rootfs is compromised an attacker could inject their own data.

This patch introduces an option to parse manifest in kernel based on envs.
The loader sets manifest path and digest.
EVENTHANDLER is used to launch the module right after the rootfs is mounted.
It has to be done this way, since one might want to verify integrity of the init file.
This means that manifest is required to be present on the root partition.
Note that the envs have to be set right before boot to make sure that no one can spoof them.

Submitted by: Kornel Duleba <mindal@semihalf.com>
Reviewed by: sjg
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D19281
12 files changed:
lib/libsecureboot/Makefile.libsa.inc
lib/libsecureboot/h/verify_file.h
lib/libsecureboot/libsecureboot-priv.h
lib/libsecureboot/pass_manifest.c [new file with mode: 0644]
lib/libsecureboot/verify_file.c
share/mk/src.opts.mk
stand/common/boot.c
stand/common/module.c
stand/loader.mk
sys/conf/files
sys/security/mac_veriexec_parser/mac_veriexec_parser.c [new file with mode: 0644]
tools/build/options/WITH_LOADER_VERIEXEC_PASS_MANFIEST [new file with mode: 0644]