diff options
author | Stephen Cprek <smcprek@us.ibm.com> | 2017-10-31 13:01:30 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-11-19 15:54:51 -0500 |
commit | 81279c1d146d8ee920494c7817cdd72f165dd373 (patch) | |
tree | d616d0914823c8c25592e8276e0610ba1c9d2a28 /src/include/usr/runtime | |
parent | 63a026113332464fc3bcc73369ba35bfe8f62b6f (diff) | |
download | talos-hostboot-81279c1d146d8ee920494c7817cdd72f165dd373.tar.gz talos-hostboot-81279c1d146d8ee920494c7817cdd72f165dd373.zip |
Secure Boot: Fix lid load from HB reserved memory issues at runtime
- Force all PNOR sections we load from HB rserved memory to be secure
Only exception is the RINGOVD section, in which we use a fake header
- Add fake header when Secureboot compiled out or a section is never
signed as there is no secure header preserved in virtual memory
RTC: 171708
RTC: 180063
Change-Id: Ibbbd7be24ee7b199e73451c63b2c2d1f86a2c2d8
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/49020
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Marshall J. Wilks <mjwilks@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include/usr/runtime')
-rw-r--r-- | src/include/usr/runtime/common/runtime_utils.H | 11 | ||||
-rw-r--r-- | src/include/usr/runtime/populate_hbruntime.H | 8 | ||||
-rw-r--r-- | src/include/usr/runtime/preverifiedlidmgr.H | 8 |
3 files changed, 26 insertions, 1 deletions
diff --git a/src/include/usr/runtime/common/runtime_utils.H b/src/include/usr/runtime/common/runtime_utils.H index d63a24d7b..c7f318bc1 100644 --- a/src/include/usr/runtime/common/runtime_utils.H +++ b/src/include/usr/runtime/common/runtime_utils.H @@ -45,4 +45,15 @@ extern const PreVerifyVector preVerifiedPnorSections; */ bool isPreVerifiedSection(const PNOR::SectionId i_section); +/** + * @brief Determines whether the given section is pre-verified and if so, if + * it's expected to be secure + * + * @param[in] i_section PNOR section to test. + * + * @return bool True if pre-verified section is expected to be secure, +* false otherwise. + */ +bool isPreVerifiedSectionSecure(const PNOR::SectionId i_section); + }
\ No newline at end of file diff --git a/src/include/usr/runtime/populate_hbruntime.H b/src/include/usr/runtime/populate_hbruntime.H index 03d8b80de..9f0466172 100644 --- a/src/include/usr/runtime/populate_hbruntime.H +++ b/src/include/usr/runtime/populate_hbruntime.H @@ -23,6 +23,8 @@ /* */ /* IBM_PROLOG_END_TAG */ #include <hdat/hdat.H> +#include <vector> +#include <utility> namespace RUNTIME { @@ -68,9 +70,13 @@ errlHndl_t unmapVirtAddr(uint64_t i_addr); * @brief Pre verify Pnor sections and load into HB reserved memory * * @param[in] i_sec - pnor section to pre-verify and load + * @param[in] i_verified - Indicates if pnor section is expected to have a + * secure header. + * e.g. RINGOVD currently never has a secure header * * @return Error handle if error */ -errlHndl_t hbResvLoadSecureSection (const PNOR::SectionId i_sec); +errlHndl_t hbResvLoadSecureSection (const PNOR::SectionId i_sec, + const bool i_verified); } // End of Namespace
\ No newline at end of file diff --git a/src/include/usr/runtime/preverifiedlidmgr.H b/src/include/usr/runtime/preverifiedlidmgr.H index 185a0d24f..4b087e102 100644 --- a/src/include/usr/runtime/preverifiedlidmgr.H +++ b/src/include/usr/runtime/preverifiedlidmgr.H @@ -171,6 +171,14 @@ class PreVerifiedLidMgr // Depends on the payload kind uint64_t (*getNextAddress)(const size_t); + // Add fake headers during pnor loads + // Use Case: Secureboot compiled out or unsigned sections need a header + // added so runtime can parse it for the section size + static bool cv_addFakeHdrs; + + // Current Pnor section ID we are processing. Used to generate fake header + static PNOR::SectionId cv_curPnorSecId; + /** * @brief Get aligned reserved memory size for OPAL * Note: Historically we have used the aligned size for OPAL |