<p>Werner Zeh has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/20560">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">drivers/intel/fsp1_1: Handle errors in find_fsp()<br><br>The function find_fsp() parses the FSP header and returns either a valid<br>pointer to the FSP_INFO_HEADER or an error code. The caller of<br>find_fsp() only takes care about a NULL-pointer but not about a possible<br>error code. This leads to memory access violations in case of error when<br>FspTempRamInit is called.<br><br>To avoid this and to let the user know that there was an error while<br>parsing the FSP header show an error message and the error code.<br><br>Change-Id: I67fef0a53fb04c8ba5d18b5d4ef2fdc1aeba869e<br>Signed-off-by: Werner Zeh <werner.zeh@siemens.com><br>---<br>M src/drivers/intel/fsp1_1/bootblock.c<br>1 file changed, 5 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/60/20560/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/src/drivers/intel/fsp1_1/bootblock.c b/src/drivers/intel/fsp1_1/bootblock.c<br>index c0f26d9..685609e 100644<br>--- a/src/drivers/intel/fsp1_1/bootblock.c<br>+++ b/src/drivers/intel/fsp1_1/bootblock.c<br>@@ -35,6 +35,11 @@<br>   /* Locate the FSP header */<br>   fih = find_fsp(CONFIG_FSP_LOC);<br>       /* Check the FSP header */<br>+   if (((uint32_t)fih >= ERROR_NO_FV_SIG) &&<br>+     ((uint32_t)fih <= ERROR_FSP_REV_MISMATCH)) {<br>+          printk(BIOS_ERR, "FSP header error %d, ", (uint32_t)fih);<br>+          fih = NULL;<br>+  }<br>     if (fih == NULL)<br>              die("FSP_INFO_HEADER not set!\n");<br> <br></pre><p>To view, visit <a href="https://review.coreboot.org/20560">change 20560</a>. To unsubscribe, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/20560"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I67fef0a53fb04c8ba5d18b5d4ef2fdc1aeba869e </div>
<div style="display:none"> Gerrit-Change-Number: 20560 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Werner Zeh <werner.zeh@siemens.com> </div>