<br><br><div class="gmail_quote">On Thu, Oct 22, 2009 at 1:11 PM, John M McIntosh <span dir="ltr">&lt;<a href="mailto:johnmci@smalltalkconsulting.com">johnmci@smalltalkconsulting.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
<br>
On 2009-10-22, at 9:26 AM, Eliot Miranda wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Is there no access other than through the VM?  One of the major pains with the iPhone is the lack of support for JITs.  The mmap function prevents granting execute access on the memory it allocates.  John McIntosh has suggested that Apple might be persuaded to provide a work-around for certain applications (i.e. the Cog JIT) but I think John is merely speculating optimistically (John, am I right or is there a real possibility here?).  It would be great if Android didn&#39;t present simular hurdles.<br>

</blockquote>
<br></div>
Ah well the story is:<br>
<br>
The iPhone uses the virtual memory hardware page tags to deal with read, write, execute. *** Actually I was looking for confirmation of this but couldn&#39;t find it ***<br>
Apps from the store run as non-root from a nosuid partition, so you can&#39;t make them root, well not outside an exploit but those are *really rare now*.<br>
Apps from the store cannot dynamically link in executable code, everything you supply is static linked.<br>
I note things like Core-Data to SQLLite do DDL, but that&#39;s Apple&#39;s sandbox.<br>
<br>
To get a page of memory that is marked executable you need to use mmap to allocate a executable/read/write page of memory.<br>
The mmap binary is not quite BSD compliant, passing PROT_EXEC won&#39;t work if you are not root.<br>
*** I assume as root PROT_EXEC will work, but not clear on this, an Apple engineer insisted the PROC_EXEC logic wasn&#39;t in the binary, but doubtful how<br>
does the application loader then get the memory to load the binary? ***<br>
<br>
I did talk to some people in Apple enterprise security (hint at WWDC, the people in charge) about this issue,<br>
they have no plans to allow anyone to mmap memory with PROT_EXEC.<br>
<br>
They did however think if the *right* enterprise clients asked, then *maybe* an enterprise app with the proper certificate could get to PROC_EXEC as a<br>
non-root app, but that would require a change to the operating system.  For the curious a Enterprise can configure phones to disable various hardware<br>
components/features (ie no camera), plus of course distribute apps signed by the enterprise internally for phones which had the enterprise certificates.<br>
<br>
I did suggest to Cincom that they should ask.<br>
<br>
Did I mention Apple&#39;s security organizations general feelings? The answer is NO, now what was the question?<br>
<br>
Obviously this lowers the optimistic level...  Since I don&#39;t think we have an enterprise client (think 100,000 phones) who needs a JIT based app on the iPhone.<br></blockquote><div><br></div><div>Its OK if you&#39;re Apple, right?  JavaScript is V8 (a JIT) on the iPhone isn&#39;t it?  And if Java is on the iPhone its probably a JIT too.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><font color="#888888">
<br>
--<br>
===========================================================================<br>
John M. McIntosh &lt;<a href="mailto:johnmci@smalltalkconsulting.com" target="_blank">johnmci@smalltalkconsulting.com</a>&gt;   Twitter:  squeaker68882<br>
Corporate Smalltalk Consulting Ltd.  <a href="http://www.smalltalkconsulting.com" target="_blank">http://www.smalltalkconsulting.com</a><br>
===========================================================================<br>
<br>
<br>
<br>
<br>
</font></blockquote></div><br>