JP2019109910A - Processor - Google Patents

Processor Download PDF

Info

Publication number
JP2019109910A
JP2019109910A JP2019020537A JP2019020537A JP2019109910A JP 2019109910 A JP2019109910 A JP 2019109910A JP 2019020537 A JP2019020537 A JP 2019020537A JP 2019020537 A JP2019020537 A JP 2019020537A JP 2019109910 A JP2019109910 A JP 2019109910A
Authority
JP
Japan
Prior art keywords
enclave
key
page
epc
instruction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2019020537A
Other languages
Japanese (ja)
Other versions
JP6777288B2 (en
Inventor
エックス. マッケーン、フランシス
X Mckeen Francis
エックス. マッケーン、フランシス
ブイ. ロザス、カルロス
V Rozas Carlos
ブイ. ロザス、カルロス
アール. サヴァガンカー、ウダイ
R Savagankar Uday
アール. サヴァガンカー、ウダイ
ピー. ジョンソン、シモン
P Johnson Simon
ピー. ジョンソン、シモン
アール. スカーラタ、ヴィンセント
R Scarlata Vincent
アール. スカーラタ、ヴィンセント
エー. ゴールドスミス、マイケル
A Goldsmith Michael
エー. ゴールドスミス、マイケル
ブリッケル、アーニー
Brickell Ernie
リ、ジャンタオ
Jiangtao Li
シー. ハーバート、ホワード
C Herbert Howard
シー. ハーバート、ホワード
デワン、プラシャント
Dewan Prashant
ジェイ. トロポカ、ステファン
J Tolopka Stephen
ジェイ. トロポカ、ステファン
ネイガー、ギルバート
Gilbert Neiger
ダーハム、デーヴィッド
Durham David
ゲラウンケ、ゲアリー
Graunke Gary
リント、バーナード
Lint Bernard
ダイケ、ドン エー. ヴァン
A Van Dyke Don
ダイケ、ドン エー. ヴァン
チフラ、ジョセフ
Cihula Joseph
ジェヤシング、スタリンセルヴァラジ
Jeyasingh Stalinselvaraj
ドレン、ステファン アール. ヴァン
R Van Doren Stephen
ドレン、ステファン アール. ヴァン
ロジャース、ディオン
Rodgers Dion
ガーネイ、ジョン
Garney John
アルトマン、アシャー
Altman Asher
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Intel Corp
Original Assignee
Intel Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Intel Corp filed Critical Intel Corp
Priority to JP2019020537A priority Critical patent/JP6777288B2/en
Publication of JP2019109910A publication Critical patent/JP2019109910A/en
Application granted granted Critical
Publication of JP6777288B2 publication Critical patent/JP6777288B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Storage Device Security (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

To make it possible to obtain secure application and consistency of data in a computer system.SOLUTION: In a microprocessor 100, each of processor cores 105, 110 has a logic 119 for carrying out a secured enclave technique. Resources are effectively allocated between a plurality of cores or processors, thereby one or more secured enclaves which can store and carry out an application or data is established.SELECTED DRAWING: Figure 1

Description

本発明の実施形態は概して、情報処理分野に係り、より詳しくは、コンピューティングシステムおよびマイクロプロセッサのセキュリティ分野に係る。   Embodiments of the present invention generally relate to the field of information processing, and more particularly to the field of security of computing systems and microprocessors.

コンピュータシステム内におけるアプリケーションおよびそのデータの間の実行および整合性を確保することは、益々重要になってきている。先行技術におけるセキュリティ技術では、セキュアなアプリケーションおよびデータを柔軟に且つ信頼性高く適切に提供することができない。   Ensuring the execution and integrity between applications and their data within computer systems is becoming increasingly important. Security techniques in the prior art do not provide flexible, reliable and appropriate provision of secure applications and data.

本発明の実施形態は、添付図面において限定ではなく例示として示されており、図面において同様の参照番号を付された部材同士は同様の部材である。   Embodiments of the present invention are illustrated by way of example and not limitation in the accompanying drawings, in which like reference numbers refer to like parts in each other.

本発明の少なくとも1つの実施形態を利用することができるマイクロプロセッサのブロック図である。FIG. 1 is a block diagram of a microprocessor that can utilize at least one embodiment of the present invention. 本発明の少なくとも1つの実施形態を利用することができる共有バスコンピュータシステムのブロック図である。FIG. 5 is a block diagram of a shared bus computer system that can utilize at least one embodiment of the present invention. 本発明の少なくとも1つの実施形態を利用することができるポイントツーポイントインターコネクトコンピュータシステムのブロック図である。FIG. 1 is a block diagram of a point-to-point interconnect computer system that can utilize at least one embodiment of the present invention. 本発明の少なくとも1つの実施形態を利用することができるマルチコアマイクロプロセッサのブロック図である。FIG. 1 is a block diagram of a multi-core microprocessor that can utilize at least one embodiment of the present invention. 本発明の一実施形態のセキュアなエンクレーブ(SE)の可能性のある実装例である。FIG. 7 is a possible implementation of a secure enclave (SE) of an embodiment of the present invention. 本発明の少なくとも1つの実施形態を利用することができるマイクロプロセッサのブロック図である。FIG. 1 is a block diagram of a microprocessor that can utilize at least one embodiment of the present invention. 本発明の一実施形態に実装可能なエンクレーブページキャッシュの一部分にアクセスする制御構造の一例を示す。FIG. 6 illustrates an example of a control structure for accessing a portion of an enclave page cache that can be implemented in an embodiment of the present invention. 本発明の一実施形態におけるスレッド制御構造の一例を示しており、データ構造同士の縫合を示す。Fig. 6 shows an example of a thread control structure in an embodiment of the present invention, showing the stitching of data structures; 本発明の一実施形態にみることができる、クオーティングとして知られているソフトウェア認証プロセスの一ステップを示す。Fig. 5 illustrates one step of a software authentication process known as Quoting, which can be found in an embodiment of the present invention. 本発明の一実施形態における、計測値レジスタセットからクオートを生成するための各ステップを示す。Fig. 6 illustrates the steps for generating quotes from the measurement value register set, in an embodiment of the present invention. 本発明の一実施形態における計測値レジスタMR_EADDを更新するEADDプロセスを示す。Fig. 6 shows an EADD process for updating the measurement value register MR_EADD in an embodiment of the present invention. 本発明の一実施形態におけるレポートを生成するEREPORT命令を示す。7 illustrates an EREPORT instruction that generates a report in one embodiment of the present invention. 本発明の一実施形態に見られる中継保護メカニズムを示す。Fig. 6 illustrates a relay protection mechanism found in an embodiment of the present invention. 本発明の一実施形態に見られる中継保護メカニズムのMACツリー構造の部分の一例を示す。FIG. 7 illustrates an example of a portion of a MAC tree structure of a relay protection mechanism found in an embodiment of the present invention. ページ不良エラーコードマップの実装法を示す本発明の一実施形態を示す。7 illustrates an embodiment of the invention showing the implementation of a page fault error code map. 本発明の一実施形態のエンクレーブを立ち上げる許可証を生成するプロセスの一例を示す。FIG. 7 illustrates an example of a process of generating a permit to launch an enclave of an embodiment of the present invention. 本発明の一実施形態における、単一のパッケージのセキュアなエンクレーブのためのプラットフォームキー階層の実装例を示す。FIG. 16 illustrates an example implementation of a platform key hierarchy for secure enclave of a single package in an embodiment of the present invention. 本発明の一実施形態における、マイクロコードベースのセキュアなエンクレーブキー階層の一例を示す。FIG. 7 illustrates an example of a microcode based secure enclave key hierarchy in an embodiment of the present invention. 本発明の一実施形態にみることができるエンクレーブCTL_MSRレジスタを示す。Fig. 7 illustrates an enclave CTL MSR register that can be found in an embodiment of the present invention. 本発明の一実施形態で利用される暗号ブロック鎖アルゴリズムを示す。Fig. 6 illustrates a cipher block chain algorithm utilized in one embodiment of the present invention. 本発明の一実施形態における単一のAESブロックの暗号を示すフローチャートである。FIG. 6 is a flow chart illustrating the encryption of a single AES block in one embodiment of the present invention. 本発明の一実施形態で実装される暗号ブロック鎖アルゴリズムを利用する複数のAESブロックの暗号例を示すフローチャートである。FIG. 6 is a flow chart illustrating an example of encryption of a plurality of AES blocks utilizing a cipher block chain algorithm implemented in an embodiment of the present invention. スタックスイッチで割り込んだ後のアプリケーションおよび割り込みスタックの一実施形態を示す。FIG. 7 illustrates one embodiment of an application and interrupt stack after being interrupted by a stack switch. 本発明の一実施形態の複数の状態セーブ領域スロットのスタックを実装する方法の一例を示す。FIG. 7 illustrates an example of a method of implementing a stack of state save area slots according to an embodiment of the invention. 本発明の一実施形態における割り込み、不良、およびトラップの状態遷移を有する状態マシンの一部を示す。FIG. 7 illustrates a portion of a state machine having interrupt, fault, and trap state transitions in one embodiment of the present invention. 本発明の一実施形態における、デジタル乱数生成器のためのプロセッサパッケージを示す。2 illustrates a processor package for a digital random number generator in one embodiment of the present invention. 本発明の一実施形態におけるデバッグレジスタDR7 2700を示す。7 illustrates a debug register DR7 2700 in one embodiment of the present invention.

本発明の実施形態は、セキュアなアプリケーションおよびデータを柔軟に且つ信頼性高く提供する技術に係る。本発明には複数の態様の複数の実施形態があるが、「セキュアなエンクレーブアーキテクチャ」なる添付書類を、少なくとも1つの実施形態としてここに参照として組み込む。しかし、組み込まれた文献は、本発明の実施形態の範囲を制限するものではなく、本発明の精神および範囲内で他の実施形態も利用可能である。ここで、実施形態に係る発明の一例を記載する。
[項目1]
保護データにアクセスする、プログラムの実行中に、保護データを、エンクレーブページキャッシュ(EPC)とシステムメモリとの間で移動させる第1の命令を少なくとも実行する実行論理と、
トランスレーション・ルックアサイド・バッファ(TLB)と、
を備え、
TLBは、TLB中の少なくとも1つのエントリがエンクレーブ用であることを示す少なくとも1つのビットを含む、
プロセッサ。
[項目2]
プログラムがハードディスクドライブまたは保護メモリに格納されているときに、セキュリティマップ(SMAP)がプログラムの整合性の確保を助けるために使用される、
項目1に記載のプロセッサ。
[項目3]
実行論理は、セキュアなエンクレーブで実行されているソフトウェアスレッドを識別する、ユーザのプログラムにソフトウェアスレッドの実体を知らせる第2の命令を少なくとも実行する、
項目1又は2に記載のプロセッサ。
[項目4]
実行論理は、セキュアなエンクレーブに格納されているデータの整合性を判断するべく、セキュアなマップ(SMAP)フィールドとセキュリティ情報(SEC_INFO)フィールドとを含む少なくとも1つの情報フィールドに動的にアクセスする第2の命令を少なくとも実行する、
項目1から3のいずれか1項に記載のプロセッサ。
[項目5]
実行論理は、メモリに格納されているセキュアなエンクレーブの状態を、ローカルエージェントまたは遠隔エージェントのいずれかに報告する第2の命令を少なくとも実行する、
項目1から4のいずれか1項に記載のプロセッサ。
[項目6]
ソフトウェアプログラムの実行中に、ソフトウェアプログラムを攻撃から保護するクリプト・メモリ・アパーチャ(CMA)と、
ソフトウェアプログラムが実行していない間にソフトウェアプログラムを保護するセキュアなマップ(SMAP)と
を更に備える項目1から5のいずれか1項に記載のプロセッサ。
[項目7]
実行論理は、セキュアなエンクレーブ内の対応するメモリまたはソフトウェアスレッドの割り当てまたは割り当て解除をする少なくとも1つのセキュアなエンクレーブアクセス命令を実行する、
項目1から6のいずれか1項に記載のプロセッサ。
[項目8]
単一のプロセッササイクルにおいてセキュアなエンクレーブ内で複数のメモリ更新を行わせる階層保護ツリー、SMAPを更に備える、
項目1から7のいずれか1項に記載のプロセッサ。
[項目9]
実行論理は、セキュアなエンクレーブに固有キーを提供する第2の命令を少なくとも実行する、
項目1から8のいずれか1項に記載のプロセッサ。
[項目10]
実行論理は、アントラステッド・エージェントが管理するトラステッド環境を構築する第2の命令を少なくとも実行する、
項目1から9のいずれか1項に記載のプロセッサ。
[項目11]
実行論理は、セキュアなエンクレーブにアクセスするためのライセンスの有効性を、エンクレーブのサイズをライセンス証明書が規定するサイズと比較して判断する第2の命令を少なくとも実行する、
項目1から10のいずれか1項に記載のプロセッサ。
[項目12]
実行論理は、セキュアなエンクレーブのユーザレベルのポリシー管理を行い、制御ビットにより制御される、
項目1から11のいずれか1項に記載のプロセッサ。
[項目13]
実行論理は、ユーザに対してライセンス許諾されるセキュアなエンクレーブの少なくとも1つのインスタンスに対するアクセスを許可する第2の命令を少なくとも実行する、
項目1から12のいずれか1項に記載のプロセッサ。
[項目14]
実行論理は、セキュアなエンクレーブのデバッグを行わせる、デバッグを許可されたエンクレーブのみのエンクレーブセキュリティを侵害する第2の命令を少なくとも実行する、
項目1から13のいずれか1項に記載のプロセッサ。
[項目15]
それぞれエンクレーブページキャッシュ(EPC)に対してメモリページの割り当てまたは割り当て解除を行う少なくとも1つの命令を実行する実行論理と、
トランスレーション・ルックアサイド・バッファ(TLB)と、
を備え、
TLBは、TLB中の少なくとも1つのエントリがエンクレーブ用であることを示す少なくとも1つのビットを含む、
プロセッサ。
Embodiments of the present invention relate to techniques for flexibly and reliably providing secure applications and data. While the present invention has multiple embodiments of aspects, the "Secure Enclave Architecture" appendix is incorporated herein by reference as at least one embodiment. However, the incorporated documents do not limit the scope of the embodiments of the present invention, and other embodiments are also available within the spirit and scope of the present invention. Here, an example of the invention concerning an embodiment is described.
[Item 1]
Execution logic for accessing protected data, at least executing a first instruction to move the protected data between the enclave page cache (EPC) and the system memory during execution of the program;
Translation Lookaside Buffer (TLB),
Equipped with
The TLB includes at least one bit indicating that at least one entry in the TLB is for enclave.
Processor.
[Item 2]
A Security Map (SMAP) is used to help ensure program integrity when the program is stored on a hard disk drive or protected memory,
The processor according to item 1.
[Item 3]
The execution logic executes at least a second instruction that informs the user's program of the entity of the software thread, which identifies the software thread being executed in the secure enclave.
The processor according to item 1 or 2.
[Item 4]
The execution logic dynamically accesses at least one information field including a secure map (SMAP) field and a security information (SEC_INFO) field to determine the integrity of data stored in the secure enclave. Execute at least 2 instructions,
The processor according to any one of Items 1 to 3.
[Item 5]
The execution logic executes at least a second instruction to report the state of the secure enclave stored in the memory to either the local agent or the remote agent.
The processor according to any one of Items 1 to 4.
[Item 6]
A crypto memory aperture (CMA) that protects the software program from attack while the software program is running;
The processor according to any one of the preceding claims, further comprising: a secure map (SMAP) protecting the software program while the software program is not running.
[Item 7]
The execution logic executes at least one secure enclave access instruction that allocates or deallocates the corresponding memory or software thread in the secure enclave.
The processor according to any one of Items 1 to 6.
[Item 8]
SMAP, a hierarchical protection tree that allows multiple memory updates to be made in a secure enclave in a single processor cycle
The processor according to any one of Items 1 to 7.
[Item 9]
The execution logic executes at least a second instruction that provides the secure enclave with a unique key,
The processor according to any one of items 1 to 8.
[Item 10]
The execution logic executes at least a second instruction to build a trusted environment managed by the untrusted agent,
The processor according to any one of Items 1 to 9.
[Item 11]
The execution logic executes at least a second instruction to determine the validity of the license for accessing the secure enclave by comparing the size of the enclave with the size prescribed by the license certificate.
The processor according to any one of Items 1 to 10.
[Item 12]
Execution logic performs secure enclave user level policy management and is controlled by control bits
The processor according to any one of items 1 to 11.
[Item 13]
The execution logic executes at least a second instruction to grant the user access to at least one instance of the secure enclave licensed.
The processor according to any one of Items 1 to 12.
[Item 14]
The execution logic executes at least a second instruction for enforcing secure enclave debugging that violates enclave-only enclave security for which debugging is permitted.
14. The processor according to any one of items 1 to 13.
[Item 15]
Execution logic that executes at least one instruction to allocate or deallocate memory pages to the enclave page cache (EPC), respectively;
Translation Lookaside Buffer (TLB),
Equipped with
The TLB includes at least one bit indicating that at least one entry in the TLB is for enclave.
Processor.

図1は、本発明の少なくとも1つの実施形態を利用することができるマイクロプロセッサのブロック図である。特に図1は、それぞれがローカルキャッシュ107と113とに関連付けられた1以上のプロセッサコア105および110を有するマイクロプロセッサ100を示す。さらに図1には、ローカルキャッシュ107および113のそれぞれに格納されている情報の少なくとも一部のバージョンを格納する共有キャッシュメモリ115が示されている。一部の実施形態では、マイクロプロセッサ110はまた、図1に示されていない他の論理(例えば、集積メモリコントローラ、集積グラフィックコントローラ、および、コンピュータシステム内の、例えばI/O制御等の他の機能を実行する論理)を含むこともできる。一実施形態では、マルチプロセッサシステム内の各マイクロプロセッサまたはマルチコアプロセッサ内の各プロセッサコアは、少なくとも1つの実施形態では、セキュアなエンクレーブ技術を実行するための論理119を含む、または論理119と関連付けられている。論理には回路、ソフトウェア(有形媒体に具現化されている)、またはこれら両方を含むことで、一部の先行技術の実装例よりも効率的に複数のコアまたはプロセッサ間のリソース割り当てを行うことができる。   FIG. 1 is a block diagram of a microprocessor that can utilize at least one embodiment of the present invention. In particular, FIG. 1 shows a microprocessor 100 having one or more processor cores 105 and 110 associated with local caches 107 and 113, respectively. Also shown in FIG. 1 is a shared cache memory 115 which stores at least a version of the information stored in each of the local caches 107 and 113. In some embodiments, microprocessor 110 may also include other logic not shown in FIG. 1 (eg, an integrated memory controller, an integrated graphics controller, and other such as I / O control within a computer system). It can also include logic to perform the function. In one embodiment, each microprocessor in a multiprocessor system or each processor core in a multi-core processor, in at least one embodiment, includes or is associated with logic 119 for performing secure enclave techniques. ing. By including circuits, software (implemented in tangible media), or both in logic, to allocate resources among multiple cores or processors more efficiently than some prior art implementations Can.

例えば図2は、本発明の一実施形態を利用することができるフロントサイドバス(FSB)コンピュータシステムを示す。プロセッサ201、205,210、または215いずれもが、プロセッサコア223、227、233、237、243、247、253、257を含む、またはこれらと関連付けられているローカルレベル1(L1)キャッシュメモリ220、225、230、235、240、245、250、255のうちいずれかの情報にアクセスすることができる。さらには、プロセッサ201、205、210、または215いずれもが、チップセット265を介して、システムメモリ260から、または、共有レベル2(L2)キャッシュ203、207、213、217のいずれかからの情報にアクセスすることができる。図2に示すプロセッサのうち1以上は、少なくとも一実施形態におけるセキュアなエンクレーブ技術を実行する論理219を含む、または論理219と関連付けられてよい。   For example, FIG. 2 shows a front side bus (FSB) computer system that can utilize an embodiment of the present invention. A local level 1 (L1) cache memory 220, any of the processors 201, 205, 210 or 215 including or associated with processor cores 223, 227, 233, 237, 243, 247, 253, 257 Any of 225, 230, 235, 240, 245, 250, 255 can be accessed. Furthermore, any of the processors 201, 205, 210, or 215 may receive information from the system memory 260 via the chipset 265, or from any of the shared level 2 (L2) caches 203, 207, 213, 217. You can access to One or more of the processors shown in FIG. 2 may include or be associated with logic 219 that implements the secure enclave technique in at least one embodiment.

図2に示すFSBコンピュータシステムに加えて、ポイントツーポイント(P2P)インターコネクトシステムおよびリングインターコネクトシステム等の他のシステム構成を、本発明の様々な実施形態と協働して利用することもできる。例えば図3のP2Pシステムは、幾つかプロセッサを含むことができ、このうち2つのプロセッサ370、380が例示されている。プロセッサ370、380はそれぞれ、メモリ32、34と接続するためにローカルメモリコントローラハブ(MCH)372、382を含んでよい。プロセッサ370、380は、PtPインタフェース回路378、388を利用してポイントツーポイント(PtP)インタフェース350を介してデータを交換することができる。プロセッサ370、380はそれぞれ、ポイントツーポイントインタフェース回路376、394、386、398を利用して個々のPtPインタフェース352、354を介してチップセット390とデータを交換することができる。チップセット390はさらに、高性能グラフィックインタフェース339を介して高性能グラフィック回路338とデータを交換することができる。本発明の実施形態は、任意の数のプロセッサコアを有する任意のプロセッサ内に配置されてもよいし、または、図3のPtPバスエージェントそれぞれの内部に配置されてもよい。一実施形態では、任意のプロセッサコアが、ローカルキャッシュメモリ(不図示)を含む、またはこれと関連付けられていてよい。さらに、共有キャッシュ(不図示)が、両プロセッサ外のプロセッサに含まれていながらも、p2pインターコネクトを介して両プロセッサに接続されており、プロセッサを低電力モードにする場合、これらプロセッサの両方または片方のローカルキャッシュ情報を共有キャッシュに格納できる、という構成も可能である。図3に示す1以上のプロセッサまたはコアは、少なくとも1つの実施形態においては、セキュアなエンクレーブ技術を実行する論理319を含む、または論理319と関連付けられていてよい。   In addition to the FSB computer system shown in FIG. 2, other system configurations, such as point-to-point (P2P) interconnect systems and ring interconnect systems can also be utilized in conjunction with various embodiments of the present invention. For example, the P2P system of FIG. 3 can include several processors, of which two processors 370, 380 are illustrated. Processors 370, 380 may include local memory controller hubs (MCHs) 372, 382 to interface with memories 32, 34, respectively. Processors 370, 380 can exchange data via point-to-point (PtP) interface 350 utilizing PtP interface circuits 378, 388. Processors 370, 380 can exchange data with chipset 390 via individual PtP interfaces 352, 354 utilizing point-to-point interface circuits 376, 394, 386, 398, respectively. Chipset 390 may further exchange data with high performance graphics circuitry 338 via high performance graphics interface 339. Embodiments of the present invention may be located within any processor having any number of processor cores, or may be located within each of the PtP bus agents of FIG. In one embodiment, any processor core may include or be associated with a local cache memory (not shown). In addition, shared caches (not shown) are connected to both processors via the p2p interconnect, even though they are included in processors outside of both processors, and if you want the processors to be in low power mode, either or both of these processors It is also possible that the local cache information of can be stored in the shared cache. The one or more processors or cores shown in FIG. 3 may, in at least one embodiment, include or be associated with logic 319 that implements secure enclave technology.

少なくとも1つの実施形態の1以上の態様は、プロセッサ内の様々な論理を表す機械可読媒体に格納される代表的なデータにより実装することができ、データが機械により読み出されることで、機械は、ここに記載する技術を実行する論理を製造する。「IPコア」として知られているような表現は、有形の機械可読媒体(「テープ」)に格納されて、論理またはプロセッサを実際に製造する製造機械に装填するために様々な顧客または製造用設備に供給されてよい。   One or more aspects of at least one embodiment can be implemented by representative data stored on a machine-readable medium representing various logic in a processor, which can be read by the machine Produce logic that implements the techniques described herein. A representation such as known as an "IP core" is stored in a tangible machine readable medium ("tape") for various customers or manufacturers to load into a manufacturing machine that actually manufactures the logic or processor. It may be supplied to the facility.

従って、マイクロアーキテクチャメモリ領域アクセスを方向付ける方法および装置が記載された。上述した記載は、例示を意図しており限定は意図していない。数多くの他の実施形態も、上述した記載を読み理解した当業者には明らかであろう。従って本発明の範囲は、添付請求項および請求項が含みうる均等物の全範囲を参照して決定される。   Thus, methods and apparatus for directing micro-architecture memory area accesses have been described. The above description is intended to be illustrative and not limiting. Many other embodiments will be apparent to those skilled in the art upon reading and understanding the above description. Accordingly, the scope of the present invention should be determined with reference to the appended claims, and the full scope of equivalents that may be included.

セキュアなエンクレーブは、アプリケーションにOSプロセスのコンテキスト内でコードを実行してデータを格納させるための安全な場所を提供する命令セットである。この環境下で実行されるアプリケーションはエンクレーブと称される。エンクレーブは、エンクレーブページキャッシュ(EPC)から実行される。エンクレーブページは、OSによりEPCに装填される。エンクレーブのページがEPCから取り出されるたびに、暗号保護を利用して、エンクレーブの機密性を保護して、エンクレーブをEPCに戻すときの改ざんを検知することができる。EPC内で、エンクレーブデータは、プロセッサが提供するアクセス制御メカニズムを利用して保護される。以下の表2−1は、特権のないエンクレーブ命令の完全リストを提供している。

Figure 2019109910
A secure enclave is a set of instructions that provides an application a safe place to execute code and store data within the context of the OS process. An application that runs under this environment is called an enclave. Enclaves are implemented from the enclave page cache (EPC). Enclave pages are loaded into the EPC by the OS. Each time an enclave page is retrieved from the EPC, cryptographic protection can be used to protect the confidentiality of the enclave and to detect tampering when returning the enclave to the EPC. Within the EPC, enclave data is protected utilizing access control mechanisms provided by the processor. Table 2-1 below provides a complete list of non-privileged enclave instructions.
Figure 2019109910

これらの命令はリング3でのみ実行される。全ての他の時点においては、これらは#UD不良を生成する。表2−2は、特権を有する命令のリストを提供する。

Figure 2019109910
These instructions are executed on ring 3 only. At all other times, they produce a #UD fault. Table 2-2 provides a list of privileged instructions.
Figure 2019109910

エンクレーブページキャッシュ(EPC)は、エンクレーブコードを実行して、保護されたエンクレーブデータにアクセスする場所である。EPCは、プラットフォームの物理アドレス空間内に配置されるが、アクセスはSE命令を利用してのみ可能となる。EPCは、多くの異なるエンクレーブからのページを含んでよく、ページの整合性および機密性を保護するアクセス制御メカニズムを提供する。ページキャッシュは、プラットフォームのコヒーレントな物理メモリに利用されるものに類似したコヒーレンスプロトコルを維持している。   Enclave page cache (EPC) is a place to execute enclave code to access protected enclave data. The EPC is located in the platform's physical address space, but access is only possible using SE instructions. An EPC may include pages from many different enclaves, and provides access control mechanisms to protect page integrity and confidentiality. The page cache maintains a coherence protocol similar to that used for the platform's coherent physical memory.

EPCは幾つかの方法でインスタンス化することができる。例えば、プロセッサパッケージ上の専用SRAMから構築することができる。クリプト・メモリ・アパーチャ(Crypto Memory Aperture)が好適な実装メカニズムとして知られている。このメカニズムにより、EPCを大きくすることができる。CMAについては以下で詳述する。   EPCs can be instantiated in several ways. For example, it can be constructed from a dedicated SRAM on a processor package. Crypto Memory Aperture is known as the preferred implementation mechanism. This mechanism can increase the EPC. CMA is described in more detail below.

エンクレーブページキャッシュマップ(EPCM)は、EPC内の各ページに関連付けられた状態情報を含む。この状態は、ページが属すエンクレーブ、装填されるページの状態等の情報を提供する。EPCからページが取り出されると、状態情報もエクスポートされて、暗号手段を利用して保護される。エンクレーブページをEPCに再装填するときには、状態情報を検証する。   The enclave page cache map (EPCM) contains state information associated with each page in the EPC. This state provides information such as the enclave to which the page belongs and the state of the page being loaded. When a page is retrieved from the EPC, state information is also exported and protected using cryptographic means. When reloading the enclave page into the EPC, the state information is verified.

図4は、本発明の少なくとも1つの実施形態を利用することができるマルチコアマイクロプロセッサ499のブロック図である。マイクロプロセッサ499は、複数のコア400、420を含むことができる。コア400は、CR3 402、SMBR404、ページミスハンドラ408、PMHE410、および変換ルックアサイドバッファ412を含むことができる。コア420は、CR3 422、SMBR424、ページミスハンドラ428、PMHE430、および変換ルックアサイドバッファ432を含むことができる。本発明の一部の実施形態では、マイクロプロセッサ499は、コア400とコア420との間で共有されるレベル1キャッシュ440を含む。レベル1キャッシュ440は、最終レベルのキャッシュ445との間でデータをやりとりすることができる。ホームエージェント450は、最終レベルのキャッシュ445に接続して、暗号エンジン452に接続(attach to)することができる。ホームエージェント450は、クリプト・メモリ・アパーチャ480の物理アドレス空間488を、メモリコントローラ454を介して評価(assess)することができる。クリプト・メモリ・アパーチャ480は、エンクレーブページキャッシュ482、エンクレーブページキャッシュマップ484、補助格納部486、物理アドレス空間の一部488を含む。   FIG. 4 is a block diagram of a multi-core microprocessor 499 that can utilize at least one embodiment of the present invention. The microprocessor 499 can include a plurality of cores 400, 420. Core 400 may include CR3 402, SMBR 404, page miss handler 408, PMHE 410, and translation lookaside buffer 412. Core 420 may include CR 3 422, SMBR 424, page miss handler 428, PMHE 430, and translation lookaside buffer 432. In some embodiments of the present invention, microprocessor 499 includes level 1 cache 440 shared between core 400 and core 420. The level 1 cache 440 can exchange data with the final level cache 445. The home agent 450 can attach to the final level cache 445 and attach to the crypto engine 452. The home agent 450 can assess the physical address space 488 of the crypto memory aperture 480 via the memory controller 454. The crypto memory aperture 480 includes an enclave page cache 482, an enclave page cache map 484, an auxiliary store 486, and a portion 488 of physical address space.

CMAは、EPC、EPCM、その他SE関連の構造をインスタンス化する助けを行うメカニズムである。アパーチャとは、この目的の利用に備えさせられる物理アドレス空間の一領域のことである。   CMA is a mechanism that helps instantiate EPC, EPCM, and other SE related structures. An aperture is a region of physical address space that is provisioned for use in this purpose.

EPCおよびEPCM(およびその他の実装データ構造)は、アパーチャ内のある位置にマッピングされる。補助格納部は、これらリソースのための実際のデータのことである。EPCのメモリ要求が生成されると、CMAは、暗号化されたEPCデータが含まれている補助格納部の位置に再マッピングを行い、そのデータを取得する。   The EPC and EPCM (and other implementation data structures) are mapped to a location within the aperture. Auxiliary storage is the actual data for these resources. Once the EPC's memory request is generated, the CMA remaps to the location of the auxiliary storage that contains the encrypted EPC data and gets that data.

一般的には、殆どのSEは、マイクロコードに実装される。CMA、パッケージ外およびコア内のデータ移動制御する論理を含む複数の位置にハードウェアによるサポートが必要である。   In general, most SEs are implemented in microcode. Hardware support is required at multiple locations including CMA, out-of-package and in-core logic to control data movement.

図5は、本発明の一実施形態のセキュアなエンクレーブ(SE)の可能性のある実装例である。オペレーティングシステムおよびVMM542は、ELPG命令540を利用して、エンクレーブ532のエンクレーブページを、エンクレーブページキャッシュ544に装填することができる。マイクロプロセッサがエンクレーブ532内で実行していないときには、エンクレーブページキャッシュ544はSERRレジスタ532によるソフトウェアアクセスから保護される。エンクレーブ内で実行する場合には、マイクロコードページテーブルが保護548を提供する。各VMにはVMCSが関連付けられている。VM510はVMCS515に接続されている。VM520はVMCS525に接続されている。VM530はVMCS535に接続されている。SMM500は、別個のコンテナにあってよく、プロセッサ状態は別個のコンテナにあってよい。   FIG. 5 is a possible implementation of a secure enclave (SE) of one embodiment of the present invention. The operating system and VMM 542 may load the enclave page of the enclave 532 into the enclave page cache 544 utilizing ELPG instructions 540. When the microprocessor is not executing in enclave 532, enclave page cache 544 is protected from software access by SERR register 532. When implemented within an enclave, the microcode page table provides protection 548. Each VM is associated with a VMCS. The VM 510 is connected to the VMCS 515. The VM 520 is connected to the VMCS 525. The VM 530 is connected to the VMCS 535. The SMM 500 may be in a separate container, and the processor state may be in a separate container.

図5は、セキュアなエンクレーブ実装の一実施形態の高レベル概略図である。この実装例では、EPCは、マイクロコードが管理する別個のコンテナに維持されている。コンテナは、エンクレーブ内で実行されていない場合にはアクセス不可能である。エンクレーブに入った場合には、制御は、別個のコンテナに含まれているEPC内のエンクレーブコードに移される。   FIG. 5 is a high level schematic of one embodiment of a secure enclave implementation. In this implementation, the EPC is maintained in a separate container managed by microcode. The container is inaccessible if not running within the enclave. Once in the enclave, control is transferred to the enclave code in the EPC contained in a separate container.

エンクレーブ内で実行されている間に起こったページ不良または例外は全て、マイクロコードにより関連OSまたはVMMに反映される。機械がエンクレーブ内で実行していない場合には、EPCへのアクセス制御はSEレンジレジスタ(SERR)により提供される。機械が内部で実行されている場合には、マイクロコードはページテーブルレベルの保護を提供して、実行されているエンクレーブに属さない他のEPCエントリへのアクセスを禁止する。   Any page faults or exceptions that occur while executing within the enclave are reflected by the microcode to the relevant OS or VMM. If the machine is not running in an enclave, access control to the EPC is provided by the SE Range Register (SERR). If the machine is running internally, the microcode provides page table level protection to prohibit access to other EPC entries that do not belong to the enclave being executed.

セキュアなエンクレーブを実装する一方法に、一部のプロセッサ内のマイクロコード機能を利用して命令および保護を行う、というものがある。この機能は、エンクレーブの目的達成をセキュアに行うというセキュリティ要件に適合しているだろう。   One way to implement a secure enclave is to take advantage of microcode capabilities in some processors to provide instruction and protection. This feature will meet the security requirements of securing the enclave's purpose.

図2−2に示すSERRレジスタは、ページミスハンドラPMHに実装される。レジスタは、各論理プロセッサについて独立してイネーブルおよびディセーブルされてよい。   The SERR register shown in FIG. 2-2 is implemented in the page miss handler PMH. The registers may be enabled and disabled independently for each logical processor.

性能を向上させる実装におけるオプションとして、変換ルックアサイドバッファ(TLB)のエントリがエンクレーブまたは特定のエンクレーブ用であることを示すために、1ビットまたは幾つかのビットを提供する、というものがある。これらのビットが提供されていない場合には、エンクレーブを退出するときに、他のコードがこのエンクレーブにアクセスしないようにするためにTLBフラッシュが必要となる。   An option in the performance enhancing implementation is to provide a bit or bits to indicate that a translation lookaside buffer (TLB) entry is for an enclave or a specific enclave. If these bits are not provided, a TLB flush is required to prevent other code from accessing the enclave when exiting the enclave.

エンクレーブビットをエンクレーブモードビットと比較する。余剰ビットは、エンクレーブ空間idの機能を提供する。特定のエンクレーブはidを割り当てられてよい。idは、アドレスチェックの一環として、実行中のエンクレーブのidと比較される。TLBサポートは、性能向上策の1つのオプションである。EPCデータの除去によってあるエントリがTLBで無効化された場合、特定のマイクロコード化された撃墜メカニズム(special microcoded shootdown mechanism)が必要となる。一実施形態では、マイクロコードがエンクレーブ信頼境界(enclave trust boundary)内の全ての他のコアと接触をとり、このエントリがどのTLB内にもないことを確かめる。他の実施形態では、他のプロセッサがTLBエントリを無効化したことを確かめる手段をマイクロコードに提供するようにしてもよい。   Compare the enclave bit with the enclave mode bit. The extra bits provide the function of the enclave space id. Specific enclaves may be assigned an id. The id is compared to the running enclave id as part of the address check. TLB support is one option for performance improvement. If an entry is invalidated in the TLB due to the removal of EPC data, a special microcoded shootdown mechanism is required. In one embodiment, the microcode contacts all other cores in the enclave trust boundary to make sure that the entry is not in any TLB. In other embodiments, the microcode may be provided with means to verify that another processor has invalidated the TLB entry.

DMAスヌープを回避してEPCに対して無効化するためには、特別なSADおよび/またはTADエントリが提供される。これら専用のレジスタがEPCを保護する。これは、SERRと同じ値に設定される。   Special SAD and / or TAD entries are provided to avoid DMA snoops and invalidate for EPC. These dedicated registers protect the EPC. This is set to the same value as SERR.

一実施形態では、各エンクレーブのセキュアなエンクレーブに対してセキュアな鍵を保証するために、マイクロコードは乱数へのセキュアなアクセスを利用することができる。   In one embodiment, the microcode can utilize secure access to random numbers to guarantee a secure key for each enclave's secure enclave.

エンクレーブは改ざんされないように保護されてよい。改ざん保護に利用されるメカニズムの詳細は、実装例に応じて変わる。これにより、エンクレーブが改ざんされると、改ざんを検知したスレッド上でのさらなる実行が防止される。ユーザにエンクレーブの状態を理解させるために、構築されているエンクレーブを証明するための立証メカニズムを設ける。これには、エンクレーブコンテンツの情報を提示するEREPORT命令が含まれる。   Enclaves may be protected from tampering. The details of the mechanism used for tamper protection vary depending on the implementation. In this way, if the enclave is tampered with, further execution on the tampering detected thread is prevented. In order to make the user understand the state of the enclave, establish a verification mechanism to prove the enclave being constructed. This includes an EREPORT instruction that presents information on enclave content.

エンクレーブ設計で必要となるマイクロコード符号を簡略化するために、アーキテクチャエンクレーブというコンセプトが開発された。この種類のエンクレーブには、エンクレーブのためのコードの原本に基づいて特別なアクセス特権が与えられる。   In order to simplify the microcode code needed for enclave design, the concept of architecture enclave was developed. This type of enclave is given special access privileges based on the original code for the enclave.

電力サイクルにおけるエンクレーブ状態は、ソフトウェアポリシーに依存している。CMA内のデータは、電力停止時に失われる。エンクレーブを保存することが望ましい場合には、ソフトウェアによって電力サイクルにおいてエンクレーブデータが失われないように保証することができる。EPCに常駐するデータは、ソフトウェアがエンクレーブをS3電力状態中に生かしておきたい場合には、メモリにフラッシュすることができる。ソフトウェアは、電力喪失時にアプリケーションに全てのエンクレーブの除去を義務付ける選択を行うこともできる。   The enclave state in the power cycle is dependent on the software policy. Data in the CMA is lost at power down. If it is desirable to save the enclave, software can ensure that the enclave data is not lost in the power cycle. The data resident in the EPC can be flushed to memory if the software wishes to keep the enclave alive during the S3 power state. The software can also make a choice to force the application to remove all enclaves on power loss.

エンクレーブはその位置に応じて保護される。CPUパッケージ外のデータは、暗号化および整合性チェックを利用して保護される。エンクレーブページキャッシュ内のコードおよびデータについては、ページがアクセス制御メカニズムを利用して保護される。   Enclaves are protected according to their position. Data outside the CPU package is protected using encryption and integrity checking. For code and data in the enclave page cache, pages are protected using access control mechanisms.

図6は、本発明の少なくとも1つの実施形態を利用することができるマイクロプロセッサのブロック図である。図6は、複数のプロセッサコア600、605、610、615、およびキャッシュ620を有するマイクロプロセッサ600を示す。エンクレーブデータ635は暗号化することができる。クリプト・メモリ・アパーチャデータ630は、エンクレーブデータ635の保護に利用される。   FIG. 6 is a block diagram of a microprocessor that can utilize at least one embodiment of the present invention. FIG. 6 shows a microprocessor 600 having a plurality of processor cores 600, 605, 610, 615 and a cache 620. Enclave data 635 can be encrypted. Crypto memory aperture data 630 is used to protect enclave data 635.

システムメモリに常駐しているエンクレーブページは、暗号化および整合性を利用して保護される。ページのEPCへの装填においては、ページはEPCにコピーされ、復号化されて、そのページの整合性をチェックする。図6は、データのこの部分を示している。   Enclave pages resident in system memory are protected using encryption and integrity. In loading a page into the EPC, the page is copied to the EPC and decrypted to check the integrity of the page. FIG. 6 shows this part of the data.

EPC内に常駐しているエンクレーブページは、システムメモリに格納されてから、エンクレーブキーを利用して暗号化される。認証情報もページ格納時に格納される。EPC内のエンクレーブデータは、復号(unencrypt)されてアクセス制御メカニズムにより保護される。プロセッサは、データの所有権を持つエンクレーブしかアクセスできないように、このデータを保護する。   Enclave pages resident in the EPC are stored in system memory and then encrypted using the enclave key. Authentication information is also stored at the time of page storage. Enclave data in the EPC is unencrypted and protected by the access control mechanism. The processor protects this data so that only the enclaves with ownership of the data can access it.

EPCに常駐しているエンクレーブページが、キャッシュから、CPUパッケージ外のメインメモリに強制的に移動させられると、CMA暗号化により保護される。CMAは、このデータを暗号化してデータの機密性を実現する。EPCの整合性は、EPCに対する読み書きを防止するレンジレジスタにより提供される。   Enclave pages residing in the EPC are protected by CMA encryption when they are forcibly moved from cache to main memory outside the CPU package. The CMA encrypts this data to achieve data confidentiality. The integrity of the EPC is provided by a range register that prevents reading and writing to the EPC.

図7は、本発明の一実施形態に実装可能なエンクレーブページキャッシュの一部分にアクセスする制御構造の一例を示す。エンクレーブページキャッシュ720の各ページは、エンクレーブページキャッシュマップ710内に対応するメタデータを有していてよい。図7に示すメタデータにおいて、リニアアドレス700のセットを含むセキュアなエンクレーブが、リニアアドレスがエンクレーブページキャッシュマップ710に格納されているリニアアドレスに合致する場合、エンクレーブページキャッシュ720に格納されているデータにアクセスすることができる。   FIG. 7 illustrates an example of a control structure for accessing a portion of an enclave page cache that can be implemented in an embodiment of the present invention. Each page of enclave page cache 720 may have corresponding metadata in enclave page cache map 710. In the metadata shown in FIG. 7, when the secure enclave including the set of linear addresses 700 matches the linear address stored in the enclave page cache map 710, the data stored in the enclave page cache 720 You can access to

図7は、EPCおよびEPCMの配置および利用法を示す。EPCは4kページに分割される。各エンクレーブは、EPCに常駐している幾つかの数のページを有してよい。EPCの各ページのEPCMのエントリには、セキュリティを確保するために必要なメタ情報を提供するものもある。EPCMの詳細は実施例に固有である。   FIG. 7 shows the placement and use of EPC and EPCM. The EPC is divided into 4k pages. Each enclave may have some number of pages resident in the EPC. Some EPCM entries on each page of the EPC provide the meta information needed to ensure security. The details of the EPCM are specific to the embodiment.

アプリケーションがエンクレーブの装填を所望する場合には、OSのシステムルーチンを呼び出す。OSはEPC内に数ページを割り当てようとする。空いている場所がない場合には、OSはビクティム・エンクレーブを選択して除去する。OSは、ビクティム・エンクレーブのページを、各ページについてEWBINVPG命令を利用して強制的に除去(evict)する。OSが強制除去を完了すると、ECREATEコマンドを利用してエンクレーブにセキュアなエンクレーブ制御構造(SECS)を追加する。SECSを生成した後で、OSは、EADDPRE命令の利用によりアプリケーションにより要求されたようにページをエンクレーブに追加する。   If the application wants to load the enclave, it calls the OS's system routine. The OS tries to allocate several pages in the EPC. If there is no free place, the OS chooses to remove the victim enclave. The OS forces the victim enclave pages to be evicted using the EWBINVPG instruction for each page. When the OS completes the forced removal, add secure enclave control structure (SECS) to the enclave using ECREATE command. After generating the SECS, the OS adds pages to the enclave as requested by the application through the use of the EADDPRE instruction.

データページをエンクレーブに追加するには、OSは先ず、EADDSMAP命令を利用してSMAPページをエンクレーブに追加する。エンクレーブのサイズおよび配置に応じて、OSは複数のSMAPページを割り当てる場合がある。エンクレーブページ全てがエンクレーブに追加されると、OSはEINIT命令を実行して、エンクレーブを実行する。EINIT命令に対するパラメータは、エンクレーブがその機械上での実行を許可されていることを示す認可状である。アプリケーションの装填時には許可状を生成する必要がある。EINITが無事に完了すると、アプリケーションはEENTER命令を実行してエンクレーブに入ることができる。   To add data pages to the enclave, the OS first adds SMAP pages to the enclave using the EADDS MAP instruction. Depending on the size and placement of the enclave, the OS may allocate multiple SMAP pages. When all the enclave pages are added to the enclave, the OS executes the EINIT instruction to execute the enclave. The parameter to the EINIT instruction is a certificate indicating that the enclave is authorized to execute on that machine. At the time of loading the application it is necessary to generate a permit. If EINIT completes successfully, the application can execute the EENTER instruction to enter the enclave.

エンクレーブが構築され、実行準備が整った旨の表示がなされると、アプリケーションは、エンクレーブに物理的メモリを追加したり取り除いたりする必要がある場合がある。エンクレーブにはこれを助けるために、さらなるメモリを追加させる命令が存在する。メモリをエンクレーブに追加する際、メモリはエンクレーブ内の正確なリニアアドレスに割り当てられる。OSはこのメモリページを、リニアアドレスを示すEPCにコピーする。EADDPOST命令を実行して、このメモリをエンクレーブ(enclave enclave)に追加する。SMAPノードがEPC内に常駐していない場合には、先ずこれを装填する。   The application may need to add or remove physical memory from the enclave once the enclave has been built and indicated that it is ready to run. Enclaves have instructions to add more memory to help with this. When adding memory to the enclave, the memory is assigned to the correct linear address in the enclave. The OS copies this memory page to the EPC indicating a linear address. Execute the EADDPOST instruction to add this memory to the enclave (enclave enclave). If the SMAP node is not resident in the EPC, first load it.

メモリをエンクレーブにコピーした後は、ソフトウェアは、ページを受諾してから、内部的にアクセスできるようになっていてよい。エンクレーブは、EACCEPT命令を実行することによりデータを受諾する。この命令は、エンクレーブ内のソフトウェアによってのみ実行可能である。   After copying the memory to the enclave, the software may accept the page and then be able to access it internally. The enclave accepts data by executing the EACCEPT instruction. This instruction can only be executed by software in the enclave.

一部の場合には、ソフトウェアは、エンクレーブメモリの特性の修正を望む場合がる。そのためには、SMAPを更新する必要がある。例えばソフトウェアが、別のスレッドエントリポイントであるTCSをエンクレーブ内に生成しようとする場合を考える。この場合、エンクレーブは、EMODIFY命令を利用してページのSMAP特性を変更するようOSに要求する。特性が変更された後で、エンクレーブソフトウェアは、EACCEPT命令を実行して、ページの利用を許可する。   In some cases, software may wish to modify the characteristics of the enclave memory. In order to do so, it is necessary to update SMAP. For example, consider the case where software tries to create another thread entry point, TCS, in an enclave. In this case, the enclave requests the OS to change the SMAP properties of the page using the EMODIFY instruction. After the property is changed, the enclave software executes the EACCEPT instruction to allow the page to be used.

メモリページはエンクレーブから除去することもできる。エンクレーブがページの除去の準備ができている場合には、OSに要求を送る。OSは、EREMOVE命令を実行して、SMAPからページを除去させる。EREMOVE命令はさらに、EPCエントリの無効化も行う。   Memory pages can also be removed from the enclave. If the enclave is ready for page removal, it sends a request to the OS. The OS executes the EREMOVE instruction to remove the page from the SMAP. The EREMOVE instruction also performs the invalidation of the EPC entry.

エンクレーブ環境の整合性を確保する方法としては、アクセスチェックを数回行う、というものがある。実施される様々なセキュリティ特性のなかには、データをEPCに正確に位置させて、データがエンクレーブの間でリークしないようにして、参照アドレスが破損しないようにすることで、コードがエンクレーブの異なるリニアアドレスに移動させられないようにする、というものがある。   One way to ensure the integrity of the enclave environment is to perform several access checks. Among the various security features implemented is that the code has a different linear address of the enclave by correctly positioning the data in the EPC, so that the data does not leak between the enclaves, and so that the reference address is not corrupted. There is a way to prevent being moved to

アクセス保護要件は、レンジャレジスタおよびマイクロコード管理されたシャドーページテーブルを利用して実装することができる。別の実施形態では、シャドーページテーブルのオーバヘッドを回避するために、ページミスハンドラハードウェアを修正して、同じアクセス制御要件を実行することができる。   Access protection requirements can be implemented utilizing ranger registers and microcode managed shadow page tables. In another embodiment, the page miss handler hardware can be modified to perform the same access control requirements in order to avoid shadow page table overhead.

EPCは、LPがマイクロコードモードで実行中、または、LPがエンクレーブ内で実行中であり、アクセスされているリニアアドレスがそのエンクレーブがカバーするリニアアドレスレンジに属している場合にのみ、論理プロセッサ(LP)によりアクセス可能である。言い換えると、EPCレンジに行くことが許されるのはマイクロコードアクセスまたはエンクレーブアクセスのみである。EPCレンジに対する他のアクセスはすべて、不法とみなされる。   EPC is a logical processor (only if the LP is running in microcode mode or if the LP is running in an enclave and the linear address being accessed is in the linear address range covered by the enclave) It is accessible by LP). In other words, only microcode access or enclave access is allowed to go to the EPC range. All other accesses to the EPC range are considered illegal.

エンクレーブアクセスは、EPCに属す物理アドレスに対して解決(resolve)されてよい。アクセスがEPC外であるが、リニアアドレスが、アドレスがエンクレーブ内にあると示している場合には、アクセスは停止されてよい。OSに対する不良または命令は、報告を行う。   Enclave access may be resolved to the physical address belonging to the EPC. If the access is outside the EPC but the linear address indicates that the address is in the enclave, the access may be halted. Defects or orders for the OS report.

エンクレーブ内のアドレスに対するアクセスは、アクセスを成功させるためにEPC内に位置させることができる。エントリがEPCに存在するかのチェックは、通常、EPCMをチェックして、有効なビットを検証することにより行われる。各EPCページは特定のエンクレーブ専用である。そのEPCエントリに対する参照は、EPCページを所有するエンクレーブによってのみ可能である。これは、実行中のエンクレーブのSECSに、参照しているページが合致するかを検証することでチェックすることができる。   Access to addresses in the enclave can be located in the EPC for successful access. Checking if an entry is present in the EPC is usually done by checking the EPCM and verifying valid bits. Each EPC page is dedicated to a specific enclave. Reference to that EPC entry is only possible by the enclave that owns the EPC page. This can be checked by verifying whether the referring enclave SECS matches the reference page.

各EPCページは、エンクレーブ用の特定のリニアアドレスページを表す。要求されているリニアアドレスは、EPC内のページのリニアアドレスに整合する場合がある。例えばEPCMエントリは、エンクレーブページがEPCに導入されるリニアアドレスを格納する。エンクレーブアクセスがEPCページに対して解決される場合には、ページを導入するリニアアドレスは、現在の要求のリニアアドレスと合致する。   Each EPC page represents a specific linear address page for the enclave. The requested linear address may match the linear address of the page in the EPC. For example, the EPCM entry stores a linear address at which the enclave page is introduced into the EPC. If the enclave access is resolved to an EPC page, the linear address introducing the page matches the linear address of the current request.

エンクレーブのリニアアドレスマッピングは破損していてはいけない。リニアアドレスのページテーブルが破損している場合には、アクセスが不法なものとされる。これにより、攻撃者がコードおよびデータをエンクレーブの付近またはその中に運び入れることを防止する。   Enclave linear address mapping must not be corrupted. If the linear address page table is corrupted, the access will be illegal. This prevents an attacker from carrying code and data near or into the enclave.

OS/VMMが初期化の後にエンクレーブにページを追加すると、EADDPOST命令が、そのページのEPCMに「係属中」ビットを設定する。係属中を示すビットは、後続するEPC書き戻しおよび強制除去(SEC_INFOを利用する)を経ても生存し続ける。エンクレーブは、EACCEPTを発行して、係属中のビットをクリアすることができる。エンクレーブアクセスが、係属中のビットが設定されたEPCページに対して解決された場合には、LPは、OS/VMMにEF_PENDING不良を発行する。   When the OS / VMM adds a page to the enclave after initialization, the EADDPOST instruction sets the "pending" bit in the EPCM of the page. The pending bit continues to survive the subsequent EPC writeback and forced removal (using SEC_INFO). The enclave can issue EACCEPT to clear the pending bit. If the enclave access is resolved for an EPC page with the pending bit set, the LP issues an EF_PENDING fault to the OS / VMM.

OS/VMMが中継保護されたエンクレーブページをEPCに装填すると、FCR(フレッシュチェック要求された)ビットが、そのページのEPCMエントリに設定される。OS/VMMは、そのEPCページに対してEUPSMAP命令を実行してこのビットをクリアすることで、このビットをクリアすることができる。エンクレーブアクセスの継続は、このページのFCRビットが設定されていない場合に限って許可される。さもなくば、LPはEF_FRESH_CHK不良をOS/VMMに送信する。   When the OS / VMM loads the relay protected enclave page into the EPC, the FCR (fresh check requested) bit is set in the EPCM entry of that page. The OS / VMM can clear this bit by executing the EUPSMAP instruction on the EPC page to clear this bit. Enclave access continuation is allowed only if the FCR bit of this page is not set. Otherwise, the LP sends an EF_FRESH_CHK fault to the OS / VMM.

各EPCMエントリは、エンクレーブがそのページに対する書き込みを許可されているかを示す「ダーティ」なビットを含む。エンクレーブのエンクレーブページに対する書き込みは、EPCMのそのページのダーティビットが設定されているときに限って許可される。さもなくば、LPはEF_EWRITEをOS/VMMに発行する。OS/VMMは、そのページに対してEUPSMAP命令を実行することで、ダーティビットを設定することができる。   Each EPCM entry contains a "dirty" bit that indicates whether the enclave is allowed to write to the page. Writing to an enclave enclave page is only allowed when the dirty bit for that page of the EPCM is set. Otherwise, LP issues EF_EWRITE to the OS / VMM. The OS / VMM can set the dirty bit by executing the EUPSMAP instruction on the page.

論理プロセッサがエンクレーブ内で実行しているときはいつでも、そのエンクレーブのSECSページがEPC内に存在しうる。しかし、SEセキュリティモデルでは、エンクレーブは、自身のSECSに直接メモリアクセスを行うことは許可されていない(ただしエンクレーブは、完全にセキュリティを脅かすという前提で、自身のエンクレーブキーを読み出すことはできる)。エンクレーブアクセスが、そのエンクレーブに対してSECSを保持するEPCページに対して解決される場合には、OS/VMMは、EF_ATTRIB_SECS不良を介して通知を受ける。エンクレーブは、TSC属性セットを有するページの修正は許可されていない。エンクレーブがEPCに装填されたTCSの修正を試みると、OS/VMMは、EF_ATTRIB_TCS不良を介して通知を受ける。以下の表のサイズフィールドにおいては、4:32および64ビットモード両方の4バイトフィールド、8:32および64ビットモード両方の8バイトフィールド、および、8(4):両方のモードにおける8バイトフィールド(上位4バイトは32ビットモードでは無視される)という値および指標を利用することができる。   Whenever a logical processor is executing in an enclave, that enclave's SECS page may be present in the EPC. However, according to the SE security model, enclaves are not permitted to perform direct memory access to their SECS (although enclaves can read their enclave keys on the premise that they are completely security threatening). If the enclave access is resolved for the EPC page that holds the SECS for that enclave, then the OS / VMM is notified via the EF_ATTRIB_SECS fault. Enclaves are not allowed to modify pages with TSC attribute sets. When the enclave attempts to modify the TCS loaded into the EPC, the OS / VMM is notified via the EF_ATTRIB_TCS fault. In the size fields in the following table, 4-byte fields in both 4:32 and 64-bit modes, 8-byte fields in both 8:32 and 64-bit modes, and 8 (4): 8-byte fields in both modes ( The upper 4 bytes are ignored in 32-bit mode) and values and indices can be used.

注:一部のフィールドは、小文字の「o」から始まる名称を有する(例えばoLSP)。これらフィールドはポインタであるが、エンクレーブでは、エンクレーブのベースに対するオフセットとして表される。この表記法により、エンクレーブページの計測値を、エンクレーブを生成した位置から独立させることができる。   Note: Some fields have names starting with the lower case "o" (e.g. oLSP). These fields are pointers but in the enclave they are represented as offsets to the base of the enclave. This notation allows the measurement of the enclave page to be independent of the position at which the enclave was generated.

注:フィールドは(未だ)特に決まった順序で記載されていない。一部のフィールドは、銘々のデータ構造内の異なるメモリページに移動させられてよく、これにより例えば異なる保護手段が可能となる。

Figure 2019109910
Note: The fields are not (yet) listed in a particular order. Some fields may be moved to different memory pages in the data structure of interest, which allows, for example, different protection measures.
Figure 2019109910

各スレッドには、スレッド制御構造(TCS)が関連付けられている。TCSは以下を含む。

Figure 2019109910
Figure 2019109910
Figure 2019109910
スレッド状態は5つの値のうちいずれかをとることができる。
Figure 2019109910
Each thread is associated with a thread control structure (TCS). TCS includes:
Figure 2019109910
Figure 2019109910
Figure 2019109910
The thread state can take one of five values.
Figure 2019109910

<状態セーブ領域オフセット(oSSA)>
状態セーブ領域オフセット(oSSA)は、エンクレーブで実行中に生じる割り込みまたは例外にプロセッサ状態をセーブするのに利用される状態セーブフレームのスタックを指し示している。次の状態セーブ領域(NSSA)が割り込みマイクロコードにより利用されて、エンクレーブでの実行中に生じる割り込みまたは例外のどこにプロセッサ状態をセーブするかが判断される。これは、oSSAがアドレス指定するフレームアレイへのインデックスである。セーブ領域(CSSA)のカウントは、このTCSに利用可能なSSAフレームの数を特定する。割り込みまたは例外が生じ、且つ、これ以上利用可能なSSAフレームがない場合には(NSSA>=CSSA)、割り込みまたは例外がまだ起こりえて、プロセッサ状態がクリアされるが、TCSは無効(INVALID)であるとして表示される。
<State save area offset (oSSA)>
State Save Area Offset (oSSA) points to a stack of state save frames that are used to save processor state to interrupts or exceptions that occur during execution in the enclave. The next state save area (NSSA) is utilized by the interrupt microcode to determine where to save processor state to an interrupt or exception that occurs during execution in the enclave. This is an index into the frame array that the oSSA addresses. The save area (CSSA) count specifies the number of SSA frames available to this TCS. If an interrupt or exception occurs and there is no more SSA frame available (NSSA> = CSSA), the interrupt or exception can still occur and the processor state is cleared but TCS is invalid (INVALID) Displayed as being.

エンクレーブでの実行中に割り込みが起こった場合には、機械の状態がTCS::SSA(状態セーブ領域)にセーブされる。この領域には以下が含まれる。

Figure 2019109910
If an interrupt occurs during enclave execution, the machine state is saved in TCS :: SSA (state save area). This area includes:
Figure 2019109910

TCS::SSAは、割り込みが生じたときにもページアウトされない。EENTERは、SSAがEPC内にあることをチェックして、物理アドレスをキャッシュする。ページが強制移動させられている場合には、EWBINVPGを実行中のプロセッサが、SSAを利用してスレッドを現在実行中のプロセッサでエンクレーブを退出させて、ページ不良を報告する。   TCS :: SSA is not paged out when an interrupt occurs. EENTER caches the physical address, checking that the SSA is in the EPC. If the page is forced to move, the processor executing EWBINVPG uses SSA to cause the thread executing processor to exit the enclave and report a page fault.

図8は、データ構造全ての縫合方法を示す。煩雑にならないように、全てのスレッドのそれぞれの構造は示していない。アントラステッドスタック(Untrusted Stacks)およびそれに関連するポインタも省かれている。図8は、本発明の一実施形態におけるスレッド制御構造の一例を示しており、セーブ状態領域同士の縫合を示す。状態セーブ領域ポインタ800は、セーブ領域0 820を指し示している。現在の状態セーブ領域805は、セーブ領域1 824を指し示している。次の状態セーブ領域810は、次のセーブ領域828を指し示している。セーブ状態領域の数は、利用可能なセーブ状態領域の数への参照を提供している。   FIG. 8 shows the stitching method for all data structures. For the sake of brevity, the respective structures of all threads are not shown. Untrusted Stacks and their associated pointers are also omitted. FIG. 8 shows an example of a thread control structure according to an embodiment of the present invention, showing the stitching of save state areas. State save area pointer 800 points to save area 0 820. The current state save area 805 points to save area 1 824. The next state save area 810 points to the next save area 828. The number of save state areas provides a reference to the number of available save state areas.

ページ情報(PAGE_INFO)は、EPC−管理命令へのパラメータとして利用されるアーキテクチャデータ構造である。

Figure 2019109910
SEC_INFOフラグおよびEPCフラグは、ページの種類を示すビットを含んでいる。
Figure 2019109910
SEC_INFOフラグは、エンクレーブページの状態を記述・説明するビットセットである。
Figure 2019109910
Figure 2019109910
Figure 2019109910
Page information (PAGE_INFO) is an architectural data structure used as a parameter to EPC-management instructions.
Figure 2019109910
The SEC_INFO flag and the EPC flag contain bits that indicate the type of page.
Figure 2019109910
The SEC_INFO flag is a bit set that describes and describes the state of the enclave page.
Figure 2019109910
Figure 2019109910
Figure 2019109910

セキュリティ情報(SEC_INFO)データ構造は、偽造保護に必要な暗号メタデータを保持する。

Figure 2019109910
The security information (SEC_INFO) data structure holds cryptographic metadata necessary for forgery protection.
Figure 2019109910

証明書(CERT)とは、アーキテクチャエンクレーブを提供される証明書構造であり、EMKPERMITに渡される。この構造は4096バイトであり、ページを整列されてよい(page-aligned)。

Figure 2019109910
Figure 2019109910
A certificate (CERT) is a certificate structure provided with an architecture enclave, which is passed to EMKPERMIT. This structure is 4096 bytes and may be page-aligned.
Figure 2019109910
Figure 2019109910

ERPORT構造は、EREPORT命令の出力である。

Figure 2019109910
The ERPORT structure is the output of the EREPORT instruction.
Figure 2019109910

計測値(MEASUREMENTS)は、ERDMR命令の出力パラメータであり、指定されたSECSからとられたエンクレーブの計測値レジスタ値(Measurement Register values)が含まれている。

Figure 2019109910
The measurement values (MEASUREMENTS) are output parameters of the ERDMR instruction, and include measurement value register values (Measurement Register values) of the enclave taken from the designated SECS.
Figure 2019109910

キー要求(KEY_REQUEST)は、EGETKEY命令への入力パラメータであり、適切なキー、および、そのキーを導出するために必要なさらなるパラメータを選択するのに利用される。

Figure 2019109910
Figure 2019109910
Figure 2019109910
The key request (KEY_REQUEST) is an input parameter to the EGETKEY command and is used to select the appropriate key and any further parameters needed to derive that key.
Figure 2019109910
Figure 2019109910
Figure 2019109910

この構造を、キー導出で利用することで、エンクレーブのセキュリティバージョンおよびエンクレーブのSE TCBに基づいてキーが生成される。TCBセキュリティバージョン構造の詳細については、プラットフォームTCB復帰仕様を参照のこと。

Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
EPCMフラグとは、エンクレーブページの状態を記述するビットのセットである。
Figure 2019109910
By using this structure in key derivation, a key is generated based on the security version of the enclave and the SE TCB of the enclave. For details on TCB security version structure, please refer to platform TCB return specification.
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
The EPCM flag is a set of bits that describe the state of the enclave page.
Figure 2019109910

エンクレーブページキャッシュ・マップ(EPCM)は、プロセッサがページキャッシュの内容を追跡するために利用するセキュアな構造である。EPCMは、EPCに現在装填されている各ページのきっちり1つのエントリを保持する。

Figure 2019109910
An enclave page cache map (EPCM) is a secure structure that the processor uses to track the contents of the page cache. The EPCM holds exactly one entry for each page currently loaded into the EPC.
Figure 2019109910

証明(認証)(attestation)は、特に遠隔の実体に対して、ソフトウェア1つがプラットフォーム上に構築されている、と示すプロセスである。セキュアなエンクレーブの場合には、遠隔のプラットフォームが、ソフトウェアが、そのソフトウェアが秘匿性およびデータ保護の観点で信頼性を確認される前に、エンクレーブ内で保護されている正規のプラットフォーム上で動作するように遠隔プラットフォームにより構築するメカニズムである。証明処理は、計測、格納、およびレポート(報告)という3段階からなる。   Attestation is the process of indicating to a remote entity that one piece of software is built on the platform. In the case of a secure enclave, the remote platform operates on the legitimate platform protected within the enclave before the software is verified for confidentiality and data protection. Is a mechanism built by remote platform. The proof process consists of three steps: measurement, storage, and reporting.

エンクレーブの計測期間には、事前エンクレーブ構築と事後エンクレーブ構築という2つの期間が存在する。エンクレーブ命令は、構築されたエンクレーブを計測させる役割を果たす。ひとたびエンクレーブが構築されると、エンクレーブ内のソフトウェアが計測をする責任を負う。   During the enclave measurement period, there are two periods: pre-enclave construction and post-enclave construction. Enclave instructions play a role in measuring the constructed enclave. Once the enclave is built, the software in the enclave is responsible for measuring.

図9は、本発明の一実施形態にみることができる、クオーティングと称されるソフトウェア認証プロセスの一ステップを示す。一実施形態では、署名処理910により、計測値レジスタ901、902、903、904から、連結されたデータに、署名キー915を適用する。署名処理910の結果がクオート920である。   FIG. 9 illustrates one step in the software authentication process referred to as queuing that can be found in one embodiment of the present invention. In one embodiment, signature processing 910 applies signature key 915 to the concatenated data from measurement value registers 901, 902, 903, and 904. The result of the signing process 910 is a quote 920.

暗号結合計測(cryptographically binds measurements)を報告する処理は、プラットフォームにエンクレーブを生成するときになされる。このメカニズムは、この種類の機能が時にTPMコマンドとしてプラットフォームで利用可能になっていることから、しばしば「クオーティング」と称される。計測値レジスタ(MR)の値は、連結されてから、非対称鍵を用いて署名される。これに対向する者は単に、クオート構造で署名を検証して、このクオートの正当性を立証する必要がある。   The process of reporting cryptographically binds measurements is done when generating an enclave on the platform. This mechanism is often referred to as "quoting" because this type of functionality is sometimes made available to the platform as TPM commands. The values of the measurement value register (MR) are concatenated and then signed using an asymmetric key. The opposite party simply needs to verify the signature in the quote structure to establish the legitimacy of the quote.

図10は、本発明の一実施形態における、計測値レジスタセット1000からクオートを生成するための各ステップを示す。ローカルレポート1005は、計測値レジスタ1000に対称認証キーでアクセスすることで生成することができる。クオーティング・エンクレーブ1025は、ローカルレポート1005を匿名のクオート1010または通常のクオート1020に変換するソフトウェアを含んでよい。   FIG. 10 illustrates the steps for generating quotes from the measurement value register set 1000 in one embodiment of the present invention. The local report 1005 can be generated by accessing the measurement value register 1000 with a symmetric authentication key. The quotation enclave 1025 may include software that converts the local report 1005 into an anonymous quote 1010 or a regular quote 1020.

非対称鍵に関する計算の性質上、および、エンクレーブリーフの命令数を低減させたいという要望から、非対称署名を行わせる命令は含めないこととする。以下の図に示す我々の採る方法では、対称鍵認証キーに基づいて「レポート」を生成して、これらの対称鍵に基づく「レポート」を、エンクレーブを利用してそれ自身が保護されているソフトウェアを利用して、非対称署名の「クオート」に変換させる。クオーティング・エンクレーブ(Quoting Enclave)は、プラットフォーム証明キーにアクセスを有するまでに先ず認証されねばならないことから、クオーティング・エンクレーブ自身が、認証エンクレーブとして知られている特殊用途のエンクレーブである。   Due to the nature of computations regarding asymmetric keys and because of the desire to reduce the number of instructions in Enclays Briefs, we will not include the instructions that cause asymmetric signatures. In our approach, shown in the figure below, we generate "reports" based on symmetric key authentication keys and use "enclaves" to protect "reports" based on these symmetric keys. To convert them into asymmetric signature "quotes". Because the Quating Enclave must first be authenticated before it has access to the platform certification key, the Quoting Enclave itself is a special-purpose enclave known as an Authentication Enclave.

各エンクレーブは、2つの256ビットの幅の計測値レジスタ(MR_EADD&MR_POLICY)および2つのレザーブされたレジスタを提供する。これら計測値レジスタは、エンクレーブのSECS内に含められている。   Each enclave provides two 256 bit wide measurement value registers (MR_EADD & MR_POLICY) and two absorbed registers. These measurement value registers are included in the enclave's SECS.

図11は、本発明の一実施形態における計測値レジスタMR_EADD1100を更新するEADDプロセスを示す。拡張処理1115は、MR_EADD1100の現在の値、ページデータ1105、およびページメタデータ1110を入力として利用することができる。拡張処理の出力がMR_EADD'1120であり、これは、MR_EADD1100に格納される次の値となる。   FIG. 11 shows the EADD process of updating the measurement value register MR_EADD 1100 in one embodiment of the present invention. The extension process 1115 can use the current value of MR_EADD 1100, page data 1105, and page metadata 1110 as input. The output of the extension process is MR_EADD'1120, which is the next value stored in MR_EADD1100.

MR_EADDは、EINIT命令が呼び出される前にEADD命令を利用して構築されたものであるので、エンクレーブの集合計測値を含んでいる。これはマイクロコードにより書き込まれるので、エンクレーブコードが読み取りだけができるSECSのページに配置される必要がある。EADDは、呼び出される毎に、SHA256をページデータおよびそのページに関連付けられたセキュリティメタデータに計算して(つまり、これはページおよびページのSEC_INFOフラグの(エンクレーブのベースアドレスに対する)相対アドレスである)、この値をMR_EADD1100に拡張する。「拡張」とは、新たなMR値=ハッシュ(古いMR値||入力値)という意味である。   Since MR_EADD is constructed using the EADD instruction before the EINIT instruction is called, it includes enclave set metrics. Since this is written by microcode, the enclave code needs to be placed on the SECS page which can only be read. Each time EADD is called, it calculates SHA256 to the page data and the security metadata associated with the page (ie it is the relative address (to the base address of the enclave) of the page and the SEC_INFO flag of the page) , Extend this value to MR_EADD1100. “Extended” means that the new MR value = hash (old MR value || input value).

MR_POLICYは、エンクレーブの起動を許可するポリシーを認証するときに利用されるポリシーの値を含んでいる。この値は、起動時にSECS内に配置されたエンクレーブ許可証から取り出されて、EINIT命令が成功裏に完了したものとしてコピーされたものである。MR_POLICYは、マクロコードによってのみ書き込まれるので、エンクレーブコードからは読み取りしかできないSECSのページに配置される必要がある。   MR_POLICY contains the value of the policy used when authenticating the policy that permits activation of the enclave. This value is taken from the enclave permit placed in the SECS at power up and copied as if the EINIT instruction completed successfully. Since MR_POLICY is written only by the macro code, it needs to be placed on a SECS page that can only be read from the enclave code.

図12は、本発明の一実施形態におけるレポートを生成するEREPORT命令を示す。キーID1200、所有者エポック1205、パッケージヒューズキー1210、および固定ストリングMACキー1215が、導出命令1220に入力される可能性がある。導出1220の出力は、CMAC1225を、TCBバージョン1232、ISVバージョン1234、機能1236、フラグ1238、ユーザデータ1240、および計測値レジスタ1242の現在の値とともに入力することができる。CMAC1225の出力は、MAC1244に格納することができる。EREPORT命令の出力は、キー識別子1230、TCBバージョン1232、ISVバージョン1234、機能1236、フラグ1238、ユーザデータ1240、計測値レジスタ1242、およびMAC1244を含むことができる。   FIG. 12 shows an EREPORT instruction that generates a report in one embodiment of the present invention. A key ID 1200, an owner epoch 1205, a package fuse key 1210, and a fixed string MAC key 1215 may be input to the derivation instruction 1220. The output of the derivation 1220 may input the CMAC 1225 along with the TCB version 1232, the ISV version 1234, the function 1236, the flag 1238, the user data 1240, and the current value of the measurement value register 1242. The output of CMAC 1225 can be stored in MAC 1244. The output of the EREPORT instruction can include key identifier 1230, TCB version 1232, ISV version 1234, function 1236, flag 1238, user data 1240, measurement value register 1242, and MAC 1244.

EREPORT命令は、対称鍵ベースのGMACを計測値レジスタ、ユーザデータ、およびさらなるコンテキスト情報(例えば、エンクレーブの機能およびフラグ)に行うための中間鍵を生成する。   The EREPORT instruction generates an intermediate key to do symmetric key based GMAC on the measurement value register, user data, and additional context information (eg, enclave functions and flags).

計測値レジスタに加えて、ユーザは256ビットの幅のデータブロックを提供して、レポートに含めさせることができる。ユーザは、多くのアプリケーション特定の値(例えばチャレンジャNONCEおよび/またはアプリケーション作成キー)の証明を希望する。これらの値は、単一のハッシュに低減(reduce)され、レポート内に含ませることができる。   In addition to the measurement value registers, the user can provide 256 bit wide data blocks to be included in the report. The user desires to prove many application specific values (eg Challenger NONCE and / or Application Creation Key). These values are reduced to a single hash and can be included in the report.

キーの磨耗を防ぐために、EREPORTを繰り返し呼び出して、乱数128ビット値(reportKeyIDとして知られている)を、プロセッサの各電力サイクルで生成して、内部の位置に格納する。この値は、この値を利用した2∧32AES処理の後に増分される。一実施形態では、EREPORT命令への各呼び出しによってこの値を1つ増分させる。

Figure 2019109910
表5−2:EREPORT構造 To prevent key wear, the EREPORT is called repeatedly to generate a random 128-bit value (known as reportKeyID) at each processor power cycle and store it in an internal location. This value is incremented after 2.sup.32 AES processing using this value. In one embodiment, each call to the EREPORT instruction increments this value by one.
Figure 2019109910
Table 5-2: EREPORT structure

レポート構造中のフラグフィールドは、チャレンジャがエンクレーブを信頼してよいかを確かめるために有用なので、エンクレーブについてのある状態情報を決定するために、または、EREPORT命令を呼び出したときに利用することができる。

Figure 2019109910
表5−4:フラグ The flag field in the report structure is useful to see if the challenger may trust the enclave, so it can be used to determine certain state information about the enclave or when invoking the EREPORT instruction. .
Figure 2019109910
Table 5-4: Flags

一実施形態では、適切な機能セットを有するアーキテクチャエンクレーブが、EGETKEYコマンドを有するCMAC処理で利用されるキーを取得することがアーキテクチャにより許可されているので、現在実行されているハードウェアでレポートが生成されたことを検証することができる。この機能はクオーティング・アーキテクチャ・エンクレーブに限定されている。   In one embodiment, an architecture enclave with the appropriate feature set is allowed by the architecture to obtain a key to be used in CMAC processing with the EGETKEY command, so the report is generated on currently running hardware It can be verified that it was done. This feature is limited to the Quarting Architecture Enclave.

エンクレーブ外で実行しているときにエンクレーブの計測値を取得するために、ERDMR(計測値読み取り)命令が提供される。この命令は、有効なSECSページへのポインタ、および、計測値を配信するアドレスへのポインタを採る。計測値は、MEASUREMENT構造の形態で配信される。MEASUREMENT構造は暗号による保護(暗号保護)はされない。

Figure 2019109910
An ERDMR (measure reading) instruction is provided to obtain enclave measurements when running outside the enclave. This instruction takes a pointer to a valid SECS page and a pointer to the address to which the measurement value is delivered. The measurements are distributed in the form of a MEASUREMENT structure. The MEASUREMENT structure is not cryptographically protected.
Figure 2019109910

エンクレーブページキャッシュ内にないときにはエンクレーブページは暗号により保護される。暗号保護には、機密保護、偽造保護、および再生保護という3つのレベルがある。一実施形態では、アプリケーションが、同じエンクレーブの他のページについて選択された保護レベルとは独立して各エンクレーブページの保護レベルを選択することができる。エンクレーブの実装により、アプリケーションは、偽造保護、偽造保護、および再生保護、機密保護および偽造保護、および機密保護、偽造保護、よび再生保護という組み合わせから選択を行うことができる。機密保護および偽造保護をエンクレーブページに行うには、GCM(Galois Counter Mode)等の幾つかの認証された暗号モードのうちいずれかを、AES等の適切な暗号法とともに利用することができる。しかし、再生保護には、より高度な解決法が要求される。   Enclave pages are cryptographically protected when not in the enclave page cache. There are three levels of cryptographic protection: security protection, forgery protection, and replay protection. In one embodiment, the application can select the protection level of each enclave page independently of the protection levels selected for other pages of the same enclave. The implementation of the enclave allows the application to choose from a combination of forgery protection, forgery protection, and replay protection, security and forgery protection, and security, forgery protection, and replay protection. To provide security and forgery protection to the enclave page, any of several authenticated cryptographic modes, such as Galois Counter Mode (GCM), can be used with appropriate cryptographic methods, such as AES. However, regeneration protection requires more sophisticated solutions.

図13は、本発明の一実施形態にみることができる、偽造保護および再生保護メカニズムを示している。偽造保護により、攻撃者が、プログラムが生成していない暗号化されたデータの別の値で置き換えることが防がれる。レプレイ保護により、攻撃者が、プログラムが生成した現在の最新値ではない暗号化されたデータの値で置き換えることが防がれる。ノードバージョン番号1300はIV1310に入り、その後GMAC1325アルゴリズムに入ることができる。子1305のバージョン番号は、データ1315をGMAC1325アルゴリズムに送ることができる。GMAC1325アルゴリズムは、キー1320、IV1310、およびデータ1315を組み合わせてMAC1330を生成する。   FIG. 13 illustrates a forgery protection and replay protection mechanism that can be found in one embodiment of the present invention. Counterfeit protection prevents an attacker from replacing the encrypted data not generated by the program with another value of the data. Replay protection prevents an attacker from replacing with the value of encrypted data that is not the current up-to-date value generated by the program. Node version number 1300 may enter IV 1310 and then enter the GMAC 1325 algorithm. The version number of child 1305 can send data 1315 to the GMAC 1325 algorithm. The GMAC 1325 algorithm combines the key 1320, IV 1310, and data 1315 to generate the MAC 1330.

再生保護によって、論理プロセッサが任意の時点に見るエンクレーブの全てのコンテンツが、破損してないエンクレーブの単一のスナップショットに属するように保証される。従って再生保護メカニズムは、エンクレーブバージョンのコンセプトを定義して、偽造保護されたエンクレーブページが、エンクレーブのそのバージョンに属すかを判断するメカニズムを提供する必要がある。この目的のために、再生保護メカニズムは、GMAC等のメッセージ認証アルゴリズムを利用して、偽造保護されたエンクレーブページ各々の内容をページバージョン番号に結びつける。GMACの場合には、このバージョンは、図13に示す初期化ベクトル(IV)の一部として利用することができる。   Replay protection ensures that all content of the enclave that the logical processor sees at any given time belongs to a single snapshot of the uncorrupted enclave. Therefore, the replay protection mechanism needs to define the concept of the enclave version to provide a mechanism to determine whether the forged protected enclave page belongs to that version of the enclave. To this end, the replay protection mechanism ties the contents of each forged protected enclave page to a page version number using a message authentication algorithm such as GMAC. In the case of GMAC, this version can be used as part of the initialization vector (IV) shown in FIG.

図14は、本発明の一実施形態に見られる中継保護メカニズムのMACツリー構造の部分の一例を示す。リーフノード1425は、個々のMACコンテンツページ1430のバージョン情報を含みうる。1420等の各リーフノードは、個々のMACコンテンツページを含む(不図示)。各内部ノード1410、1415は、リンク先の子のグループのバージョン情報を含みうる。ルート1400は、ツリーデータ構造の最高位のノードである。   FIG. 14 shows an example of a portion of the MAC tree structure of the relay protection mechanism found in an embodiment of the present invention. Leaf nodes 1425 may include version information for individual MAC content pages 1430. Each leaf node, such as 1420, contains an individual MAC content page (not shown). Each internal node 1410, 1415 may include version information of the linked child group. The root 1400 is the top node of the tree data structure.

全エンクレーブに対するバージョン付けを拡張するために、再生保護メカニズムは、バージョンツリーを維持する。リーフノードは、エンクレーブインスタンスの個々の再生保護されたページのバージョンを含む。各内部ノードは、子の各グループのバージョンを提供するので、それらが表すページのバージョン情報を論理的に保持している。図14はこのコンセプトを図式化している。   In order to extend the versioning for all enclaves, the playback protection mechanism maintains a version tree. Leaf nodes contain versions of individual replay protected pages of the enclave instance. As each internal node provides a version of each group of children, it logically holds the version information of the page that they represent. Figure 14 illustrates this concept.

一実施形態では、O(n)ページをO(log n)へと処理する必要のあるデータ数を低減させるようにツリー構造が選択されている。ハッシュツリーではなくてバージョンツリーを利用することで、ツリーを更新することなくEPCからのページの強制退去が可能となる。   In one embodiment, the tree structure is selected to reduce the number of data that needs to be processed to O (log n) pages. By using a version tree instead of a hash tree, it is possible to evict pages from the EPC without updating the tree.

再生保護では各ページのバージョンが暗号的に自身の内容に結び付けられている必要があるので、再生保護では偽造保護が必要となる。従って、SEアーキテクチャにおいては偽造保護が必須である。さらに、SEを始めから実装しておくことにより、サポートされる保護の組み合わせのリストがさらに制限されうる。   Reproduction protection requires forgery protection, as reproduction protection requires that each page version be cryptographically linked to its content. Therefore, forgery protection is essential in the SE architecture. Furthermore, implementing SE from scratch may further limit the list of supported protection combinations.

OS/VMMは、ECREATE命令を実行することによりエンクレーブを生成する。エンクレーブの生成中に、エンクレーブにより保護されるリニアアドレスの範囲が特定される。このリニアアドレスの範囲は、エンクレーブリニア空間(ELS)レンジとして知られている。   The OS / VMM generates an enclave by executing the ECREATE command. During generation of the enclave, the range of linear addresses protected by the enclave is identified. This linear address range is known as the enclave linear space (ELS) range.

ひとたびエンクレーブが生成されると、ELSレンジに属している個々のページを、EADDPRE命令を利用してエンクレーブに追加する。EADDPRE命令は、追加されたページの各々を、これらのページをエンクレーブページキャッシュ内に移動させることにより、エンクレーブ保護領域に移動させる。EWBINVPGを利用してこれらページのいずれかがEPC外に置かれている場合、論理プロセッサは、これらページに暗号保護を行う。   Once the enclave is created, the individual pages belonging to the ELS range are added to the enclave using the EADDPRE instruction. The EADDPRE instruction moves each of the added pages into the enclave protected area by moving those pages into the enclave page cache. If any of these pages are located outside of the EPC using EWBNVPG, the logical processor will provide cryptographic protection to these pages.

暗号保護は、各エンクレーブページに暗号メタデータを関連付けることにより行われる。メタデータは、uCodeのフローにより、様々なプロセッサ命令がエンクレーブページのコンテンツを復号して、各エンクレーブページの信頼性/フレッシュネスを検証するために利用される。SEアーキテクチャは、暗号メタデータを更新、管理、およびその正当性を立証(validate)するためにこのような命令を幾つか提供する。   Cryptographic protection is achieved by associating cryptographic metadata with each enclave page. The metadata is used by the flow of uCode to enable various processor instructions to decrypt the contents of the enclave page and to verify the reliability / freshness of each enclave page. The SE architecture provides some such instructions to update, manage, and validate cryptographic metadata.

各エンクレーブページは、セキュリティ情報SEC_INFOデータ構造に関連付けられている。SEC_INFOデータ構造の目的は、ページを復号および検証する必要のある暗号メタデータを保持することである。SEC_INFO構造の様々なフィールドは以下の通りである。

Figure 2019109910
Each enclave page is associated with a security information SEC_INFO data structure. The purpose of the SEC_INFO data structure is to hold cryptographic metadata that needs to be decrypted and verified for the page. The various fields of the SEC_INFO structure are as follows:
Figure 2019109910

セキュリティ情報フラグ(SEC_INFO.Flags)は、保護されているページのページタイプ、暗号およびアクセス保護を記述する。

Figure 2019109910
Figure 2019109910
Figure 2019109910
The security information flag (SEC_INFO.Flags) describes the page type, encryption and access protection of the page being protected.
Figure 2019109910
Figure 2019109910
Figure 2019109910

セキュリティマップ(SMAP)は、エンクレーブページのフレッシュネスを検証するために必要となる暗号メタデータを格納するのに利用されるデータ構造である(つまり再生保護)。セキュリティマップは、エンクレーブの特定のスナップショットの完全バージョンのツリーを表す。セキュリティマップの各ノードは、256の子のノード(リーフノードの場合にはエンクレーブページ)のバージョンを保持する。セキュリティノードに関するさらなるメタデータが、特定のSMAPノードのSEC_INFO内に含められる。   A Security Map (SMAP) is a data structure that is used to store cryptographic metadata needed to verify the freshness of enclave pages (ie, replay protection). The security map represents a tree of the full version of a particular snapshot of an enclave. Each node in the security map holds a version of 256 child nodes (enclave pages in the case of leaf nodes). Additional metadata about the security node is included in the SEC_INFO of a particular SMAP node.

一実施形態では、セキュリティマップツリーは2レベル深くてよく(セキュリティマップの深さは、SEアーキテクチャによりサポートされるエンクレーブのサイズに関している。Gen1では、SEアーキテクチャは最大エンクレーブサイズ32GBをサポートしている。)、エンクレーブ内のエンクレーブページのエンクレーブオフセットを利用してアクセスされる。SMAPのルートは、SECSに含められ、128の子のノードのバージョンのみを保持する。エンクレーブオフセットのビットは、適切な子を選択するのに利用され、SMAPにインデックスするのに利用される。gen1では、エンクレーブオフセットは35ビット長である。エンクレーブオフセットは、以下の公式により抽出される(エンクレーブリニアアドレス&エンクレーブマスク)。エンクレーブマスクは、(エンクレーブのサイズ−1)で求められ、ECREATE中に計算することができる。

Figure 2019109910
In one embodiment, the security map tree may be two levels deep (the security map depth relates to the size of the enclave supported by the SE architecture. In Gen 1 the SE architecture supports a maximum enclave size of 32 GB). ), Accessed using the enclave offset of the enclave page within the enclave. The root of the SMAP is included in the SECS and holds only 128 child node versions. The enclave offset bits are used to select the appropriate children and are used to index into SMAP. For gen1, the enclave offset is 35 bits long. The enclave offset is extracted by the following formula (enclave linear address & enclave mask). The enclave mask is determined by (enclave size-1) and can be calculated during ECREATE.
Figure 2019109910

