<?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: sgx-pytorch remote attestation failed due to msg3 type not matched in Intel® Software Guard Extensions (Intel® SGX)</title>
    <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/sgx-pytorch-remote-attestation-failed-due-to-msg3-type-not/m-p/1513098#M5850</link>
    <description>&lt;P&gt;Hello Ken,&lt;/P&gt;&lt;P&gt;Thanks for the reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A couple of things to know &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. As mentioned, TCB is out of date. Does that mean we need to update the firmware of SGX from BIOS? Is there any way I can do it remotely?&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. If I build dkeycache and dkeyserver in simulation mode, will the below command work in SGX PyTorch?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;model = secure_mkldnn.to_secure_mkldnn(model)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. I'll check out Gramaine. Thank you for the suggestion. I have a quick question: can Gramaine be used for SGX Pytorch scenarios?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mubashwir&lt;/P&gt;</description>
    <pubDate>Fri, 11 Aug 2023 02:53:44 GMT</pubDate>
    <dc:creator>mubashwir</dc:creator>
    <dc:date>2023-08-11T02:53:44Z</dc:date>
    <item>
      <title>sgx-pytorch remote attestation failed due to msg3 type not matched</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/sgx-pytorch-remote-attestation-failed-due-to-msg3-type-not/m-p/1510289#M5828</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;I am trying to run SGX-Pytorch.&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/intel/sgx-pytorch/tree/sgx" target="_blank" rel="nofollow noopener noreferrer"&gt;https://github.com/intel/sgx-pytorch/tree/sgx&lt;/A&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I successfully followed&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/intel/sgx-pytorch/tree/sgx/enclave_ops" target="_blank" rel="nofollow noopener noreferrer"&gt;enclaves_op&lt;/A&gt;'s instructions for setting up the environment. Prior to running a secure model in SGX, it is necessary to run "dkeycache" and perform remote attestation through "dkeyserver". However, I encountered an error during remote attestation where it indicated that msg3 was not matching.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Please note that the default remote attestation provided by SGX SDK works perfectly, and msg 3 was also successfully verified there.&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;But for SGX-Pytorch, RA is not working.&lt;/P&gt;&lt;P&gt;Here are the logs:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;dhar@SGX-server:~/temp/sgx-pytorch/enclave_ops/deployment/bin/dkeycache$ sudo ./dkeycache 
Connect dkeyserver success!
Call sgx_ra_get_msg1_ex success, the MSG1 body generated.
Sending MSG1 to remote attestation service provider, and expecting MSG2 back...
MSG2 recieved success!
Call sgx_ra_proc_msg2_ex success.
Sending MSG3 to remote attestation service provider,expecting attestation result msg back...
Error, the attestaion MSG's type is not matched!

Call enclave_ra_close success.
Failed(-1) to setup the secure channel.
failed to initialize the dkeycache service.
dkeycache service is ON...



dhar@SGX-server:~/temp/sgx-pytorch/enclave_ops/deployment/bin/dkeyserver$ sudo ./dkeyserver 
Waiting for incoming connections...
New Client(4) connected! IP=127.0.0.1
receive the msg type(1) from client.
Dispatching TYPE_RA_MSG1, body size: 68
send response success with msg type(2)
receive the msg type(3) from client.
Dispatching TYPE_RA_MSG3, body size: 4936
cert_key_type = 0x5
    Error: sgx_qv_get_quote_supplemental_data_size failed: 0x0000
    Info: App: sgx_qv_verify_quote successfully returned.
    Info: App: Verification quote_verification_result=0xa003
