<p>Kane Chen has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/25425">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">soc/intel/skylake: ME status value is over status array boundary<br><br>me_progress_rom_values array provides detailed information maps to<br>ME HFSTS2 register value.<br>There is a chance that ME status value might be over the size of<br>me_progress_rom_values.<br>This commit adds a check before access the array.<br><br>BUG=b:77247550<br><br>Change-Id: I5de569c62b94b0595d3d3ea254f50e312e8c11a4<br>Signed-off-by: Kane Chen <kane.chen@intel.com><br>---<br>M src/soc/intel/skylake/me.c<br>1 file changed, 8 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/25/25425/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/soc/intel/skylake/me.c b/src/soc/intel/skylake/me.c</span><br><span>index 9a721bc..a23172e 100644</span><br><span>--- a/src/soc/intel/skylake/me.c</span><br><span>+++ b/src/soc/intel/skylake/me.c</span><br><span>@@ -346,8 +346,14 @@</span><br><span> printk(BIOS_DEBUG, "ME: Progress Phase State : ");</span><br><span> switch (hfs2.fields.progress_code) {</span><br><span> case ME_HFS2_PHASE_ROM: /* ROM Phase */</span><br><span style="color: hsl(0, 100%, 40%);">- printk(BIOS_DEBUG, "%s",</span><br><span style="color: hsl(0, 100%, 40%);">- me_progress_rom_values[hfs2.fields.current_state]);</span><br><span style="color: hsl(120, 100%, 40%);">+ if (hfs2.fields.current_state</span><br><span style="color: hsl(120, 100%, 40%);">+ < ARRAY_SIZE(me_progress_rom_values)</span><br><span style="color: hsl(120, 100%, 40%);">+ && me_progress_rom_values[hfs2.fields.current_state])</span><br><span style="color: hsl(120, 100%, 40%);">+ printk(BIOS_DEBUG, "%s",</span><br><span style="color: hsl(120, 100%, 40%);">+ me_progress_rom_values[</span><br><span style="color: hsl(120, 100%, 40%);">+ hfs2.fields.current_state]);</span><br><span style="color: hsl(120, 100%, 40%);">+ else</span><br><span style="color: hsl(120, 100%, 40%);">+ printk(BIOS_DEBUG, "0x%02x", hfs2.fields.current_state);</span><br><span> break;</span><br><span> </span><br><span> case ME_HFS2_PHASE_UKERNEL: /* uKernel Phase */</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/25425">change 25425</a>. To unsubscribe, or for help writing mail filters, 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/25425"/><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: I5de569c62b94b0595d3d3ea254f50e312e8c11a4 </div>
<div style="display:none"> Gerrit-Change-Number: 25425 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Kane Chen <kane.chen@intel.com> </div>