一般的には、深さl>1において、ビットN−(l)×8からN−(l+1)×8+1を利用して、次のレベルの適切な子を選択する。   In general, at depth l> 1, bits N- (l) x8 to N- (l + 1) x8 + 1 are used to select the appropriate child at the next level.

注:セキュリティマップは、論理データ構造であり、アーキテクチャではない。論理プロセッサは、SMAPが位置しているリニアアドレス空間の位置についてすら認識していない。システムソフトウェアは、セキュリティマップを維持および探索(walking)する役割を担う。セキュリティマップの各個々のノードは、アーキテクチャにより定義された構造を有するが、アーキテクチャは、セキュリティマップがどのようにメモリ内に維持されているかを特定しない。しかし、セキュリティマップ内の各ノードが、セキュリティマップ内によく定義された論理位置を有しており、ノードがマップ内であちこち移動する場合にはセキュリティマップに関する様々なプロセッサ命令が、それを攻撃のシナリオとして解釈する、ということに留意されたい。   Note: The security map is a logical data structure, not an architecture. The logic processor does not even know about the location of the linear address space where the SMAP is located. System software is responsible for maintaining and walking security maps. Each individual node of the security map has an architecture defined structure, but the architecture does not specify how the security map is maintained in memory. However, each node in the security map has a well-defined logical location in the security map, and various processor instructions for the security map attack it if the node moves around in the map. Note that it is interpreted as a scenario.

