https://ticket.coreboot.org/https://ticket.coreboot.org/themes/PurpleMine2-2.16.2/favicon/favicon.ico?12017-05-13T19:11:46ZIssue Trackercoreboot - Bug #66: rmodule_copy_payload() does not initialize unused memoryhttps://ticket.coreboot.org/issues/66?journal_id=2772017-05-13T19:11:46ZNico Hubernico.h@gmx.de
<ul><li><strong>Assignee</strong> set to <i>Aaron Durbin</i></li></ul> coreboot - Bug #66: rmodule_copy_payload() does not initialize unused memoryhttps://ticket.coreboot.org/issues/66?journal_id=2962017-05-15T20:02:23ZAaron Durbinadurbin@google.com
<ul></ul><p>What about rmodule_clear_bss() ? I'm confused here. Is this a theoretical issue or a do you have a rmodule where things aren't cleared?</p>
<p>payload_size is the on-disk usage while rmodule_memory_size is the full program (including bss). </p>
coreboot - Bug #66: rmodule_copy_payload() does not initialize unused memoryhttps://ticket.coreboot.org/issues/66?journal_id=2992017-05-16T19:44:40ZAaron Durbinadurbin@google.com
<ul></ul><p>This is from rmodule_load():</p>
<blockquote>
<p>-------/*<br>
------- * In order to load the module at a given address, the following steps<br>
------- * take place:<br>
------- * 1. Copy payload to base address.<br>
------- * 2. Adjust relocations within the module to new base address.<br>
------- * 3. Clear the bss segment last since the relocations live where<br>
------- * the bss is. If an rmodule is being loaded from its load<br>
------- * address the relocations need to be processed before the bss.<br>
------- */<br>
-------module->location = base;<br>
-------rmodule_copy_payload(module);<br>
-------if (rmodule_relocate(module))<br>
------->-------return -1;<br>
-------rmodule_clear_bss(module);</p>
</blockquote>
<p>You want to verify the contents of the on-disk piece? I'm confused when/where you are trying to do measurements. It seems like you are doing it at the wrong place. There's not much information to go on here w.r.t. the original report. </p>
coreboot - Bug #66: rmodule_copy_payload() does not initialize unused memoryhttps://ticket.coreboot.org/issues/66?journal_id=3002017-05-16T19:54:24ZTrammell Hudsonhudson@trmm.net
<ul></ul><p>I'm not sure about module_clear_bss() and will need to look into it. Right now I'm doing the measurement in cbfs_load_and_decompress().</p>
<p>The one module that shows the problem is the SMM code. However, I note that cbfs_prog_stage_load() appears to memset() the extra memory, so perhaps I need to relocate my measurement.</p>
coreboot - Bug #66: rmodule_copy_payload() does not initialize unused memoryhttps://ticket.coreboot.org/issues/66?journal_id=3012017-05-16T20:03:35ZAaron Durbinadurbin@google.com
<ul></ul><p>You are making your measurement at the wrong place for the rmodules. You need to hook into the full loading path for each type of thing loaded. prog_segment_loaded(..., SEG_FINAL) are the final contents including memory location and size. You could certainly hook into that in some form. That would give you a better view of the contents of memory.</p>