#
f616d61a |
| 12-Feb-2024 |
Simon J. Gerraty <sjg@FreeBSD.org> |
libsecureboot do not report expected unverified files
By default only report unverified files at severity VE_WANT and above. This inlcudes *.conf but not *.hints, *.cookie or *.tgz which get VE_TRY
libsecureboot do not report expected unverified files
By default only report unverified files at severity VE_WANT and above. This inlcudes *.conf but not *.hints, *.cookie or *.tgz which get VE_TRY as their severity.
If Verbose is set to 0, then VerifyFlags should default to 0 too. Thus the combination of
module_verbose=0 VE_VEBOSE=0
is sufficient to make the loader almost totally silent.
When verify_prep has to find_manifest and it is verified ok return VE_NOT_CHECKED to verify_file so that it can skip repeating verify_fd
Also add better debugging output for is_verified and add_verify_status.
vectx handle compressed modules
When verifying a compressed module (.ko.gz or .ko.bz2) stat() reports the size as -1 (unknown). vectx_lseek needs to spot this during closing - and just read until EOF is hit.
Note: because of the way libsa's open() works, verify_prep will see the path to be verified as module.ko not module.ko.bz2 etc. This is actually ok, because we need a separate module.ko.bz2 entry so that the package can be verified, and the hash for module.ko is of the uncompressed file which is what vectx will see.
Re-work local.trust.mk so site.trust.mk need only set VE_SIGN_URL_LIST (if using the mentioned signing server)
interp.c: restrict interactive input
Apply the same restrictions to interactive input as for unverified conf and hints files.
Use version.veriexec when LOADER_VERIEXEC is yes
Reviewed by: kevans Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D43810
show more ...
|
#
a2f733ab |
| 24-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
lib: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row.
Remov
lib: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row.
Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/
Sponsored by: Netflix
show more ...
|
Revision tags: release/14.0.0 |
|
#
1d386b48 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
Revision tags: release/13.2.0, release/12.4.0, release/13.1.0 |
|
#
66655411 |
| 18-Apr-2022 |
Simon J. Gerraty <sjg@FreeBSD.org> |
Update libsecureboot
Preparation for updating bearssl, pull in updates to libsecureboot.
o fix handling of some out-of-memory cases
o allow more control over reporting of Verified/Unverified files
Update libsecureboot
Preparation for updating bearssl, pull in updates to libsecureboot.
o fix handling of some out-of-memory cases
o allow more control over reporting of Verified/Unverified files. this helps boot time when console output is slow
o recheck verbose/debug level after reading any unverified file
o more debug support for vectx
o hash_string to support fake stat for tftp
o tests/tvo add -v to simply verify signatures
o vets.c allow for HAVE_BR_X509_TIME_CHECK which will greatly simplify verification in loader
o report date when certificate fails validity period checks
Reviewed by: stevek Sponsored by: Juniper Networks, Inc.
show more ...
|
Revision tags: release/12.3.0 |
|
#
ee6dc333 |
| 10-Aug-2021 |
Toomas Soome <tsoome@FreeBSD.org> |
libsecureboot: define SOPEN_MAX
With commit 97cbd5e722389a575e820c4e03f38053308f08ea, the SOPEN_MAX was removed from stand.h.
We would need better mechanism there.
|
Revision tags: release/13.0.0, release/12.2.0 |
|
#
e2515283 |
| 27-Aug-2020 |
Glen Barber <gjb@FreeBSD.org> |
MFH
Sponsored by: Rubicon Communications, LLC (netgate.com)
|
#
0929924b |
| 21-Aug-2020 |
Simon J. Gerraty <sjg@FreeBSD.org> |
veloader: insist on verifying .4th .lua etc
When files are read from .rc or .4th, verify_file is asked to guess the severity (VE_TRY,VE_WANT,VE_MUST)
Reviewed by: stevek MFC after: 1 week Sponsored
veloader: insist on verifying .4th .lua etc
When files are read from .rc or .4th, verify_file is asked to guess the severity (VE_TRY,VE_WANT,VE_MUST)
Reviewed by: stevek MFC after: 1 week Sponsored by: Juniper Networks
show more ...
|
#
3e6e3de0 |
| 12-Jun-2020 |
Simon J. Gerraty <sjg@FreeBSD.org> |
verify_pcr_export: bump kenv_mvallen if needed
The loader.ve.hashed list can easily exceed KENV_MVALLEN. If so, bump kenv_mvallen to a multiple of KENV_MVALLEN to accommodate the value.
Reviewed by
verify_pcr_export: bump kenv_mvallen if needed
The loader.ve.hashed list can easily exceed KENV_MVALLEN. If so, bump kenv_mvallen to a multiple of KENV_MVALLEN to accommodate the value.
Reviewed by: stevek MFC after: 1 week
show more ...
|
Revision tags: release/11.4.0 |
|
#
53f151f9 |
| 25-Mar-2020 |
Simon J. Gerraty <sjg@FreeBSD.org> |
Fix pkgfs stat so it satisfies libsecureboot
We need a valid st_dev, st_ino and st_mtime to correctly track which files have been verified and to update our notion of time.
ve_utc_set(): ignore utc
Fix pkgfs stat so it satisfies libsecureboot
We need a valid st_dev, st_ino and st_mtime to correctly track which files have been verified and to update our notion of time.
ve_utc_set(): ignore utc if it would jump our current time by more than VE_UTC_MAX_JUMP (20 years).
Allow testing of install command via userboot. Need to fix its stat implementation too.
bhyveload also needs stat fixed - due to change to userboot.h
Call ve_error_get() from vectx_close() when hash is wrong.
Track the names of files we have hashed into pcr
For the purposes of measured boot, it is important to be able to reproduce the hash reflected in loader.ve.pcr so loader.ve.hashed provides a list of names in the order they were added.
Reviewed by: imp MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org//D24027
show more ...
|
#
16b90565 |
| 10-Mar-2020 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r358731 through r358831.
|
#
afc571b1 |
| 08-Mar-2020 |
Simon J. Gerraty <sjg@FreeBSD.org> |
veloader use vectx API for kernel and modules
The vectx API, computes the hash for verifying a file as it is read. This avoids the overhead of reading files twice - once to verify, then again to loa
veloader use vectx API for kernel and modules
The vectx API, computes the hash for verifying a file as it is read. This avoids the overhead of reading files twice - once to verify, then again to load.
For doing an install via loader, avoiding the need to rewind large files is critical.
This API is only used for modules, kernel and mdimage as these are the biggest files read by the loader. The reduction in boot time depends on how expensive the I/O is on any given platform. On a fast VM we see 6% improvement.
For install via loader the first file to be verified is likely to be the kernel, so some of the prep work (finding manifest etc) done by verify_file() needs to be factored so it can be reused for vectx_open().
For missing or unrecognized fingerprint entries, we fail in vectx_open() unless verifying is disabled.
Otherwise fingerprint check happens in vectx_close() and since this API is only used for files which must be verified (VE_MUST) we panic if we get an incorrect hash.
Reviewed by: imp,tsoome MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org//D23827
show more ...
|
Revision tags: release/12.1.0 |
|
#
18e2fbc0 |
| 24-Oct-2019 |
Simon J. Gerraty <sjg@FreeBSD.org> |
Initialize verbosity and debug level from env
For EFI at least, we can seed the environment with VE_VERBOSE etc.
Reviewed by: stevek imp Sponsored by: Juniper Networks MFC after: 1 week Differentia
Initialize verbosity and debug level from env
For EFI at least, we can seed the environment with VE_VERBOSE etc.
Reviewed by: stevek imp Sponsored by: Juniper Networks MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D22135
show more ...
|
Revision tags: release/11.3.0 |
|
#
7f49ce7a |
| 28-Jun-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead @349476
Sponsored by: The FreeBSD Foundation
|
#
f9510887 |
| 27-Jun-2019 |
Simon J. Gerraty <sjg@FreeBSD.org> |
libsecureboot: allow OpenPGP support to be dormant
Since we can now add OpenPGP trust anchors at runtime, ensure the latent support is available.
Ensure we do not add duplicate keys to trust store.
libsecureboot: allow OpenPGP support to be dormant
Since we can now add OpenPGP trust anchors at runtime, ensure the latent support is available.
Ensure we do not add duplicate keys to trust store.
Also allow reporting names of trust anchors added/revoked
We only do this for loader and only after initializing trust store. Thus only changes to initial trust store will be logged.
Reviewed by: stevek MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D20700
show more ...
|
#
0269ae4c |
| 06-Jun-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead @348740
Sponsored by: The FreeBSD Foundation
|
#
980bde58 |
| 19-May-2019 |
Simon J. Gerraty <sjg@FreeBSD.org> |
libsecureboot: allow control of when pseudo pcr is updated
During boot we only want to measure things which *must* be verified - this should provide more deterministic ordering.
Reviewed by: stevek
libsecureboot: allow control of when pseudo pcr is updated
During boot we only want to measure things which *must* be verified - this should provide more deterministic ordering.
Reviewed by: stevek MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D20297
show more ...
|
#
7648bc9f |
| 13-May-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead @347527
Sponsored by: The FreeBSD Foundation
|
#
64ca9a7f |
| 23-Apr-2019 |
Simon J. Gerraty <sjg@FreeBSD.org> |
Allow no_hash to appear in manifest.
sbin/veriexec will ignore entries that have no hash anyway, but loader needs to be explicitly told that such files are ok to ignore (not verify).
We will report
Allow no_hash to appear in manifest.
sbin/veriexec will ignore entries that have no hash anyway, but loader needs to be explicitly told that such files are ok to ignore (not verify).
We will report as Unverified depending on verbose level, but with no reason - because we are not rejecting the file.
Reviewed by: imp, mindal_semihalf Sponsored by: Juniper Networks MFC After: 1 week Differential Revision: https://reviews.freebsd.org//D20018
show more ...
|
#
7b8b0fdb |
| 10-Apr-2019 |
Simon J. Gerraty <sjg@FreeBSD.org> |
Always report file with incorrect hash.
|
#
9a696dc6 |
| 04-Apr-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead@r345880
|
#
b0fefb25 |
| 03-Apr-2019 |
Marcin Wojtas <mw@FreeBSD.org> |
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 e
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
show more ...
|
#
2aaf9152 |
| 18-Mar-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead@r345275
|
#
ff511f1f |
| 11-Mar-2019 |
Enji Cooper <ngie@FreeBSD.org> |
MFhead@r344996
|
#
13ea0450 |
| 06-Mar-2019 |
Marcin Wojtas <mw@FreeBSD.org> |
Extend libsecureboot(old libve) to obtain trusted certificates from UEFI and implement revocation
UEFI related headers were copied from edk2.
A new build option "MK_LOADER_EFI_SECUREBOOT" was added
Extend libsecureboot(old libve) to obtain trusted certificates from UEFI and implement revocation
UEFI related headers were copied from edk2.
A new build option "MK_LOADER_EFI_SECUREBOOT" was added to allow loading of trusted anchors from UEFI.
Certificate revocation support is also introduced. The forbidden certificates are loaded from dbx variable. Verification fails in two cases:
There is a direct match between cert in dbx and the one in the chain. The CA used to sign the chain is found in dbx. One can also insert a hash of TBS section of a certificate into dbx. In this case verifications fails only if a direct match with a certificate in chain is found.
Submitted by: Kornel Duleba <mindal@semihalf.com> Reviewed by: sjg Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D19093
show more ...
|
#
b18a4cca |
| 05-Mar-2019 |
Enji Cooper <ngie@FreeBSD.org> |
MFhead@r344786
|