ルートセキュリティノードは、SECSに含まれており、128の子のバージョン情報を含んでいる。非ルートセキュリティノードは、保護されたページであり、関連付けられたSEC_INFO(and its associated SEC_INFO)である。保護されたページは、256の子のバージョン情報を含む。

Figure 2019109910
The root security node is included in SECS and contains version information of 128 children. A non-root security node is a protected page and is an associated SEC_INFO (and its associated SEC_INFO). The protected page contains version information of 256 children.
Figure 2019109910

SEC_INFOは、SMAP内のSMAPの位置を含む。SMAPの位置は、リニア/エンクレーブオフセットおよびページタイプSMAP_LEVEL_1およびSMAP_LEVEL_2により決定される。   SEC_INFO contains the position of SMAP in SMAP. The position of SMAP is determined by the linear / enclave offset and page types SMAP_LEVEL_1 and SMAP_LEVEL_2.

再生保護されたエンクレーブページを追加するためには、SMAPの親が生成されて、FCRビットがクリアされた状態でEPC内に常駐している必要がある。エンクレーブページの整合性を検証するために、論理プロセッサは、SEC_INFO構造内のIV_Pおよびkey_idを利用してキーを生成する。このキーを利用して、SEC_INFO構造およびページの内容内のフラグに対してMACを計算する。計算されたMACは、SEC_INFO構造内に設けられているMACと比較される。MAC同士が整合する場合に、このページが整合性チェックに合格したとみなすことができる。   In order to add a replay protected enclave page, the SMAP's parent needs to be created and reside in the EPC with the FCR bit cleared. To verify the integrity of the enclave page, the logical processor generates keys using IV_P and key_id in the SEC_INFO structure. This key is used to calculate the MAC for the SEC_INFO structure and the flags in the content of the page. The calculated MAC is compared to the MAC provided in the SEC_INFO structure. If the MACs match, this page can be considered to pass the consistency check.

論理プロセッサは、ELPG命令を利用してEPCにページを装填するときに、ページの整合性を検証する。この命令の一部として、論理プロセッサは、ページの検証に利用されたSEC_INF構造からIV_Pを記憶する(note down)。   The logic processor verifies page integrity when loading pages into the EPC using ELPG instructions. As part of this instruction, the logical processor notes down IV_P from the SEC_INF structure used to verify the page.

エンクレーブページのフレッシュネスを検証するために、論理プロセッサは、エンクレーブページおよびそのsmapの親がEPCに装填されており、smapの親がフレッシュであることを検証する。そして、ページのバージョンを、smapの親に格納されているバージョンと比較する。これら2つのバージョンが合致した場合には、プロセッサは、このページの新たなバージョンを生成して、smapの親のバージョンとエンクレーブページのバージョンを更新する。最後に、エンクレーブページをフレッシュであると表示する。   To verify the freshness of the enclave page, the logic processor verifies that the enclave page and its smap's parent have been loaded into the EPC and that the smap's parent is fresh. Then compare the version of the page with the version stored in the parent of smap. If these two versions match, the processor generates a new version of this page to update the parent version of the smap and the enclave page version. Finally, show the enclave page as fresh.

注:新たなバージョン生成によって、ページを修正可能なものにすることができる。これにより、アーキテクチャおよび実装両方が簡単になる。   Note: A new version can make a page modifiable. This simplifies both architecture and implementation.

エンクレーブページを除去するために、論理プロセッサは、エンクレーブページとそのsmapの親とがEPCに装填されており、両方ともフレッシュであることを検証する。そして、smapの親のページのバージョンを0に設定して、エンクレーブページのEPCスロットを利用可能であると表示する。   To remove the enclave page, the logic processor verifies that the enclave page and its smap's parent have been loaded into the EPC and both are fresh. Then, set the version of the smap's parent page to 0, indicating that the EPC slot of the enclave page is available.

エンクレーブページキャッシュ(EPC)は、CPUが、SE暗号保護により暗号保護を受けていないエンクレーブページを一時的に格納するために利用するセキュアなストレージである。   Enclave page cache (EPC) is a secure storage that the CPU uses to temporarily store enclave pages that are not cryptographically protected by SE cryptographic protection.

以下の要件がEPCで特定される。非デバッグエンクレーブに属すEPCに装填されるエンクレーブメモリページへのアクセスは、エンクレーブ外のソフトウェア実体による修正から保護することができる。攻撃者は、直接のハードウェア攻撃では、EPCに装填されている非デバッグエンクレーブに属す平文データを読み取ることができない。また攻撃者は、直接のハードウェア攻撃では、非デバッグエンクレーブに属すEPCのデータを修正することができない。システムのCPUは、EPCに装填されるデータにコヒーレント且つセキュアにアクセスすることができる。   The following requirements are identified in the EPC: Access to enclave memory pages loaded into EPCs belonging to non-debug enclaves can be protected from modification by software entities outside the enclave. Attackers can not read plaintext data belonging to non-debug enclaves loaded in the EPC with direct hardware attacks. Also, attackers can not modify the data of EPCs belonging to non-debug enclaves with direct hardware attacks. The system's CPU can coherently and securely access the data loaded into the EPC.

EPCを実装するメカニズムは幾つかある。EPCは、オンダイSRAMまたはeDRAMの上に実装可能である。EPCはさらに、CPUの最終レベルキャッシュのやり方を動的に隔離することにより構築することもできる。この実装例では、パッケージの外部からの許可されていないアクセスからEPCを保護することができる。一方でシステム内の他のパッケージは、EPCにコヒーレント且つセキュアにアクセスすることができる。   There are several mechanisms to implement EPC. The EPC can be implemented on an on-die SRAM or eDRAM. The EPC can also be built by dynamically isolating the CPU's final level cache approach. In this implementation, the EPC can be protected from unauthorized access from outside the package. Meanwhile, other packages in the system can access the EPC coherently and securely.

EPCを実装する別のメカニズムに、クリプト・メモリ・アパーチャ(Crypto Memory Aperture)がある。クリプト・メモリ・アパーチャ(Crypto Memory Aperture)は、プラットフォームDRAMを利用して暗号により保護された揮発性ストレージを生成する費用効果のよいメカニズムを提供する。CMAは、CPUアンコア(CPU uncore)内の1以上の戦略的に配置された暗号ユニットを利用してカスタマ技術が必要とする様々なレベルの保護を提供する。様々なアンコア(uncore)エージェントは、CMAに対するメモリアクセスを認識し、これら25のアクセスをアンコア内に位置しているクリプト・コントローラにルーティングするよう修正される。クリプト・コントローラは、所望の保護レベルに応じて、プラットフォームDRAMへの1以上のメモリアクセスを生成して、暗号文を取得する。そして、暗号文を処理して、平文を得て、元のCMAメモリ要求を満たす。CMAは、Intel QuickPathインターコネクト(QPI)プロトコルに完全に統合されており、QPIプロトコルへのセキュリティ拡張によりマルチパッケージプラットフォームにスケーリングされる。マルチパッケージプラットフォーム30の構成では、CMAは、外的に対面している(externally facing)QPIリンク層のリンクレベルのセキュリティ(Link−Sec)エンジンを利用して、Intel CPUの間のメモリ転送を保護する。   Another mechanism to implement EPC is Crypto Memory Aperture. Crypto Memory Aperture provides a cost effective mechanism for generating cryptographically protected volatile storage utilizing platform DRAM. The CMA utilizes one or more strategically placed cryptographic units within a CPU uncore to provide various levels of protection that customer technology requires. Various uncore agents are aware of memory accesses to the CMA and are modified to route these 25 accesses to the crypto controller located in the uncore. The crypto controller generates one or more memory accesses to the platform DRAM to obtain ciphertext, depending on the desired level of protection. The ciphertext is then processed to obtain the plaintext to satisfy the original CMA memory request. CMA is fully integrated with the Intel QuickPath Interconnect (QPI) protocol and is scaled to a multi-package platform with security extensions to the QPI protocol. In the multi-package platform 30 configuration, the CMA uses the externally facing QPI link layer link level security (Link-Sec) engine to protect memory transfers between Intel CPUs Do.

SECSは、EPCに現在装填されている場合にアクティブと称される。本書類では後述するように、OS/VMMは、EPCに装填されるものを管理する役割を果たす。しかし、EPCにエンクレーブページを装填する間に、OS/VMMは、その対象ページ自身がSECSである場合を除いて、CPUにそのページのSECSの所在を伝える。装填されているページがSECSではない場合には、CPUは、そのページに対応するSECSをEPC内に配置するよう要求する。エンクレーブのページを装填する前にはいつでも、OS/VMMは、そのエンクレーブのSECSをEPCに装填してよい(MAY load)。   The SECS is said to be active when currently loaded into the EPC. As described later in this document, the OS / VMM is responsible for managing what is loaded into the EPC. However, while loading the enclave page into the EPC, the OS / VMM informs the CPU of the SECS's whereabouts of the page except when the target page itself is SECS. If the page being loaded is not a SECS, the CPU requests that the SECS corresponding to the page be placed in the EPC. At any time prior to loading an enclave page, the OS / VMM MAY load the enclave's SECS into the EPC.

CPUは、SECSをEPCに装填することのできる回数に対しては制約を課しはしないが、OS/VMMがエンクレーブページキャッシュにSECSのコピーを複数装填するようなことが頻繁に行われるとは考えにくい。とはいえ、もしも同じSECSの複数のコピーがEPCに装填される場合には、これらコピーそれぞれを別個のアクティブSECSインスタンスとして捉え、アクティブSECSの異なるインスタンスに属すEPCに装填されたエンクレーブページを、ハードウェアによりそれぞれ異なるエンクレーブに属すものとして捉える。   The CPU imposes no restrictions on the number of times that the SECS can be loaded into the EPC, but it is likely that the OS / VMM will load multiple copies of the SECS into the enclave page cache frequently. Very Hard to think. However, if multiple copies of the same SECS are loaded into the EPC, then each of these copies is considered as a separate active SECS instance, and enclave pages loaded into EPCs belonging to different instances of active SECS can be It is regarded as belonging to different enclaves depending on the wear.

OS/VMMは、EPCを、システムアドレス空間の物理メモリの連続ブロックとしてとらえる(10)。しかし、内部ストレージを低減させて、高速インデックスを可能とするために、CPUは、スロット識別子(SID)を各EPCページに関連付ける。EPCページの物理アドレスおよび対応するスロット識別子は、以下のように互いに関連している。
sid=(page_pa-epc_base_pa)>>12
page_pa=pc_base_p|(sid<<12)
The OS / VMM sees the EPC as a contiguous block of physical memory in system address space (10). However, in order to reduce internal storage and allow for a fast index, the CPU associates a slot identifier (SID) with each EPC page. The physical address of the EPC page and the corresponding slot identifier are related to one another as follows.
sid = (page_pa-epc_base_pa) >> 12
page_pa = pc_base_p | (sid << 12)

ハードウェアは、0xFFという特殊なスロットを用いて、無効なスロットを示す。EPCスロット識別子は、uCodeおよびPMH両方により利用されて、エンクレーブページに関する情報を追跡する。   The hardware uses a special slot of 0xFF to indicate an invalid slot. The EPC slot identifier is utilized by both uCode and PMH to track information about enclave pages.

EPCに装填される全てのエンクレーブページは、よく定義されたシステム物理アドレスを有する。EPCに属す物理アドレスおよびEPCスロット識別子間に一対一のマッピング関係があることから、EPCに装填される各ページは自身のEPCスロット識別子あるいはEPC_SIDを有するということができよう。   All enclave pages loaded into the EPC have a well-defined system physical address. Because there is a one-to-one mapping between the physical address belonging to the EPC and the EPC slot identifier, each page loaded into the EPC could be said to have its own EPC slot identifier or EPC_SID.

加えて、SECSページを除く、EPCに装填される全てのエンクレーブページは、アクティブSECSインスタンスと関連付けられる。アクティブSECSインスタンスが、EPCに装填されたSECSページにすぎないことを想起されたい。この結果、アクティブSECSページも自身のEPC_SIDを有する。非SECSエンクレーブページが属すSECSページのEPC_SIDは、非SECS25ページのSECS_SIDと称される。EPCに装填される各ページについて、ハードウェアはSECS_SIDの記録をとっておく。EPCに装填されるSECSページのSECS_SIDは、0xFF(または無効SID)と定義される。   In addition, all enclave pages loaded into the EPC, except the SECS pages, are associated with the active SECS instance. Recall that the active SECS instance is only the SECS page loaded into the EPC. As a result, the active SECS page also has its own EPC_SID. The EPC_SID of the SECS page to which the non-SECS enclave page belongs is referred to as the SECS_SID of the non-SECS 25 page. The hardware keeps a record of SECS_SID for each page loaded into the EPC. The SECS_SID of the SECS page loaded into the EPC is defined as 0xFF (or invalid SID).

EPCMは、プロセッサがページキャッシュの内容を追跡するために利用するセキュアな構造である。30EPCMは、EPCに現在装填されている各ページのきっちり1つのエントリを保持する。それが表すページにおいては、各EPCMエントリが、ページが属すエンクレーブ、ページがエンクレーブページキャッシュに移動させられるリニアアドレス、ページのバージョン等の情報を追跡する。EPCM構造は、アドレス変換フローにおいてCPUにより利用されて、EPCに装填されるエンクレーブページに対してアクセス制御を実施する。EPCMエントリは、(x)uCodeにより、様々な命令フローの一環として管理される。   The EPCM is a secure structure that the processor uses to track the contents of the page cache. The 30 EPCM holds exactly one entry for each page currently loaded into the EPC. In the page it represents, each EPCM entry tracks information such as the enclave to which the page belongs, the linear address by which the page is moved to the enclave page cache, the version of the page, and so on. The EPCM structure is utilized by the CPU in the address translation flow to perform access control on enclave pages loaded into the EPC. EPCM entries are managed by (x) uCode as part of various instruction flows.

