<?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 Demonstrating memory protection in Intel® Software Guard Extensions (Intel® SGX)</title>
    <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Demonstrating-memory-protection/m-p/1191650#M3809</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I was trying to understand the memory protections available for SGX. While it is theoretically clear, I am unable to validate this using a simple example.&amp;nbsp;My goal was to embed a string inside the enclave and ensure that the string is not visible in a process dump. But it seems that the string and any operations done on it are completely visible in the process dump on the Windows platform.&lt;/P&gt;
&lt;P&gt;I read in a post on this forum that this is expected in Debug mode - but the memory protections are enabled in Pre-Release mode (&lt;A href="https://community.intel.com/t5/Intel-Software-Guard-Extensions/Is-not-memory-protection-in-debug-mode/td-p/1152059" target="_blank"&gt;https://community.intel.com/t5/Intel-Software-Guard-Extensions/Is-not-memory-protection-in-debug-mode/td-p/1152059&lt;/A&gt;). I have tried both, but the result is the same for both times. I've done my experiments by modifying the standard ConsoleApp example.&lt;/P&gt;
&lt;P&gt;Is there something I am missing in the settings or is this not possible compiling in Release mode, i.e. without the Intel Commercial Agreement?&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;SJ&lt;/P&gt;</description>
    <pubDate>Sat, 11 Jul 2020 21:03:11 GMT</pubDate>
    <dc:creator>sj</dc:creator>
    <dc:date>2020-07-11T21:03:11Z</dc:date>
    <item>
      <title>Demonstrating memory protection</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Demonstrating-memory-protection/m-p/1191650#M3809</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I was trying to understand the memory protections available for SGX. While it is theoretically clear, I am unable to validate this using a simple example.&amp;nbsp;My goal was to embed a string inside the enclave and ensure that the string is not visible in a process dump. But it seems that the string and any operations done on it are completely visible in the process dump on the Windows platform.&lt;/P&gt;
&lt;P&gt;I read in a post on this forum that this is expected in Debug mode - but the memory protections are enabled in Pre-Release mode (&lt;A href="https://community.intel.com/t5/Intel-Software-Guard-Extensions/Is-not-memory-protection-in-debug-mode/td-p/1152059" target="_blank"&gt;https://community.intel.com/t5/Intel-Software-Guard-Extensions/Is-not-memory-protection-in-debug-mode/td-p/1152059&lt;/A&gt;). I have tried both, but the result is the same for both times. I've done my experiments by modifying the standard ConsoleApp example.&lt;/P&gt;
&lt;P&gt;Is there something I am missing in the settings or is this not possible compiling in Release mode, i.e. without the Intel Commercial Agreement?&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;SJ&lt;/P&gt;</description>
      <pubDate>Sat, 11 Jul 2020 21:03:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Demonstrating-memory-protection/m-p/1191650#M3809</guid>
      <dc:creator>sj</dc:creator>
      <dc:date>2020-07-11T21:03:11Z</dc:date>
    </item>
    <item>
      <title>Re:Demonstrating memory protection</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Demonstrating-memory-protection/m-p/1191962#M3813</link>
      <description>&lt;P&gt;Hello SJ,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;It is strange that you can see the contents of the enclave using a process dump since this is possible only in Simulation Mode. A debugger or other software must use the CPU instructions EDBGRD to read from a debug enclave and EDBGWR to write to a debug enclave. The SGX Debugger implements these instructions to see into enclaves.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Read this page, &lt;A href="https://software.intel.com/content/www/us/en/develop/blogs/intel-sgx-debug-production-prelease-whats-the-difference.html" target="_blank"&gt;https://software.intel.com/content/www/us/en/develop/blogs/intel-sgx-debug-production-prelease-whats-the-difference.html&lt;/A&gt;, for more info on the differences between the different compilation modes.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 13 Jul 2020 17:39:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Demonstrating-memory-protection/m-p/1191962#M3813</guid>
      <dc:creator>JesusG_Intel</dc:creator>
      <dc:date>2020-07-13T17:39:07Z</dc:date>
    </item>
    <item>
      <title>Re: Re:Demonstrating memory protection</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Demonstrating-memory-protection/m-p/1192248#M3815</link>
      <description>&lt;P&gt;Hello Jesus,&lt;/P&gt;
&lt;P&gt;This is quite strange - I'd have expected different behavior. I have verified all the settings on my machine. The machine definitely supports SGX, it is enabled and I am linking against the regular SGX libraries (non sim variants).&lt;/P&gt;
&lt;P&gt;Any ideas on how this can be debugged? Am I missing something or is something configured incorrectly. This is quite essential because all future work would depend on the proper usage of SGX.&lt;/P&gt;
&lt;P&gt;I am attaching the VS2017 project I am referring to that should show all my build settings. The CPUID command output is posted below. I have also created a small video that shows the steps I have taken and exactly what I am seeing in the memory dump.&lt;/P&gt;
&lt;P&gt;I am basically embedding a secret string in the enclave. Within the enclave, I am doing the operation of reversing the last few characters of the string. Both the original and processed strings are visible in the memory dump.&lt;/P&gt;
&lt;P&gt;Thanks for your help&lt;/P&gt;
&lt;P&gt;-Shalabh&lt;/P&gt;
&lt;P&gt;Project: Attached&lt;/P&gt;
&lt;P&gt;Video Description:&amp;nbsp;&lt;A href="https://youtu.be/XYZmo7IpazE" target="_blank"&gt;https://youtu.be/XYZmo7IpazE&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;CPUID dump&lt;/P&gt;
&lt;P&gt;0 EAX(0016) EBX(756e6547) ECX(6c65746e) EDX(49656e69)&lt;BR /&gt;1 EAX(406e3) EBX(2100800) ECX(7ffafbff) EDX(bfebfbff)&lt;BR /&gt;2 EAX(76036301) EBX(f0b5ff) ECX(0000) EDX(c30000)&lt;BR /&gt;3 EAX(0000) EBX(0000) ECX(0000) EDX(0000)&lt;BR /&gt;4 EAX(1c004121) EBX(1c0003f) ECX(003f) EDX(0000)&lt;BR /&gt;5 EAX(0040) EBX(0040) ECX(0003) EDX(11142120)&lt;BR /&gt;6 EAX(27f7) EBX(0002) ECX(0009) EDX(0000)&lt;BR /&gt;7 EAX(0000) EBX(29c6fbf) ECX(0000) EDX(9c002400)&lt;BR /&gt;8 EAX(0000) EBX(0000) ECX(0000) EDX(0000)&lt;BR /&gt;9 EAX(0000) EBX(0000) ECX(0000) EDX(0000)&lt;BR /&gt;10 EAX(7300404) EBX(0000) ECX(0000) EDX(0603)&lt;BR /&gt;11 EAX(0001) EBX(0002) ECX(0100) EDX(0003)&lt;BR /&gt;12 EAX(0000) EBX(0000) ECX(0000) EDX(0000)&lt;BR /&gt;13 EAX(001f) EBX(0440) ECX(0440) EDX(0000)&lt;BR /&gt;14 EAX(0000) EBX(0000) ECX(0000) EDX(0000)&lt;BR /&gt;15 EAX(0000) EBX(0000) ECX(0000) EDX(0000)&lt;BR /&gt;16 EAX(0000) EBX(0000) ECX(0000) EDX(0000)&lt;BR /&gt;17 EAX(0000) EBX(0000) ECX(0000) EDX(0000)&lt;BR /&gt;18 EAX(0001) EBX(0000) ECX(0000) EDX(241f)&lt;BR /&gt;19 EAX(0000) EBX(0000) ECX(0000) EDX(0000)&lt;BR /&gt;20 EAX(0001) EBX(000f) ECX(0007) EDX(0000)&lt;BR /&gt;21 EAX(0002) EBX(00d0) ECX(0000) EDX(0000)&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2020 15:31:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Demonstrating-memory-protection/m-p/1192248#M3815</guid>
      <dc:creator>sj</dc:creator>
      <dc:date>2020-07-14T15:31:27Z</dc:date>
    </item>
    <item>
      <title>Re:Demonstrating memory protection</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Demonstrating-memory-protection/m-p/1193068#M3823</link>
      <description>&lt;P&gt;Hi SJ,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;We are investigating your issue. Please stay tuned.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 16 Jul 2020 21:10:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Demonstrating-memory-protection/m-p/1193068#M3823</guid>
      <dc:creator>JesusG_Intel</dc:creator>
      <dc:date>2020-07-16T21:10:25Z</dc:date>
    </item>
    <item>
      <title>Re:Demonstrating memory protection</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Demonstrating-memory-protection/m-p/1193096#M3824</link>
      <description>&lt;P&gt;Hello SJ,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;It took me a while but I finally found the answer: &lt;A href="https://community.intel.com/t5/Intel-Software-Guard-Extensions/ENCLAVE-DATA-STORAGE/m-p/1133763/highlight/true#M1971" target="_blank"&gt;https://community.intel.com/t5/Intel-Software-Guard-Extensions/ENCLAVE-DATA-STORAGE/m-p/1133763/highlight/true#M1971&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Basically, "&lt;SPAN style="font-size: 12px; font-family: intel-clear, tahoma, Helvetica, helvetica, Arial, sans-serif;"&gt;any variables initialized at compile time will be in the clear in the enclave binary, as that is not encrypted in any way."&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 16 Jul 2020 23:26:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Demonstrating-memory-protection/m-p/1193096#M3824</guid>
      <dc:creator>JesusG_Intel</dc:creator>
      <dc:date>2020-07-16T23:26:46Z</dc:date>
    </item>
    <item>
      <title>Re:Demonstrating memory protection</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Demonstrating-memory-protection/m-p/1193103#M3825</link>
      <description>&lt;P&gt;SJ,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;There is more information on this in the Intel SGX Developer Reference for Windows. The section "Enabling Enclave Code Confidentiality" states that:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;"Intel® SGX provides integrity of code and confidentiality and integrity of data at run-time. However, it does NOT provide confidentiality of code offline as a binary file on disk."&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;The solution, if you must use a global variable with secret data, is to encrypt the enclave DLL at build time then decrypt it at enclave load time using the Intel SGX Protected Code Loader.&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 16 Jul 2020 23:53:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Demonstrating-memory-protection/m-p/1193103#M3825</guid>
      <dc:creator>JesusG_Intel</dc:creator>
      <dc:date>2020-07-16T23:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: Re:Demonstrating memory protection</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Demonstrating-memory-protection/m-p/1193215#M3826</link>
      <description>&lt;P&gt;Hello Jesus,&lt;/P&gt;
&lt;P&gt;This is not a matter of checking at rest - its the memory dump computed during execution.&lt;/P&gt;
&lt;P&gt;It is clear that to encrypt the secrets at rest we need to use PCL or something similar - but the problem I am raising is that the runtime memory is visible. This means that any operation done on static variables (e.g. reversing it in the video I uploaded) is also visible. This is not the expected behaviour. This is basically indicative of no runtime protections.&lt;/P&gt;
&lt;P&gt;Please have a look at the video I uploaded.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2020 09:47:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Demonstrating-memory-protection/m-p/1193215#M3826</guid>
      <dc:creator>sj</dc:creator>
      <dc:date>2020-07-17T09:47:35Z</dc:date>
    </item>
    <item>
      <title>Re:Demonstrating memory protection</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Demonstrating-memory-protection/m-p/1193325#M3827</link>
      <description>&lt;P&gt;You are correct, SJ. I confused code at rest on disk with code in memory.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;We are investigating your issue further and will respond to you as soon as I have an answer.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 17 Jul 2020 18:17:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Demonstrating-memory-protection/m-p/1193325#M3827</guid>
      <dc:creator>JesusG_Intel</dc:creator>
      <dc:date>2020-07-17T18:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: Re:Demonstrating memory protection</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Demonstrating-memory-protection/m-p/1193332#M3828</link>
      <description>&lt;P&gt;Thank you Jesus. I appreciate the efforts.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2020 18:53:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Demonstrating-memory-protection/m-p/1193332#M3828</guid>
      <dc:creator>sj</dc:creator>
      <dc:date>2020-07-17T18:53:17Z</dc:date>
    </item>
    <item>
      <title>Re:Demonstrating memory protection</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Demonstrating-memory-protection/m-p/1193350#M3829</link>
      <description>&lt;P&gt;&lt;STRONG&gt;This thread has been marked as answered and Intel will no longer monitor this thread. If you want a response from Intel in a follow-up question, please open a new thread.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Hello SJ,&lt;/P&gt;
&lt;P&gt;This is indeed expected behavior in Windows 10. This paper, &lt;A href="https://silo.tips/download/intel-sgx-enclave-support-in-windows-10-fall-update-threshold-2" target="_blank" rel="noopener"&gt;https://silo.tips/download/intel-sgx-enclave-support-in-windows-10-fall-update-threshold-2&lt;/A&gt;, explains it in the section "Debugging Enclaves."&lt;/P&gt;
&lt;P&gt;Basically, Microsoft owns the SGX driver for Windows and in Windows 10 they implemented their memory readers -- such as WinDBG, and other processes that read memory -- to recognize when they are reading into an Enclave. So, Microsoft is calling the functions I listed above, EDBGRD and EDBGWR, to see inside the Enclave.&lt;/P&gt;
&lt;P&gt;This only happens for non-Release/non-Production enclaves. In a full production enclave, the EDBGRD and EDBGWR instructions will not work so a process dump from Windows will not reveal what is inside the enclave.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 18:15:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Demonstrating-memory-protection/m-p/1193350#M3829</guid>
      <dc:creator>JesusG_Intel</dc:creator>
      <dc:date>2020-07-23T18:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: Demonstrating memory protection</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Demonstrating-memory-protection/m-p/1222782#M4059</link>
      <description>&lt;P&gt;Have you applied for the SGX commercial license? The Release model seems to require a commercial license&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2020 08:44:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Demonstrating-memory-protection/m-p/1222782#M4059</guid>
      <dc:creator>Ray1</dc:creator>
      <dc:date>2020-10-26T08:44:26Z</dc:date>
    </item>
  </channel>
</rss>

