<?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 EINIT without a token is possible? in Intel® Software Guard Extensions (Intel® SGX)</title>
    <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/EINIT-without-a-token-is-possible/m-p/1619646#M6178</link>
    <description>&lt;P&gt;As title shown, according EINIT document here&lt;BR /&gt;&lt;A href="https://www.felixcloutier.com/x86/einit" target="_blank" rel="noopener"&gt;https://www.felixcloutier.com/x86/einit&lt;/A&gt;&lt;BR /&gt;The token field is mandatory and will fail the check if input token is empty.&lt;/P&gt;&lt;P&gt;However we've tried to call `EINIT` with empty token (actually we are calling `&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;sgx_encl_init` inside `arch/x86/kernel/cpu/sgx/ioctl.c` with empty token, and it actually succeed, so we have following questions&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;1. Is this an expected behavior? that `EINIT` can success with an empty token?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;2. Can we find the source code of EINIT anywhere? We only find this one (&lt;A href="https://insujang.github.io/2017-04-05/intel-sgx-instructions-in-enclave-initialization/" target="_blank" rel="noopener"&gt;https://insujang.github.io/2017-04-05/intel-sgx-instructions-in-enclave-initialization/&lt;/A&gt;), but seems that this should be migrated into linux kernel already, and I cannot find the source code about `EINIT` in linux kernel&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;here is my kernel version&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;6.5.0-1024-azure&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 31 Jul 2024 07:45:16 GMT</pubDate>
    <dc:creator>Jason-Liang</dc:creator>
    <dc:date>2024-07-31T07:45:16Z</dc:date>
    <item>
      <title>EINIT without a token is possible?</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/EINIT-without-a-token-is-possible/m-p/1619646#M6178</link>
      <description>&lt;P&gt;As title shown, according EINIT document here&lt;BR /&gt;&lt;A href="https://www.felixcloutier.com/x86/einit" target="_blank" rel="noopener"&gt;https://www.felixcloutier.com/x86/einit&lt;/A&gt;&lt;BR /&gt;The token field is mandatory and will fail the check if input token is empty.&lt;/P&gt;&lt;P&gt;However we've tried to call `EINIT` with empty token (actually we are calling `&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;sgx_encl_init` inside `arch/x86/kernel/cpu/sgx/ioctl.c` with empty token, and it actually succeed, so we have following questions&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;1. Is this an expected behavior? that `EINIT` can success with an empty token?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;2. Can we find the source code of EINIT anywhere? We only find this one (&lt;A href="https://insujang.github.io/2017-04-05/intel-sgx-instructions-in-enclave-initialization/" target="_blank" rel="noopener"&gt;https://insujang.github.io/2017-04-05/intel-sgx-instructions-in-enclave-initialization/&lt;/A&gt;), but seems that this should be migrated into linux kernel already, and I cannot find the source code about `EINIT` in linux kernel&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;here is my kernel version&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;6.5.0-1024-azure&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 31 Jul 2024 07:45:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/EINIT-without-a-token-is-possible/m-p/1619646#M6178</guid>
      <dc:creator>Jason-Liang</dc:creator>
      <dc:date>2024-07-31T07:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: EINIT without a token is possible?</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/EINIT-without-a-token-is-possible/m-p/1619745#M6179</link>
      <description>&lt;P&gt;Hi Jason.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the operation flow, see step 5... If the token is not valid (null), the instruction just checks that the MRSIGNER of the enclave being launched matches what's in the IA32_SGX_LEPUBKEYHASH MSRs. Those MSRs are used to allow what is called Flexible Launch Control (FLC), allowing any enclave to launch without a token. EINIT tokens are really only ever used on legacy hardware without the FLC feature and using the old, now unsupported out of tree driver &lt;A href="https://github.com/intel/linux-sgx-driver" target="_self"&gt;here&lt;/A&gt;. The upstreamed Linux SGX kernel driver simply writes the MRSIGNER of any enclave wanting to load into the IA32_SGX_LEPUBKEYHASH MSRs as shown &lt;A href="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/x86/kernel/cpu/sgx/main.c?h=v6.11-rc1#n854" target="_self"&gt;here&lt;/A&gt;, thereby allowing any enclave to load without an EINT Token.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2024 13:33:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/EINIT-without-a-token-is-possible/m-p/1619745#M6179</guid>
      <dc:creator>Scott_R_Intel</dc:creator>
      <dc:date>2024-07-31T13:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: EINIT without a token is possible?</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/EINIT-without-a-token-is-possible/m-p/1622566#M6184</link>
      <description>&lt;P&gt;Hi Scott&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Thanks for the reply!&lt;BR /&gt;I've got another question related to this FLC&lt;BR /&gt;So from your response, FLC hardware support means that there are some MSRs that can store the hash of enclave's signer pubkey. And latest SGX in-kernel driver will always try to set correct value to MSRs before launching an enclave&lt;BR /&gt;&lt;BR /&gt;I have following questions&lt;BR /&gt;&lt;BR /&gt;1. Then why DCAP requires FLC support? Is it just because the in-kernel DCAP driver will always try to set correct value to MSRs? Not actually due to any verification mechanism inside DCAP?&lt;BR /&gt;2. Then if FLC is disabled, it means that we cannot use in-kernel SGX support?&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2024 03:39:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/EINIT-without-a-token-is-possible/m-p/1622566#M6184</guid>
      <dc:creator>Jason-Liang</dc:creator>
      <dc:date>2024-08-12T03:39:19Z</dc:date>
    </item>
    <item>
      <title>Re: EINIT without a token is possible?</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/EINIT-without-a-token-is-possible/m-p/1622685#M6185</link>
      <description>&lt;P&gt;Hello again Jason.&lt;/P&gt;&lt;P&gt;Answers below:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Basically, yes.&amp;nbsp; The requirement to allow any enclave to load via FLC without using Intel's Launch Policy List was a requirement of the Linux kernel community.&amp;nbsp; And yes, because the in-kernel driver always tries to set these MSRs, you are required to have the FLC feature or the driver will fail to load.&lt;/LI&gt;&lt;LI&gt;That is correct.&amp;nbsp; FLC is a requirement to load the upstreamed in-kernel driver.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2024 13:09:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/EINIT-without-a-token-is-possible/m-p/1622685#M6185</guid>
      <dc:creator>Scott_R_Intel</dc:creator>
      <dc:date>2024-08-12T13:09:24Z</dc:date>
    </item>
    <item>
      <title>Re: EINIT without a token is possible?</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/EINIT-without-a-token-is-possible/m-p/1622713#M6186</link>
      <description>&lt;P&gt;Hi Scott,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Thanks for the answer, no more question from my side&lt;BR /&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2024 14:31:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/EINIT-without-a-token-is-possible/m-p/1622713#M6186</guid>
      <dc:creator>Jason-Liang</dc:creator>
      <dc:date>2024-08-12T14:31:13Z</dc:date>
    </item>
  </channel>
</rss>

