libsecureboot do not report expected unverified filesBy default only report unverified files at severity VE_WANTand above. This inlcudes *.conf but not *.hints, *.cookieor *.tgz which get VE_TRY
libsecureboot do not report expected unverified filesBy default only report unverified files at severity VE_WANTand above. This inlcudes *.conf but not *.hints, *.cookieor *.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=0is sufficient to make the loader almost totally silent.When verify_prep has to find_manifest and it is verified okreturn VE_NOT_CHECKED to verify_file so that it can skiprepeating verify_fdAlso add better debugging output for is_verified and add_verify_status.vectx handle compressed modulesWhen 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 untilEOF is hit.Note: because of the way libsa's open() works, verify_prep will seethe path to be verified as module.ko not module.ko.bz2 etc. This isactually ok, because we need a separate module.ko.bz2 entry so thatthe package can be verified, and the hash for module.ko is of theuncompressed file which is what vectx will see.Re-work local.trust.mk so site.trust.mk need only setVE_SIGN_URL_LIST (if using the mentioned signing server)interp.c: restrict interactive inputApply the same restrictions to interactive input as forunverified conf and hints files.Use version.veriexec when LOADER_VERIEXEC is yesReviewed by: kevansSponsored by: Juniper Networks, Inc.Differential Revision: https://reviews.freebsd.org/D43810(cherry picked from commit f616d61ab6b071e5fbfdbae7033a9ef04c1444ad)
show more ...
libsecureboot: be more verbose about validation failuresReviewed by: imp, sjgPull Request: https://github.com/freebsd/freebsd-src/pull/916(cherry picked from commit 4b9d605768acabc460aa6dcfe8a1f
libsecureboot: be more verbose about validation failuresReviewed by: imp, sjgPull Request: https://github.com/freebsd/freebsd-src/pull/916(cherry picked from commit 4b9d605768acabc460aa6dcfe8a1f8db35b16794)
Remove $FreeBSD$: one-line bare tagRemove /^\s*\$FreeBSD\$$\n/
Remove $FreeBSD$: one-line sh patternRemove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
Remove $FreeBSD$: one-line .c patternRemove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
Remove $FreeBSD$: one-line .h patternRemove /^\s*\*+\s*\$FreeBSD\$.*$\n/
Remove $FreeBSD$: two-line .h patternRemove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
libsecureboot: do not accept certificate we cannot decodeAlthough we care more about the CN of a certificate than its status(for purpose of reporting), we should skip if we have errors decoding.
libsecureboot: do not accept certificate we cannot decodeAlthough we care more about the CN of a certificate than its status(for purpose of reporting), we should skip if we have errors decoding.Reviewed by: stevekSponsored by: Juniper Networks, Inc.
libsecureboot: avoid set but not used errorsReviewed by: stevek
libsecureboot ensure correct BUILD_UTCIf using stat(1) on BUILD_UTC_FILE we should use -L incaseit is a symlink.If we have new enough bmake though we can just use ${BUILD_UTC_FILE:mtime}
libsecureboot allow site.trust.mk to override settingsThe current content of local.trust.mk is mostly for examplepurposes.
lib/libsecureboot: Fix some typosSigned-off-by: Elyes HAOUAS <[email protected]>Pull Request: https://github.com/freebsd/freebsd-src/pull/544
Add -S option to veriexecDuring software installation, use veriexec -S to strictlyenforce certificate validity checks (notBefore, notAfter).Otherwise ignore certificate validity period.It is ge
Add -S option to veriexecDuring software installation, use veriexec -S to strictlyenforce certificate validity checks (notBefore, notAfter).Otherwise ignore certificate validity period.It is generally unacceptible for the Internet to stop workingjust because someone did not upgrade their infrastructure for a decade.Sponsored by: Juniper Networks, Inc.Reviewed by: sebastien.bini_stormshield.euDifferential Revision: https://reviews.freebsd.org/D35758
libsecureboot: Do not propagate empty stringIf Trust Anchors are provided by UEFI and not compiled intolibsecureboot the segmentation fault occurs due to emptyor NULL string usage.Obtained from
libsecureboot: Do not propagate empty stringIf Trust Anchors are provided by UEFI and not compiled intolibsecureboot the segmentation fault occurs due to emptyor NULL string usage.Obtained from: SemihalfReviewed by: sjgDifferential revision: https://reviews.freebsd.org/D35120
Merge bearssl-20220418Main change is a callback for checking validity period of certificates.Merge commit 'f6acb9b9f81c96ae7c9592bee1bb89c4357cc3e5'Add -DHAVE_BR_X509_TIME_CHECK to libsecureboo
Merge bearssl-20220418Main change is a callback for checking validity period of certificates.Merge commit 'f6acb9b9f81c96ae7c9592bee1bb89c4357cc3e5'Add -DHAVE_BR_X509_TIME_CHECK to libsecureboot/Makefile.inc
Update libsecurebootPreparation for updating bearssl, pull in updates to libsecureboot.o fix handling of some out-of-memory caseso allow more control over reporting of Verified/Unverified files
Update libsecurebootPreparation for updating bearssl, pull in updates to libsecureboot.o fix handling of some out-of-memory caseso 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 fileo more debug support for vectxo hash_string to support fake stat for tftpo tests/tvo add -v to simply verify signatureso vets.c allow for HAVE_BR_X509_TIME_CHECK which will greatly simplify verification in loadero report date when certificate fails validity period checksReviewed by: stevekSponsored by: Juniper Networks, Inc.
Move ve_check_hash prototype to libsecureboot-priv.hReviewed by: stevek
libsecureboot: define SOPEN_MAXWith commit 97cbd5e722389a575e820c4e03f38053308f08ea, the SOPEN_MAXwas removed from stand.h.We would need better mechanism there.
veloader: insist on verifying .4th .lua etcWhen files are read from .rc or .4th, verify_file is asked toguess the severity (VE_TRY,VE_WANT,VE_MUST)Reviewed by: stevekMFC after: 1 weekSponsored
veloader: insist on verifying .4th .lua etcWhen files are read from .rc or .4th, verify_file is asked toguess the severity (VE_TRY,VE_WANT,VE_MUST)Reviewed by: stevekMFC after: 1 weekSponsored by: Juniper Networks
Revert that!
Oops missed Makefile.config
verify_pcr_export: bump kenv_mvallen if neededThe loader.ve.hashed list can easily exceed KENV_MVALLEN.If so, bump kenv_mvallen to a multiple of KENV_MVALLEN toaccommodate the value.Reviewed by
verify_pcr_export: bump kenv_mvallen if neededThe loader.ve.hashed list can easily exceed KENV_MVALLEN.If so, bump kenv_mvallen to a multiple of KENV_MVALLEN toaccommodate the value.Reviewed by: stevekMFC after: 1 week
Improve interaction of vectx and tftpOn slow platforms, it helps to spread the hashing loadover time so that tftp does not timeout.Also, some .4th files are too big to fit in cache of pkgfs,so
Improve interaction of vectx and tftpOn slow platforms, it helps to spread the hashing loadover time so that tftp does not timeout.Also, some .4th files are too big to fit in cache of pkgfs,so increase cache size and ensure fully populated.Reviewed by: stevekMFC after: 1 weekDifferential Revision: https://reviews.freebsd.org/D24287
Fix pkgfs stat so it satisfies libsecurebootWe need a valid st_dev, st_ino and st_mtimeto correctly track which files have been verifiedand to update our notion of time.ve_utc_set(): ignore utc
Fix pkgfs stat so it satisfies libsecurebootWe need a valid st_dev, st_ino and st_mtimeto correctly track which files have been verifiedand to update our notion of time.ve_utc_set(): ignore utc if it would jump our current timeby 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.hCall ve_error_get() from vectx_close() when hash is wrong.Track the names of files we have hashed into pcrFor the purposes of measured boot, it is importantto be able to reproduce the hash reflected inloader.ve.pcrso loader.ve.hashed provides a list of names in the order theywere added.Reviewed by: impMFC after: 1 weekSponsored by: Juniper NetworksDifferential Revision: https://reviews.freebsd.org//D24027
veloader use vectx API for kernel and modulesThe vectx API, computes the hash for verifying a file as it is read.This avoids the overhead of reading files twice - once to verify, thenagain to loa
veloader use vectx API for kernel and modulesThe vectx API, computes the hash for verifying a file as it is read.This avoids the overhead of reading files twice - once to verify, thenagain to load.For doing an install via loader, avoiding the need to rewindlarge files is critical.This API is only used for modules, kernel and mdimage as these are thebiggest files read by the loader.The reduction in boot time depends on how expensive the I/O ison 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 thekernel, so some of the prep work (finding manifest etc) done byverify_file() needs to be factored so it can be reused forvectx_open().For missing or unrecognized fingerprint entries, we failin vectx_open() unless verifying is disabled.Otherwise fingerprint check happens in vectx_close() andsince this API is only used for files which must be verified(VE_MUST) we panic if we get an incorrect hash.Reviewed by: imp,tsoomeMFC after: 1 weekSponsored by: Juniper NetworksDifferential Revision: https://reviews.freebsd.org//D23827
12