本発明の一実施形態では、エンクレーブページキャッシュ(EPC)は、割り当て、割り当て解除が動的に行われてよい。一実施形態では、オペレーティングシステム等のソフトウェアが、EPC等のメモリページを割り当てたり、EPCのメモリ割り当て解除を行ったりする。一実施形態では、オペレーティングシステムは、エンクレーブの任意のページをEPC内に割り当てることもできる。一部の実施形態では、EPCは、メモリ内の全ての利用可能な位置を占めてよい。一実施形態において、動的EPCの固定EPCとの1つの違いは、動的EPCがメモリのページの追加および除去を可能とすることである。一実施形態では、ソフトウェアドライバ等の論理が、メモリ領域をEPCとして割り当てたり、EPCのメモリ割り当てを解除したりする。一実施形態では、起動前処理によりメモリの各ページのメタデータの格納に利用できるメモリがチェックされ、ソフトウェアがページをEPCまたは非EPCであると宣言し、ハードウェア論理が各ページの属性の追跡・実施(enforce)を行ってよい。   In one embodiment of the present invention, enclave page cache (EPC) may be dynamically allocated and deallocated. In one embodiment, software, such as the operating system, allocates memory pages, such as the EPC, and performs memory de-allocation of the EPC. In one embodiment, the operating system can also allocate any page of enclaves in the EPC. In some embodiments, the EPC may occupy all available locations in memory. In one embodiment, one difference between a dynamic EPC and a fixed EPC is that the dynamic EPC allows for the addition and removal of pages of memory. In one embodiment, a logic, such as a software driver, allocates a memory area as an EPC or deallocates a memory of the EPC. In one embodiment, the pre-boot process checks the memory available to store metadata for each page of memory, and the software declares the page as EPC or non-EPC, and the hardware logic tracks attributes of each page -Enforcement may be performed.

一実施形態では、ハードウェア論理は、変換ルックアサイドバッファ(TLB)およびページミスハンドラ(PMH)によって、EPCとして利用されるメモリに対するアクセスを制御してよい。一実施形態では、検索アドレスがTLB内に合致するものがあるとき(TLBヒットとして知られている)、セキュアなエンクレーブがEPCを退出するときにTLBをフラッシュしてよい。一実施形態では、検索アドレスがTLBに合致するものがない場合(TLBミスとして知られている)、さらなるルックアップによって、複数のメモリ参照においてエンクレーブページキャッシュマップ(EPCM)からデータを取得することができる。一実施形態では、PMHは、EPCMのルックアップを行うことができる。別の実施形態では、PMHのレンジレジスタをチェックして、連続物理アドレス、EPCに対する制御を制御する。オペレーティングシステムは、EPCページへのアクセスとして、直接メモリアクセス(DMA)を許可しない。もしもメモリの戻りページが、エンクレーブページとして表示されていた場合には、そのページのセキュアなエンクレーブ制御構造識別子(SECSID)を、現在実行中のエンクレーブと比較して、アクセスがセキュアであることを確かめてよい。戻りページのSECSIDと、現在実行中のエンクレーブのものとが合致しない場合には、PMHは停止メッセージを発行してよい。メモリの戻りページがエンクレーブページとして表示されていない場合、またはメモリの戻りページがエンクレーブページとして表示されており、そのページのSECSIDが実行中のエンクレーブのものと合致する場合には、PMHは、ページ変換をTLBに装填してよい。一実施形態では、キャッシュタグを利用して、書き戻しサイクルで他のラインからエンクレーブラインを識別することができる。しかし、少なくとも1つの実施形態では、そのタイプのメモリ要求が書き戻しサイクル中にEPCMにアクセスすると論理が判断する場合には、キャッシュタグは利用されない。   In one embodiment, hardware logic may control access to memory utilized as an EPC by means of a translation lookaside buffer (TLB) and a page miss handler (PMH). In one embodiment, the secure enclave may flush the TLB as it exits the EPC when there is a match for the search address in the TLB (known as a TLB hit). In one embodiment, if there is no search address that matches the TLB (known as a TLB miss), then further lookup may retrieve data from the Enclave Page Cache Map (EPCM) at multiple memory references. it can. In one embodiment, the PMH can perform an EPCM lookup. In another embodiment, the PMH range register is checked to control control over the continuous physical address, EPC. The operating system does not allow direct memory access (DMA) as access to EPC pages. If the memory return page is displayed as an enclave page, then compare the secure enclave control structure identifier (SECSID) of the page with the currently executing enclave to ensure that the access is secure. You may If the SECSID of the return page does not match the one of the currently executing enclave, the PMH may issue a stop message. If the return page of memory is not displayed as an enclave page, or if the return page of memory is displayed as an enclave page and the SECSID of the page matches that of the executing enclave, then PMH will The translation may be loaded into the TLB. In one embodiment, cache tags can be used to identify enclave lines from other lines in a write back cycle. However, in at least one embodiment, the cache tag is not utilized if the logic determines that type of memory request accesses the EPCM during a write back cycle.

本発明の一実施形態では、ソフトウェア、BIOSが、オペレーティングシステムが起動してエンクレーブページを作成する前に、メモリを割り当てることができる。一実施形態では、ソフトウェアは、BIOSの一連のステップによりEPCを生成することができる。BIOSは、あるメモリをメタデータの格納用にリザーブすることができ、各プロセッサについてレンジレジスタを設定することができる。BIOSは、ベースアドレスおよびメモリサイズを入力とすることができる。システム構成は、MCHECKという処理によりチェックされて、全てのパッケージおよび全てのコアにおける全てのレジスタを、エンクレーブ外のアクセスから保護することができる目的に適した設定とする。MCHECKは、システムがリセットされるまでレジスタをロックする。別の実施形態では、ソフトウェアは、メモリの部分をEPCの一部と宣言することの出来るEPCADDとして知られている命令によりEPCにページを追加することができる。EPCADDシーケンスは、メモリアドレスを入力とすることができ、成功または失敗を示すメッセージを出力することができる。EPCADDが成功を示すメッセージを出力する場合には、EPCADDは、EPCM.Eビットを設定することができ、その物理アドレスに対応するページをシステムの全てのTLBからフラッシュする。本発明の一実施形態では、EPCADDは、RAXにおける01のエラーコードを戻して、入力アドレスを有するページが既にEPCページであることを示し、02のエラーコードを戻して、入力アドレスが範囲外であることを示すことができる。EPCADDがEPCの一部であるとして宣言するメモリページは、EPCセマンティクスにデータにアクセスするよう要求してよい。本発明のこの実施形態では、ソフトウェアは、EWBINVGとして知られている命令のEPCからページを除去して、暗号化されたデータを、暗号保護および整合性保護を継続させながら、引き続き利用可能にすることができる。このフォーマットのデータは、ハードディスクドライブの通常メモリに格納することができる。また別の実施形態では、EPCREMOVEとして知られている命令のソフトウェアが、EPC内のページを除去して、暗号化されたデータを利用不可能にすることができる。EPCREMOVEを実行するハードウェアは、ページおよびEPCMの部分をクリアする。EPCREMOVEは、先ずEWBINVPGを実行することなく実行することができる。一実施形態では、EPCREMOVEシーケンスは、メモリアドレスに基づいてEPCからページを除去することができる。本発明の一実施形態では、EPCREMOVE命令は、RAXに01のエラーコードを含み、除去されるページが、セキュアなエンクレーブ制御構造(SECS)の一部であり、除去不可能であることを示し、02のエラーコードは、除去されるページがEPCページではないことを示す。メモリのページのグローバルTLB撃墜は、本発明の一実施形態におけるEPCREMOVEから生じてよく、ページに前に占有されていたメモリは、汎用ソフトウェアアクセス用に利用可能となってよい。   In one embodiment of the present invention, software, BIOS, may allocate memory before the operating system boots to create an enclave page. In one embodiment, software can generate an EPC by a series of steps in the BIOS. The BIOS can reserve certain memory for metadata storage and can set range registers for each processor. The BIOS can take a base address and a memory size as input. The system configuration is checked by a process called MCHECK to make settings suitable for the purpose of being able to protect all packages and all registers in all cores from access outside the enclave. MCHECK locks the register until the system is reset. In another embodiment, software can add pages to the EPC with an instruction known as EPCADD, which can declare portions of memory as part of the EPC. The EPCADD sequence can take a memory address as input and can output a message indicating success or failure. If EPCADD outputs a message indicating success, then EPCADD is processed as EPCM. The E bit can be set, and the page corresponding to that physical address is flushed from all TLBs of the system. In one embodiment of the invention, EPCADD returns an error code of 01 in RAX to indicate that the page with the input address is already an EPC page, and an error code of 02, the input address is out of range It can be shown that there is. Memory pages that EPCADD declares to be part of EPC may require EPC semantics to access data. In this embodiment of the invention, the software removes the page from the EPC of the instruction known as EWBINVG to keep the encrypted data available while continuing the cryptographic protection and integrity protection. be able to. Data of this format can be stored in the normal memory of the hard disk drive. In yet another embodiment, the software of the instruction known as EPCREMOVE can remove the pages in the EPC to make the encrypted data unusable. The hardware executing EPCREMOVE clears the page and the part of EPCM. EPCREMOVE can be performed without first executing EWBINVPG. In one embodiment, the EPCREMOVE sequence can remove pages from the EPC based on memory addresses. In one embodiment of the present invention, the EPCREMOVE instruction indicates that the RAX contains an error code of 01 and the page to be removed is part of a secure enclave control structure (SECS) and can not be removed. An error code of 02 indicates that the page to be removed is not an EPC page. A global TLB hit of a page of memory may result from EPCREMOVE in one embodiment of the invention, and the memory previously occupied by the page may be available for general software access.

PMHは、メモリ空間の保護されている領域へのアクセスを防止する。アーキテクチャによっては、これは、EPCへのアクセスの物理アドレスチェックのみといった簡単なもので済むこともある。さらなるPMHサポートを利用して、SEの性能向上または別の実装が可能となる場合もある。SEアーキテクチャは、エンクレーブページキャッシュに対するエンクレーブページへの不正アクセス防止にページミスハンドラ(PMH)を利用する。PMHは様々なイベントを検知して、これらイベントをマイクロコードに報告する。マイクロコードは、イベントをOS/VMMに報告してよい。次いでOS/VMMは、不良を修復するために適切な命令を実行することができる。   The PMH prevents access to protected areas of the memory space. Depending on the architecture, this may be as simple as only physical address checking for access to the EPC. Additional PMH support may be used to allow SE performance or other implementations. The SE architecture uses a page miss handler (PMH) to prevent unauthorized access to enclave pages for enclave page caches. The PMH detects various events and reports these events to the microcode. The microcode may report the event to the OS / VMM. The OS / VMM can then execute appropriate instructions to repair the fault.

ECREATE命令を利用してエンクレーブを作成する場合には、リニアアドレスレンジをそのエンクレーブに対して指定する。このレンジは、そのエンクレーブの「リニアアドレスレンジ(linear address range)」と称される。エンクレーブのリニアアドレスレンジに属すメモリページは全て、エンクレーブの保護下にあり、SEC_INFOエントリが関連付けられていると考えることができる。   When creating an enclave using the ECREATE instruction, specify a linear address range for that enclave. This range is referred to as the "linear address range" of that enclave. All memory pages that belong to the enclave's linear address range are under the enclave's protection and can be considered as being associated with a SEC_INFO entry.

あるエンクレーブのリニアアドレスレンジに属すメモリページも、「エンクレーブページ(enclave page)」と称される。エンクレーブ内で実行しているプログラムは、エンクレーブページキャッシュ内に装填されておりそのページの所有者であるエンクレーブであるエンクレーブページにのみアクセスを許可される。プロセッサは、こうではない場合には例外クラスイベントを生成する。OS/VMMは、必要に応じて、エンクレーブページをEPCに装填する責任を負う。   Memory pages that belong to a certain enclave linear address range are also referred to as "enclave pages". Programs running within the enclave are only allowed access to the enclave page that is loaded into the enclave page cache and is the enclave owner of the page. The processor generates an exception class event if this is not the case. The OS / VMM is responsible for loading the enclave page into the EPC as needed.

論理プロセッサがエンクレーブを実行しており、そのエンクレーブページにメモリアクセスを生成する場合、このメモリアクセスは「エンクレーブアクセス(enclave access)」と称される。正しい実体によりアクセスされていることを確かめるためにかドレスチェックが行われてよい。   If the logical processor is executing an enclave and generates a memory access to the enclave page, this memory access is referred to as "enclave access". A dress check may be performed to make sure that the correct entity is being accessed.

一実施形態では、PMHは、アクセス制御機能を提供して、プログラムがエンクレーブ内で実行していないときにEPCを保護する。各論理プロセッサについてイネーブルされているレンジレジスタは、プロセッサがエンクレーブコードを実行していないときにEPCに対するアクセスを制限する。このレンジレジスタは、プロセッサがエンクレーブコードの実行を開始するとディセーブルされる。その持ち場において、プロセッサは特殊なページテーブルを定位置に置く。これらページテーブルは、プロセッサによる制御を受けて、そのエンクレーブが所有しているEPCページのみにアクセスを許可する。プロセッサおよびマイクロコードは、これら2つのメカニズムを利用してEPCへのアクセスを制限する。   In one embodiment, the PMH provides access control functionality to protect the EPC when the program is not running in the enclave. The range register enabled for each logical processor limits access to the EPC when the processor is not executing enclave code. This range register is disabled when the processor starts executing the enclave code. In its place, the processor places a special page table in place. These page tables are controlled by the processor and allow access only to EPC pages owned by the enclave. The processor and microcode use these two mechanisms to limit access to the EPC.

一部の実施形態では、性能、実装の複雑性、シリコンのコストといった数多くの軸同士の間を調整されてよい。この章では、開発者に対して可能性ある調整例の幾つかを示すために3つの実装例を紹介する。以下の表8−1は、これら保護の例および必要となるPMHサポートを示す。

Figure 2019109910
In some embodiments, coordination may be made between many axes such as performance, implementation complexity, cost of silicon. In this chapter, three implementation examples are introduced to show the developer some of the possible tuning examples. Table 8-1 below shows examples of these protections and the required PMH support.
Figure 2019109910

表8−1の第1行に示すとおり、必要なアクセス制御保護を提供するには追加のレンジレジスタは1つでよい。この特定の実装例では、他の保護はマイクロによって提供される。レンジレジスタは、論理プロセッサごとにイネーブルされてよい。このメカニズムを利用する基本実装例を図2−2に示す。   As shown in the first row of Table 8-1, there may be one additional range register to provide the necessary access control protection. In this particular implementation, other protection is provided by Micro. Range registers may be enabled per logical processor. A basic implementation using this mechanism is shown in Figure 2-2.

PMHは、マイクロコードモードでもエンクレーブモードでも実行されていないLPからCMAレンジ(CPUのCMRRがカバーしている)へのアクセスを除去するよう修正される。加えて、エンクレーブモードで実行しているLPは、CMAのEPCサブレンジにのみアクセスを許可される。   The PMH is modified to remove access to the LP to CMA range (covered by the CMRR of the CPU) that is not running in microcode mode or in enclave mode. In addition, LPs running in enclave mode are only allowed access to the EPC sub-range of the CMA.

図15は、ページ不良エラーコードマップの実装を示す本発明の一実施形態を示す。ビット5 1540が設定されている場合、ビット9、ビット8、ビット7、ビット6を一緒に復号して、ページ不良エラーコードを決定することができる。resビット1512、I/Dビット1514、REVDビット1516、U/Sビット1518、W/Rビット1520、Pビット1522。   FIG. 15 shows an embodiment of the invention showing the implementation of a page failure error code map. If bit 51540 is set, then bit 9, bit 8, bit 7, bit 6 can be decoded together to determine a page fault error code. Res bit 1512, I / D bit 1514, REVD bit 1516, U / S bit 1518, W / R bit 1520, P bit 1522.

あるページがEPCにない場合、その旨を伝えるために「不良」がOS/VMMに提供される。表8−2に示すように、ページ不良エラーコードマップを変更する。これは、不良条件を報告するために利用される新たなビットを示している。EPC不良がない場合には、ビット5をゼロに設定して、ビット6から9もゼロに設定する。不良がEPC条件に起因している場合には、ビット5を設定して、ソフトウェアはビット6から9を復号して、EPC不良条件を解明してもよい。不良タイプについてのさらなる情報は次のセクションに記す。   If a certain page is not found in the EPC, a "bad" is provided to the OS / VMM to indicate that. As shown in Table 8-2, the page failure error code map is changed. This indicates a new bit that is used to report a bad condition. If there is no EPC failure, bit 5 is set to zero and bits 6 to 9 are also set to zero. If the failure is due to an EPC condition, bit 5 may be set and the software may decode bits 6 through 9 to resolve the EPC failure condition. Further information on defect types is provided in the next section.

ページ不良エラーコードのビット5が設定されている場合、ビット6から9が所与であると解釈される(表8−2)。これは、このページ不良を起こした条件を示している。状態の一部は、通常処理では生じ得ないであろう不法の条件を示しており、OS/VMM管理エラーを示している。

Figure 2019109910
If bit 5 of the page fault error code is set, then bits 6 to 9 are interpreted as given (Table 8-2). This indicates the condition that caused this page failure. Some of the states indicate illegal conditions that may not occur in normal processing, and indicate OS / VMM management errors.
Figure 2019109910

攻撃からEPCを保護するためには、プラットフォームの全てのTLBのEPCアドレスを無効化するメカニズムを利用することができる。この特徴により、全てのコアに対して、特定のページの無効化を知らせることができる。次いで、全てのプロセッサから撃墜完了報告を受けるまで待つ。   To protect the EPC from attacks, a mechanism can be used to invalidate the EPC addresses of all TLBs in the platform. This feature allows all cores to be notified of the invalidation of a particular page. It then waits until it receives a shoot complete report from all processors.

エンクレーブが退出するたびに(EEXIT)、TLBは、TLBに現在存在しているエンクレーブページへのアクセスを禁ずることができる(may not allow accesses)。これは、TLBのクリアにより、またはさらなるビットを利用してエンクレーブエントリをタグ付けすることにより可能となる。   Each time an enclave exits (EEXIT), the TLB may may not allow access to the enclave pages currently present in the TLB. This can be done by clearing the TLB or by tagging the enclave entry using additional bits.

また別の方法としては、エンクレーブ退出時にTLBでエンクレーブビットを利用して、全てのエンクレーブエントリをクリアする、というものもある。別の方法としては、幾つかのビットを利用して特定のエンクレーブを特定するものもある。この場合、エンクレーブエントリは強制的に除去される必要がない。エンクレーブエントリは、tlbに残されてよい。アドレスをルックアップのためにtlbに送る場合には、これらビットはルックアップに追加される。これらビットは、エンクレーブの身元を示すコアからのエンクレーブidと比較される。ビットが合致した場合には、要求はこのエンクレーブから来ていることになる。合致しない場合には、要求がこのエンクレーブからのものではないことになるので、ルックアップはこの位置にヒットしない。   Another way is to use the enclave bit in the TLB at enclave exit to clear all enclave entries. Another way is to use a few bits to identify a particular enclave. In this case, enclave entries do not have to be forcibly removed. Enclave entries may be left in tlb. When sending the address to tlb for lookup, these bits are added to the lookup. These bits are compared to the enclave id from the core that indicates the enclave's identity. If the bits match, then the request is coming from this enclave. If not, the lookup will not hit this location as the request will not be from this enclave.

エンクレーブ認証は、エンクレーブコードのエンクレーブ内における実行を許可した認可機関(つまり、このコードの著者/承認者)を見つける手段を提供する。エンクレーブ認証はさらに、エンクレーブマイクロコードフロー、フレキシブルシール&レポート、および、幾つかの新たなビジネスモデルの実施点を外部委託するファウンデーションも提供する。   Enclave certification provides a means of finding the authorizing authority (ie, the author / author of this code) that has been authorized to execute the enclave code within the enclave. Enclave certification also provides a foundation to entrust implementation points of Enclave Microcode Flow, Flexible Seals & Reports, and several new business models.

セキュアエンクレーブアーキテクチャのある態様では、マイクロコード化された命令内の実装にあまり適していない複雑、且つ時間のかかるフローが必要となる場合がある。これに対する解決法は、セキュアエンクレーブアーキテクチャのこれらの部分をマイクロコードに外部委託することである。多くの場合、任されたコードは、繊細なプロセッサまたはプラットフォームデータへの特別なアクセスを要求する。例えばEPID信号は、単一の命令には長すぎる。この代わりに、クオーティング・エンクレーブを利用して、EPID秘密鍵への特別なアクセスを許可することにより、EPID署名されたクオートを生成する。エンクレーブ認証により、Intelは、クオーティング・エンクレーブのみによって、EPIDキーに対するアクセス等の特別なエンクレーブに許可された追加機能を特定することができる。Intelが提供するエンクレーブは、追加機能を有し、コアのエンクレーブ機能を実装するが、アーキテクチャエンクレーブと称される。   Certain aspects of the secure enclave architecture may require complex and time-consuming flows that are not well suited to implementation within microcoded instructions. The solution to this is to outsource these parts of the secure enclave architecture to microcode. In many cases, delegated code requires special access to delicate processor or platform data. For example, the EPID signal is too long for a single instruction. Instead, it generates an EPID signed quote by allowing special access to the EPID private key using a Quoting Enclave. Enclave authentication allows Intel to identify additional features that are authorized to a special enclave, such as access to EPID keys, by only the quarts enclave. The enclave provided by Intel has additional functionality and implements the core enclave functionality, but is referred to as an architectural enclave.

エンクレーブ・シール・ストレージは、エンクレーブのある属性(例えば装填時間計測値)にデータを暗号化する機能をエンクレーブソフトウェアに提供する。エンクレーブ証明フレームワークによって、エンクレーブは、エンクレーブを計測した証拠を外部の実体に提供することができる。多くの状況において、エンクレーブの正確なソフトウェアハッシュよりも、データのシールまたはエンクレーブのソースに対する証明のほうが望ましい。   Enclave Seal Storage provides the enclave software with the ability to encrypt data to certain attributes (eg, load time measurements) of the enclave. The enclave proof framework allows the enclave to provide the external entity with evidence of the enclave being measured. In many situations, it may be desirable to seal the data or prove to the source of the enclave rather than the exact software hash of the enclave.

一実施形態では、認証されたエンクレーブにおける署名が確認されると、エンクレーブの署名に利用されたキーの公的な部分は、シール&証明メカニズムに利用可能となり、この結果、販売業者は、エンクレーブ計測値に基づく強固な保護と、エンクレーブのコードのソースに基づくこれよりも柔軟な保護との間で選択することができるようになる。   In one embodiment, once the signature in the certified enclave is verified, the public part of the key used to sign the enclave is made available to the seal & certification mechanism, so that the merchant can not measure the enclave It allows you to choose between strong protection based on values and more flexible protection based on the source of the enclave code.

エンクレーブ認証は2つの部分に分割される。各エンクレーブは、Intelにそのルートを辿る(rooted back to Intel)ことができる署名鎖(signature chain)を有するエンクレーブライセンスを伴っている。エンクレーブライセンスは、そのエンクレーブのソース/責任実体、エンクレーブが必要とする特別な機能、および、そのエンクレーブを実現する特別なビジネスモデル/取り決めを特定するために必要な追加情報を示す。ライセンスは、特別なエンクレーブに対するものであってよく、これは、このエンクレーブの計測値を示しており、または、キーについて示しており、これが後に必要に応じてエンクレーブに署名することができるようになる。   Enclave certification is divided into two parts. Each enclave is accompanied by an enclave license that has a signature chain that can be rooted back to Intel on Intel. The enclave license indicates the source / responsible entity of the enclave, the special features that the enclave needs, and the additional information needed to identify the particular business model / arrangement that will implement the enclave. The license may be for a special enclave, which indicates the measurement of this enclave or indicates for the key, which will later be able to sign the enclave as required .

例えばAが、Aのビデオプレーヤで利用するエンクレーブを製造するライセンスを購入する場合を考える。このために、Intelは、販売業者Aのビデオプレーヤのルートキーと、Intelが販売業者Aがビデオプレーヤエンクレーブでの利用を許可される機能とに関するライセンスを生成する。次に販売業者Aは、ビデオプレーヤのルートキーを利用して、リリースする各ビデオプレーヤ修正版についての個々のライセンスファイルに署名する。これにより、エンクレーブのライセンス鎖が、複数の中間ライセンスを含むことになる。   For example, consider the case where A purchases a license to produce an enclave for use with A's video player. To this end, Intel generates a license for the root key of vendor A's video player and the features Intel is authorized to use for vendor A's video player enclave. Vendor A then uses the video player's root key to sign an individual license file for each video player modification to be released. This will result in the enclave license chain including multiple intermediate licenses.

署名されたライセンス鎖は、エンクレーブ起動プロセス中の評価には理想的とはいえないので、代わりに、これらを、許可証(permit)と称される単一の命令の実行しやすい構造(single instruction digestible structure)に組み込む。許可証は、CMACアルゴリズムを利用して対称認証され、エンクレーブの初期化(EINIT)中に解釈される。

Figure 2019109910
Figure 2019109910
Figure 2019109910
Since the signed license chain is not ideal for evaluation during the enclave activation process, instead, they are a single instruction easy-to-implement structure called permit. Incorporate into the digestible structure). The permit is symmetrically authenticated using the CMAC algorithm and interpreted during enclave initialization (EINIT).
Figure 2019109910
Figure 2019109910
Figure 2019109910

ラインセンスの部分の殆どが許可証にコピーされ、同様の構造を成す。ライセンスIDは、ビジネス上の取り決めを特定するための64ビットの数値である。ライセンスの種類は、ライセンスを適用するプラットフォームを特定する。バルクライセンスにより、このエンクレーブを、セキュアなエンクレーブをサポートしているプラットフォーム上に立ち上げることができる。プラットフォームごとのライセンスにより、プラットフォームは先ず示されているライセンス認可機関に接触をとり、エンクレーブを立ち上げる許可を要求する。ひとたび許可されると、ライセンス認可機関とは接触をとる必要はなくなるが、これにより、ライセンス認可機関は、このエンクレーブが配置されたプラットフォームの数を課金目的で追跡することができる。このエンクレーブをライセンスしたISVは、エンクレーブのこのバージョンのセキュリティバージョン番号を構築することもできる。こうすることで、このバージョンがシールするデータを、前のバージョンではなくて将来のバージョンについて利用可能とすることができる。フラグフィールドは、この許可証を適用するために設定されうるエンクレーブのためのフラグを示す。機能マスクは、このエンクレーブに許可されうる特別な機能のビットマスクである。親のキーハッシュとは、このエンクレーブのライセンスを署名して、キーを署名した公開鍵でハッシュした公開鍵のハッシュである。実体ハッシュとは、このライセンスを適用する実体の予期されるハッシュである。エンクレーブの場合には、これは、適切に構築されたエンクレーブのMR.EADDの値である。ライセンスキーにおいては、これは公開鍵のハッシュである。   Most of the license part is copied to the permit and forms a similar structure. The license ID is a 64-bit number for identifying a business arrangement. The type of license specifies the platform to which the license applies. The bulk license allows this enclave to be launched on a platform that supports secure enclaves. With a per platform license, the platform first contacts the indicated licensing authority and requests permission to launch the enclave. Once authorized, there is no need to contact the licensing authority, which allows the licensing authority to track the number of platforms on which this enclave is deployed for billing purposes. The ISV that licensed this enclave can also build a security version number for this version of the enclave. In this way, the data that this version seals can be made available for future versions rather than previous ones. The flag field indicates a flag for enclave that may be set to apply this permit. The feature mask is a bit mask of special features that can be granted to this enclave. The parent's key hash is the hash of the public key that has been signed with this enclave license and hashes the key with the signed public key. The entity hash is the expected hash of the entity to which this license applies. In the case of an enclave, this is a properly constructed enclave MR. It is the value of EADD. In the license key, this is a hash of the public key.

ライセンスにおいては、ライセンスを署名するのに利用される公開鍵を、ライセンス自身に含める。許可証はCPUキーを利用してMACされる。正規のcpuMACは、EMKPERMIT命令がこの許可証を、ライセンス鎖が今度はIntelに対して認証されたことを示す。ライセンスの種類がバルクではない場合には、ライセンスMACが、アーキテクチャライセンスエンクレーブが適切なライセンス認可機関に連絡して、このプラットフォームがエンクレーブを立ち上げうるという確認を受けたことを示す。   In a license, the license itself includes the public key used to sign the license. The permit is MAC using the CPU key. The genuine cpuMAC indicates that the EMKPERMIT command has this permit, and that the license chain is now certified against Intel. If the type of license is not bulk, the license MAC indicates that the architecture license enclave has contacted the appropriate license authority to confirm that this platform can launch the enclave.

全てのエンクレーブが許可証を要求するわけではない。エンクレーブの開発をし易くするために、開発中およびソフトウェアのライフサイクルのデバッグ段階に許可証をオプションとする。以下のポリシーがEINITにより実施される。非デバッグエンクレーブは常に許可証を立ち上げることを要求する。デバッグエンクレーブは、許可証なしに立ち上げられる。しかし、EINITに許可証が提示されない場合には、MR.Policy、ISV Secバージョン、許可証の見るバージョン(Permit See Version)、および機能の全てを0に設定する。   Not all enclaves require a permit. To facilitate the development of enclaves, permit is an option during development and during the debugging phase of the software life cycle. The following policies are enforced by EINIT. Non-debugging enclaves always require the launch of a permit. Debug enclaves are launched without a permit. However, if EINIT is not presented with a permit, MR. Set Policy, ISV Sec version, Permit See Version, and all features to 0.

許可証がデバッグエンクレーブの立ち上げに利用される場合には、permit−>フラグ「デバッグ」を設定することができ、デバッグエンクレーブが許可する機能のみを許可証に設定することができる。   If the permit is used for launching a debug enclave, the permit-> flag "debug" can be set, and only the function permitted by the debug enclave can be set to the permit.

図16は、本発明の一実施形態のエンクレーブを立ち上げる許可証を生成するプロセスの一例を示す。このプロセスは、3つの段階(許可証発行1600、さらなるライセンス承認1640、および初期化エンクレーブ1680)を有することができる。許可証発行1600段階では、ISVキー許可証1615を、EMKPERMIT命令1612をISVキーライセンス1610に実行することにより生成することができる。CPUのみ用のMACを有するエンクレーブ許可証1625は、EKPERMIT命令1612を、エンクレーブライセンス1620およびISVキー許可証1615に行うことにより生成することができる。さらなるライセンス承認1640段階では、CPUのみ用のMACを有するエンクレーブ許可証1625、および、ライセンスされる情報に対応する第三者エンクレーブ1642が、ライセンスエンクレーブ1644に入り、ライセンスエンクレーブ1644が、CPU用のMACおよびライセンスを有するエンクレーブ許可証1645を生成する。初期化エンクレーブ1680段階では、エンクレーブSECS1682、および、CPU用のMACおよびライセンスを有するエンクレーブ許可証1645が、EINIT1684命令に対する入力とされてよい。EINIT1684mリtリの出力は、ISVエンクレーブ1685となる。   FIG. 16 illustrates an example of a process of generating a permit to launch an enclave of one embodiment of the present invention. This process can have three phases (Permit Issue 1600, Additional License Approval 1640, and Initialization Enclave 1680). In the permit issuance step 1600, an ISV key permit 1615 may be generated by executing the EMKPERMIT instruction 1612 on the ISV key license 1610. An enclave permit 1625 having a MAC only for the CPU can be generated by performing an EKPERMIT instruction 1612 on the enclave license 1620 and the ISV key permit 1615. In a further license approval step 1640, an enclave permit 1625 having a MAC only for the CPU, and a third party enclave 1642 corresponding to the information to be licensed enter the license enclave 1644, and the license enclave 1644 controls the MAC for the CPU. And generate a licensed enclave permit 1645. At the initialization enclave 1680 stage, enclave SECS 1682 and a MAC and licensed enclave permit 1645 for the CPU may be input to the EINIT 1684 instruction. The output of the EINIT 1684m is an ISV enclave 1685.

エンクレーブを起動するには、ソフトウェアとともに出荷されるライセンスから許可証を生成して、CPUに提供して、エンクレーブを開始させることができる。このプロセスは、許可証発行、さらなるライセンス承認、および、エンクレーブ初期化という3つの段階に分割することができる。図16は、このプロセスのフローを示す。   To activate an enclave, a license can be generated from a license shipped with the software and provided to the CPU to initiate the enclave. This process can be divided into three stages: permit issuance, further license approval, and enclave initialization. FIG. 16 shows the flow of this process.

EMKPERMITという新たな命令を利用して、ライセンスから許可証を生成する。EMKPERMITは、単一のライセンスから単一の許可証を生成するが、連続呼び出しされることで、ライセンスの鎖を、許可書キーを利用してMACを有する単一の許可証に変換することもできる。次のセクションでは、このことを詳述する。   Generate a permit from the license using a new instruction called EMKPERMIT. Although EMKPERMIT generates a single permit from a single license, it can also be used to convert a chain of licenses into a single permit with a MAC using a permit key, by being called sequentially it can. The next section will elaborate on this.

各ライセンスは、許可証を利用可能とするためにとることができるさらなるステップを決定する「ライセンスの種類」を含む。プラットフォームごとのライセンスは、クラウドのライセンス認可機関に、エンクレーブが配置されるプラットフォームの課金額を維持するよう要求する。この種類のライセンスにおいては、さらなる段階が必要となる。つまり、ライセンスエンクレーブと称されるアーキテクチャエンクレーブは、クラウドのライセンス認可機関と交渉して、承認されると、ライセンスキーを用いて許可証にさらなるMACを提供する。例えばアーキテクチャエンクレーブは常にバルクライセンスであり、これは、実行するためにライセンスキーMACが不要であることを意味する。これらは、セキュアなエンクレーブをサポートする任意のプラットフォーム上で動作する。   Each license includes a "type of license" which determines further steps that can be taken to make the permit available. The per platform license requires the cloud licensing authority to maintain the charge for the platform on which the enclave is deployed. This type of license requires additional steps. That is, an architecture enclave, referred to as a license enclave, negotiates with the cloud licensing authority and, if approved, provides an additional MAC for the permit using the license key. For example, the architecture enclave is always a bulk license, which means that no license key MAC is required to execute. These run on any platform that supports secure enclaves.

エンクレーブの初期化において許可証が実施形態される。初期化中に許可証が処理され、エンクレーブ計測値が許可証内のものと合致した場合には、MACは正しいことになり、エンクレーブが起動される。EINITはライセンスの種類を見て、さらなる承認を要するライセンスのライセンスMACのみを調査する。   A permit is implemented in the enclave initialization. If the permit is processed during initialization and the enclave measurements match those in the permit, then the MAC will be correct and the enclave will be activated. EINIT looks at the type of license and examines only the license MAC of the license requiring further approval.

EMKPERMITは、ライセンス上のRSA署名を検証するのに必要となる時間のために、特権付き命令である。この命令は、検証して、その内容から許可証を生成する非常に単純な署名付き証明書をとる。ライセンスは、署名およびそれを署名するのに利用するキーの公開部分の両方を含む。これにより、uCodeは、Intelのライセンス署名キーのハッシュのみを格納して、Intelが署名したライセンスを認証することができる。EMKPERMITは、さらに、キーの認証された承認を提供することにより、ISVキーが署名したライセンスを認証することができる。これは、ISVの公開鍵のハッシュを含む許可証を作成することによって行われる。この結果、EMKPERMITがIntelのライセンスを、内部ハッシュ、あるいは、第2の許可証に提供されているハッシュを持つISVキーを利用して、Intelのライセンスを検証することができる。   EMKPERMIT is a privileged instruction due to the time required to verify the RSA signature on the license. This instruction validates and takes a very simple signed certificate that generates a permit from its contents. The license includes both the signature and the public part of the key used to sign it. This allows uCode to store only the hash of Intel's license signing key to authorize the Intel-signed license. The EMKPERMIT can further authenticate the license signed by the ISV key by providing an authorized approval of the key. This is done by creating a permit that contains the hash of the ISV's public key. As a result, EMKPERMIT can verify Intel's license using Intel's license, an internal hash, or an ISV key with the hash provided in the second permit.