verify result is not expected (0xa003)
failed(-1) to handle msg type(3)
send response success with msg type(3)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;P&gt;I would greatly appreciate any assistance.&lt;/P&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 02 Aug 2023 01:19:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/sgx-pytorch-remote-attestation-failed-due-to-msg3-type-not/m-p/1510289#M5828</guid>
      <dc:creator>mubashwir</dc:creator>
      <dc:date>2023-08-02T01:19:05Z</dc:date>
    </item>
    <item>
      <title>Re:sgx-pytorch remote attestation failed due to msg3 type not matched</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/sgx-pytorch-remote-attestation-failed-due-to-msg3-type-not/m-p/1510665#M5831</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;Hello Mubashwir,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;Thanks for reaching out to us.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;Let me check with relevant team and I'll update here at the earliest.&lt;/SPAN&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;SPAN style="font-size: 16px;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;Wan&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Aug 2023 01:42:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/sgx-pytorch-remote-attestation-failed-due-to-msg3-type-not/m-p/1510665#M5831</guid>
      <dc:creator>Wan_Intel</dc:creator>
      <dc:date>2023-08-03T01:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: Re:sgx-pytorch remote attestation failed due to msg3 type not matched</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/sgx-pytorch-remote-attestation-failed-due-to-msg3-type-not/m-p/1512524#M5844</link>
      <description>&lt;P&gt;Hello Wan,&lt;/P&gt;&lt;P&gt;Do you have any updates from your side? Any help will be appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2023 15:36:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/sgx-pytorch-remote-attestation-failed-due-to-msg3-type-not/m-p/1512524#M5844</guid>
      <dc:creator>mubashwir</dc:creator>
      <dc:date>2023-08-09T15:36:04Z</dc:date>
    </item>
    <item>
      <title>Re:sgx-pytorch remote attestation failed due to msg3 type not matched</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/sgx-pytorch-remote-attestation-failed-due-to-msg3-type-not/m-p/1512645#M5845</link>
      <description>&lt;P&gt;Hi Mubashwir,&lt;/P&gt;&lt;P&gt;Apologies for the delay, we are working with the engineering team to resolve this issue. I will let you know when we have more information.&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;BR /&gt;</description>
      <pubDate>Wed, 09 Aug 2023 20:43:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/sgx-pytorch-remote-attestation-failed-due-to-msg3-type-not/m-p/1512645#M5845</guid>
      <dc:creator>Sahira_Intel</dc:creator>
      <dc:date>2023-08-09T20:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: sgx-pytorch remote attestation failed due to msg3 type not matched</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/sgx-pytorch-remote-attestation-failed-due-to-msg3-type-not/m-p/1512772#M5847</link>
      <description>&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;&lt;SPAN&gt;Hi Mubashwir,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;&lt;SPAN&gt;Thank you for your patience while we are looking into this issue.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;&lt;SPAN&gt;I noticed the "Verification quote_verification_result=0xa003" which means SGX_QL_QV_RESULT_OUT_OF_DATE_CONFIG_NEEDED, as shown &lt;/SPAN&gt;&lt;A style="font-family: sans-serif;" href="https://github.com/intel/SGXDataCenterAttestationPrimitives/blob/e7604e02331b3377f3766ed3653250e03af72d45/QuoteVerification/QvE/Include/sgx_qve_header.h#L51" target="_blank" rel="noopener noreferrer"&gt;here&lt;/A&gt;&lt;SPAN&gt;. The Quote is good but the TCB level of the platform is out of date. This could mean&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;&lt;SPAN&gt;Some part of the SGX TCB is out of date and needs to be updated&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;&lt;SPAN&gt;Some configuration is needed to fully mitigate certain Security Advisories (SAs) on this particular CPU.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;&lt;SPAN&gt;We would recommend to run our DCAP Quote Generation and Quote Verification samples located &lt;/SPAN&gt;&lt;A style="font-family: sans-serif;" href="https://github.com/intel/SGXDataCenterAttestationPrimitives/tree/master/SampleCode" target="_blank" rel="noopener noreferrer"&gt;here&lt;/A&gt;&lt;SPAN&gt;. The quote verifier sample will print out the list of SAs for your reference.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;&lt;SPAN&gt;Furthermore, have you heard of Gramine? We would recommend you to look in Gramine for your PyTorch use cases. Here is the &lt;/SPAN&gt;&lt;A style="font-size: 12px; font-family: sans-serif;" href="https://github.com/gramineproject/examples/tree/master/pytorch" target="_blank" rel="noopener noreferrer"&gt;link&lt;/A&gt;&lt;SPAN&gt; for the repo.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;&lt;SPAN&gt;Let us know if you have any questions. We are happy to assist you.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;&lt;SPAN&gt;Ken&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2023 05:32:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/sgx-pytorch-remote-attestation-failed-due-to-msg3-type-not/m-p/1512772#M5847</guid>
      <dc:creator>KFPW_Intel</dc:creator>
      <dc:date>2023-08-10T05:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: sgx-pytorch remote attestation failed due to msg3 type not matched</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/sgx-pytorch-remote-attestation-failed-due-to-msg3-type-not/m-p/1513098#M5850</link>
      <description>&lt;P&gt;Hello Ken,&lt;/P&gt;&lt;P&gt;Thanks for the reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A couple of things to know &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. As mentioned, TCB is out of date. Does that mean we need to update the firmware of SGX from BIOS? Is there any way I can do it remotely?&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. If I build dkeycache and dkeyserver in simulation mode, will the below command work in SGX PyTorch?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;model = secure_mkldnn.to_secure_mkldnn(model)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. I'll check out Gramaine. Thank you for the suggestion. I have a quick question: can Gramaine be used for SGX Pytorch scenarios?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mubashwir&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2023 02:53:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/sgx-pytorch-remote-attestation-failed-due-to-msg3-type-not/m-p/1513098#M5850</guid>
      <dc:creator>mubashwir</dc:creator>
      <dc:date>2023-08-11T02:53:44Z</dc:date>
    </item>
    <item>
      <title>Re: sgx-pytorch remote attestation failed due to msg3 type not matched</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/sgx-pytorch-remote-attestation-failed-due-to-msg3-type-not/m-p/1513699#M5854</link>
      <description>&lt;P&gt;Hi Mubashwir,&lt;/P&gt;
