<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic An OCALL temporarily exits in Intel Confidential Computing</title>
    <link>https://community.intel.com/t5/Intel-Confidential-Computing/How-to-dump-data-in-enclave-memory/m-p/1113272#M1367</link>
    <description>&lt;P style="margin-bottom: 0px; border: 0px; font-size: 14px; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Lucida Grande&amp;quot;, sans-serif; vertical-align: baseline; color: rgb(0, 0, 0);"&gt;An OCALL temporarily exits the enclave, so it does not have access to enclave memory.&lt;/P&gt;

&lt;P style="margin-bottom: 0px; border: 0px; font-size: 14px; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Lucida Grande&amp;quot;, sans-serif; vertical-align: baseline; color: rgb(0, 0, 0);"&gt;&lt;BR /&gt;
	The SampleEnclave snippet you are referring to works because the bridge function copies the contents of the enclave memory buffer to a buffer allocated in unprotected memory. Note the EDL for the OCALL:&lt;/P&gt;

&lt;P style="margin-bottom: 0px; border: 0px; font-size: 14px; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Lucida Grande&amp;quot;, sans-serif; vertical-align: baseline; color: rgb(0, 0, 0); min-height: 8pt;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="margin-bottom: 0px; border: 0px; font-size: 14px; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Lucida Grande&amp;quot;, sans-serif; vertical-align: baseline; color: rgb(0, 0, 0);"&gt;&lt;SPAN style="margin: 0px; padding: 0px; border: 0px; font-weight: inherit; font-style: inherit; font-family: &amp;quot;courier new&amp;quot;, courier; vertical-align: baseline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; untrusted {&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="margin-bottom: 0px; border: 0px; font-size: 14px; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Lucida Grande&amp;quot;, sans-serif; vertical-align: baseline; color: rgb(0, 0, 0);"&gt;&lt;SPAN style="margin: 0px; padding: 0px; border: 0px; font-weight: inherit; font-style: inherit; font-family: &amp;quot;courier new&amp;quot;, courier; vertical-align: baseline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; void ocall_print_string([in, string] const char *str);&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="margin-bottom: 0px; border: 0px; font-size: 14px; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Lucida Grande&amp;quot;, sans-serif; vertical-align: baseline; color: rgb(0, 0, 0);"&gt;&lt;SPAN style="margin: 0px; padding: 0px; border: 0px; font-weight: inherit; font-style: inherit; font-family: &amp;quot;courier new&amp;quot;, courier; vertical-align: baseline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="margin-bottom: 0px; border: 0px; font-size: 14px; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Lucida Grande&amp;quot;, sans-serif; vertical-align: baseline; color: rgb(0, 0, 0); min-height: 8pt;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="margin-bottom: 0px; border: 0px; font-size: 14px; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Lucida Grande&amp;quot;, sans-serif; vertical-align: baseline; color: rgb(0, 0, 0);"&gt;The&amp;nbsp;&lt;EM style="border: 0px; font-weight: inherit; font-family: inherit; vertical-align: baseline;"&gt;in&lt;/EM&gt;&amp;nbsp;parameter says to copy the memory buffer at&amp;nbsp;&lt;EM style="border: 0px; font-weight: inherit; font-family: inherit; vertical-align: baseline;"&gt;str&lt;/EM&gt;&amp;nbsp;into the OCALL function's memory space (in this case, untrusted memory), and the&amp;nbsp;&lt;EM style="border: 0px; font-weight: inherit; font-family: inherit; vertical-align: baseline;"&gt;string&lt;/EM&gt;&amp;nbsp;parameter says that the length of the buffer to be copied is taken from the length of the string. That is, it expects&amp;nbsp;&lt;EM style="border: 0px; font-weight: inherit; font-family: inherit; vertical-align: baseline;"&gt;str&lt;/EM&gt;&amp;nbsp;to be NULL-terminated.&lt;/P&gt;

&lt;P style="margin-bottom: 0px; border: 0px; font-size: 14px; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Lucida Grande&amp;quot;, sans-serif; vertical-align: baseline; color: rgb(0, 0, 0); min-height: 8pt;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="margin-bottom: 0px; border: 0px; font-size: 14px; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Lucida Grande&amp;quot;, sans-serif; vertical-align: baseline; color: rgb(0, 0, 0);"&gt;To find out why your program is crashing, we'd need to see your EDL and the code that both calls the OCALL as well as the OCALL itself.&lt;/P&gt;</description>
    <pubDate>Sat, 15 Oct 2016 04:51:54 GMT</pubDate>
    <dc:creator>Surenthar_S_Intel</dc:creator>
    <dc:date>2016-10-15T04:51:54Z</dc:date>
    <item>
      <title>How to dump data in enclave memory ?</title>
      <link>https://community.intel.com/t5/Intel-Confidential-Computing/How-to-dump-data-in-enclave-memory/m-p/1113271#M1366</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;I try to print the memory data inside enclave using ocall like this (from linux SampleEnclave)&lt;/P&gt;

&lt;P&gt;/* OCall functions */&lt;BR /&gt;
	void ocall_print_string(const char *str)&lt;BR /&gt;
	{&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; /* Proxy/Bridge will check the length and null-terminate&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp;* the input string to prevent buffer overflow.&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; printf("%s", str);&lt;BR /&gt;
	}&lt;/P&gt;

&lt;P&gt;But it failed and core dump&amp;nbsp;&lt;/P&gt;

&lt;P&gt;"Program received signal SIGSEGV, Segmentation fault.&lt;BR /&gt;
	0x00007ffff69c6943 in _IO_vfprintf_internal (s=&amp;lt;optimized out&amp;gt;, format=&amp;lt;optimized out&amp;gt;, ap=ap@entry=0x7fffffffe368) at vfprintf.c:166&lt;BR /&gt;
	1&lt;/P&gt;

&lt;P&gt;"&lt;/P&gt;

&lt;P&gt;So is it allowed to dump or read the enclave memory in the ocall funtion?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2016 14:43:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Confidential-Computing/How-to-dump-data-in-enclave-memory/m-p/1113271#M1366</guid>
      <dc:creator>Changzheng_W_Intel</dc:creator>
      <dc:date>2016-10-13T14:43:15Z</dc:date>
    </item>
    <item>
      <title>An OCALL temporarily exits</title>
      <link>https://community.intel.com/t5/Intel-Confidential-Computing/How-to-dump-data-in-enclave-memory/m-p/1113272#M1367</link>
      <description>&lt;P style="margin-bottom: 0px; border: 0px; font-size: 14px; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Lucida Grande&amp;quot;, sans-serif; vertical-align: baseline; color: rgb(0, 0, 0);"&gt;An OCALL temporarily exits the enclave, so it does not have access to enclave memory.&lt;/P&gt;

&lt;P style="margin-bottom: 0px; border: 0px; font-size: 14px; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Lucida Grande&amp;quot;, sans-serif; vertical-align: baseline; color: rgb(0, 0, 0);"&gt;&lt;BR /&gt;
	The SampleEnclave snippet you are referring to works because the bridge function copies the contents of the enclave memory buffer to a buffer allocated in unprotected memory. Note the EDL for the OCALL:&lt;/P&gt;

&lt;P style="margin-bottom: 0px; border: 0px; font-size: 14px; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Lucida Grande&amp;quot;, sans-serif; vertical-align: baseline; color: rgb(0, 0, 0); min-height: 8pt;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="margin-bottom: 0px; border: 0px; font-size: 14px; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Lucida Grande&amp;quot;, sans-serif; vertical-align: baseline; color: rgb(0, 0, 0);"&gt;&lt;SPAN style="margin: 0px; padding: 0px; border: 0px; font-weight: inherit; font-style: inherit; font-family: &amp;quot;courier new&amp;quot;, courier; vertical-align: baseline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; untrusted {&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="margin-bottom: 0px; border: 0px; font-size: 14px; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Lucida Grande&amp;quot;, sans-serif; vertical-align: baseline; color: rgb(0, 0, 0);"&gt;&lt;SPAN style="margin: 0px; padding: 0px; border: 0px; font-weight: inherit; font-style: inherit; font-family: &amp;quot;courier new&amp;quot;, courier; vertical-align: baseline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; void ocall_print_string([in, string] const char *str);&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="margin-bottom: 0px; border: 0px; font-size: 14px; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Lucida Grande&amp;quot;, sans-serif; vertical-align: baseline; color: rgb(0, 0, 0);"&gt;&lt;SPAN style="margin: 0px; padding: 0px; border: 0px; font-weight: inherit; font-style: inherit; font-family: &amp;quot;courier new&amp;quot;, courier; vertical-align: baseline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="margin-bottom: 0px; border: 0px; font-size: 14px; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Lucida Grande&amp;quot;, sans-serif; vertical-align: baseline; color: rgb(0, 0, 0); min-height: 8pt;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="margin-bottom: 0px; border: 0px; font-size: 14px; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Lucida Grande&amp;quot;, sans-serif; vertical-align: baseline; color: rgb(0, 0, 0);"&gt;The&amp;nbsp;&lt;EM style="border: 0px; font-weight: inherit; font-family: inherit; vertical-align: baseline;"&gt;in&lt;/EM&gt;&amp;nbsp;parameter says to copy the memory buffer at&amp;nbsp;&lt;EM style="border: 0px; font-weight: inherit; font-family: inherit; vertical-align: baseline;"&gt;str&lt;/EM&gt;&amp;nbsp;into the OCALL function's memory space (in this case, untrusted memory), and the&amp;nbsp;&lt;EM style="border: 0px; font-weight: inherit; font-family: inherit; vertical-align: baseline;"&gt;string&lt;/EM&gt;&amp;nbsp;parameter says that the length of the buffer to be copied is taken from the length of the string. That is, it expects&amp;nbsp;&lt;EM style="border: 0px; font-weight: inherit; font-family: inherit; vertical-align: baseline;"&gt;str&lt;/EM&gt;&amp;nbsp;to be NULL-terminated.&lt;/P&gt;

&lt;P style="margin-bottom: 0px; border: 0px; font-size: 14px; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Lucida Grande&amp;quot;, sans-serif; vertical-align: baseline; color: rgb(0, 0, 0); min-height: 8pt;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P style="margin-bottom: 0px; border: 0px; font-size: 14px; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Lucida Grande&amp;quot;, sans-serif; vertical-align: baseline; color: rgb(0, 0, 0);"&gt;To find out why your program is crashing, we'd need to see your EDL and the code that both calls the OCALL as well as the OCALL itself.&lt;/P&gt;</description>
      <pubDate>Sat, 15 Oct 2016 04:51:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Confidential-Computing/How-to-dump-data-in-enclave-memory/m-p/1113272#M1367</guid>
      <dc:creator>Surenthar_S_Intel</dc:creator>
      <dc:date>2016-10-15T04:51:54Z</dc:date>
    </item>
  </channel>
</rss>