EMKPERMITは、ライセンスへのポインタ、キー許可証へのオプションのポインタ、および、出力許可証へのポインタという3つのパラメータをとる。Intelが署名したライセンスについては、キー許可証が空値であり、内部的にハードコードされた許可証パラメータのセットが利用される。アーキテクチャエンクレーブのライセンスを認証する呼び出し方法を利用して、その許可証を生成する。EMKPERMITは、このライセンスの公開鍵がuCodeにより認可されるようにする(含まれている公開鍵のハッシュを内部ハッシュと比較することにより)。   EMKPERMIT takes three parameters: a pointer to a license, an optional pointer to a key permit, and a pointer to an output permit. For licenses signed by Intel, the key permit is null and an internally hard-coded set of permit parameters is used. The architecture enclave license is generated using a calling method to validate the license. EMKPERMIT ensures that the public key of this license is authorized by uCode (by comparing the hash of the contained public key with the internal hash).

ISVの場合には、ISVのキーは、Intelが署名したライセンスを有する。キー許可証を利用しないEMKPERMITの呼び出しには、Intelのキーハッシュを利用して、ライセンス上の署名を検証して、ISVキーのハッシュを認可する許可証を生成して、合法なライセンス署名キーを表す。そしてEMKPERMITを再度呼び出す(ISVのキーの許可証を含む)。EMKPERMITは、キーの許可証のMACを認証して、前にIntelのハッシュを利用したISVキーのハッシュを利用する。エンクレーブライセンスの公開鍵がISVキーの値にハッシュを行い、且つ、エンクレーブライセンスがそれにより適切な署名を行う、ということを仮定して、EMKPERMITは、エンクレーブ用の許可証を生成する。この許可証は、ライセンス情報(全鎖で一貫していてよい)、ライセンス鎖の全ての公開鍵のハッシュ、エンクレーブの計測値、およびその機能を示している。   In the case of an ISV, the ISV's key has a license signed by Intel. For EMKPERMIT calls that do not use a key permit, use Intel's key hash to verify the signature on the license, generate a permit to authorize the hash of the ISV key, and generate a legal license signing key Represent. Then call EMKPERMIT again (including ISV key permit). EMKPERMIT authenticates the key's permit MAC and uses the hash of the ISV key, which previously utilized Intel's hash. EMKPERMIT generates a permit for the enclave, assuming that the enclave license's public key hashes the value of the ISV key, and the enclave license thereby signs appropriately. This permit indicates the license information (which may be consistent across the chain), the hash of all the public keys in the license chain, the enclave's measure, and its function.

以下のステップがu−codeによりEMKPERMIT中にとられる。

Figure 2019109910
The following steps are taken during EMKPERMIT by u-code.
Figure 2019109910

ライセンスエンクレーブは、uCodeが見える範囲の外で起動されるエンクレーブについての決定をするように設計される。例えばuCodeは、ISVのIntelとのビジネスにおける取り決めにより、さらなるエンクレーブ配置が許可されるかを評価する。ライセンスエンクレーブは、アセスメントを行う必要がある全ての材料の収集、および、エンクレーブの起動のさらなる承認、拒絶を行うように設計されている。ライセンスエンクレーブは、複雑なビジネスにおける取り決めのみをサポートする必要があり、バルクライセンス(例えば、必要とされている回数だけ任意のプラットフォームでエンクレーブを起動させる機能)には必要がない。   The license enclave is designed to make decisions about enclaves that are activated outside of what uCode can see. For example, uCode will assess whether further enclave placement is permitted by arrangements in business with ISV's Intel. The license enclave is designed to collect all the material that needs to be assessed and to further approve or reject the enclave activation. License enclaves need to support only complex business arrangements, not bulk licenses (eg, the ability to launch an enclave on any platform as many times as needed).

ライセンスエンクレーブは、システムサービスであることが予期されている。ライセンスが、ライセンスエンクレーブからのさらなる承認が必要であると示す場合、EMKPERMITが生成したライセンス鎖およびエンクレーブ許可証をライセンスエンクレーブに渡す。ライセンスエンクレーブは次に、承認要求を生成する。そしてアプリケーションはこの承認要求を適切なライセンス認可機関に送り、ここで承認通知が生成される。そしてライセンスエンクレーブに戻されて、ライセンスエンクレーブは、ライセンスキーを利用して、ライセンスMACフィールド内の許可証をMACする。   License enclaves are expected to be system services. If the license indicates that further approval from the license enclave is required, the license chain and the enclave permit generated by EMKPERMIT are passed to the license enclave. The license enclave then generates an approval request. The application then sends this approval request to the appropriate licensing authority, where an approval notification is generated. Then, it is returned to the license enclave, and the license enclave uses the license key to MAC the permit in the license MAC field.

エンクレーブに対して許可証が発行されると、エンクレーブ機動プロセスでu−codeを利用して評価して実施することができる。これは、許可証のリニアアドレスをパラメータとして利用して、EINIT命令の一部として実施される。(1)スクラッチパッドの許可証をコピーする、(2)許可証上のcpuMACを、許可証キーを利用して検証する、(3)ライセンスタイプ!=バルクである場合には、ライセンスMACを、ライセンスキーを利用して検証する、(4)許可証内の計測値を、SECS内のMR.EADDと比較する、(5)許可証内のフラグを、SECS内のフラグと比較する、(6)許可証内のPubkeyハッシュをMR.Policyにコピーする、(7)ISV SVNをSECSにコピーする、(8)許可証内の機能マップをSECSにコピーする、という、さらなるステップをEINITに、認証されたエンクレーブメカニズムの一環として追加する。   Once a permit is issued for the enclave, it can be evaluated and implemented using u-code in the enclave maneuver process. This is implemented as part of the EINIT instruction, using the linear address of the permit as a parameter. (1) copy the scratch pad permit, (2) verify the cpu MAC on the permit using the permit key, (3) license type! In the case of bulk, the license MAC is verified using the license key. (4) The measurement value in the permit is recorded in MR. (5) compare the flag in the permit with the flag in the SECS, (6) compare the Pubkey hash in the permit with the MR. The additional steps of copying to Policy, (7) copying ISV SVN to SECS, and (8) copying functional map in permit to SECS, are added to EINIT as part of the certified enclave mechanism.

<機能>
現在の機能マップは、このエンクレーブに利用可能な128ビットマスクの機能である。

Figure 2019109910
Figure 2019109910
<Function>
The current feature map is the feature of the 128 bit mask available to this enclave.
Figure 2019109910
Figure 2019109910

空間は、EINITがとるアクションに基づいて組織化される。ビット00−03は、リングレベルの制約がこのエンクレーブ上でアクティブになったときの将来の利用のためにリザーブされる。04−07は、将来許可されるページ保護を示すためにリザーブされている。08−23は、EGETKEYを通じて利用可能なプロセッサキーである。24−31は、他の制御(例えば証明のために名称ベースのモードを利用する、または、将来制限を希望する技術に対するもの等)のためである。一部の機能は、デバッグモードでエンクレーブによって利用されない。デバッグ列は、ある機能をデバッグモードにおいて利用して合法かを示す。   Spaces are organized based on the actions that EINIT takes. Bits 00-03 are reserved for future use when ring level constraints become active on this enclave. 04-07 are reserved to indicate page protection to be permitted in the future. 08-23 are processor keys available through EGETKEY. 24-31 are for other controls (e.g., for techniques that use name-based mode for proofing, or for which technology wants to be restricted in the future) Some features are not used by the enclave in debug mode. The debug column indicates whether a certain function is used in the debug mode and it is legal.

将来の世代においては、ビット00は、リングレベルおよびVTの制約が、このエンクレーブに適用されることを示していてよい。ビット01−02は、エンクレーブが実行を許可されるリングレベルを示しており、ビット02は、エンクレーブがVTルートモードで実行されるか示している。各EENTERにおいて、現在のCPLをビット01−02に比較して、このエンクレーブがこのリングレベルにおいて実行を許可されているかを判断する。これを実行する試みが誤ったリングで行われる場合、EENTERは失敗する。同様に、リング制約がアクティブな場合は、エンクレーブは、ビット03が起動中にはVTルートモードからしか入ることができない。第一世代では、これらビットがMBZである。   In future generations, bit 00 may indicate that ring level and VT constraints apply to this enclave. Bits 01-02 indicate the ring level at which the enclave is allowed to execute, and bit 02 indicates whether the enclave is to be performed in VT root mode. At each EENTER, compare the current CPL to bits 01-02 to determine if this enclave is allowed to execute at this ring level. If an attempt to do this is made in the wrong ring, EENTER will fail. Similarly, if the ring constraint is active, the enclave can only enter from VT root mode while bit 03 is awake. In the first generation, these bits are MBZ.

エンクレーブページは、暗号化されても、整合性のみを保護されてもよい。さらに、ページは実行可能であってもなくてもよい。将来の世代においては、これらの属性を追跡して、EPCMのセキュリティ情報の部分で実施することができる。ページが実施可能であるか、またはエンクレーブが既にEINITされているかに基づいて、エンクレーブのエンクレーブページへの暗号化の利用を制御するために機能ビットがリザーブされる。   Enclave pages may be encrypted or only integrity protected. Furthermore, the page may or may not be executable. In future generations, these attributes can be tracked and implemented in the security information portion of EPCM. Function bits are reserved to control the use of encryption on the enclave enclave page based on whether the page is workable or the enclave is already EINIT.

多くのアーキテクチャエンクレーブは、CPU内で、またはCPUにより保護されているキーへのアクセスを要求するリング3の実体である。EGETKEYはこれらキーに対するアクセスを提供し、機能ビットは、キーへのアクセスを許可することができるか決定するためにEGETKEYにより利用される。   Many architecture enclaves are ring 3 entities that require access to the CPU or key protected by the CPU. EGETKEY provides access to these keys, and feature bits are used by EGETKEY to determine if access to the key can be granted.

以下は、これら特性および短い説明を有する現在のアーキテクチャエンクレーブのリストである。   The following is a list of current architecture enclaves with these characteristics and a short description.

プロビジョンエンクレーブは、KEY_PROVISION機能を有し、Intelにより承認されており、新たなデバイス証明キー(DAK)またはプロビジョン証明キー(PAK)が必要になるたびに、単一のパッケージプラットフォーム上で実行される。その目的は、エンクレーブに、EGETKEYが提供するプロビジョンシードに基づいて、デバイスID&プロビジョンキーを導出させる、というものである。次いでプロビジョンエンクレーブは、これらキーを利用して、プロビジョンサーバに対してプラットフォームの正当性を証明して、デバイス証明キー(DAK)を取得する。DAKを取得した後で、プロビジョンエンクレーブは、オプションとしてDAKを利用して、プラットフォーム証明キー(PAK)プロバイダとの間で認証を行い、PAKを再試行する。PAKの利用により、特定のISVについて保証することで、ユーザによりよいプライバシーを提供することができ、そのアクティビティがそのプラットフォームの前の所有者のものに関連付けられなくなる。PAKを取得してから、プロビジョンエンクレーブは、クオーティング・エンクレーブが取得することができるように、それをシールする。   The Provision Enclave has the KEY_PROVISION feature, is approved by Intel, and runs on a single packaged platform whenever a new Device Certification Key (DAK) or Provision Certification Key (PAK) is needed. Ru. The purpose is to have the enclave derive a device ID & provision key based on the provision seed provided by EGETKEY. The Provision Enclave then uses these keys to prove the platform's legitimacy to the Provision Server and obtain a Device Certification Key (DAK). After obtaining the DAK, the Provision Enclave authenticates with the Platform Proof Key (PAK) provider, optionally using the DAK, and retries the PAK. The use of PAKs can provide better privacy for users by guaranteeing for a particular ISV, and that activity will not be associated with that of the previous owner of the platform. After obtaining the PAK, the Provision Enclave seals it so that the Quating Enclave can obtain it.

クオーティング・エンクレーブは、機能KEY_REPORTを有し、エンクレーブにより承認されており、EPIDキーをプロビジョンするのに利用されたプロビジョンエンクレーブ(通常はIntel)と同じ著者を有する。その位置は、全てのappsに対して利用可能であるOSサービスである。その目的は、エンクレーブにプラットフォームEPIDキーのシールを解かせることである。EREPORTからのレポートは入力として提供される。エンクレーブは、EGETKEYを利用して、レポートキーを取得する。レポートキーは、次に、レポートを検証するのに利用される。エンクレーブは、EPIDの利用によりクオートに署名する。   The Quotating Enclave has the function KEY_REPORT, is approved by the Enclave, and has the same author as the Provision Enclave (usually Intel) used to provision EPID keys. Its location is an OS service that is available to all apps. The purpose is to have the enclave unseal the platform EPID key. Reports from EREPORT are provided as input. The enclave uses EGETKEY to obtain a report key. The report key is then used to validate the report. Enclaves sign quotes through the use of EPIDs.

ライセンスエンクレーブは、KEY_LICENSE機能を有し、Intelにより認可され、Root Intelにより署名されており、エンクレーブ(OSサービス)とともに出荷され、単独でインスタンス化されている。その目的は、複雑なライセンスポリシーを評価することである。エンクレーブがライセンスエンクレーブからさらなるライセンス確認を要求する場合には、EINITは、ライセンスエンクレーブがライセンスキーを利用してその許可証をCMACした後に限り、それを受け付けることができる。   The license enclave has a KEY_LICENSE function, is licensed by Intel, is signed by Root Intel, is shipped with the enclave (OS service) and is instantiated alone. Its purpose is to evaluate complex license policies. If the enclave requests a further license confirmation from the license enclave, EINIT can only accept it after the license enclave CMACs its permit using the license key.

単一のパッケージシステムにおいて、エンクレーブのアーキテクチャが利用する全ての対称キーを、プロセッサのヒューズアレイに格納された単一の特異性ソースから導出する。キー階層は、SE TCB階層に分割されて、これはプラットフォーム実装に依存しており、その構造が全てのセキュアなエンクレーブ実装にわたり一貫したSEキー階層である。TCB復帰用のキーイング材料およびEPIDプロビジョンの基礎は、SEキー階層のルートとして機能するSE TCB階層により提供される。エンクレーブ命令セットおよびトラステッドアーキテクチャエンクレーブ両方で利用される全てのキーイング材料は、SEキー階層により提供される。   In a single package system, all symmetric keys utilized by the enclave architecture are derived from a single singularity source stored in the processor's fuse array. The key hierarchy is divided into SE TCB hierarchies, which are platform implementation dependent and the structure is a consistent SE key hierarchy across all secure enclave implementations. The keying material for TCB reversion and the basis of the EPID provision is provided by the SE TCB hierarchy which serves as the root of the SE key hierarchy. All keying materials utilized in both the enclave instruction set and the trusted architecture enclave are provided by the SE key hierarchy.

プラットフォームは、ヒューズされている128ビットのプラットフォーム固有キーを提供する。これらキーは、秘密のCPU論理に格納されているキーを利用してヒューズで暗号化される。幾つかの単一の目的のキーはこのキーを利用して導出され、TCB復帰技術は、プラットフォームの要件に基づいて適用される。結果生じるキーは、SEキー階層のルートとして機能する。   The platform provides a fused 128-bit platform-specific key. These keys are fuse encrypted using the keys stored in the secret CPU logic. Several single purpose keys are derived utilizing this key, and TCB recovery techniques are applied based on platform requirements. The resulting key serves as the root of the SE key hierarchy.

アーキテクチャエンクレーブのキーは、EGETKEY命令を利用して取得される。   The architecture enclave key is obtained using the EGETKEY instruction.

エンクレーブアーキテクチャは、REPORTの値の証明をプラットフォーム外のシステムに提供するために非対称キーの利用を必要とする。このキー(EPIDキー)は、最初はヒューズで提供されるが、配置後にキー階層から導出されるキーの1つを利用して再度プロビジョンされてよい。EPID証明キーのプロビジョン方法は、本明細書の範囲外である。さらなる情報は、デバイス証明キー(DAK)プロビジョン仕様を参照されたい。   The enclave architecture requires the use of asymmetric keys to provide proof of the value of REPORT to off-platform systems. This key (EPID key) is initially provided by the fuse but may be re-provisioned using one of the keys derived from the key hierarchy after placement. The method of provision of the EPID certification key is outside the scope of the present specification. For more information, see Device Certification Key (DAK) Provision Specification.

最後に、エンクレーブのアーキテクチャも、全てのプロセッサの論理にあるキーを利用して、OEMにおけるキーイング材料をプロビジョンする。このキーはアウトオブボックス経験グローバルキー(Out-of-Box Experience Global Key)として知られている。我々は、このキーに同様の導出処理を行い、ISVの固有性を提供する。OOBキーから導出されたこれらキーのISVによる利用法は、本明細書の範囲外である。   Finally, Enclave's architecture also uses the keys in all processor logic to provision keying material at the OEM. This key is known as the Out-of-Box Experience Global Key. We perform a similar derivation on this key to provide the ISV's uniqueness. The use by ISVs of these keys derived from OOB keys is beyond the scope of this document.

キー階層のSE TCBの部分はプラットフォーム特有であり、全ての基礎は、同じ基本のキーセットを必要とする。我々はこれらをベースキーと称す。これらは全てヒューズキーおよび論理キー内に導出され、SEキー階層のルートである。次いでこれらキーは、SE命令により、SEアーキテクチャで直接利用される全てのキーを導出するために利用される。これらキーはTCBキー階層の結果である。4つのSEベースキーに、プラットフォーム固有メカニズムによりSEアーキテクチャに利用可能となるEPIDコンポーネントが足し合わせられる。表12−1は、これらキーをそれぞれ示す。

Figure 2019109910
The SE TCB portion of the key hierarchy is platform specific and all foundations need the same basic key set. We call these base keys. These are all derived in fuse keys and logical keys and are the root of the SE key hierarchy. These keys are then used by the SE command to derive all the keys used directly in the SE architecture. These keys are the result of the TCB key hierarchy. The four SE base keys are combined with EPID components that will be available to the SE architecture by platform specific mechanisms. Table 12-1 shows these keys respectively.
Figure 2019109910

図17は、単一のパッケージのセキュアなエンクレーブのためのプラットフォームキー階層の実装を示す本発明の一実施形態を示す。ボックスベースキー外1700は、利用可能な導出リソース1750から導出され1702、ボックスキー外1704が生成される。利用可能な導出リソース1750は、固有値1752、所有者エポック1754、セキュアなエンクレーブセキュリティバージョン1756、SECS計測値レジスタ1758、ISVセキュリティバージョン1760、およびSECSフラグ1762を含むエレメントを有するストリングである。プロビジョンキー1710は、Intelバックエンドに対してプラットフォームの正当性を証明することができる。EPID ID1712は署名キーである。初期safeIDキーブロブ1718は、クオートであり、safeIDシード1716に関連付けられている。ベースopsキー1714は、利用可能な導出リソース1750からの情報と組み合わせられて、エンクレーブキー1730、許可証キー1732、ライセンスキー1734、レポートキー1736、認証キー1738、およびシールキー1740を含む一連のキーを導出する1720ことができる。   FIG. 17 shows an embodiment of the invention showing an implementation of a platform key hierarchy for secure enclave of a single package. An out-of-box based key 1700 is derived 1702 from available derived resources 1750 and an out-of-box key 1704 is generated. The available derived resources 1750 are strings with elements including unique value 1752, owner epoch 1754, secure enclave security version 1756, SECS metering register 1758, ISV security version 1760, and SECS flag 1762. The provision key 1710 can prove the legitimacy of the platform to the Intel backend. The EPID ID 1712 is a signature key. The initial safeID keyblob 1718 is a quote and is associated with the safeID seed 1716. The base ops key 1714 is combined with information from the available derived resources 1750 into a series of keys including an enclave key 1730, a permit key 1732, a license key 1734, a report key 1736, an authentication key 1738, and a seal key 1740. Can be derived 1720.

図17aは、マルチパッケージキー階層の一実施形態を示す。   FIG. 17a shows an embodiment of a multi-package key hierarchy.

セキュアなエンクレーブ命令およびデータ構造は、キーイング材料のソースであるベースキーに依存している。表12−1に示すプラットフォームキー階層は、プラットフォームキー材料の階層関係、および、プラットフォームルートキーからのキーの導出方法の記述である。   Secure enclave instructions and data structures rely on the base key being the source of keying material. The platform key hierarchy shown in Table 12-1 is a description of the hierarchical relationship of the platform key material and how to derive the key from the platform root key.

エンクレーブラップキー(enclave wrapping key)1752は、エンクレーブページキャッシュ(EPC)内で保護されていない間にセキュアなエンクレーブ制御構造(SECS)のページを暗号化するのに利用される対称キーである。   Enclave wrapping key 1752 is a symmetric key used to encrypt secure enclave control structure (SECS) pages while not protected in the enclave page cache (EPC).

許可証キー1754は、許可証に正当性および整合性を提供するのに利用され、これにはエンクレーブの機能およびライセンス情報が含まれる。許可証はMACされて、EINITへの遷移中にその整合性が確かめられる。このキーはEMKPERMIT uCodeおよびEINITにより利用される。   The Permit Key 1754 is used to provide legitimacy and integrity to the Permit, including Enclave function and license information. The permit is MAC and its integrity is verified during the transition to EINIT. This key is used by EMKPERMIT uCode and EINIT.

ライセンスキー1756は、uCodeにより評価不可能なライセンスポリシーに準拠してアサートするのに利用される(is used assert compliance with)。ライセンスキーは、EINITが評価するライセンスエンクレーブから認証された承認を生成するのに利用される。EINIT uCodeが利用するこのキーは、EGETKEYを介して利用可能であり、KEY_LICENSE機能セットとともにエンクレーブされる。   The license key 1756 is used to assert in accordance with a license policy that can not be evaluated by uCode (is used assert compliance with). The license key is used to generate a certified authorization from the license enclave that EINIT evaluates. This key, which EINIT uCode uses, is available via EGETKEY and is enclaved with the KEY_LICENSE feature set.

レポートキー1758は、レポートの正当性および整合性を提供するのに利用される。レポートは、ERREPORTによりMACされ、クオーティング・エンクレーブに遷移する間に、整合性を確かめられる。このキーはEREPORT uCodeにより利用され、QUOTE機能セットを有するエンクレーブに対してEGETKEYを介して利用可能となる。   Report key 1758 is used to provide report legitimacy and integrity. The reports are MACd by ERREPORT to ensure integrity while transitioning to a Qualing Enclave. This key is utilized by the EREPORT uCode and is available via the EGETKEY to enclaves with the QUOTE feature set.

認証キー1760は、エンクレーブ固有キーであり、クオーティング・エンクレーブからISVエンクレーブに送信されるデータの正当性および整合性を提供するのに利用され、エンクレーブからエンクレーブへの認証を同じプラットフォームで実現する。キーは、EGETKEYを介して全てのエンクレーブに利用可能となり、ISV_AUTH機能セットを有するエンクレーブが、必要としているキーを特定することができる。   The authentication key 1760 is an enclave-specific key and is used to provide legitimacy and integrity of the data sent from the quarting enclave to the ISV enclave, and provides enclave to enclave authentication on the same platform. Keys are available to all enclaves via EGETKEY, and enclaves with the ISV_AUTH feature set can identify the keys they need.

シールキー1762は、128ビットを各エンクレーブに提供して、それらの含む繊細なデータを暗号化させる。複数のシールポリシーをこのシールキーに統合することで、ISVに、どのソフトウェアを使ってデータのシールを解くかについての柔軟性を持たせることができる。これらのキーは、EGETKEを介して任意のエンクレーブに利用可能となるが、個々にはシールキーは、要求されているシールポリシーに合致するエンクレーブにのみ利用可能となる。   The seal key 1762 provides 128 bits to each enclave to encrypt their sensitive data. By integrating multiple seal policies into this seal key, ISVs have the flexibility to use which software to unseal the data. These keys will be available to any enclave via EGETKE, but individually the seal key will only be available to enclaves that meet the required seal policy.

EPID ID1712は、パッケージを一意に識別する。その唯一の目的は、デバイス証明キーのプロビジョンを可能とする、ということであり、デバイス証明キーは、EPIDベースの匿名証明キーである。EPID IDは、プロビジョンエンクレーブのみにアクセス可能である。プロビジョンエンクレーブは、これをセキュアなチャネルを介して、承認されたプロビジョンサーバのみに提供し、しかもこれは、ユーザまたはオペレーティングシステムが開始するプロビジョンプロセス中に限って行われる。このIDは、PROVISIONING機能を有するエンクレーブに対してEGETKEYを介して利用可能となる。   The EPID ID 1712 uniquely identifies a package. Its sole purpose is to enable the provision of a device certification key, which is an EPID-based anonymous certification key. The EPID ID is accessible only to provision enclaves. The provision enclave provides this over the secure channel only to the approved provision server, but only during the user or operating system initiated provision process. This ID will be available to the enclave with PROVISIONING function via EGETKEY.

プロビジョンキー1710は、Intelバックエンドにプラットフォームの正当性を証明すること、および、現在のSE TCBの実行を認証することに利用される。プロビジョンキーへのアクセスを示すことで、プロビジョンサーバは、エンクレーブが実際はEPID IDを所有しており、少なくとも特定のTCBセキュリティバージョン上で実行されているデバイスであることを確かめることができる。プロビジョンキーは、このパッケージおよびこれを要求するプロビジョンエンクレーブの署名者に固有である。これにより、単一のプラットフォームで利用されている場合、これら複数のプロビジョンインフラストラクチャの間を分離させることができる。このキーはEGETKEYを介して、KEY_PROVISION機能を有するエンクレーブに利用可能である。   The provision key 1710 is used to prove the validity of the platform to the Intel backend and to authenticate the current SE TCB execution. By indicating access to the provision key, the provision server can verify that the enclave is in fact the device that owns the EPID ID and is running at least on a particular TCB security version. The provision key is specific to this package and the signatories of the provision enclaves that require it. This allows separation between these multiple provision infrastructures when used on a single platform. This key is available to enclaves with the KEY_PROVISION function via EGETKEY.

プロビジョンシールキーは、所有権に変更があった後であっても取得可能な方法でプロビジョンを暗号化することができるように、128ビットキーをプロビジョンエンクレーブに与える。このキーを利用して古いEPIDを暗号化することで、新たなEPIDの取得中にプラットフォームが無効になったことを証明することができる。プロビジョンキーはこのパッケージおよびこれを要求するプロビジョンエンクレーブの署名者に固有である。これにより、単一のプラットフォームで利用されている場合、これら複数のプロビジョンインフラストラクチャの間を分離させることができる。このキーはEGETKEYを介して、KEY_PROVISION機能を有するエンクレーブに利用可能である。   Provision seal keys provide provision enclaves with 128-bit keys so that they can be encrypted in a manner that can be obtained even after a change in ownership. By encrypting the old EPID using this key, it is possible to prove that the platform has been invalidated while acquiring a new EPID. The provision key is specific to this package and the signatories of the provision enclaves that require it. This allows separation between these multiple provision infrastructures when used on a single platform. This key is available to enclaves with the KEY_PROVISION function via EGETKEY.

ISVアウトオブボックス(OOB)経験キー1700は、全てのIntelプラットフォームとISVとの間の共有キーである。このキーは、特定のISVに固有のOOBルートから導出される。ISVは、このキーに購入アクセスすることができ、このキーに対して秘密を暗号化して、OEMのハードディスク画像内に配置することができる。これらの秘密は、セキュアなエンクレーブ内で安全に実行されているこれらのコードのみがアクセス可能であり、プラットフォームはオンライン動作または完全な証明キープロビジョンを行う必要がない。これらキーはEGETKEYを介して、OOB機能を有するエンクレーブに利用可能である。   The ISV out of box (OOB) experience key 1700 is a shared key between all Intel platforms and the ISV. This key is derived from the OOB root specific to a particular ISV. The ISV can have purchase access to this key, encrypt the secret for this key, and place it in the OEM's hard disk image. These secrets are accessible only to those codes that are securely executed within the secure enclave, and the platform does not have to perform on-line operation or complete proof key provision. These keys are available to enclaves with OOB functionality via EGETKEY.

プロビジョンキーは、セキュアなエンクレーブアーキテクチャに対して重要なキーであるが、プラットフォーム・キーイング材料からは導出されない。これらキーは、プロビジョンサーバまたはオフライン技術からプロビジョンされる。デバイス証明キー(DAK)は、個々のエンクレーブの特性を証明するための匿名署名キー(EPID)利用である。これは、キーまたは秘密のプロビジョン中にISVにより利用され、この繊細な情報を改ざんされていないアプリケーションの保護された導入にのみ送信するようにする。   The provision key is an important key for a secure enclave architecture but is not derived from the platform keying material. These keys are provisioned from a provision server or offline technology. Device Certification Key (DAK) is the use of Anonymous Signature Key (EPID) to certify the characteristics of individual enclaves. This is used by the ISV during key or secret provisioning to ensure that this sensitive information is only sent to the protected introduction of the unaltered application.

デバイス証明キーには2つのソースがある。好適なアーキテクチャは、ヒューズで圧縮される初期DAKを、EPIDキーブロブおよびEPIDエントロピーとして出荷する。これにより、プラットフォームは、最初の電源投入直後に証明を開始することができるようになる。第2のソースは、DAKプロビジョンサーバに接触をとり、EPID IDおよびプロビジョンキーを利用してハードウェアの正当性を証明した後に1つがダウンロードされる。この2番目の方法は、ヒューザされたEPID キーを有さないプラットフォームおよび基礎となるTCBのバージョンを無効化した後のプラットフォームにより利用される。EPIDヒューズは、EGETKEYを介してPROVISIONING機能を有するエンクレーブにアクセス可能である。   The device certificate key has two sources. The preferred architecture ships the fuse-compressed initial DAK as an EPID keyblob and EPID entropy. This allows the platform to start certification immediately after the first power up. The second source contacts the DAK provision server and uses the EPID ID and the provision key to prove the correctness of the hardware and one is downloaded. This second method is used by platforms that do not have a fused EPID key and platforms after invalidating the underlying TCB version. The EPID fuse can access an enclave with PROVISIONING function via EGETKEY.

プラットフォーム証明キー(PAK)は、オプションとしてさらなるプライバシーのレベルを提供する。DAKのある利用を関連付けることもできる。特にISVエンクレーブが名称ベースの証明機能を有する場合には、単一のISVが、所与のEPIDがこのサービスを再利用するか判断することができる。(しかし複数のISVの間で、ユーザの追跡のための結託は行われない)。DAKは、所有者にではなくて、むしろプラットフォームに結び付けられているので、この関連付けは、ウォータフォール・イベント中継続する。従って一部のユーザは、第三者にPAKを発行してもらって日々の証明に利用するより、も自身のDAKを利用して自分のプラットフォームの正当性を証明するほうを好む。マルチパッケージのプラットフォームでは、各パッケージのDAKは、PAK(証明におけるプラットフォーム全体を表す)を構築するのに利用される。   The platform certificate key (PAK) optionally provides an additional level of privacy. It is also possible to associate certain uses of DAK. A single ISV can determine if a given EPID reuses this service, especially if the ISV enclave has a name-based proof function. (But there is no collusion for tracking users between multiple ISVs). This association continues throughout the waterfall event since DAK is tied to the platform rather than to the owner. Therefore, some users prefer to use their own DAK to prove the legitimacy of their platform rather than having a third party issue a PAK and use it for daily proofing. On multi-package platforms, each package's DAK is used to build a PAK (representing the entire platform in the proof).

