<?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 Re: Ecall invocation from a remote enclave fails in Intel® Software Guard Extensions (Intel® SGX)</title>
    <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Ecall-invocation-from-a-remote-enclave-fails/m-p/1410679#M5451</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Library&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;The library that generates the enclave.signed.so has an ecall &lt;FONT face="courier new,courier"&gt;public int ecall_two(int n)&lt;/FONT&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Application&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;When I invoke the application I get the error:&lt;/P&gt;
&lt;LI-CODE lang="bash"&gt;$ ./app_ex
./app_ex: symbol lookup error: ./app_ex: undefined symbol: ecall_two&lt;/LI-CODE&gt;
&lt;P&gt;But this happens when using &lt;FONT face="courier new,courier"&gt;-rdynamic&lt;/FONT&gt; in the makefile (I don't need it, was just trying to find a way to solve the problem).&lt;/P&gt;
&lt;P&gt;Without &lt;FONT face="courier new,courier"&gt;-rdynamic&lt;/FONT&gt; the error is:&lt;/P&gt;
&lt;LI-CODE lang="bash"&gt;$ ./app_ex
Loads remote enclave using sgx_create_enclave_from_buffer_ex
sgx_create_enclave: success
Segmentation fault (core dumped)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 25 Aug 2022 13:15:28 GMT</pubDate>
    <dc:creator>Daniel_ˢᵍˣ</dc:creator>
    <dc:date>2022-08-25T13:15:28Z</dc:date>
    <item>
      <title>Ecall invocation from a remote enclave fails</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Ecall-invocation-from-a-remote-enclave-fails/m-p/1407423#M5426</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a lib project that generates an enclave.signed.so and an app project that loads that .so using &lt;FONT face="courier new,courier"&gt;sgx_create_enclave_from_buffer_ex&lt;/FONT&gt;. The enclave is loaded successfully. However, when I attempt to invoke ecalls this fails.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I created a hello world to demo the problem: &lt;A href="https://github.com/andrade/create-from-buffer-hello" target="_blank"&gt;https://github.com/andrade/create-from-buffer-hello&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I imagined &lt;FONT face="courier new,courier"&gt;sgx_create_enclave_from_buffer_ex&lt;/FONT&gt; would work similarly to &lt;FONT face="courier new,courier"&gt;dlopen&lt;/FONT&gt; and allow this scenario. Am I doing something wrong? Is this not possible with SGX?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;* Right now this is all done locally but the endgame is having a server that can load client enclaves on request and invoke a well-defined API which all clients implement (clients may have other ecalls/ocalls which the server does not care about and ignores).&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 18:00:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Ecall-invocation-from-a-remote-enclave-fails/m-p/1407423#M5426</guid>
      <dc:creator>Daniel_ˢᵍˣ</dc:creator>
      <dc:date>2022-08-10T18:00:12Z</dc:date>
    </item>
    <item>
      <title>Re:Ecall invocation from a remote enclave fails</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Ecall-invocation-from-a-remote-enclave-fails/m-p/1408364#M5435</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;This is probably because the empty trusted enclave function gets compiled out. It should work if you put something in the enclave (it can be something simple like returning a value). &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/andrade/create-from-buffer-hello/blob/a5beed8111c5e5ec030d1f830635e80f83834a93/lib/enclave.c#L9" rel="noopener noreferrer" target="_blank"&gt;https://github.com/andrade/create-from-buffer-hello/blob/a5beed8111c5e5ec030d1f830635e80f83834a93/lib/enclave.c#L9&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Sincerely,&lt;/P&gt;&lt;P&gt;Sahira&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 15 Aug 2022 23:17:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Ecall-invocation-from-a-remote-enclave-fails/m-p/1408364#M5435</guid>
      <dc:creator>Sahira_Intel</dc:creator>
      <dc:date>2022-08-15T23:17:17Z</dc:date>
    </item>
    <item>
      <title>Re: Re:Ecall invocation from a remote enclave fails</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Ecall-invocation-from-a-remote-enclave-fails/m-p/1408571#M5438</link>
      <description>&lt;P&gt;Hello. Thank you for your reply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've tried with a non-empty ecall but it still fails with the same error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/andrade/create-from-buffer-hello/blob/fa2279b65cf0c3b9c329450c613847a47238fcc3/lib/enclave.c#L14" target="_blank"&gt;https://github.com/andrade/create-from-buffer-hello/blob/fa2279b65cf0c3b9c329450c613847a47238fcc3/lib/enclave.c#L14&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2022 15:19:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Ecall-invocation-from-a-remote-enclave-fails/m-p/1408571#M5438</guid>
      <dc:creator>Daniel_ˢᵍˣ</dc:creator>
      <dc:date>2022-08-16T15:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: Ecall invocation from a remote enclave fails</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Ecall-invocation-from-a-remote-enclave-fails/m-p/1410216#M5447</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Can you send the errors you are getting?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sincerely,&lt;/P&gt;
&lt;P&gt;Sahira&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 18:46:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Ecall-invocation-from-a-remote-enclave-fails/m-p/1410216#M5447</guid>
      <dc:creator>Sahira_Intel</dc:creator>
      <dc:date>2022-08-23T18:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: Ecall invocation from a remote enclave fails</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Ecall-invocation-from-a-remote-enclave-fails/m-p/1410679#M5451</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Library&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;The library that generates the enclave.signed.so has an ecall &lt;FONT face="courier new,courier"&gt;public int ecall_two(int n)&lt;/FONT&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Application&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;When I invoke the application I get the error:&lt;/P&gt;
&lt;LI-CODE lang="bash"&gt;$ ./app_ex
./app_ex: symbol lookup error: ./app_ex: undefined symbol: ecall_two&lt;/LI-CODE&gt;
&lt;P&gt;But this happens when using &lt;FONT face="courier new,courier"&gt;-rdynamic&lt;/FONT&gt; in the makefile (I don't need it, was just trying to find a way to solve the problem).&lt;/P&gt;
&lt;P&gt;Without &lt;FONT face="courier new,courier"&gt;-rdynamic&lt;/FONT&gt; the error is:&lt;/P&gt;
&lt;LI-CODE lang="bash"&gt;$ ./app_ex
Loads remote enclave using sgx_create_enclave_from_buffer_ex
sgx_create_enclave: success
Segmentation fault (core dumped)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 13:15:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Ecall-invocation-from-a-remote-enclave-fails/m-p/1410679#M5451</guid>
      <dc:creator>Daniel_ˢᵍˣ</dc:creator>
      <dc:date>2022-08-25T13:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: Ecall invocation from a remote enclave fails</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Ecall-invocation-from-a-remote-enclave-fails/m-p/1412270#M5456</link>
      <description>&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Finally got it working.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Library generates &lt;EM&gt;enclave.signed.so&lt;/EM&gt; and &lt;EM&gt;untrusted.so&lt;/EM&gt;. Then application creates enclave from &lt;EM&gt;enclave.signed.so&lt;/EM&gt; and loads &lt;EM&gt;untrusted.so&lt;/EM&gt; using dlopen.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;I wasn't generating untrusted code and passing it to the app which was causing the problem. I usually don't do this when I have no ocalls but in this case it won't work without it.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;I've also updated the repository with the example I posted above, in case someone else needs it, since there is no other code using &lt;FONT face="courier new,courier" class="sub_section_element_selectors"&gt;&lt;SPAN class="sub_section_element_selectors"&gt;sgx_create_enclave_from_buffer_ex&lt;/SPAN&gt;&lt;/FONT&gt; at the moment as far as I could find.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2022 21:31:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Ecall-invocation-from-a-remote-enclave-fails/m-p/1412270#M5456</guid>
      <dc:creator>Daniel_ˢᵍˣ</dc:creator>
      <dc:date>2022-09-01T21:31:13Z</dc:date>
    </item>
  </channel>
</rss>

