diff options
author | Stephen Cprek <smcprek@us.ibm.com> | 2017-11-21 16:09:22 -0600 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-12-05 14:37:19 -0500 |
commit | ca52131dad3de16f44b9c9f07b5413edf1e9742a (patch) | |
tree | 56a0fcd4357510dee0fa25883dea463cfdb1433b /src/usr/util | |
parent | 89f7297255af3b70c6c1f7a3845498d13eff5cfd (diff) | |
download | talos-hostboot-ca52131dad3de16f44b9c9f07b5413edf1e9742a.tar.gz talos-hostboot-ca52131dad3de16f44b9c9f07b5413edf1e9742a.zip |
Handle ContainerHeader asserts more nicely with error logs
Change-Id: I2dfd02bd7c7f5b5356cd93ca967482c2d7f79ec1
RTC: 178520
RTC: 181899
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/49966
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@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/usr/util')
-rw-r--r-- | src/usr/util/runtime/utillidmgr_rt.C | 38 | ||||
-rw-r--r-- | src/usr/util/utilmclmgr.C | 8 |
2 files changed, 13 insertions, 33 deletions
diff --git a/src/usr/util/runtime/utillidmgr_rt.C b/src/usr/util/runtime/utillidmgr_rt.C index 0e45de3f0..05f15c3c4 100644 --- a/src/usr/util/runtime/utillidmgr_rt.C +++ b/src/usr/util/runtime/utillidmgr_rt.C @@ -163,44 +163,18 @@ errlHndl_t UtilLidMgr::loadLid() { UTIL_FT("UtilLidMgr::loadLid - resv mem section found"); - // Ensure Section has a Secure Header - if (!PNOR::cmpSecurebootMagicNumber( - reinterpret_cast<uint8_t*>(iv_lidBuffer))) + // Build a container header object to parse protected size + SECUREBOOT::ContainerHeader l_conHdr; + l_errl = l_conHdr.setHeader(iv_lidBuffer); + if (l_errl) { - UTIL_FT(ERR_MRK"UtilLidMgr::loadLid: currently don't support " - "a reserved memory area without a secure header. Section = %s", - PNOR::SectionIdToString(pnorSectionId)); - - uint64_t l_actualBytes = 0; - memcpy(&l_actualBytes, - iv_lidBuffer, - sizeof(ROM_MAGIC_NUMBER)); - - /*@ - * @errortype ERRL_SEV_INFORMATIONAL - * @moduleid Util::UTIL_LIDMGR_RT - * @reasoncode PNOR::RC_BAD_SECURE_MAGIC_NUM - * @userdata1 Section attempting to be loaded - * @userdata2 First 4 bytes of vaddr - * @devdesc Error loading lid from reserved memory without secure header - * @custdesc Firmware Error - */ - l_errl = new ERRORLOG::ErrlEntry( - ERRORLOG::ERRL_SEV_INFORMATIONAL, - Util::UTIL_LIDMGR_RT, - PNOR::RC_BAD_SECURE_MAGIC_NUM, - pnorSectionId, - l_actualBytes, - true/*SW Error*/); + UTIL_FT(ERR_MRK"UtilLidMgr::loadLid - setheader failed"); break; } + iv_lidSize = l_conHdr.payloadTextSize(); UTIL_FT("UtilLidMgr::loadLid - resv mem section has secure header"); - // Build a container header object to parse protected size - SECUREBOOT::ContainerHeader l_conHdr(iv_lidBuffer); - iv_lidSize = l_conHdr.payloadTextSize(); - // Increment by page size to not expose secure header iv_lidBuffer = static_cast<uint8_t*>(iv_lidBuffer) + PAGESIZE; diff --git a/src/usr/util/utilmclmgr.C b/src/usr/util/utilmclmgr.C index d3974a5e3..66c3b1a29 100644 --- a/src/usr/util/utilmclmgr.C +++ b/src/usr/util/utilmclmgr.C @@ -619,7 +619,13 @@ errlHndl_t MasterContainerLidMgr::verifyExtend(const ComponentID& i_compId, } // Parse Container Header - SECUREBOOT::ContainerHeader l_conHdr(iv_pVaddr); + SECUREBOOT::ContainerHeader l_conHdr; + l_errl = l_conHdr.setHeader(iv_pVaddr); + if (l_errl) + { + UTIL_FT(ERR_MRK"MasterContainerLidMgr::verifyExtend - setheader failed"); + break; + } // Cache size stats into comp info cache io_compInfo.totalSize = l_conHdr.totalContainerSize(); |