ユーザがアクセス可能なキーのキー導出は、NIST特殊公報800−108(擬似乱数関数を利用するキー導出について推奨されている)に準拠する。キー導出関数の構成においては、擬似乱数関数(PRF)が必要である。PRFは、NIST SP800−38Bに定義されているAES−CMACアルゴリズム、処理のブロック暗号モードについて推奨−認証のためのCMACモード、2005年5月(http://csrc.nist.gov/publications/nistpubs/800-108/sp800-108.pdf)に基づく。一般的なキー導出は、DerivativeKey=PRFParentKey(DerivativeString)である。 Key derivation for user accessible keys conforms to NIST Special Publication 800-108 (recommended for key derivation using pseudorandom functions). In the construction of the key derivation function, a pseudorandom function (PRF) is required. PRF uses the AES-CMAC algorithm defined in NIST SP 800-38B, recommended for block cipher mode of processing-CMAC mode for authentication, May 2005 (http://csrc.nist.gov/publications/nistpubs Based on /800-108/sp800-108.pdf). A common key derivation is: DerivativeKey = PRF ParentKey (DerivativeString).

導出ストリング(derivative string)は、要求されている特定のキーに基づく8つの要素からなるサブセットからなる。表12−2は、導出の一部となりうる利用可能なエレメントをそれぞれ説明している。

Figure 2019109910
Figure 2019109910
Figure 2019109910
Derivative strings consist of a subset of eight elements based on the specific key being requested. Table 12-2 describes each of the available elements that can be part of the derivation.
Figure 2019109910
Figure 2019109910
Figure 2019109910

各キーは、予め定義された導出要素のセットを有しており、これは導出ストリングを含む。表12−3は、キー階層の各キーに含まれる要素を示している。各列はキーを表し、行は、そのキーに特定の要素が含まれているかを示す。デバッグストリングは、要求を発するエンクレーブのSECSが、デバッグモードにあることを示している場合に含められ、「要求」は、このエレメントが要求されておらず、キー導出のために要求において選択可能であることを示している。

Figure 2019109910
Each key has a pre-defined set of derived elements, which contain derived strings. Table 12-3 shows the elements included in each key of the key hierarchy. Each column represents a key, and a row indicates whether the key contains a specific element. The debug string is included if the enclave SECS originating the request indicates that it is in debug mode, and a "request" is not required for this element and is selectable in the request for key derivation It shows that there is.
Figure 2019109910

セキュアなエンクレーブは、起動シーケンスの幾つかのポイントでソフトウェアのセキュリティ侵害を分離させ復帰させる技術をサポートしている。分離をサポートするために、エンクレーブに提供された全ての長期キーイング材料を、現在のTCBのセキュリティバージョンを利用して導出する。   Secure enclaves support technology that isolates and recovers software security breaches at several points in the boot sequence. In order to support separation, all long term keying materials provided to the enclave are derived utilizing the security version of the current TCB.

このセクションでは、復帰可能なTCBが、uCode、MCHECK、およびマイクロコード(またはuVMM)からなるプラットフォームのアーキテクチャの一例について説明する。ハードウェア要件は、どのSEサポートプラットフォームについても同じであってよいが、具体的なキーフローは、特定のTCB要素に依存している。ここで利用されている技術に類似した技術を利用して他のプラットフォームをサポートすることもできる。   In this section, we describe an example of platform architecture where the recoverable TCB consists of uCode, MCHECK, and microcode (or uVMM). The hardware requirements may be the same for any SE support platform, but the specific key flow is dependent on the particular TCB element. Other platforms can be supported using techniques similar to those used here.

CPUベースの保護技術をサポートするためには、ハードウェアに以下のキーが必要である。これらキーはTCBキー階層の基盤となる。
<ステッピング固有の256ビットの論理キー>
256ビットの論理キーは、128ビットのヒューズ・ラップキー、および、128ビットのアウトオブボックス経験キー(out-of-box experience key)という2つの部分に分割される。しかし、uCodeを追加する単一の128ビットのキーを両方について利用することもできる。
<ダイ固有の544ビットのヒューズキー>
これらには、32ビットのグループid、256ビットのSafeIdA.x値、および256ビットのプレシードが含まれる。A.x値および256ビットのプレシードは、上述した128ビットのヒューズ・ラップキーで暗号化される。
<一次レジスタ>
キー導出プロセスでは、キーを格納して、パッケージ上に置き、uCodeのみに利用可能とさせる必要がある。プラットフォームのランタイム中は2つの128ビットレジスタが必要である。CMAが起動して動作するまでの間は、EPIDキーのために、さらなる256ビットの空間が必要である。この後は、該さらなる256ビットはCPUには不要となる。
<TCB SVNレジスタ>
このレジスタは、各TCB層にSVNを保持するよう分割された64ビットのロック可能レジスタである。分割の仕方はプラットフォーム設計者の裁量に任されているが、8個の8ビットのSVNに分割する、というのが妥当に思われる。このレジスタの各部分は、独立してロック可能である。
The hardware needs the following keys to support CPU-based protection technology. These keys form the basis of the TCB key hierarchy.
<Stepping-specific 256-bit logical key>
The 256 bit logical key is divided into two parts: a 128 bit fuse wrap key and a 128 bit out-of-box experience key. However, a single 128-bit key that adds uCode can be used for both.
<Die-specific 544-bit fuse key>
These include a 32-bit group id, a 256-bit SafeIdA.x value, and a 256-bit pre-seed. The A.x value and the 256-bit pre-seed are encrypted with the 128-bit fuse wrap key described above.
<Primary register>
In the key derivation process, the key needs to be stored and placed on the package and made available only to uCode. During the runtime of the platform, two 128-bit registers are required. An additional 256 bits of space are required for the EPID key until the CMA is up and running. After this, the additional 256 bits are unnecessary for the CPU.
<TCB SVN register>
This register is a 64-bit lockable register divided to hold SVN in each TCB layer. The division method is at the discretion of the platform designer, but it seems reasonable to divide it into eight 8-bit SVNs. Each part of this register is independently lockable.

キーを特定のTCBバージョンのセットに結合することは、ヒューズキーから第1セットのキーを、開始される機動シーケンスの種類に基づいてuCodeに導出させることにより行われる。このヒューズをロックした後、起動シーケンスの各装填において鎖状に導出(a chain of derivations)が行われる。   Combining keys into a particular set of TCB versions is done by having the uCode derive a first set of keys from the fuse keys based on the type of maneuver sequence being initiated. After locking this fuse, a chain of derivations is performed at each load of the start-up sequence.

低レベルのコードを装填した後で、鎖は、エンクレーブで実行されているソフトウェアの、ISVが割り当てられたセキュリティバージョン(ISV assigned security version)を含み続ける。特定の構成においては、現在のバージョンから導出したキー、および、前の構成からのキーにアクセスすることができる。これにより、新たな安定性のあるバージョンへユーザデータを途切れなく遷移させることができる。   After loading the low level code, the chain will continue to include the ISV assigned security version of the software running on the enclave. In certain configurations, keys derived from the current version and keys from previous configurations can be accessed. Thereby, user data can be seamlessly transitioned to a new stable version.

ダイ固有のキーが生成されると、キー・ラップ・キーで暗号化される。これにより、ハードウェア監視ツールを利用してキーを抽出し、その部分に配置される前に通過するキーを保護することが益々難しくなる。   Once a die specific key is generated, it is encrypted with the key wrap key. This makes it more and more difficult to utilize the hardware monitoring tool to extract the key and to protect the key that passes before being placed in that part.

これらキーを暗号化するのに利用される暗号アルゴリズムは、10ラウンドの128ビットのAES−ECB復号である。キー生成サーバは、AES−ECB暗号化を各キーに行い、ヒューズで焼かれる暗号文キーを生成する。   The encryption algorithm used to encrypt these keys is 10 rounds of 128-bit AES-ECB decryption. The key generation server performs AES-ECB encryption on each key and generates a ciphertext key to be burned with a fuse.

TCBキー階層におけるキー導出に利用される擬似乱数機能(PRF)は、プラットフォームに特有である。AES−NIをサポートするプラットフォーム用には、128ビットのAES−ECBが推奨される。目的は、他のキーからキーを導出するための不可逆的な方法を提供する、というものである。このセクションでは、以下の関数のプロトタイプを利用する。

Figure 2019109910
The pseudorandom number function (PRF) used for key derivation in the TCB key hierarchy is platform specific. For platforms that support AES-NI, 128-bit AES-ECB is recommended. The purpose is to provide an irreversible way to derive keys from other keys. This section makes use of the following function prototypes:
Figure 2019109910

キー導出ではPRFに3つの方法がある。PRFループ導出は、異なるSVNのキー間の関係を構築しつつ、uCode SVNをキーに投入するのに利用される。具体的には、PRELoop(x-1)=PRFPRELoop(x)(const)である。 There are three methods in PRF for key derivation. The PRF loop derivation is used to inject uCode SVNs into keys while building relationships between keys of different SVNs. Specifically, PRELoop (x-1) = PRF PRELoop (x) (const).

これにより、データを前方マイグレーションさせる。uCode SVN3を実行する場合を例にとる。エンクレーブはEGETKEYを利用して、このバージョンに基づくシールキーを取得して(PRELoop(3))、これを利用してデータをシールする。フィールドuCodeのアップグレードを配信し、次の起動uCode SVNは4である。アップグレードの後で、EGETKEY実装は、PRFLoop(4)にアクセス可能となる。エンクレーブが、EGETKEYにSVN3キーを送るよう要求する場合、PRELoop(3)=PRFPRELoop(4)(constant)を計算して、古いシールキーを取得することができる。 This causes data to be migrated forward. Take uCode SVN3 as an example. The enclave uses EGETKEY to obtain a seal key based on this version (PRELoop (3)) and uses it to seal data. Distribute field uCode upgrade, the next launch uCode is SVN 4. After the upgrade, the EGETKEY implementation will be accessible to PRFLoop (4). If the enclave requests EGETKEY to send an SVN3 key, PRELoop (3) = PRF PRELoop (4) (constant) can be calculated to obtain the old seal key.

この特性を構築するには、PRFのループを利用するが、特性PRFPRELoop(x-1)がPRFPRELoop(x)から計算されるので、SVNの最大値を構築して、ここから減算していく必要がある。特定の最大値は、要求される性能に基づいて各プラットフォームの種類に対して構築する必要がある。最大値の初期値としては32を推奨する。PRFループ導出は、以下のようになる。

Figure 2019109910
In order to construct this property, the loop of PRF is used, but since the property PRF PRELoop (x-1) is calculated from PRF PRELoop (x) , the maximum value of SVN is constructed and subtracted from this. We have to go. Specific maxima need to be built for each platform type based on the required performance. 32 is recommended as the initial value of the maximum value. The PRF loop derivation is as follows.
Figure 2019109910

この方法は、uCodeのSVNをSVNキーに投入するために利用され、SEベースのキーの基礎となるキーである。ヒューズされるダイ固有キーは、288ビットのEPID値、および、256ビットのランダムキーを含む。全てのエフェメラルではない対称鍵は、これら256ビット(2個の128ビットキーからなる)から導出することができる。従って、単一のキーから複数のキーを導出するための技術の作成が可能である。こうするためには、ヒューズキーが復号されると、これを利用して異なる固定定数を利用してPRFを呼び出すことができる。鍵を分割すると、一般的には以下のような形になる。   This method is used to inject uCode's SVN into the SVN key and is the key underlying SE based keys. The die unique key to be fused includes 288 bits of EPID value and 256 bits of random key. All non-ephemeral symmetric keys can be derived from these 256 bits (consisting of two 128-bit keys). Thus, it is possible to create techniques for deriving multiple keys from a single key. To do this, once the fuse key is decrypted, it can be used to invoke PRF using different fixed constants. When the key is divided, it is generally as follows.

Figure 2019109910
Figure 2019109910

この技術は、EPID IDおよびプロビジョンIDの一部として利用される乱数を生成するのに利用される。   This technique is used to generate a random number that is used as part of the EPID ID and the Provision ID.

SVNキーがuCode SVNに基づいてループ導出されると、SE CMA等の、離れた保護メモリ内に格納することができる。マイクロコードは、SVNキーからキーを導出するためだけに、マイクロコードに曝されるMSRを利用する。MSRは、導出の基礎が、グローバルなアウトオブボックスのキーなのか、ヒューズキーなのか、および、各TCB層について要求されているSVNセットを示すキー選択器を利用する。これにより、要求が現在の値以下であることを確かめることができる。UCodeは、任意の必要なPREを利用して、古いSVNキー、PRF,および要求されているTCB SVNを取得することができる。

Figure 2019109910
Once the SVN key is loop derived based on uCode SVN, it can be stored in a separate protected memory, such as SE CMA. The microcode utilizes the MSR exposed to the microcode only to derive the key from the SVN key. The MSR utilizes key selectors that indicate whether the basis of the derivation is a global out-of-box key, a fuse key, and the SVN set required for each TCB layer. This makes it possible to verify that the request is below the current value. UCode can obtain the old SVN key, the PRF, and the required TCB SVN using any required PRE.
Figure 2019109910

適切なSVNキーが利用可能になると、要求されているTCB SVNのCMACのキーとして利用される。マイクロコードは、これをCMACキーとして、Opsキー、またはプロビジョンベースキーの固定ストリングについてSEOpsシード(Intelが知らないヒューズキーの部分から導出した値)に対して利用する。つまり、se_base_key=CMAC(svn_base_key,se_ops_seed)である。   When the appropriate SVN key is available, it is used as the key of the requested TCB SVN CMAC. The microcode uses this as the CMAC key, for the Ops key, or for the SEOps seed (the value derived from the part of the fuse key that Intel does not know) for the fixed string of the provision base key. That is, se_base_key = CMAC (svn_base_key, se_ops_seed).

図18は、本発明の一実施形態における、マイクロコードベースのセキュアなエンクレーブキー階層の一例を示す。リセットマイクロコード1800階層では、グローバル・ラップ論理キー1801およびインテルが知っている固有のルートヒューズ1802を、ラップ解除1806機能への入力として利用する。ラップ解除1806およびマイクロコードSVN1805の出力がPRFループ1808に入力される。マイクロコードSVN1805およびグローバルルート論理キー1803は別のPRFループ1809に入る。PRFループ1808の出力は、SVNキー1810レジスタに格納される。PRFループ1809の出力は、グローバルキーレジスタ1812に格納される。マイクロコードSVN1805は、TCB SVNレジスタ1814に格納される。グローバルラップ論理キー1801およびSE EPID A.xヒューズ1893は、ラップ解除1807関数に入力され、結果をSE EPID1816レジスタに格納する。MCheck1820階層においては、MCheckSVN1821およびTCB SVNレジスタ1814の出力が、TCB SVNレジスタ1826に格納される。SVNキーレジスタ1810は、マイクロコードSVNレジスタ1822に格納される。グローバルキーレジスタ1812は、グローバルキーレジスタ1824に格納される。SE EPID1816は、SE EPID1828に格納される。装填マイクロコード1830階層では、マイクロコードSVN1831およびTCB SVNレジスタ1826の出力を、TCB SVNレジスタ1846に格納する。マイクロコードSVNレジスタ1822は、マイクロコードSVNレジスタ1832に格納される。グローバルキーレジスタ1824は、グローバルキーレジスタ1834に格納される。SE EPID1828は、SE EPID1838に格納される。XuMSR導出キー1840階層では、マイクロコードSVN差異1841がPRFループ1842およびPRFループ1844に入る。マイクロコードSVN1832レジスタがデータをPRFループ1842に送り、グローバルキーレジスタ1834がデータをPRFループ1844に送る。PRFループ1842の出力およびTCB SVNレジスタ1836の出力が、PRFループ1846に入り、PRFループ1844の出力およびTCB SVNレジスタ1836の出力が、PRFループ1848に入る。PRFループ1846の出力は、SVNベースキー1850に格納され、PRFループ1848の出力はグローバルキー1852に格納される。マイクロコード1860階層では、Intelが知らない固有のルートヒューズ1894をシード1 1856に格納して、EPIDグループIDヒューズがEPIDグループ1858に格納される。シード1 1856は、PREループ1886およびPRE1888に入る。PREループ1888の出力は、SE EPIDシード1 1892である。PRFループ1886の出力はSE opsシード1890である。SE opsシード1890は、SVNベースキー1850から得られ、要求されたSVN1864は、CMAC1868関数に入り、SE opsキー1872を生成する。現在のSVN1862は、SVNベースキー1850から得られ、CMAC1866関数に入り、SEプロビジョンキー1870を生成する。SVNベースキーが{0、0、0}1874に等しい場合、SVNベースキー1850は、シード0 1876に格納される。シード0 1876は、PRFループ1878およびPRFループ1880に入る。PRFループ1878の出力は、SE EPID ID1882であり、PRFループ1880の出力は、SE EPIDシード0 1884である。   FIG. 18 illustrates an example of a microcode based secure enclave key hierarchy in accordance with one embodiment of the present invention. The reset microcode 1800 hierarchy uses the global wrap logical key 1801 and a unique root fuse 1802 known to Intel as input to the unwrap function 1806 function. The output of unwrapping 1806 and microcode SVN 1805 is input to PRF loop 1808. The microcode SVN 1805 and global root logical key 1803 enter another PRF loop 1809. The output of PRF loop 1808 is stored in SVN key 1810 register. The output of PRF loop 1809 is stored in global key register 1812. The microcode SVN 1805 is stored in the TCB SVN register 1814. Global wrap logic key 1801 and SE EPID A.x fuse 1893 are input to the unwrap function 1807 function and store the result in SE EPID 1816 register. In the MCheck 1820 hierarchy, the outputs of the MCheck SVN 1821 and the TCB SVN register 1814 are stored in the TCB SVN register 1826. The SVN key register 1810 is stored in the microcode SVN register 1822. Global key register 1812 is stored in global key register 1824. The SE EPID 1816 is stored in the SE EPID 1828. In the loading microcode 1830 hierarchy, the outputs of the microcode SVN 1831 and the TCB SVN register 1826 are stored in the TCB SVN register 1846. The microcode SVN register 1822 is stored in the microcode SVN register 1832. Global key register 1824 is stored in global key register 1834. The SE EPID 1828 is stored in the SE EPID 1838. In the XuMSR derivation key 1840 hierarchy, the microcode SVN difference 1841 enters the PRF loop 1842 and the PRF loop 1844. The microcode SVN 1832 register sends data to the PRF loop 1842 and the global key register 1834 sends data to the PRF loop 1844. The output of PRF loop 1842 and the output of TCB SVN register 1836 enter PRF loop 1846 and the output of PRF loop 1844 and the output of TCB SVN register 1836 enter PRF loop 1848. The output of PRF loop 1846 is stored in SVN base key 1850 and the output of PRF loop 1848 is stored in global key 1852. In the microcode 1860 hierarchy, the EPID group ID fuse is stored in the EPID group 1858, with the unique root fuse 1894 not known to Intel being stored in the seed 1 1856. Seed 1 1856 enters PRE loop 1886 and PRE 1888. The output of PRE loop 1888 is SE EPID seed 1 1892. The output of PRF loop 1886 is SE ops seed 1890. The SE ops seed 1890 is obtained from the SVN base key 1850 and the requested SVN 1864 enters the CMAC 1868 function to generate the SE ops key 1872. The current SVN 1862 is obtained from the SVN base key 1850 and enters the CMAC 1866 function to generate the SE provision key 1870. If the SVN base key is equal to {0, 0, 0} 1874, then the SVN base key 1850 is stored in seed 0 1876. Seed 0 1876 enters the PRF loop 1878 and the PRF loop 1880. The output of PRF loop 1878 is SE EPID ID 1882 and the output of PRF loop 1880 is SE EPID seed 0 1884.

全てのコアが同期して、ドアベルまたは類似したメカニズムを利用して、全てがMCHECKに入るようにする。全てのコアがMCHECKを実行中になると、(1)uCodeが、ヒューズの読み取り、復号、およびロックを行う、(2)uCodeがPRFループをSVNキーに、PRFループをOOBEキーに利用して、uCodeのSVNを両キーに投入する。uCodeは、そのSVNをTCB SVNレジスタに書き込み、その部分をロックする、(3)MCHECKローダまたは早期MCKECKコードが、MCHECKのSVNをTCB SVNレジスタに書き込み、ロックする、(4)マイクロコードパッチ・ローダが、マイクロコードパッチSVNをTCB SVNレジスタに書き込み、ロックする、という各ステップがBSPから行われる。APは、キーフローに参加しない。   Make sure all cores are in sync and all in MCHECK using doorbell or similar mechanism. (1) uCode reads, decodes, and locks fuses when all cores are running MCHECK. (2) uCode uses PRF loop as SVN key and PRF loop as OOBE key. Insert uCode's SVN into both keys. uCode writes its SVN to the TCB SVN register and locks that part, (3) The MCHECK loader or early MCKECK code writes and locks the MCHECK SVN to the TCB SVN register, (4) Microcode patch loader Each step of writing and locking the microcode patch SVN into the TCB SVN register is performed from the BSP. The AP does not participate in key flow.

マイクロコード初期化中、またはEGETKEYの呼び出し時に、マイクロコードは、要求を満たすのに必要となるSEベースキーを計算する。ベースキーは、さらに性能向上のために利用するために、CMA内にキャッシュされてよい。表12−4は、ベースキーの計算方法を示す。

Figure 2019109910
During microcode initialization, or when EGETKEY is called, the microcode calculates the SE base key needed to fulfill the request. The base key may be cached in the CMA for further use for performance improvement. Table 12-4 shows how to calculate the base key.
Figure 2019109910

プラットフォームのウォータフォールでユーザのプライバシーおよびデータを保護するために、256ビットのランダム所有者エポックをキー導出に含める。この値は、所有者変更中にランダムに作成される。エンクレーブキーを利用する前に、ソフトウェアは、所有者エポックをSE_EPOCH_MSRに書き込んでよい。これはBIOSがフラッシュに永久書き込みを行うことにより実行されてよい。一部のユーザ入力(ユーザ起動パスワードのハッシュ等)からこれを計算することもできる。または、エンクレーブの利用を許可する前に、セキュアなエンクレーブドライバにより提供されてもよい。   Include 256-bit random owner epoch in key derivation to protect user's privacy and data in platform waterfall. This value is randomly generated during owner change. Before using the enclave key, the software may write the owner epoch to SE_EPOCH_MSR. This may be done by the BIOS permanently writing to the flash. It can also be calculated from some user input (such as a hash of a user initiated password). Alternatively, it may be provided by the secure enclave driver prior to authorizing the use of the enclave.

この値の機密性は、プラットフォームにより暗号化されるデータが、ウォータフォールの後でラップトップの所有者により最初に認可されているエンクレーブでは復号できないことを保証する必要がある。この値のセキュリティ侵害は、エンクレーブデータのセキュリティ侵害につながらない。   The secrecy of this value should ensure that the data encrypted by the platform can not be decrypted by the enclave first authorized by the laptop owner after waterfall. Security breaches of this value do not lead to security breaches of enclave data.

SEキー情報構造は、メモリまたはパッケージの保護された領域に格納されている非永久構造である。CMAが最もよく利用される位置であるが、オンダイで保護されたストレージのいずれかを利用することも可能である。電源投入中には、SEキー情報を初期化することができる。キーIDは乱数値に設定され、キーカウントは0に設定される。エンクレーブキー、許可書キー、およびレポートキーが利用されるごとに、キーIDが読み出され(the KeyID read)、キーカウントを増分する。2^32個のキーが利用された後で、キーIDが新たな乱数の値に変更され、キーカウントが0にリセットされる。SEキー情報配置を5に示す。

Figure 2019109910
The SE key information structure is a non-permanent structure stored in a protected area of memory or package. Although CMA is the most commonly used location, it is possible to use any of the on-die protected storage. While the power is on, the SE key information can be initialized. The key ID is set to a random value and the key count is set to zero. Each time an enclave key, a grant key, and a report key are used, the key ID is read (the KeyID read) and the key count is incremented. After 2 ^ 32 keys are used, the key ID is changed to a new random number value and the key count is reset to zero. The SE key information arrangement is shown in 5.
Figure 2019109910

電源が投入されると、プラットフォームキーテーブルをuCodeにより初期化する。BIOSその他のホストファームウェアは、現在の所有者エポックを、永久ストレージから、または、ユーザから取得して、これをLoadOwnerEpochMSRに書き込む。この時点ではエンクレーブキー階層が利用可能である。   When the power is turned on, the platform key table is initialized by uCode. The BIOS or other host firmware gets the current owner epoch from permanent storage or from the user and writes it to the LoadOwnerEpochMSR. At this point, the enclave key hierarchy is available.

エンクレーブのアーキテクチャの多くは、エンクレーブデータの認証および機密性を提供するためにキーが利用され、プロセッサの複雑性を最小限にとどめるために、アーキテクチャエンクレーブを利用して、高レベルの利用のためにこれらキーを処理する。例えば、クオーティング・エンクレーブは、REPORTキーを利用して、EREPORT命令により生成されたREPORT構造がプラットフォーム上に作成されたことを確認して、PERMITINGエンクレーブは、PERMITキーを利用して、エンクレーブが起動されたときにEINITが消費するエンクレーブPERMITを生成する。   Many of Enclave's architectures use keys to provide authentication and confidentiality of enclave data, and use architecture enclaves to achieve high levels of utilization to minimize processor complexity. Process these keys. For example, the quotation enclave confirms that the REPORT structure generated by the EREPORT instruction has been created on the platform using the REPORT key, and the PERMITING enclave activates the enclave using the PERMIT key. Generate the enclave PERMIT that EINIT consumes when it is done.

加えて、任意のアプリケーションレベルのエンクレーブが、エンクレーブ外のプラットフォーム上の格納されている秘密をシールするためにキーにアクセスする必要があり、アプリケーションエンクレーブが再度確立されたとき(電力サイクル中であっても)シールは解除される。   In addition, when any application level enclave needs access to the keys to seal the stored secret on the platform outside the enclave, when the application enclave is re-established (during the power cycle) ) The seal is released.

