<br><br><div class="gmail_quote">2011/3/24 Levente Uzonyi <span dir="ltr">&lt;<a href="mailto:leves@elte.hu">leves@elte.hu</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
 <br>On Thu, 24 Mar 2011, Igor Stasenko wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
On 24 March 2011 19:53, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
<br>
On Thu, Mar 24, 2011 at 11:42 AM, Igor Stasenko &lt;<a href="mailto:siguctua@gmail.com" target="_blank">siguctua@gmail.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
On 24 March 2011 19:34, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
On Tue, Mar 22, 2011 at 5:34 AM, Stéphane Ducasse<br>
&lt;<a href="mailto:stephane.ducasse@inria.fr" target="_blank">stephane.ducasse@inria.fr</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
But why we could not have a byecode validator at the image level that<br>
first make sure that byte code are in sync with the format of the objects.<br>
</blockquote>
<br>
Because it can be compromised.  An in-image verifier is subject to attack,<br>
and could be disabled by an attack that got past the in-image verifier<br>
before it got a chance to run.  An in-VM verifier is not possible to<br>
side-step because it is the only way to execute code.  So an in-VM verifier<br>
can be secure but an in-image one can&#39;t and so is pointless.<br>
<br>
</blockquote>
For real hacker there&#39;s nothing impossible :)<br>
</blockquote>
<br>
True, but it can be much harder.  How would you attempt to hack past the fact that the interpreter and JIT code, including the verifier, is in read-only memory?  If this is the only route to create executable code, and it always verifies the bytecode before it executes then it is secure right?<br>

[there are issues; one doesn&#39;t want to verify a method each time it is activated in the interpreter, but e.g. a bit in the header saying &quot;this method has been verified&quot; might be easy to compromise.  I&#39;m not sure it is though, because one big advantage of the current funky method format (half literals, half btes) is that there&#39;s only one primitive to construct a method and it has to have a valid header, and there&#39;s only one way to modify the header, objectAt:put:.  So as far as I can see the VM can in fact preserve the integrty a header flag bit that says &quot;this method has been verified&quot;.  Am I right or wrong?]<br>

</blockquote>
<br>
To my thinking, verification needs to be performed at the moment of<br>
installation method to some class.<br>
Because if method is not installed anywhere, performing verification<br>
is just a waste of time,<br>
and moreover it could be erroneous and tedious, because compiler could<br>
fill method&#39;s state in multiple stages.<br>
<br>
Instead, if we could have a primitive<br>
installMethod: aMethod forClass: aClass<br>
then we can put verification there as well as sealing compiled method<br>
for the rest of its life.<br>
As well, as we no longer need to flush cache (like<br>
MethodDictionary&gt;&gt;at:put: does), because VM can do this<br>
correctly in given primitive so, it is an additional benefit.<br>
<br>
For this to work, we should also prevent modification to methods<br>
dictionary once it assigned to particular class<br>
(we will need additional primitives for removing/replacing methods in<br>
given dictionary).<br>
</blockquote>
<br>
Note that are primitives (188 and 189) to execute methods which are not installed in the object&#39;s class&#39;s method dictionary.<br></blockquote><div><br></div><div>+1</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<br>
Also note that this effort is against the &quot;keep the VM simple, move as much stuff to the image side as possible&quot; paradigm.<br></blockquote><div><br></div><div>+1</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<br>
<br>
Levente<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
-- <br>
Best regards,<br>
Igor Stasenko AKA sig.<br>
</blockquote>
<br></blockquote></div><br>