&lt;P&gt;Well, some part of SGX TCB is out of date and needs to be updated. It could be the BIOS loaded microcode, OS loaded microcode, certain Authenticated Code Modules (ACMs) included in the BIOS, or one of the SGX Architectural Enclaves (Quoting Enclave, Provisioning Certification Enclave). For the BIOS components, you need to make sure you have the latest BIOS on your platform and if is the latest, you may need to request a new one from your OEM.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a reason you are using the SGX+PyTorch repo? Since it's outdated, it's not exactly fully supported anymore, that is why we recommend using Gramine or the PyTorch Curated App. Many customers are using it in production with PyTorch and other workloads, and it is fully supported:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://github.com/gramineproject/examples/tree/master/pytorch" target="_blank"&gt;https://github.com/gramineproject/examples/tree/master/pytorch&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://github.com/gramineproject/contrib/tree/master/Intel-Confidential-Compute-for-X/workloads/pytorch" target="_blank"&gt;https://github.com/gramineproject/contrib/tree/master/Intel-Confidential-Compute-for-X/workloads/pytorch&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sincerely,&lt;/P&gt;
&lt;P&gt;Sahira&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Aug 2023 23:26:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/sgx-pytorch-remote-attestation-failed-due-to-msg3-type-not/m-p/1513699#M5854</guid>
      <dc:creator>Sahira_Intel</dc:creator>
      <dc:date>2023-08-13T23:26:36Z</dc:date>
    </item>
    <item>
      <title>Re:sgx-pytorch remote attestation failed due to msg3 type not matched</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/sgx-pytorch-remote-attestation-failed-due-to-msg3-type-not/m-p/1516110#M5878</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;This thread is now closed and will not be monitored. Please open a new thread if needed.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 21 Aug 2023 15:45:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/sgx-pytorch-remote-attestation-failed-due-to-msg3-type-not/m-p/1516110#M5878</guid>
      <dc:creator>Sahira_Intel</dc:creator>
      <dc:date>2023-08-21T15:45:39Z</dc:date>
    </item>
  </channel>
</rss>