こうするためのメカニズムはEGETKEY命令である。これは、現在のソフトウェア環境について秘密を構築するための単一のインタフェースである。
EGETKEYは現在、以下のキーにアクセスを提供している:(1)プロビジョンキーID(プロセッサについて一意に暗号化された(プロビジョンキーを利用して)データブロブを識別するために、アーキテクチャ・プロビジョン・エンクレーブが利用する)、(2)プロビジョンキー(プロセッサについて一意に暗号化されたデータブロブを復号するために、アーキテクチャ・プロビジョン・エンクレーブが利用する)、(3)プロビジョンシールキー(エンクレーブが、所有者が変わっても復号できるような形にEPIDを暗号化するために、アーキテクチャ・プロビジョン・エンクレーブが利用する)、(4)許可証キー(許可証を作成するためにアーキテクチャ許可証エンクレーブが利用する)、(5)レポートキー(レポート構造を検証するために、アーキテクチャ・クオーティング・エンクレーブが利用する)、(6)ISV認証キー(ISV AUTH KEY)(特定の対象アプリケーションエンクレーブのための認証データを作成するために、アーキテクチャ・クオーティング・エンクレーブが利用する)、(7)認証キー(AUTH KEY)(アーキテクチャ・クオーティング・エンクレーブが受け取ったデータを認証するために、アプリケーションエンクレーブが利用する)、(8)シールキー(エンクレーブ外に格納を希望するデータを暗号化するために、アプリケーションエンクレーブが利用する)、(9)OOB経験キー(アウトオブボックス経験利用のために(例えばBluRayプレーヤ)暗号化データを予めプロビジョンするために、ISVが利用する)。
The mechanism for doing this is the EGETKEY command. This is a single interface to build a secret for the current software environment.
EGETKEY currently provides access to the following keys: (1) Provision Key ID (Architect to identify data blobs that are uniquely encrypted for the processor (using the provision key); (2) Provision key (used by the architecture provision enclave to decrypt data blobs uniquely encrypted for the processor) (3) provision seal key (used by the provision enclave) (Used by the architecture provision enclave to encrypt the EPID in such a way that the enclave can decrypt even if the owner changes) (4) Permit key (architect to create a permit Permit (Enclave), (5) Report key (Report) (Architecture Quotating Enclaves use to verify the build), (6) ISV AUTH KEY (Architecture Quotating to create authentication data for a specific target application enclave -Used by the enclave, (7) Authentication key (AUTH KEY) (used by the application enclave to authenticate data received by the architecture quotation enclave), (8) Seal key (stored outside the enclave) (9) OOB experience keys (eg, BluRay players) for pre-provisioning encrypted data for out-of-the-box experience use, to encrypt the desired data. To use).

これら値の殆どは、未加工でプロセッサに常駐はせず、実際には、単一のヒューズキーの値からEGETKEYの要求に応じて導出される。これらキーのそれぞれが単一のキーではなく、可能性のあるセットからの単一のキーにあるときに要求に応じて導出される。配信された特定のキーは、複数のパラメータに依存しており、そのうち一部がユーザ選択可能であり、その他がシステムまたは特定の状態に基づいている。   Most of these values are raw and non-resident on the processor, and in fact are derived from single fuse key values in response to EGETKEY requests. It is derived on demand when each of these keys is not a single key, but a single key from the possible set. The particular key delivered is dependent on multiple parameters, some of which are user selectable and others are based on system or particular conditions.

キーを選択するために、キー要求構造をEGETKEY命令への入力として利用する。キーを選択することに加えて、ユーザは、キー要求構造を利用して、キー生成中に利用を希望する、制御下にあるこれら変数を、呼び出し者に特定させる。以下の図面は、キー要求構造を示す。

Figure 2019109910
The key request structure is used as input to the EGETKEY command to select a key. In addition to selecting keys, the user utilizes a key request structure to allow callers to specify those variables under control that they wish to use during key generation. The following figures show the key request structure.
Figure 2019109910

キー選択は、ユーザが必要とするキーを特定するのに利用され、キーポリシーは、キーを作成するのに利用されるさらなる値を確かめるのに利用される(それが、アーキテクチャエンクレーブの特定のセキュリティバージョンであろうと、アーキテクチャエンクレーブの特定のセキュリティバージョンであろうと、アプリケーションエンクレーブの特定のバージョンであろうと、現在のエンクレーブに関連付けられた計測値レジスタであろうと(EGETKEYがENCLAVE内から呼び出されるとき))。   Key selection is used to identify the key the user needs, and the key policy is used to verify the additional values used to create the key (which is the specific security of the architecture enclave Whether it is a version, a particular security version of the architecture enclave, or a particular version of the application enclave, whether it is a measurement register associated with the current enclave (when EGETKEY is called from within ENCLAVE) .

さらなるランダムネスがキー導出に利用することもでき、これは特に、キーの消耗を防止するために必要であり、PERMITINGおよびQUOTINGアーキテクチャエンクレーブにより利用される。また、シールキー(SEALing key)を作成するときにもアプリケーションエンクレーブにより利用される。ゼロにセットされたフィールドは、ランダムネスを追加しないことを意味しており、そうでない場合にはフィールドは、256ビットの整列したデータの値を指し示すことになる。以下の表は、キー選択フィールドの構造を特定する。

Figure 2019109910
Additional randomness can also be used for key derivation, which is especially necessary to prevent key wear and is used by the PERMITING and QUOTING architecture enclaves. It is also used by the application enclave when creating a seal key. A field set to zero means that no randomness is added, otherwise the field will point to the 256-bit aligned data value. The following table identifies the structure of the key selection field.
Figure 2019109910

キーポリシーは、ビットフィールドセレクタであり、特定の値(ユーザまたはシステム状態いずれからのものであっても)が、キー導出に利用されるかを判断するのに利用される。

Figure 2019109910
A key policy is a bit field selector, which is used to determine whether a particular value (whether from user or system state) is used for key derivation.
Figure 2019109910

<エンクレーブレジスタおよび制御>

Figure 2019109910
<Enclave Register and Control>
Figure 2019109910

2つのイネーブルレベルがエンクレーブに提供される。第1のイネーブルは、BIOSによるビットセットのoptである。これは一度の書き込み関数(write once function)である。次のリセットまでにエンクレーブ機能をイネーブルまたはディセーブルする。第2のイネーブルは、OSまたはVMMに提供されて、必要に応じてエンクレーブ機能をONまたはOFFに切り替える。   Two enable levels are provided to the enclave. The first enable is a bit set opt by the BIOS. This is a write once function. Enable or disable the enclave feature by the next reset. The second enable is provided to the OS or VMM to turn the enclave feature on or off as needed.

図19は、本発明の一実施形態にみることができるエンクレーブCTL_MSRレジスタを示す。最下位ビットがイネーブル1900である。レジスタのビット1が1910でOnである。ビット2から63はリザーブされている。   FIG. 19 shows an enclave CTL_MSR register that can be found in an embodiment of the present invention. The least significant bit is enable 1900. Bit 1 of the register is On at 1910. Bits 2 to 63 are reserved.

エンクレーブ機能は、先ず、図19に示すエンクレーブCTL_MSRにイネーブルビットを設定することから始まる。このビットは、パッケージのリセットが行われるとディセーブルに初期設定される。このビットは、パッケージリセットの後に一度書き込むことができる。   The enclave function begins by setting the enable bit in the enclave CTL_MSR shown in FIG. This bit is initialized to disabled upon a package reset. This bit can be written once after a package reset.

BIOSは、ビットをセットして、エンクレーブをイネーブルする。BIOSがビットをクリアすると、エンクレーブは、その部分がリセットされるまでイネーブルすることができない。   The BIOS sets the bit to enable enclave. Once the BIOS clears the bit, the enclave can not be enabled until the part is reset.

ソフトウェアは、CPUID命令を実行することで、エンクレーブのサポートを検知することができる。CPUIDは、エンクレーブがサポートされているか否かを示す結果を戻す。   Software can detect enclave support by executing the CPUID instruction. The CPUID returns a result indicating whether the enclave is supported.

ビットのOptがクリアされると、CPUIDは、そのエンクレーブを実行しないことを報告する。   When the bit Opt is cleared, the CPUID reports not to execute its enclave.

システムソフトウェアは、図19に示すエンクレーブCTL_MSRを利用してエンクレーブ機能を制御する。Onビットは、ソフトウェアに、エンクレーブ機能に対するアクセスを動的に制御させる。   The system software controls the enclave function using the enclave CTL_MSR shown in FIG. The On bit allows software to dynamically control access to the enclave function.

ソフトウェアは、CPUID命令を実行することで、エンクレーブのサポートを検知することができる。エンクレーブCTL MSRにONビットがセットされている場合に、エンクレーブサポートが示される。   Software can detect enclave support by executing the CPUID instruction. Enclave support is indicated when the ON bit is set in the enclave CTL MSR.

TCSMSRレジスタは、TCSのアドレスを含む各プロセッサ上のレジスタであり、例外処理およびRDTCSPTRにより利用される。エンクレーブに入るときに装填される。レジスタは、EENTERを実行するときにTCSの値を装填され、ERDTCSPTRにより読み取られる。レジスタサイズは、プロセッサのモードに基づく。   The TCSMSR register is a register on each processor that includes the TCS address, and is used by exception handling and RDTCSPTR. Loaded when entering an enclave. The register is loaded with the value of TCS when EENTER is executed and read by ERDTCSPTR. The register size is based on the mode of the processor.

各プロセッサ上にあるエンクレーブ・ベースアドレスレジスタは、実行中のエンクレーブの下位アドレスを含み、マイクロコードによりエンクレーブに入るときに装填される。レジスタサイズは、プロセッサのモードに基づく。このレジスタはソフトウェアからは見えず、一時的なマイクロコード(microcode temporary)である。   The enclave base address register on each processor contains the lower address of the enclave being executed and is loaded by the microcode as it enters the enclave. The register size is based on the mode of the processor. This register is invisible to software and is temporary microcode temporary.

レジスタは、現在のエンクレーブのアドレスの上限を保持し、エンクレーブに入るときに装填される。レジスタは、エンクレーブが実行を開始するときに、SECSに格納されている値を装填される。これは、一時的なマイクロコードレジスタである。レジスタサイズは、プロセッサのモードに基づく。   The register holds the upper limit of the current enclave's address and is loaded when it enters the enclave. The register is loaded with the value stored in the SECS when the enclave starts execution. This is a temporary microcode register. The register size is based on the mode of the processor.

エンクレーブページキャッシュ(EPC)最大サイズレジスタは、EPCの最大サイズを示す。このサイズは、4096バイトのページの数で与えられる。これは32ビットのレジスタである。このレジスタは、読み取り専用であり、現在の設計でEPCがサポートする最大サイズを示す。   The enclave page cache (EPC) maximum size register indicates the maximum size of the EPC. This size is given by the number of pages of 4096 bytes. This is a 32-bit register. This register is read only and indicates the maximum size that the EPC supports in the current design.

EPCサイズレジスタEPC_SIZE MSRは、EPCの現在定義されているサイズを示す。レジスタを装填することで、EPCがそのサイズに定義される。この値は、4096ビットのページで与えられる。例えば、4096ビットのページ1枚が1である。レジスタの値は、EPC_MAX値を超えることはできない。値がEPC_MAX値を超えると、WRMSR命令によりGP不良がとられる。このレジスタに書き込むことで、書き込み前に、EPCの全てのデータが無効化される。ソフトウェアは、このレジスタを更新する前に(必要であれば)全てのEPCエントリをセーブしてよい。   EPC Size Register EPC_SIZE MSR indicates the currently defined size of EPC. By loading the register, the EPC is defined to that size. This value is given in pages of 4096 bits. For example, one 4096-bit page is one. The value of the register can not exceed the EPC_MAX value. If the value exceeds the EPC_MAX value, the WRMSR instruction causes a GP fault. By writing to this register, all data in the EPC is invalidated before writing. Software may save all EPC entries (if necessary) before updating this register.

EPCベースレジスタは、EPCのベースの位置を示す。このレジスタに書き込むことで、書き込み前に、EPCの全てのデータが無効化される。ソフトウェアは、このレジスタを更新する前に(必要であれば)全てのEPCエントリをセーブしてよい。   The EPC base register indicates the position of the EPC base. By writing to this register, all data in the EPC is invalidated before writing. Software may save all EPC entries (if necessary) before updating this register.

概して、外部インタフェースは、エンクレーブのセキュリティを侵害しうる転送またはトランザクションを許可しない。セキュアなエンクレーブは、エンクレーブキーについてランダムな数を要求する。乱数生成器は、マイクロコードによりセキュアにアクセス可能である。パーツのコアに配置される必要はない。   Generally, the external interface does not allow transfers or transactions that may compromise the security of the enclave. Secure enclaves require random numbers for enclave keys. The random number generator is securely accessible by microcode. It does not have to be placed at the core of the part.

図26は、本発明の一実施形態における、デジタル乱数生成器のためのプロセッサパッケージを示す。プロセッサパッケージ2600は、コア0 2640、コア1 2670という複数のコアを含みうる。コア0 2640は、マイクロコード2642、マイクロコード2644、マイクロコード2646、RNGマイクロコードモジュール2650、およびRNGキュー2654を含んでよい。コア1 2670は、マイクロコード2672、マイクロコード2674、マイクロコード2676、RNGマイクロコードモジュール2680、およびRNGキュー2684を含んでよい。読み取りランダム命令2630は、マイクロコード2642と通信してよく、読み取りランダム命令2635は、マイクロコード2672と通信してよい。プロセッサパッケージ2600は、さらに、DRNG2602を含んでよく、DRNG2602は、STD2608、OPE2610、PSK2612、およびTSC2614をとる。DRNG2602は、デジタルエントロピーソース2604を取得することができ、これはオンラインの自己テスト2606に接続する。オンラインの自己テスト2606の出力は、組み合わせられた調節器/決定論ランダムビット生成器(DRBG)2620の1つの入力であってよい。   FIG. 26 shows a processor package for a digital random number generator in one embodiment of the present invention. The processor package 2600 may include multiple cores, core 02640 and core 12670. Core 0 2640 may include microcode 2642, microcode 2644, microcode 2646, RNG microcode module 2650, and RNG queue 2654. Core 1 2670 may include microcode 2672, microcode 2674, microcode 2676, RNG microcode module 2680, and RNG queue 2684. The read random instruction 2630 may be in communication with the microcode 2642 and the read random instruction 2635 may be in communication with the microcode 2672. The processor package 2600 may further include a DRNG 2602, which takes the STD 2608, the OPE 2610, the PSK 2612, and the TSC 2614. The DRNG 2602 can obtain a digital entropy source 2604, which connects to an on-line self test 2606. The output of the on-line self-test 2606 may be one input of a combined regulator / deterministic random bit generator (DRBG) 2620.

エンクレーブは、作成時にデバッグエンクレーブとして設定されてよい。デバッグエンクレーブは、EDBGRDおよびEDBGWR命令を利用してエンクレーブの内容に外部アクセスすることができる。デバッグエンクレーブは、ECREATE内にデバッグエンクレーブを設定することによりセットアップされる。このビットはエンクレーブのECS内に格納される。   Enclaves may be set as debug enclaves at creation time. The debug enclave can externally access the contents of the enclave using the EDBGRD and EDBGWR instructions. The debug enclave is set up by setting the debug enclave in ECREATE. This bit is stored in the enclave's ECS.

デバッグビットクレアで作成されるエンクレーブは、生成エンクレーブである。エンクレーブは、EPCは、エンクレーブがデバッグエンクレーブであると示すデバッグビットを含んでいる。エンクレーブは、メインメモリ内に、またはディスク上に、暗号化されたままで残っている。エンクレーブの内容を探す必要のあるデバッガは、メモリをEPCに装填する。EDBGRDおよびEDBGWR命令を利用して、EPCに常駐するエンクレーブメモリの位置にアクセスすることができる。デバッグエンクレーブは、実行するために許可証を必要とせず、有効な許可証なしに実行される。   The enclave created by debug bit clair is a generated enclave. For the enclave, the EPC contains debug bits that indicate that the enclave is a debug enclave. Enclaves remain encrypted in main memory or on disk. The debugger, which needs to find the contents of the enclave, loads the memory into the EPC. The EDBGRD and EDBGWR instructions can be used to access the location of the enclave memory resident in the EPC. The debug enclave does not require a permit to execute and is performed without a valid permit.

生成エンクレーブに入るときにデバッグ制御レジスタDR7は、TCSセーブ領域にセーブされる。DR7は図27に示されている。図27は、本発明の一実施形態では、デバッグレジスタDR7 2700である。レジスタDR7 2700は、L0 2702、L1 2706、L2 2710、L3 2714、G0 2704、G1 2708、G2 2712、およびG3 2716を含む。DR7 レジスタ2700の他のビットは、LE2718、GE2720、001 2722、GD2724、00 2726、R/W0 2728、LEN0 2730、R/W1 2732、LEN1 2734、R/W2 2736、LEN2 2738、R/W3 2740、およびLEN3 2742を含む。   When entering the generation enclave, the debug control register DR7 is saved in the TCS save area. DR7 is shown in FIG. FIG. 27 is a debug register DR7 2700 in one embodiment of the present invention. The register DR7 2700 includes L0 2702, L1 2706, L2 2710, L3 2714, G0 2704, G1 2708, G2 2712, and G3 2716. The other bits of the DR7 register 2700 are: LE2718, GE2720, 001 2722, GD2724, 00 2726, R / W0 2728, LEN0 2730, R / W1 2732, LEN1 2734, R / W2 2736, LEN2 2738, R / W3 2740, R / W3 2740 And LEN 3 2742.

ビットL3−L0およびG3−G0は、0の値に設定されている。DR7は、エンクレーブの退出時に元の値に設定される。   Bits L3-L0 and G3-G0 are set to a value of zero. DR7 is set to the original value when the enclave exits.

デバッグエンクレーブについては、デバッグレジスタの値を変更しない。RFLAGS.TFは、EENTER命令の開始時に設定され、以下の2つの場合を考慮に入れる必要がある。   For debug enclaves, do not change the value in the debug register. RFLAGS. The TF is set at the start of the EENTER command, and the following two cases need to be taken into account.

1つの場合は、デバッガがレガシー(非SE認識)である、または、エンクレーブが生成(非デバッグ)モードにある場合である。   One case is when the debugger is legacy (non SE aware) or if the enclave is in generate (non debug) mode.

SE認識デバッガは、デバッグモード・エンクレーブを対象としている。   The SE recognition debugger targets debug mode enclaves.

第1の場合には、#DB例外が、次のEEXIT命令の対象において生じうる。これにより、エンクレーブが、大きく、不透明な処理(large, opaque operation)として取り扱われる。第2の場合には、ユーザは、エンクレーブによる単一のステップへの完全な自由度を利用することができる(complete freedom to single step through the enclave)。この行為は、エンクレーブ内の3つのデータフィールド、および、EENTER、EEXIT、および、EIRETにおけるRFLAGS.TFの特殊処理によりサポートされる。

Figure 2019109910
Figure 2019109910
In the first case, a #DB exception may occur at the subject of the next EEXIT instruction. This causes the enclave to be treated as a large, opaque operation. In the second case, the user can take advantage of complete freedom to a single step by the enclave (complete freedom to single step through the enclave). This action consists of three data fields in the enclave, and EENTER, EEXIT, and RFLAGS. Supported by TF special handling.
Figure 2019109910
Figure 2019109910

TCSセーブ領域にレジスタ値をセーブする。レジスタは0に設定される。エンクレーブの終了時には、レジスタは、エントリ値に復元される。エンクレーブが、開始時にイネーブルされた分岐トレース(branch trace)を有する場合、EENTERがエンクレーブに入る前の最終エントリとなる。エンクレーブの終了時に、終了後の始めの位置が分岐トレースに書き込まれる。   Save the register value in the TCS save area. The register is set to 0. At the end of the enclave, the register is restored to the entry value. If the enclave has a branch trace enabled at start up, EENTER will be the last entry before entering the enclave. At the end of the enclave, the beginning position after the end is written to the branch trace.

Int nおよびInt 3命令は、エンクレーブ内で実行されるときにGP不良として報告される。デバッガは、エンクレーブをデバッグするときにGP不良条件をフックすることができる。   Int n and Int 3 instructions are reported as GP fault when executed within the enclave. The debugger can hook a GP fault condition when debugging an enclave.

本文書では、AESブロック暗号のためにCMACモード処理を実施する新規な技術を記載する。CMACは、メッセージの真偽をサポートするモードであり、メッセージAおよびキーKを入力として受け付けて、認証タグTを戻す。認証タグの導出は、CBC(暗号ブロック鎖)アルゴリズムを利用して行われる。CMACは、長さ拡張攻撃に対する保護メカニズムを含むために、CBCよりも複雑である。これらを「CMACの3つの特性」と称する。以下では、CBCおよびCMACを概略する。   This document describes a novel technique to implement CMAC mode processing for AES block ciphers. CMAC is a mode that supports message authenticity and accepts message A and key K as input and returns an authentication tag T. Derivation of the authentication tag is performed using a CBC (cipher block chain) algorithm. CMAC is more complex than CBC because it includes a protection mechanism against length extension attacks. These are referred to as "the three properties of CMAC". The following outlines CBC and CMAC.

図20は、本発明の一実施形態で利用される暗号ブロック鎖アルゴリズムを示す。初期化ベクトル2000およびステージ1入力2010は、排他的論理和ゲート2012に入る。排他的論理和ゲート2012の出力は、ステージ1ブロック暗号2015に入る。ステージ1ブロック暗号出力2018は次に、ステージ2排他的論理和ゲート2022に、ステージ2入力2020とともに入る。排他的論理和ゲート2022の出力は、ステージ2ブロック暗号2025に入る。ステージ2ブロック暗号出力2028は、暗号ブロック鎖の次の段階に入る(不図示)。   FIG. 20 illustrates the cipher block chain algorithm utilized in one embodiment of the present invention. The initialization vector 2000 and stage 1 input 2010 enter the exclusive OR gate 2012. The output of the exclusive OR gate 2012 enters stage 1 block cipher 2015. Stage 1 block cipher output 2018 then enters stage 2 exclusive OR gate 2022 along with stage 2 input 2020. The output of exclusive OR gate 2022 enters stage 2 block cipher 2025. Stage 2 block cipher output 2028 enters the next stage of the cipher block chain (not shown).

CBCアルゴリズムは、ブロック暗号を利用して、一部のデータの機密性を確保する、または、このデータの認証タグを計算する。CBCアルゴリズムの基本をなす構想は、前の暗号からの出力が、暗号化前に次の入力ブロックでXORされる、というものである。このようにして、入力データに存在しうるパターンを、暗号文から排除することができる。また、ブロック暗号のトランザクションの間のXOR処理の組み合わせにより、理想的には許されない(forgeable)メッセージ認証タグを導出するために混合が大幅に行われる(strong mixing)。   The CBC algorithm uses block ciphers to ensure the confidentiality of some data or to calculate an authentication tag for this data. The idea underlying the CBC algorithm is that the output from the previous cipher is XOR'd with the next input block prior to encryption. In this way, patterns that may be present in the input data can be excluded from the ciphertext. Also, the combination of XORing between block cipher transactions results in a strong mixing to derive an ideally forgeable message authentication tag.

CBCアルゴリズムは、図20と以下に示される。暗号は、AESの場合同様に、128ビットの暗号と想定する。

Figure 2019109910
The CBC algorithm is shown in FIG. 20 and below. Encryption is assumed to be 128-bit encryption as in the case of AES.
Figure 2019109910

CMACの仕様は、CBCアルゴリズムを初期化および終了させるために3つのさらなるアルゴリズムを含む。これらは、CMACの「3つの特徴」と称される。1つ目の特徴は、対称鍵Kから2つのサブキー値KおよびKを導出することに関する。サブキーKおよびKは、中間値Lから導出される。CMACは、対称鍵の値Kを利用して、ゼロからなるストリング(つまり0128)に、対称鍵値Kを利用して対称鍵ブロック暗号変換を行うことでLが得られる、と示している。この関係を、式(1)L=CIPHER(0128)で示す。 The CMAC specification includes three additional algorithms to initialize and terminate the CBC algorithm. These are referred to as the "three features" of CMAC. The first feature relates to deriving two subkey values K 1 and K 2 from a symmetric key K. The subkeys K 1 and K 2 are derived from the intermediate value L. CMAC indicates that L can be obtained by performing symmetric key block cipher transformation using a symmetric key value K to a string of zeros (ie 0 128 ) using the symmetric key value K . This relationship is shown by the equation (1) L = CIPHER K (0 128 ).

Lが導出されると、Lの最上位ビットをチェックする。これがゼロであれば、Kを、左に1ビットシフトすることにより、Lから導出される。そうでない場合は、Lを左に1ビットシフトして、特殊な値RでXORして、Kを生成する。Rは、バイナリ形式の(012010000111)として定義される。Kも同じプロシージャでKから生成される。サブキーK、Kの導出は、以下の擬似符号に示されている。MSB()がある値の最上位ビットを示すこととする。

Figure 2019109910
Once L is derived, the most significant bit of L is checked. If this is zero, it is derived from L by shifting K 1 one bit to the left. Otherwise, shift L one bit to the left and XOR with the special value R b to generate K 1 . R b is defined as (0 120 10000111) in binary form. K 2 is also generated from K 1 in the same procedure. The derivation of the subkeys K 1 , K 2 is shown in the pseudo code below. Let MSB () indicate the most significant bit of a value.
Figure 2019109910

CMACの第2の特徴は、入力データにCBCアルゴリズムを利用する前に、パディングを行うことに関している。データの最後のブロックが完全なブロックではない場合にはそのブロックを、1に必要な数の0を付けたビットでパディングして、最終的なブロックが完全なものになるようにする。   The second feature of CMAC relates to padding before using CBC algorithm on input data. If the last block of data is not a complete block, the block is padded with the necessary number of zeros of bits to 1 so that the final block is complete.

CMACの第3の特徴は、長さ拡張攻撃を回避するために行われる最終ブロックに対する修正に関している。最終ブロックが完全に1ではない場合(パディング不要の場合)には、最終ブロックをサブキーKでXORする。そうでない場合には、サブキーKでXORする。CMACタグ生成および検証アルゴリズムを以下に示す。 The third feature of CMAC relates to the modifications to the final block that are made to avoid length extension attacks. If the final block is not completely 1 (if no padding is necessary), the final block is XORed with the subkey K 1 . Otherwise, XOR with subkey K 2 . The CMAC tag generation and verification algorithm is shown below.

Figure 2019109910
Figure 2019109910

以下では、対称鍵ブロック暗号がAESとして利用され、プロセッサがAESラウンド加速(AES round acceleration)の命令セットをサポートしている場合の、CBC()アルゴリズムの実装方法例を示す。Intelアーキテクチャは、ウェストミア(Westmere)プロセッサ(2009)およびそれ以降の時間フレームにおいて4つの新たな命令をサポートする。これら命令は、AESENC(AESラウンド暗号)、AESENCLAST(AES最終ラウンド暗号)、AESDEC(AESラウンド復号)、AESDECLAST(AES最終ラウンド復号)である。これら命令の仕様を以下に示す。

Figure 2019109910
In the following, an example of how to implement the CBC () algorithm is shown, where the symmetric key block cipher is used as AES and the processor supports the instruction set of AES round acceleration. The Intel architecture supports four new instructions in the Westmere processor (2009) and later time frames. These instructions are AESENC (AES round encryption), AESENCLAST (AES last round encryption), AESDEC (AES round decryption), and AESDECLAST (AES last round decryption). The specifications of these instructions are shown below.
Figure 2019109910

タグ検証プロセスがタグ生成と同じであることから、CMACモードを、AESラウンド命令を利用して実装するには、AESENC AESENCLASTのみの呼び出しで十分である。図21は、単一のAESブロックの暗号化と関連付けられたフローチャートである。図22は、CBCアルゴリズムを利用する多数のAESブロックの暗号化と関連付けられたフローチャートを示す。   Since the tag verification process is the same as tag generation, calling only AESENC AESENCLAST is sufficient to implement CMAC mode using AES round instructions. FIG. 21 is a flowchart associated with encryption of a single AES block. FIG. 22 shows a flow chart associated with the encryption of multiple AES blocks utilizing the CBC algorithm.

キースケジュール変換を実装するためには、逆混合列(inverse mix columns)用のAESIMC命令とAESKEYGENASSIST命令とを利用することができる。AESKEYGENASSISTは、暗号化に利用されるラウンドキーを生成するために利用される。AESIMCは、暗号ラウンドキーを、均等な逆暗号化モデルに従って復号に利用可能な形式に変換するために利用される。AESIMCおよびAESKEYGENASSIST命令は、http://softwarecommunity.intel.com/articles/eng/3788.htmに記載されている。   To implement key schedule conversion, AESIMC and AESKEYGENASSIST instructions for inverse mix columns can be used. AESKEYGENASSIST is used to generate a round key that is used for encryption. AESI MC is used to convert a cryptographic round key into a form that can be used for decryption according to the equivalent reverse encryption model. The AESI MC and AESKEYGENASSIST instructions are described at http://softwarecommunity.intel.com/articles/eng/3788.htm.

CMACは、128ビットの量のビッグエンディアン記述を利用して示される。CMACをリトルエンディアン・マシンを利用して正確に実装するには、16バイト幅の反映処理をソースコード実装のある時点で行う必要がある。この処理は、PSHUFB命令(1クロック・レイテンシー、スループット)の利用により迅速に行うことができる。以下に、バイトシャッフルが必要な時点を記述する。   CMAC is indicated using a big endian description of 128 bit quantities. In order to implement CMAC correctly using a little endian machine, it is necessary to perform reflection processing of 16-byte width at a certain point of source code implementation. This process can be performed quickly by using the PSHUFB instruction (1 clock latency, throughput). The following describes the point at which byte shuffle is required.

SUBKEYS()アルゴリズム実装バイト反映(byte reflection)は、AES暗号をゼロストリングに利用して導出された後であって、2つのサブキーが導出される前に、Lに対して行われる必要がある。バイト反映は、2つのサブキーに対して、Lから導出された後で必要である。SUBKEYS()実装は、以下のCで示される。

Figure 2019109910
Figure 2019109910
The SUBKEYS () algorithm implementation byte reflection needs to be done for L after being derived using the AES cipher for the zero string and before two subkeys are derived. Byte reflection is necessary for two subkeys after being derived from L. The SUBKEYS () implementation is denoted by C below.
Figure 2019109910
Figure 2019109910

次に、最終ブロックが完全ではない場合に限って、最終ブロックに対するバイト反映をパディングの前後に行う必要がある。これらのステップは以下のCの実装例に示されている。

Figure 2019109910
Next, it is necessary to perform byte reflection on the final block before and after padding only if the final block is not perfect. These steps are illustrated in the C implementation below.
Figure 2019109910

function_pshufb()が、128ビット幅のバイト反映を行う。   function_pshufb () performs byte reflection of 128 bit width.

<SMIのSE要件>
エンクレーブは、SMM空間内での実行を許可されていない。エンクレーブをSMMモードで実行しようとすると、命令のGP不良が生じる。SMIがエンクレーブ内で実行している間に生じると、プロセッサは、レジスタ状態を、遠隔のエンクレーブ内にセーブして、終了する。終了すると、TBD MSRビットを、エンクレーブの実行中にSMIが生じたことを示すように設定する。SMMコードは、エンクレームデータにアクセスできない。EPC領域に接触しようと試みると、実際のモードではジャンクデータを戻し、保護されたモードではEPCページ不良を戻すこととなる。
<SE Requirements for SMI>
Enclaves are not allowed to run in SMM space. Attempting to execute an enclave in SMM mode results in a GP fault of the instruction. If the SMI occurs while executing in the enclave, the processor saves the register state in the remote enclave and exits. When complete, the TBD MSR bit is set to indicate that an SMI has occurred during enclave execution. SMM code can not access enclaimed data. Attempts to contact the EPC area will return junk data in the actual mode and return EPC page faults in the protected mode.

一部の命令は実行が許可されない。どの命令が合法かを決定するためには幾つかの一般法則が利用される。
1.エンクレーブ内ではリングレベルの変更は許可されない。リングレベルの変更または変更の可能性の命令は禁止されている。
2.外部ソフトウェアは、エンクレーブ内のVMEXITSにサービス提供できない。エンクレーブ内でVMEXITを生成する、または生成する可能性のある全ての命令を禁ずる。
3.ソフトウェアは、エンクレーブ内で仮想マシンを生成することができない。全てのVMX命令を禁ずる。
4.エンクレーブの内部でI/O参照を実行する命令を禁ずる。
Some instructions are not allowed to execute. Several general rules are used to determine which order is legal.
1. Ring level changes are not allowed within the enclave. Ring level change or possible change orders are prohibited.
2. External software can not service VMEXITS in the enclave. Prohibit all instructions that generate or may generate VMEXIT within the enclave.
3. Software can not create virtual machines within an enclave. Prohibit all VMX instructions.
4. Prohibits instructions that perform I / O references inside the enclave.

エンクレーブの第一世代では、プロセッサは、エンクレーブに入るときに、IOPLセットを0として、リング3で実行されてよい。エンクレーブを仮想化または非仮想化環境で実行する際に、プログラミング環境を保存するためには、表18−1にリストされている命令が合法である。

Figure 2019109910
In the first generation of enclave, the processor may be executed on ring 3 with IOPL set equal to 0 when entering the enclave. When executing enclaves in a virtualized or non-virtualized environment, the instructions listed in Table 18-1 are legal to preserve the programming environment.
Figure 2019109910

エンクレーブ内の状態には制約が課されている。エンクレーブに入るとき、GDTR.limit、LDTR.limit, IA32_EFER.SCE、および、IA32_SYSENTER_CSをTCS領域にセーブする。ローカルの値がクリアされる。これらレジスタへアクセスする、またはアクセスを生じさせる命令は、エンクレーブ内で失敗する。GDTR.limit、LDTR.limit, IA32_EFER.SCE、および、IA32_SYSENTER_CSは、エンクレーブを抜けるときに復元される。

Figure 2019109910
Constraints are imposed on the state within the enclave. When entering an enclave, save GDTR.limit, LDTR.limit, IA32_EFER.SCE, and IA32_SYSENTER_CS in the TCS area. The local value is cleared. Instructions that access or cause access to these registers fail within the enclave. GDTR.limit, LDTR.limit, IA32_EFER.SCE, and IA32_SYSENTER_CS are restored when leaving the enclave.
Figure 2019109910

エンクレーブの寿命は、独立した(distinct phases)に分類できる。第1の段階は、エンクレーブ生成である。第2の段階は、エンクレーブ利用である。最終の段階は、エンクレーブ破壊である。   The lifetimes of enclaves can be classified into distinct phases. The first stage is enclave generation. The second step is enclave utilization. The final stage is enclave destruction.

エンクレーブの生成および利用には、OS/VMMのサポートが必要となる。エンクレーブはOS/VMMにセキュリティ面で依存しないが、一定のハードウェアデータ構造を適切に維持するためにはOS/VMMが必要となる。OS/VMMがこれら構造の維持に失敗すると、セキュリティは損なわれないが、エンクレーブ全体が不良となる場合がある。   The creation and use of enclaves requires OS / VMM support. Enclaves do not rely on OS / VMM for security, but OS / VMM is required to maintain certain hardware data structures properly. If OS / VMM fails to maintain these structures, security is not compromised, but the entire enclave may fail.

幾つかの命令は、エンクレーブの証明、秘密データのシールおよびシール解除、および、認証されたエンクレーブの許可をサポートする。   Some commands support enclave certification, sealing and unsealing of secret data, and authorization of certified enclaves.

第1の段階では、エンクレーブは、アプリケーションによる利用に備えて、セキュアに構築され、内部ソフトウェア環境が設定されていてよい。3つの命令を利用してエンクレーブを生成する。第1の命令ECREATEは、最初の状態環境を設定する。この命令は、エンクレーブキーを生成し、装填し、暗号化を行い、エンクレーブデータ構造の格納に利用される2ページの整合性チェックを行う。第2の命令EADDPREは、エンクレーブに1ページのデータを追加する。詳しくは、エンクレーブ内のコード、スタック、およびヒープに必要なページを追加する。第3の命令EINITは、公知の状態に内部ソフトウェア環境を設定する。この命令の完了時には、エンクレーブは第2の段階である「利用」に移動している。   In the first phase, the enclave may be securely built and have an internal software environment set up for use by the application. Generate enclaves using three instructions. The first instruction ECREATE sets the initial state environment. This instruction creates, loads, encrypts the enclave key, and performs a two page integrity check that is used to store the enclave data structure. The second instruction EADDPRE adds one page of data to the enclave. Specifically, add the necessary pages to the code, stack, and heap in the enclave. The third instruction EINIT sets the internal software environment to a known state. At the completion of this order, the enclave has moved to the second phase, "use."

EINITを実行する前に、構築ソフトウェアは許可証を、EMKPERMITを実行することにより、または、許可エンクレーブを利用することにより取得していてよい。   Prior to performing EINIT, the construction software may have obtained a permit by executing EMKPERMIT or by utilizing an permit enclave.

エンクレーブは、EENTER命令により入力される。この命令により、マシンがエンクレーブモードへと遷移する。そして、予め定義されたエントリポイントへ制御を渡す。EEXIT命令は、エンクレーブから外部アプリケーションに戻る。EIRRET命令は、割り込みの終了からエンクレーブに戻る。   Enclaves are input by the EENTER command. This instruction causes the machine to transition to enclave mode. Then, control is passed to a predefined entry point. The EEXIT instruction returns from the enclave to the external application. The EIRRET instruction returns to the enclave from the end of the interrupt.

EENTERまたはEIRETを介してエンクレーブに入る際には、以下の処理を命令により実行する。すなわち、処理は、GDTR.limitのセーブおよびクリア、LDTR.limit、IA32_EFER.SCE、IA32_SYSENTER_CSである。抜けるときに、GDTR、LDTR、IA32_EFER、および、IA32_SYSENTER_CSを復元する(On exit restore GDTR, LDTR, IA32_EFER, and IA32_SYSENTER_CS)。   When entering an enclave via EENTER or EIRET, the following processing is executed according to an instruction. That is, the processing is save and clear of GDTR.limit, LDTR.limit, IA32_EFER.SCE, IA32_SYSENTER_CS. Restore GDTR, LDTR, IA32_EFER, and IA32_SYSENTER_CS when exiting (On exit restore GDTR, LDTR, IA32_EFER, and IA32_SYSENTER_CS).

エンクレーブの破壊には命令は存在しない。   There is no order for the destruction of enclaves.

EDBG_READ命令は、デバッグエンクレーブ内のある位置の8バイトの読み取りを行う。非デバッグエンクレーブにはアクセスが許可されていない。EDBG_WRITE命令は、デバッグエンクレーブ内のある位置への8バイトの書き込みを行う。非デバッグエンクレーブにはアクセスが許可されていない。   The EDBG_READ instruction reads eight bytes of a location in the debug enclave. Non-debug enclaves are not allowed access. The EDBG_WRITE instruction writes eight bytes to a location within the debug enclave. Non-debug enclaves are not allowed access.

エンクレーブページキャッシュ(EPC)は、2つの命令を解して管理される。2つの命令は、EPCページ(ELPGおよびEWBINVPG)を装填/格納する。   The enclave page cache (EPC) is managed through two instructions. Two instructions load / store EPC pages (ELPG and EWBINVPG).

EREPORTは、エンクレーブ計測値を保持する暗号的に保護された構造を生成する。EGETKEYは、様々な種類のエンクレーブ固有キーを取得する手段を提供する。EMKPERMITは、認証されたエンクレーブに対する許可証を生成するために利用される。

Figure 2019109910
:「内部」には利用可能なモデルがないが、内部からEMKPERMITに実行を許可することにまつわる被害は知られていない。
:将来のバージョンでは、リング0からもエンクレーブへのエントリが可能となるかもしれない。 EREPORT produces a cryptographically protected structure that holds enclave measurements. EGETKEY provides a means to obtain various types of enclave unique keys. EMKPERMIT is used to generate a permit for the certified enclave.
Figure 2019109910
Note 2 : There is no model available "inside", but there is no known damage from allowing EMKPERMIT to execute from the inside.
Note 3 : Future versions may allow entry to the enclave from ring 0 as well.

割り込みが生じると、プロセッサ状態をエンクレーブ内にセーブして(隠して)、状態をクリアする。さらに、割り込みの戻りアドレスを隠してもよい。   When an interrupt occurs, save (hide) the processor state in the enclave and clear the state. In addition, the return address of the interrupt may be hidden.

エンクレーブの実行中に生じる割り込みは、オペレーティングシステムが予期するような形態の割り込みスタックに情報をプッシュして、OSコードを変更する必要がないようにする。これを遂行するために、トランポリンコードへのポインタを、割り込みスタックへとRIPとしてプッシュする。このトランポリンコードは、ゆくゆくは、特殊パラメータ(q.v.)を有するEENTER命令によりエンクレーブへ戻る。   The interrupts that occur during enclave execution push information onto the interrupt stack in the form that the operating system expects, so that it is not necessary to change the OS code. To accomplish this, we push a pointer to the trampoline code onto the interrupt stack as a RIP. This trampoline code is eventually returned to the enclave by the EENTER command with the special parameter (qv).

利用される割り込みスタックは、非SEモードで利用されたものと同じ規則により選択される。つまり規則とは、(1)特権付きレベル変更がある場合には、割り込みスタックは、新たなリングに関連付けられたものである、(2)特権付きレベル変更がない場合には、現在のアントラステッド・スタック(Untrusted Stack)を利用する、(3)IA−32e ISTメカニズムを利用する場合には、この方法を利用して割り込みスタックを選択する。   The interrupt stack utilized is selected according to the same rules as utilized in non-SE mode. That is, the rules are: (1) the interrupt stack is associated with the new ring if there is a privileged level change, and (2) the current untrusted if there is no privileged level change. (3) When using the IA-32e IST mechanism, use an untrusted stack, and use this method to select an interrupt stack.

図23は、スタックスイッチで割り込んだ後のアプリケーションおよび割り込みスタックの一実施形態を示す。現在のセーブ状態領域フレーム2300は、RSPレジスタ2305を含む。スレッド制御構造2310は、状態セーブ領域2312および割り込み戻りルーチン2314のカウントを含みうる。割り込みスタック2330は、SSレジスタ2332、RSPレジスタ2334、フラグレジスタ2336、CSレジスタ2338、命令レジスタ2340、およびエラーコード2342を含む。割り込みスタック2330は、RSPレジスタ2334内のデータを、アプリケーションスタック2320およびセーブ状態領域2300のカウントに送ってよい。エラーコード2342は、プッシュ2346後に、RSPから来てよい。割り込みルーティングルーチン2314および命令レジスタ2340は、uRTS2344のスレッドごとのトランポリンを送出する。   FIG. 23 illustrates one embodiment of the application and interrupt stack after interrupting at the stack switch. The current save state area frame 2300 includes an RSP register 2305. Thread control structure 2310 may include counts of state save area 2312 and interrupt return routine 2314. The interrupt stack 2330 includes an SS register 2332, an RSP register 2334, a flag register 2336, a CS register 2338, an instruction register 2340, and an error code 2342. The interrupt stack 2330 may send the data in the RSP register 2334 to the count of the application stack 2320 and the save state area 2300. Error code 2342 may come from RSP after push 2346. The interrupt routing routine 2314 and the instruction register 2340 deliver a per-thread trampoline for the uRTS 2344.

いずれの場合にも、割り込みスタックおよびそれにプッシュされた情報の選択は、非SE処理と矛盾しない。図23は、スタックスイッチで割り込んだ後の、アプリケーションおよび割り込みスタックを示す。スタックスイッチのない割り込みは、アプリケーションスタックを利用する。加えて、TCSポインタは、後ほどEENTER命令が、割り込み後にエンクレーブを再開するときに利用するので、RBXに配置される。   In either case, the choice of interrupt stack and the information pushed to it is consistent with non-SE processing. FIG. 23 shows the application and interrupt stack after interrupting with the stack switch. Stack switchless interrupts utilize the application stack. In addition, the TCS pointer is located at RBX as the EENTER instruction will be used later to resume enclave after an interrupt.

TCS::IRR(割り込み戻りルーチン)は、後に特別なスレッドに戻る、スレッドごとのコードシーケンスを指し示している。このポインタは、戻りRIPとして割り込みスタックにプッシュされる。これによりデータ構造のセットが、IRETを、割り込み戻りコード(特別なEENTER命令を含む)が実行されるアプリケーションに戻す。EENTERは、割り込み時に初期化されるRBXレジスタをとり、これをTCSとして利用して、エンクレーブに再度入る。   TCS :: IRR (Interrupt Return Routine) points to a per-thread code sequence which is later returned to a special thread. This pointer is pushed onto the interrupt stack as a return RIP. This causes the set of data structures to return IRET to the application where the interrupt return code (including the special EENTER instruction) is executed. EENTER takes the RBX register initialized at interrupt time and uses it as a TCS to re-enter the enclave.

CF(キャリー・フラグ)、SF(サイン・フラグ)、PF(パリティ・フラグ)、OF(オーバフロー・フラグ)、AS(調節フラグ)、DF(方向フラグ)、ZF(ゼロ・フラグ)というRFLAGSのビットは、レジスタを割り込みスタックにプッシュする前にクリアされる。   Bits of RFLAGS such as CF (carry flag), SF (sign flag), PF (parity flag), OF (overflow flag), AS (adjustment flag), DF (direction flag), ZF (zero flag) Is cleared before pushing the register onto the interrupt stack.

図24は、本発明の一実施形態の複数の状態セーブ領域スロットのスタックを実装することのできる方法を示す。スレッド制御構造2400は、次の状態セーブ領域スロット2402、現在の状態セーブ領域スロット2404、および、状態セーブ領域スロット2406を含んでよい。状態セーブ領域0 2410、状態セーブ領域12412、および状態セーブ領域N 2418は、状態セーブ領域内の3つの別個の選択位置である。次の状態セーブ領域スロット2402は、状態セーブ領域で利用される位置を特定する(状態セーブ領域0 2410)。現在の状態セーブ領域スロット2404は、状態セーブ領域で利用される位置を特定する(状態セーブ領域1 2412)。状態セーブ領域スロット2406は、状態セーブ領域で利用される位置を特定する(状態セーブ領域N 2418)。   FIG. 24 illustrates how a stack of state save area slots of one embodiment of the invention can be implemented. The thread control structure 2400 may include a next state save area slot 2402, a current state save area slot 2404, and a state save area slot 2406. State save area 0 2410, state save area 12412, and state save area N 2418 are three separate selected locations within the state save area. The next state save area slot 2402 specifies the position to be used in the state save area (state save area 0 2410). The current state save area slot 2404 identifies the location used in the state save area (state save area 12412). The state save area slot 2406 identifies the position to be used in the state save area (state save area N 2418).

状態セーブ領域は、割り込み時点のエンクレーブ状態を保持する。割り込みは、次のエンクレーブに再度入る可能性のあるユーザモードに送られうるので、SSAは、図19−3に示すような複数のSSAスロットからなるスタックである。利用される状態セーブ領域の位置は、TCSの3つの変数により制御されるが、3つの変数とは、状態セーブ領域スロット(NSSA)の数(状態セーブ領域スタックの全スロット数を定義する)、現在の状態のセーブ領域スロット(CSSA)(次の割り込み上で利用される現在のスロットを定義する)、状態セーブ領域(SSA)(割り込み上にプロセッサ状態をセーブするのに利用されるセーブ領域スロットのセット)である。   The state save area holds the enclave state at the point of interruption. Because interrupts can be sent to user modes that may re-enter the next enclave, the SSA is a stack of multiple SSA slots as shown in Figure 19-3. The position of the state save area to be used is controlled by three variables of TCS, where three variables are the number of state save area slots (NSSA) (which defines the total number of slots in the state save area stack), Save area slot in current state (CSSA) (defines the current slot to be used on the next interrupt), state save area (SSA) (save area slot used to save processor state on interrupts) A set of

エンクレーブ内のスレッド上で実行中に割り込みが生じたときには、マイクロコードが、TCS::SSAおよびTCS::CSSAを調べて、利用されるセーブ領域を決定する。プロセッサ状態がセーブされクリアされ(秘密のリークを防止するために)、TCS::CSSAを増分する。後述するように、最終スロットで例外が生じた場合には、例外をエンクレーブに送ることができない。   When an interrupt occurs while executing on a thread in the enclave, the microcode examines TCS :: SSA and TCS :: CSSA to determine the save area to be used. The processor state is saved and cleared (to prevent secret leaks) and increment TCS :: CSSA. As described below, if an exception occurs in the last slot, the exception can not be sent to the enclave.

注:EENTERでは、CCSAをNSSA未満としてよく、割り込みについて少なくとも1つのセーブ領域が存在するよう保証される(割り込みから戻るためにEENTERを利用中ではない限り)。   Note: In EENTER, CCSA may be less than NSSA, and it is ensured that there is at least one save area for interrupts (unless EENTER is being used to return from interrupts).

図25は、割り込み、不良、およびトラップの状態遷移を有する状態マシンの一部を示す。可能性のある状態は、非アクティブ2500、アクティブ2510、予期2520、処理済み(EENTER不法)2530、および処理中2540である。EENTERがTCS:ENTRY2502に配置されると、非アクティブ2500は、アクティブ2510に遷移する。EEXIT2504が生じると、アクティブ2510は非アクティブ2500に遷移する。割り込み、不良、またはトラップ2512が生じると、アクティブ2510は予期2520に遷移する。EIRET2514が生じると、予期2520はアクティブ2510に遷移する。EENTERがTCS:HANDLER2524に配置されると、予期2520が処理中2540に遷移する。EIRET2522が生じると、予期2520が処理中2540に遷移する。割り込み、不良、またはトラップ2526が生じると、処理中2540は予期2520に遷移する。EEXIT2532が生じると、処理中2540が処理済み2530に遷移する。エンクレーブ例外ハンドラで処理割り込みが生じ、EIRET2534が生じると、処理済2530が処理中2540に遷移する。エンクレーブ例外ハンドラからではない処理割り込みが生じ、EIRET2534が生じると、処理済み2530がアクティブ2510に遷移する。点線の遷移2522、2526、2534は、エンクレーブ例外ハンドラ内の割り込みの処理中のみに生じる。   FIG. 25 shows a portion of a state machine with interrupt, fault, and trap state transitions. Possible states are inactive 2500, active 2510, expected 2520, processed (EENTER illegal) 2530, and in progress 2540. When EENTER is placed in TCS: ENTRY 2502, inactive 2500 transitions to active 2510. When EEXIT 2504 occurs, active 2510 transitions to inactive 2500. When an interrupt, fault, or trap 2512 occurs, active 2510 transitions to anticipation 2520. When EIRET 2514 occurs, anticipation 2520 transitions to active 2510. When EENTER is placed in TCS: HANDLER 2524, anticipation 2520 transitions to 2540 during processing. When EIRET 2522 occurs, anticipation 2520 transitions to 2540 during processing. If an interrupt, fault, or trap 2526 occurs, processing 2540 transitions to anticipation 2520. When EEXIT 2532 occurs, processing 2540 transitions to processed 2530. When a processing interrupt occurs in the enclave exception handler and EIRET 2534 occurs, processed 2530 transitions to 2540 during processing. When a processing interrupt that is not from the enclave exception handler occurs and EIRET 2534 occurs, processed 2530 transitions to active 2510. Dotted transitions 2522, 2526, 2534 occur only during the processing of the interrupt in the enclave exception handler.

図25は、エンクレーブ状態マシンの、割り込みに対処する部分を示す。割り込みは、オプションのスタックスイッチおよび割り込みスタックに合成割り込みフレームをプッシュすることから始まる。イベントが割り込みであった場合には、エンクレーブは割り込み状態に入る。イベントが例外であった場合には、エンクレーブは例外状態に入る。これら2つの状態は、エンクレーブへのエンクレーブ例外を確実に配信するために、さらには、攻撃アプリケーションコードによるスプリアス例外の配信を妨げるために、区別される。   FIG. 25 shows the part of the enclave state machine that deals with interrupts. The interrupt begins with pushing the synthetic interrupt frame onto the optional stack switch and interrupt stack. If the event is an interrupt, the enclave enters an interrupt state. If the event is an exception, the enclave enters an exception state. These two states are distinguished to ensure delivery of the enclave exception to the enclave and also to prevent the delivery of spurious exceptions by the attack application code.

割り込み状態に遷移すると、アントラステッド・コード(アプリケーション、OSまたはこれらの両方)は、EENTER/RETURN_FROM_INTERRUPTを利用したエンクレーブの再開を行うだけでよい。   Upon transitioning to the interrupt state, the untrusted code (application, OS or both) need only resume enclaves using EENTER / RETURN_FROM_INTERRUPT.

例外状態に遷移すると、アントラステッド・コード(アプリケーション、OSまたはこれらの両方)は、(1)EIRETを利用してエンクレーブを再開して割り込まれたIPに戻る。これは、例えばページ不良を処理する方法である。割り込みが不良により生じ、不良条件を修正するために何も行われていない場合には、不良命令を再度実行して、不良を再度起こす(and will fault again)。しかしトラップの後のEIRETは、トラップ命令の後に命令に戻る、(2)エンクレーブ例外ハンドラを呼び出す、(3)スレッドまたはエンクレーブを破棄する、と決定してよい。   Upon transitioning to the exception state, the untrusted code (application, OS or both) resumes the enclave using (1) EIRET to return to the interrupted IP. This is, for example, a method for processing page faults. If an interrupt is caused by a fault and nothing is done to correct the fault condition, then the fault instruction will be re-executed to cause the fault again. However, EIRET after the trap may decide to return to the instruction after the trap instruction, (2) call the enclave exception handler, (3) destroy the thread or enclave.

予期状態のEENTERは、処理中状態に進む。トラップハンドラからのEEXIT(処理中状態)は、処理済状態に進む。ENTER/NORMALは、この状態において不法である。トランポリンからのEIRETは、最後の割り込みからSSAにプッシュされた状態(アクティブまたは処理中状態)を再開する。   The expected state EENTER goes to the processing state. EEXIT (processing in progress) from the trap handler proceeds to the processed state. ENTER / NORMAL is illegal in this state. EIRET from the trampoline resumes the state (active or in-progress state) pushed to the SSA since the last interrupt.

セキュアなエンクレーブ命令を2つのオペコード(つまり、特権付きオペコードと特権なしオペコード)に分割する。命令処理は、命令の呼び出し時にRAXの値により決定される。

Figure 2019109910
Figure 2019109910
Split the secure enclave instruction into two opcodes (ie, privileged opcodes and nonprivileged opcodes). Instruction processing is determined by the value of RAX at the time of instruction invocation.
Figure 2019109910
Figure 2019109910

ECREATE命令は、保護されているSECSを初期化する。ソースオペランドは、page_info構造を指し示している。コンテンツページフィールドは、保護されていないSECS構造を指し示している。SECS構造は、ページが整列されていてもよい。SECSベースの下位の12ビットおよび境界値は0であってよい。SECSは、EPC内の空のスロットのアドレスである。sec_infoは、保護されていないsec_info構造のアドレスである。対応するsec_infoフラグフィールドは、適切に初期化されてよい。

Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
The ECREATE instruction initializes a protected SECS. The source operand points to the page_info structure. The content page field points to an unprotected SECS structure. The SECS structure may be page aligned. The lower 12 bits and boundary value of the SECS base may be zero. SECS is the address of an empty slot in the EPC. sec_info is an address of an unprotected sec_info structure. The corresponding sec_info flag field may be properly initialized.
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910

<EADDPRE>
<命令の説明>
EADDPREは、特権のあるソフトウェアに、lin_addrが指定するエンクレーブ内のページに、エンクレーブの外部のページをコピーさせ、エンクレーブページの属性は、sec_infoフラグフィールドを利用して設定される。命令の一部として、ページをハッシュして、結果生じるハッシュ値を、エンクレーブの計測値レジスタに拡張する。EADDPREは、EINIT命令がまだ初期化していないエンクレーブに対してのみ実行することができる。

Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
<EADDPRE>
<Description of instruction>
EADDPRE allows privileged software to copy pages outside the enclave to the page in the enclave specified by lin_addr, and the attributes of the enclave page are set using the sec_info flag field. As part of the instruction, the page is hashed and the resulting hash value is expanded into the enclave's metric register. EADDPRE can only be executed for enclaves that have not yet initialized the EINIT instruction.
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910

<EADDPOST>
<命令の説明>
EALLOCATEは、特権のあるソフトウェアに、lin_addrが指定するエンクレーブのSMAPエントリを初期化させ、エンクレーブページの属性は、sec_infoフラグフィールドを利用して設定される。エンクレーブがページにアクセスできるようになる前に、EACCEPT命令を用いてエンクレーブのページにアクセスしてよい。EALLOCATEは、EINIT命令が初期化したエンクレーブにのみ実行される。

Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
<EADDPOST>
<Description of instruction>
EALLOCATE causes privileged software to initialize the enclave SMAP entry specified by lin_addr, and the attributes of the enclave page are set using the sec_info flag field. Before the enclave can access the page, the EACC EPT instruction may be used to access the enclave page. EALLOCATE is only performed on enclaves that have been initialized by the EINIT instruction.
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910

<EMKPERMIT>
<命令の説明>
エンクレーブまたはライセンスを認証して、これを用いて許可証を生成する。rbx==NULLである場合には、証明書はIntelにより署名されてよい。他の場合には、ライセンスは、rbx許可証に示されるキーにより署名されてよい。

Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
<EMKPERMIT>
<Description of instruction>
Authorize the enclave or license and use it to generate a permit. If rbx == NULL, then the certificate may be signed by Intel. In other cases, the license may be signed by the key indicated on the rbx permit.
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910

<EINIT>
<命令の説明>
EINITは、エンクレーブを、ソフトウェア環境で実行準備できた状態として表示する。ついに初期化に成功すると(At the end successful initialization)、EENTERをエンクレーブに対して許可する。

Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
<EINIT>
<Description of instruction>
EINIT displays the enclave as ready to run in the software environment. At the end successful initialization, allow EENTER to the enclave.
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910

<ELPG>
<命令の説明>
この命令は、ページをエンクレーブページキャッシュ(EPC)に装填するのに利用される。

Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
<ELPG>
<Description of instruction>
This instruction is used to load the page into the enclave page cache (EPC).
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910

<EWBINVPG>
<命令の説明>
この命令は、EPCからメインメモリにダーティページを書き戻すために利用される。

Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
<EWBINVPG>
<Description of instruction>
This instruction is used to write back a dirty page from the EPC to the main memory.
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910

<EUPSMAP>
<命令の説明>
この命令は、EPCに常駐しているエンクレーブページのバージョンをチェックおよび更新する。

Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
<EUPSMAP>
<Description of instruction>
This instruction checks and updates the version of the enclave page resident in the EPC.
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910

<EREMOVE>
<命令の説明>
この命令は、データがEPCに装填されたときにSMAPを更新する。

Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
<EREMOVE>
<Description of instruction>
This instruction updates the SMAP when data is loaded into the EPC.
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910

<EADDSMAP>
<命令の説明>
この命令は、エンクレーブを既に初期化したとき、SMAPに新たなページを追加するために利用される。

Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
<EADDSMAP>
<Description of instruction>
This instruction is used to add a new page to the SMAP when the enclave has already been initialized.
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910

<EMODIFY>
<命令の説明>
この命令は、SEC_INFOフィールドを修正して、エンクレーブが該エンクレーブ内のページを修正することを許可する。エンクレーブは、ページに対する変更を要求するが、プロセスを完了するために変更を受け付けてもよい。

Figure 2019109910
Figure 2019109910
Figure 2019109910
<EMODIFY>
<Description of instruction>
This instruction modifies the SEC_INFO field to allow the enclave to modify the pages in the enclave. The enclave requests changes to the page, but may accept changes to complete the process.
Figure 2019109910
Figure 2019109910
Figure 2019109910

<EACCEPT>
<命令の説明>
エンクレーブ内のソフトウェアは、この命令を利用して、SEC_INFOフィールドへの変更を受け付ける。これにより、SMAPを新たなページタイプに更新することができる。

Figure 2019109910
Figure 2019109910
Figure 2019109910
<EACCEPT>
<Description of instruction>
Software in the enclave uses this instruction to accept changes to the SEC_INFO field. This allows the SMAP to be updated to a new page type.
Figure 2019109910
Figure 2019109910
Figure 2019109910

<EENTER>
<命令の説明>
EENTER命令は、エンクレーブに実行を渡す。命令の最後に、CPUは、TCS oENTRYまたはoHANDLERで指定されるIPで、エンクレーブモードで実行されている。EENTERは、TCSが有効であり、エントリ可能であることを確かめる。TCSおよび対応するSSAは、命令を続けるためにメモリに常駐させてよい。EENTERはさらに、状態マシンをチェックして、エントリのタイプを判断し、TCS内で一度に1つの論理プロセッサのみがアクティブであることを確かめる。RFLAGS.TFは、EENTER上で、僅かに修正された振る舞いを有する。RFLAGS.TFがTCS.SAVE_TFに格納されて、その後、TCS.TFから装填される。次にデバッグ例外が、RFLAGS.TFの更新値に応じて条件付きで生成される。エンクレーブがデバッグモードにない場合には、デバッグレジスタDR7をTCS.DR7にセーブして、クリアする。IA32_DEBUGCTL MSRについても同様である。

Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
<EENTER>
<Description of instruction>
The EENTER instruction passes execution to the enclave. At the end of the instruction, the CPU is being executed in enclave mode with the IP specified by TCS oENTRY or oHANDLER. EENTER verifies that the TCS is valid and can be entered. The TCS and corresponding SSA may be resident in memory to continue the instruction. EENTER also checks the state machine to determine the type of entry, making sure that only one logical processor at a time is active in the TCS. RFLAGS. The TF has a slightly modified behavior on EENTER. RFLAGS. TF is TCS. Stored in SAVE_TF, and then TCS. Loaded from TF. Then the debug exception is RFLAGS. Conditionally generated according to the updated value of TF. When the enclave is not in the debug mode, the debug register DR7 is set to TCS. Save to DR7 and clear. The same applies to IA32_DEBUGCTL MSR.
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910

<RFLAGS.TFの振る舞い>
EENTERの実行開始時のRFLAGS.TFの値は、EENTER完了時のトラップに影響しない。TCSから装填されるRFLAGS.TFの値は、トラップがとられているかを決定する。
<DR7の振る舞い>
エンクレーブがデバッグモードにない場合には、デバッグレジスタDR7をTCS.DR7にセーブして、クリアする。
<IA32_DEBUG_CTLの振る舞い>
エンクレーブがデバッグモードにない場合には、IA32_DEBUG_CTL MSRをTCS.DEBUG_CTLにセーブして、クリアする。

Figure 2019109910
Figure 2019109910
<RFLAGS. TF behavior>
RFLAGS. At the start of EENTER execution. The value of TF does not affect the trap when EENTER completes. RFLAGS. Loaded from TCS. The value of TF determines if the trap is taken.
<DR7 behavior>
When the enclave is not in the debug mode, the debug register DR7 is set to TCS. Save to DR7 and clear.
<Behavior of IA32_DEBUG_CTL>
If the enclave is not in debug mode, TCS.IA32_DEBUG_CTL MSR. Save to DEBUG_CTL and clear.
Figure 2019109910
Figure 2019109910

<EEXIT>
EEXITは、エンクレーブの外部へと抜ける。
<命令の説明>
EEXITは、エンクレーブモードをディセーブルして、RBSが指定する位置に分岐する。この命令によりレジスタは影響を受けない。秘密がいずれかのレジスタに含まれる場合には、これらレジスタをクリアするのはエンクレーブソフトウェアの任務となる。RFLAGS.TFは、EEXIT上で、僅かに修正された振る舞いを有する。RFLAGS.TFがTCS.SAVE_TFから装填される。次に、デバッグ例外が、RFLAGS.TFの更新値に応じて条件CR-0021付きで生成される。エンクレーブがデバッグモードにない場合には、デバッグレジスタDR7をTCS.DR7に装填する。この振る舞い、および、RFLAGS.TFの振る舞いは、???に詳述されている。

Figure 2019109910
Figure 2019109910
Figure 2019109910
<EEXIT>
EEXIT exits the enclave.
<Description of instruction>
EEXIT disables enclave mode and branches to the location specified by RBS. This instruction does not affect the register. If the secret is contained in any of the registers, it is the task of the enclave software to clear those registers. RFLAGS. TF has a slightly modified behavior on EEXIT. RFLAGS. TF is TCS. Loaded from SAVE_TF. Next, the debug exception is RFLAGS. It is generated with the condition CR-0021 according to the updated value of TF. When the enclave is not in the debug mode, the debug register DR7 is set to TCS. Load into DR7. This behavior, and RFLAGS. What is the behavior of TF? ? ? Detailed in
Figure 2019109910
Figure 2019109910
Figure 2019109910

<RFLAGS.TFの振る舞い>
EEXITの実行開始時のRFLAGS.TFの値は、EEXITの完了時のトラップには影響しない。SSAから装填されるRFLAGS.TFの値は、トラップをとるかを決定する。
<DR7の振る舞い>
エンクレーブがデバッグモードにない場合には、デバッグレジスタDR7をTCS.DR7に装填する。
<IA32_DEBUG_CTLの振る舞い>
エンクレーブがデバッグモードにない場合には、IA32_DEBUG_CTL MSRをTCS.DEBUG_CTLから装填する。

Figure 2019109910
<RFLAGS. TF behavior>
RFLAGS. At the start of execution of EEXIT. The value of TF does not affect the trap on completion of EEXIT. RFLAGS. Loaded from SSA. The value of TF determines whether to take a trap.
<DR7 behavior>
When the enclave is not in the debug mode, the debug register DR7 is set to TCS. Load into DR7.
<Behavior of IA32_DEBUG_CTL>
If the enclave is not in debug mode, TCS.IA32_DEBUG_CTL MSR. Load from DEBUG_CTL.
Figure 2019109910

<EIRET>
<命令の説明>
EIRET命令は、SSAに前に格納していたマシン状態を利用して、例外または割り込みのために中断していたエンクレーブの実行を再開する。EIRETは、TCSが有効であり、再開可能であることを確かめる。TCSおよび対応するSSAが、処理を進めるために命令のためのメモリに常駐している場合がある。EIRETはさらに、状態マシンをチェックして、エントリの種類を判断し、TCS内で一度に1つの論理プロセッサのみがアクティブであることを確かめる。RFLAGS.TFがEIRET上に設定されている場合、命令の完了時にデバッグ例外が生じる(つまり、通常のTFの振る舞い)。この例外は、エンクレーブ内で生じたものとして報告され(通常のSEで定義されている方法により)、内部では命令は実行されない。EIRETはSSAからのRFLAGSを復元するので、TFは、EIRETの終了時に設定されてよい。この場合、TFは、以下の命令に影響する(これも通常のTFの振る舞いである)。

Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
<EIRET>
<Description of instruction>
The EIRET instruction uses the machine state previously stored in the SSA to resume execution of the enclave suspended for an exception or interrupt. EIRET verifies that the TCS is valid and can be resumed. The TCS and corresponding SSA may be resident in memory for instructions to proceed. EIRET also checks the state machine to determine the type of entry and to ensure that only one logical processor at a time is active in the TCS. RFLAGS. If TF is set on EIRET, a debug exception will occur at instruction completion (ie normal TF behavior). This exception is reported as occurring within the enclave (in the manner defined by the normal SE) and the instruction is not executed internally. TF may be set at the end of EIRET, since EIRET restores RFLAGS from SSA. In this case, the TF influences the following instructions (also the normal TF behavior):
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910

<RFLAGS.TFの振る舞い>
RFLAG.TFがEIRET命令の始めに設定されている場合、#DBが完了後に生じる。例外は、TFが設定されていなければ制御が転送されたRIPで報告される。実際、エンクレーブにおいて転送処理は行われない。EIRETの通常処理の一環として、RFLAGSをSSAコピーから復元する。結果生じるTFが設定されている場合には、エンクレーブ内の対象命令の実行後に#DBが生じる。これらの振る舞いは、通常のIA IRET命令の振る舞いと矛盾しない。
<DR7の振る舞い>
DR7は、最後の割り込みまたは例外で前にセーブされたSSAコピーからを復元される。
<IA32_DEBUG_CTLの振る舞い>
IA32_DEBUG_CTL MSRは、最後の割り込みまたは例外で前にセーブされたSSAコピーから復元される。

Figure 2019109910
<RFLAGS. TF behavior>
RFLAG. If TF is set to the beginning of the EIRET instruction, #DB will occur after completion. Exceptions are reported in the RIP to which control is transferred if TF is not set. In fact, no forwarding is done in the enclave. RFLAGS is restored from the SSA copy as part of the normal processing of EIRET. If the resulting TF is set, #DB will occur after execution of the subject instruction in the enclave. These behaviors are consistent with the behavior of the normal IA IRET instruction.
<DR7 behavior>
DR7 is restored from the SSA copy previously saved at the last interrupt or exception.
<Behavior of IA32_DEBUG_CTL>
The IA32_DEBUG_CTL MSR is restored from the SSA copy previously saved on the last interrupt or exception.
Figure 2019109910

<EREPORT>
EREPORT命令は、エンクレーブの内容に関する計測値を報告する。
<命令の説明>
EREPORTは、エンクレーブ計測値レジスタ、その機能およびデバッグステータス(フラグ)を取得する。これらの値全ては、対称メッセージ認証コードを利用して保護され、REPORTキーを利用して検証することができる。REPORTキーを要求するエンクレーブでは、適切な機能がSECSに設定されて、EGETKEY命令によりこれを取得することができる。この命令の結果は、宛先位置output_buffer_laに配置される。

Figure 2019109910
Figure 2019109910
Figure 2019109910
<EREPORT>
The EREPORT command reports measurements on the contents of the enclave.
<Description of instruction>
EREPORT gets the enclave measurement value register, its function and debug status (flag). All these values are protected using symmetric message authentication codes and can be verified using the REPORT key. For an enclave that requires a REPORT key, the appropriate function can be set in the SECS to obtain it with the EGETKEY command. The result of this instruction is placed in the destination location output_buffer_la.
Figure 2019109910
Figure 2019109910
Figure 2019109910

<ERDMR>
ERDMR命令は、エンクレーブSECSから計測値レジスタの値を読み取る。
<命令の説明>
この命令は、エンクレーブ外からのみ実行可能である。SECSが有効なSECページを指し示している場合には、命令は、output_buffer_laにより特定されるアドレスに、エンクレーブ計測値レジスタの内容を出力する。

Figure 2019109910
Figure 2019109910
Figure 2019109910
<ERDMR>
The ERDMR instruction reads the value of the measurement value register from the enclave SECS.
<Description of instruction>
This instruction can only be executed from outside the enclave. If the SECS points to a valid SEC page, the instruction outputs the contents of the enclave measurement value register at the address specified by output_buffer_la.
Figure 2019109910
Figure 2019109910
Figure 2019109910

<EGETKEY>
エンクレーブコードにより利用されて、プロセッサキー階層から特定のキーを戻す。
<命令の説明>
要求されるキーは、KeyRequest構造を利用して特定され、そのアドレスは入力として提供される。このアドレスは自然整列される。出力は常に256ビットのデータ値となる。この値とするためには、output_laは自然整列される必要がある。

Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
<EGETKEY>
Used by the enclave code to return a particular key from the processor key hierarchy.
<Description of instruction>
The required key is identified using the KeyRequest structure, and its address is provided as input. This address is naturally aligned. The output will always be a 256 bit data value. In order to obtain this value, output_la needs to be naturally aligned.
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910

<ERDTCSPTR>
<命令の説明>
ERDTCSPTR命令は、現在のTCSリニアアドレスをRBXに読み込むために利用される。

Figure 2019109910
Figure 2019109910
<ERDTCSPTR>
<Description of instruction>
The ERDTCSPTR instruction is used to read the current TCS linear address into RBX.
Figure 2019109910
Figure 2019109910

<EDBGRD>
<命令の説明>
EDBGRD命令は、デバッグエンクレーブから8バイトを読み取るのに利用される。

Figure 2019109910
Figure 2019109910
Figure 2019109910
<EDBGRD>
<Description of instruction>
The EDBGRD instruction is used to read eight bytes from the debug enclave.
Figure 2019109910
Figure 2019109910
Figure 2019109910

<EDBGWR>
<命令の説明>
EDBGWR命令は、8バイトをデバッグ・エンクレーブページに書き込むために利用される。

Figure 2019109910
Figure 2019109910
Figure 2019109910
<EDBGWR>
<Description of instruction>
The EDBGWR instruction is used to write eight bytes to the debug enclave page.
Figure 2019109910
Figure 2019109910
Figure 2019109910

<ERDINFO>
ERDINFO命令は、エンクレーブページキャッシュの内容に関する情報を戻す。
<命令の説明>
エンクレーブ外で実行されると、EREPORTは、自身の機能およびデバッグステータス(フラグ)を、エンクレーブ計測値レジスタに報告する。これらの値全ては、対称メッセージ認証コードを利用して保護され、EVERIFYREPORT命令を利用して検証することができる。この命令の結果は、宛先位置output_buffer_laに配置される。

Figure 2019109910
Figure 2019109910
Figure 2019109910
<ERDINFO>
The ERDINFO instruction returns information about the contents of the enclave page cache.
<Description of instruction>
When executed out of the enclave, the EREPORT reports its function and debug status (flags) to the enclave metrics register. All these values are protected using the symmetric message authentication code and can be verified using the EVERIFYREPORT instruction. The result of this instruction is placed in the destination location output_buffer_la.
Figure 2019109910
Figure 2019109910
Figure 2019109910

<ルーチン参照>
<退出(Exit)>
このセクションでは、退出処理についての擬似コードを提供する。このコードは、エンクレーブコードが計画していないエンクレーブからの退出があるときに呼び出される。エンクレーブの実行は、停止した場所から再開される。再開に必要な情報は、外部スタック上にセーブされる。プロセッサのアーキテクチャ状態は、適切なセーブ領域にセーブされる。

Figure 2019109910
Figure 2019109910
<See routine>
<Exit (Exit)>
This section provides pseudo code for the exit process. This code is called when there is an exit from the enclave that the enclave code has not planned. Enclave execution resumes from where it left off. The information needed to resume is saved on the external stack. The processor's architectural state is saved in the appropriate save area.
Figure 2019109910
Figure 2019109910

<リーダ・ロックの取得>
RWロックにより、論理プロセッサは、共有リソースにアクセスして、スレッドが共有リソースにアクセスすることのできる2つのモードを提供する。この2つのモードとは、(1)共有モード:複数のリーダ論理プロセッサに対する共有の読み取り専用アクセスを許可し、これにより、これら複数のプロセッサが、共有リソースからコンカレントにデータを読み出すことができるようになるモード、(2)排他的モード:一度の1つの書き込み論理プロセッサへの読み書きアクセスを許可するモードであり、排他的モードでロックが取得されると、他のスレッドは、書き込みを行っている実体がロックを解除するまでは共有リソースにアクセスできなくなる、である。

Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Acquisition of reader lock
The RW lock allows the logical processor to access shared resources to provide two modes in which threads can access shared resources. These two modes are: (1) Shared mode: allow shared read-only access to multiple reader logical processors, so that these multiple processors can read data concurrently from shared resources Mode, (2) exclusive mode: a mode that permits read / write access to one write logical processor at a time, and when a lock is acquired in exclusive mode, an entity to which another thread is writing You will not be able to access shared resources until you unlock it.
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910
Figure 2019109910

<サブルーチンの説明>
このサブルーチンは、実際のところ、uCodeがPMHアドレス−変換機能をuCodeに曝すとき利用されるハードウェアの追加である。XUTRANSLATEは、主に、PMHコンテキストおよびリニアアドレスを入力として、出力として最終物理アドレスを生成するuOpである。PMHがページテーブル・ウォークの間に不良条件に遭遇すると、これらがuCodeに報告される。uOpの詳細は、本書類の範囲外である。
<Description of subroutine>
This subroutine is actually the addition of hardware that is utilized when uCode exposes the PMH address-to-conversion function to uCode. XUTRANSLATE is a uOp that mainly takes a PMH context and a linear address as input and generates a final physical address as output. When the PMH encounters bad conditions during the page table walk, these are reported to uCode. The details of uOp are beyond the scope of this document.

<サブルーチンの説明>
このサブルーチンは、識別されたキーを有する導出バッファ(DerivationBuffer)にCMAC処理を行うことでキーを生成する際に利用される。導出バッファは、128ビットの倍数でなくてはならない。

Figure 2019109910
Figure 2019109910
<Description of subroutine>
This subroutine is used when generating a key by performing CMAC processing on a derivation buffer (DerivationBuffer) having the identified key. The derived buffer must be a multiple of 128 bits.
Figure 2019109910
Figure 2019109910

Claims (6)

セキュアなエンクレーブで実行されているソフトウェアスレッドのスレッド制御構造にアクセスする第1の命令を実行する実行論理を備え、
前記スレッド制御構造は、前記セキュアなエンクレーブを退出するときに、スレッドに特有の情報をセーブして復帰するための前記ソフトウェアスレッドに関する情報を記憶し、
前記セキュアなエンクレーブは保護されたコンテナである、
プロセッサ。
Providing execution logic to execute a first instruction to access a thread control structure of a software thread being executed in a secure enclave,
The thread control structure stores information about the software thread for saving and returning thread specific information when exiting the secure enclave;
The secure enclave is a protected container,
Processor.
前記実行論理は、エンクレーブページがハードディスクドライブまたは保護メモリに格納される場合に、前記セキュアなエンクレーブのセキュリティマップ(SMAP)を用いて前記エンクレーブページの整合性の確保を助ける、
請求項1に記載のプロセッサ。
The execution logic helps ensure integrity of the enclave page using the secure enclave security map (SMAP) when the enclave page is stored on a hard disk drive or protected memory.
The processor of claim 1.
前記SMAPは、エンクレーブページのフレッシュネスを検証するための暗号メタデータを記憶する、
請求項2に記載のプロセッサ。
The SMAP stores cryptographic metadata for verifying the freshness of the enclave page.
The processor according to claim 2.
前記SMAPは、エンクレーブの特定のスナップショットのための完全バージョンのツリーを表す、
請求項2に記載のプロセッサ。
The SMAP represents a full version tree for a specific snapshot of an enclave,
The processor according to claim 2.
前記SMAPの各ノードは、少なくとも256の子ノードのためのバージョンを保持する、
請求項4に記載のプロセッサ。
Each node of said SMAP holds a version for at least 256 child nodes,
The processor according to claim 4.
セキュリティノードに関するメタデータを記憶するデータ構造をさらに備える、
請求項2に記載のプロセッサ。
Further comprising a data structure storing metadata about the security node;
The processor according to claim 2.
JP2019020537A 2019-02-07 2019-02-07 Processor Active JP6777288B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2019020537A JP6777288B2 (en) 2019-02-07 2019-02-07 Processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019020537A JP6777288B2 (en) 2019-02-07 2019-02-07 Processor

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2016250111A Division JP6480403B2 (en) 2016-12-22 2016-12-22 apparatus

Publications (2)

Publication Number Publication Date
JP2019109910A true JP2019109910A (en) 2019-07-04
JP6777288B2 JP6777288B2 (en) 2020-10-28

Family

ID=67179968

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019020537A Active JP6777288B2 (en) 2019-02-07 2019-02-07 Processor

Country Status (1)

Country Link
JP (1) JP6777288B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220012355A1 (en) * 2021-09-23 2022-01-13 Intel Corporation Provisioning federated computation on distributed private data

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001318787A (en) * 2000-05-08 2001-11-16 Toshiba Corp Microprocessor and multi-task execution method and multi-thread execution method using the same
JP2002232417A (en) * 2001-01-31 2002-08-16 Toshiba Corp Microprocessor
JP2005099984A (en) * 2003-09-24 2005-04-14 Toshiba Corp On-chip multicore type tamper resistant processor

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001318787A (en) * 2000-05-08 2001-11-16 Toshiba Corp Microprocessor and multi-task execution method and multi-thread execution method using the same
JP2002232417A (en) * 2001-01-31 2002-08-16 Toshiba Corp Microprocessor
JP2005099984A (en) * 2003-09-24 2005-04-14 Toshiba Corp On-chip multicore type tamper resistant processor

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220012355A1 (en) * 2021-09-23 2022-01-13 Intel Corporation Provisioning federated computation on distributed private data

Also Published As

Publication number Publication date
JP6777288B2 (en) 2020-10-28

Similar Documents

Publication Publication Date Title
US10885202B2 (en) Method and apparatus to provide secure application execution
JP5443599B2 (en) Method and apparatus for providing secure application execution
US8972746B2 (en) Technique for supporting multiple secure enclaves
US11550962B2 (en) Secure processor and a program for a secure processor
US20240176749A1 (en) System, Apparatus And Method For Integrity Protecting Tenant Workloads In A Multi-Tenant Computing Environment
JP2005527019A (en) Multi-token seal and seal release
JP6068325B2 (en) Processor that provides secure application execution
JP6777288B2 (en) Processor
JP6480403B2 (en) apparatus
JP6085320B2 (en) Processor, program, system and method

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20190306

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20190306

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20200526

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20200825

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20200908

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20200928

R150 Certificate of patent or registration of utility model

Ref document number: 6777288

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250