JP4226760B2 - Microprocessor, multitask execution method using the same, and multired execution method - Google Patents

Microprocessor, multitask execution method using the same, and multired execution method Download PDF

Info

Publication number
JP4226760B2
JP4226760B2 JP2000135010A JP2000135010A JP4226760B2 JP 4226760 B2 JP4226760 B2 JP 4226760B2 JP 2000135010 A JP2000135010 A JP 2000135010A JP 2000135010 A JP2000135010 A JP 2000135010A JP 4226760 B2 JP4226760 B2 JP 4226760B2
Authority
JP
Japan
Prior art keywords
microprocessor
program
key
execution
encryption
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.)
Expired - Fee Related
Application number
JP2000135010A
Other languages
Japanese (ja)
Other versions
JP2001318787A (en
Inventor
幹生 橋本
謙作 藤本
健治 白川
圭一 寺本
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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP2000135010A priority Critical patent/JP4226760B2/en
Priority to US09/781,284 priority patent/US7270193B2/en
Priority to US09/781,158 priority patent/US6983374B2/en
Priority to DE60135695T priority patent/DE60135695D1/en
Priority to EP01301240A priority patent/EP1126355A1/en
Priority to CNB011045124A priority patent/CN1220121C/en
Priority to KR1020010007301A priority patent/KR100362219B1/en
Priority to CNB011030003A priority patent/CN1189819C/en
Priority to KR10-2001-0007300A priority patent/KR100375158B1/en
Priority to EP01301241A priority patent/EP1126356B1/en
Publication of JP2001318787A publication Critical patent/JP2001318787A/en
Priority to US11/071,327 priority patent/US7353404B2/en
Application granted granted Critical
Publication of JP4226760B2 publication Critical patent/JP4226760B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Storage Device Security (AREA)
  • Microcomputers (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、マルチタスクのプログラム実行環境下で、実行コードや処理対象であるデータの不正な改変を防止することのできるマイクロプロセッサ、これを用いたマルチタスク実行方法、およびマルチレッド実行方法に関する。
【0002】
【従来の技術】
近年マイクロプロセッサの性能向上は著しく、従来の用途である計算やグラフィックに留まらず動画像、音声の再生や編集加工が可能となっている。これによりマイクロプロセッサを応用したエンドユーザ向けシステム(以下PCと呼ぶ)でユーザはさまざまな動画像や音声を楽しめるようになった。PCを動画像、音声の再生装置として使うことは、PCが持っている計算能力と組み合わせてゲームなどの応用ができることは当然として、固定的なハードウェアを必要としないため、すでにPCを持っているユーザにとっては安価に動画像、音声の再生が楽しめるという利点もある。
【0003】
しかしながらPCで画像/音声を扱う場合に問題となるのがその画像/音声の著作権の保護である。MDやデジタルビデオデッキでは、不正なコピーを防ぐための機構がそれら装置に組み込まれることによって無制限なコピーが防止されていた。そこでは、装置を改造して不正コピーを行うことは極めて稀であり、また仮に改造された装置があったとしてもそれが広く流通することは充分防止できるという仮定がなされていた。実際、世界的に見て不正コピーを目的とする装置の製造、販売は法律によって禁止される方向にあり、不正コピーによる被害は著作権者の収益を大きく脅かすほどの問題とはなっていない。
【0004】
ところが、PC上で画像、音楽の再生を行うときにデータを扱うのではソフトウェアである。PCではエンドユーザがソフトウェアの改変を自由に行うことができてしまう。ソフトウェアの場合、ある程度の知識があればプログラムを解析することにより、それらソフトウェアを改造して不正コピーをすることが可能であることは充分想像できる。さらに問題なのはそうして作られて不正コピーのソフトウェアはハードウェアと比べて、ネットワークなどの媒体を通じて広まりやすいことがある。
【0005】
この問題を解決するために、著作権が問題となる商業映画や音楽の再生に使われるPCソフトウェアは、ソフトウェアを暗号化するなどの手法により、解読、改竄されることを防止する技術が使われている。この技術は耐タンパソフトウェア技術と呼ばれている(David Aucsmith et.al;“Tamper Resistant Software:An Implementation”,Proceeding of the 1996 Intel Software Developer's Conference)。
【0006】
また、動画像、音声に限らずPCを通じてユーザに提供される著作物あるいはノウハウとして価値のある情報を不正にコピーされたり、PCソフトウェア自体に含まれるノウハウなどを解析から守るのにも耐タンパソフトウェア技術は有効である。
【0007】
しかし、耐タンパソフトウェア技術は、プログラムのうち保護を要する部分を実行開始時には暗号化しておき、その部分を実行する前に復号化し、実行終了後に再び暗号化することにより、逆アセンブラ、デバッガなどの解析ツールによる解析を困難にするという技術である。したがって、プログラムがプロセッサによって実行可能である以上、プログラムの開始時から順を追って解析していけば必ず解析することが可能になる。
【0008】
これは、著作権者がPCを利用した動画像、音声を再生するシステムに著作物を提供する際の妨げとなっている。
【0009】
また、その他の耐タンパソフトの応用についても同様の弱点があり、PCを通じた高度な情報サービスや企業、個人のノウハウを含んだプログラムのPCへの適用の妨げにもなっている。
【0010】
上記のことはソフトウェアの保護一般にあてはまる問題であるが、これに加えて、オープンプラットフォームであるPCには、システムのソフトウェア的土台となるはずのオペレーションシステム(以下、適宜「OS」と略する)自体が改変されて攻撃の手段とされるという問題もある。技術を持ち、悪意のあるユーザは、自分が所有するPCのOSに改造を加え、OSの持つ特権を利用して、OSにアプリケーションプログラムに埋め込まれている著作権保護機構を無効化させたり、その機構を解析させたりできるからである。
【0011】
現代のOSは、CPUに備えられた実行制御機能やメモリへの特権操作機能を利用して、コンピュータの制御下にある資源の管理や利用の調停を行なっている。管理の対象として、従来からの対象であるデバイスや、CPU、メモリ資源に加え、ネットワークやアプリケーションレベルのQoS(Quality of Service)などが加わってきている。とはいえ、資源管理の基本はあくまでも、プログラムの実行に必要な資源の割り当てである。すなわち、そのプログラムの実行に対するCPU時間の割り当てと、実行に必要なメモリ空間の割り当てが、資源管理の基本となる。それ以外のデバイス、ネットワーク、アプリケーションQoSの制御は、これらの資源に対してアクセスするプログラムの実行を制御することによって(CPU時間とメモリを割り当てることによって)行われる。
【0012】
OSは、CPU時間の割り当てと、メモリの割り当てを行うための特権を有する。すなわち、CPU時間の割り当てをするために、アプリケーションプログラムを任意の時点で停止、再開する特権と、任意の時点でアプリケーションに割り当てたメモリ空間の内容を、異なる階層のメモリに移動する特権である。後者の特権は、異なるアクセス速度と容量を持つ(通常は)階層化されたメモリシステムをアプリケーションから隠ぺいして、フラットなメモリ空間をアプリケーションに提供するためにも使用される。
【0013】
この2つの特権を持つことにより、任意の時点でOSはアプリケーションの実行状態を停止してスナップショットをとり、それをコピーまたは書き換えて再開することが可能である。この機能はアプリケーションのもつ秘密を解析する道具にも使うことができる。
【0014】
コンピュータ上のアプリケーションに対する解析を防ぐために、プログラムやデータの暗号化を行う技術はすでにいくつか知られている(Hampsonによる米国特許第4,47,902号、Hartmanによる米国特許第5,224,166号、Davisによる米国特許第5,806,706号、Takahasiによる米国特許第5,825,878号、Leonard et.alによる米国特許第6,003,117号、特開平11−282756号公報等)。しかし、これらの技術では、上述したようなオペレーションシステムの特権動作からプログラムの動作とデータの秘密を守ることは考慮されていない。
【0015】
Intel社のx86アーキテクチャに基づく従来技術(Hartmanの米国特許第5,224,166号、“System for seamless processing of encrypted and non-encrypted data and instructions”、以下、「従来技術1」とする)は、実行コードとデータを、予め定められた暗号化鍵Kxで暗号化してメモリに格納する技術を開示している。Kxは、プロセッサに埋め込まれた秘密鍵Ksに対応する公開鍵Kpで暗号化されてEKr[Kx]の形で与えられる。したがって、Ksを知っているプロセッサのみがメモリ上の暗号化された実行コードを復号化できる。暗号化鍵Kxは、セグメントレジスタと呼ばれるプロセッサ内部のレジスタに格納される。
【0016】
この機構により、確かにプログラムコードを暗号化することでユーザからコードの秘密をある程度保護することは可能である。また、コードの暗号化鍵Kxを知らない者がコードを意図した通りに改変することや、暗号化鍵Kxで復号化されて実行可能なコードを新たに作成することは暗号学的に困難となる。
【0017】
【発明が解決しようとする課題】
しかし、この技術を適用したシステムでは、実行コードの暗号化を解かなくても、コンテキスト切替と呼ばれるOSが持つ特権を利用することで、プログラムの解析が可能になるという欠点がある。
【0018】
具体的には、割り込みによってプログラムの実行が中断された時や、プログラムがシステムコール呼び出しのために自発的にソフトウェア割り込み命令を呼び出した時、OSは他のプログラム実行のために、コンテキストの切替処理を行う。コンテキストの切替とは、その時点でのレジスタ値の集合からなるプログラムの実行状態(以下コンテキスト情報と呼ぶ)をメモリに保存し、あらかじめメモリに保存されていた別のプログラムのコンテキスト情報をレジスタに復帰させる操作である。x86プロセッサにおける従来のコンテキスト保存の形式を、図18に示す。ここにはアプリケーションが使うレジスタの内容が全て含まれている。中断されたプログラムのコンテキスト情報は、プログラムが再開される時に元のレジスタに復帰される。コンテキスト切替は複数のプログラムを並行動作させる上で不可欠の機能である。従来の技術では、OSはコンテキスト切替の時にレジスタ値を読むことができるので、そのプログラムの実行状態がどのように変化したかに基づいて、全てとは限らないが、プログラムの行なっている動作のほとんどの部分を推定することができる。
【0019】
さらにタイマなどの設定によって例外を発生させるタイミングを制御すれば、プログラムの任意の実行時点でこの処理を行うことができる。また、実行を中断、解析するばかりでなく、レジスタの情報を悪意で書き換えることも可能である。レジスタの書き換えは、プログラムの動作を変更できるばかりでなく、プログラムの解析も容易にする。OSはアプリケーションの任意の状態を保存することができるため、ある時点で保存した状態から、繰り返し何度もレジスタ値を書き換えてプログラムを動作させてプログラムの動作を解析することが可能なのである。上記の機能に加えてプロセッサにはステップ実行などのデバッグ支援機構があり、OSはこれらの機能を全て利用してアプリケーションの解析を行うことができてしまうという失点がある。
【0020】
また、前記従来技術1ではデータに関しては、暗号化されたコードセグメントを通じたプログラム実行によってのみ、プログラムは暗号化データにアクセスできるとされている。このとき、それぞれ異なる暗号化鍵で暗号化されたプログラムがあっても、暗号化されたデータは、プログラムがどのような暗号化鍵で暗号化されているかにかかわらず、任意の鍵を用いて、暗号化されたプログラムから自由に読むことができるという問題がある。ここに示した従来技術では、OSとアプリケーションが独立に秘密を持ち、アプリケーションの秘密をOSから守ることや、複数のプログラム供給者がそれぞれに秘密を持つことは考えられていないのである。
【0021】
もちろん、仮想記憶機構に設けられた保護機能によって、アプリケーションの間でメモリ空間を隔離したり、アプリケーションによるシステムメモリへのアクセスを禁止することは既存のプロセッサでも可能である。しかし、仮想記憶機構がOSの管理下にある以上、アプリケーションの秘密を守ることをOSの管理下ある機能に依存することはできない。OSは保護機構を無視してデータをアクセスすることができるからであり、前述のように仮想記憶機能の提供においてその特権は不可欠である。
【0022】
別の従来技術として、特開平11−282756(以下従来技術2と呼ぶ)では、アプリケーションの持つ秘密情報を保存するためにCPU内に設けられた秘密メモリの技術が開示されている。この例では秘密メモリの中のデータへアクセスするために予め定められた参照値を必要とするとしている。しかしながら、同一のCPUで動作する複数のプログラム、特にOSから、秘密データのアクセス権を得るための参照値をどのように保護するかはこの公知技術においては開示されていない。
【0023】
さらに、米国特許第5,123,045号(Ostorovsky et.al、以下従来技術3と呼ぶ)では、アプリケーション対応に固有の秘密鍵を持つサブプロセッサを前提とし、それらサブプロセッサがメインメモリ上に置かれたプログラムをアクセスする時にそのアクセスパターンからプログラムの動作を推定されることのないシステムが開示されている。メモリに対して操作を行う命令体系を、それとは異なる命令体系に変換し、ランダムなメモリアクセスが行われるのがその機構である。
【0024】
しかしながら、この技術はアプリケーション毎に異なるサブプロセッサが必要となり、コスト高になるばかりでなく、このような命令体系を処理するコンパイラやプロセッサハードウェアの実装、高速化技術は、現在のプロセッサのそれとはかなり異なり、非常に困難なものとなることが予想される。なによりも、このようなプロセッサでは、実際に動作するコードの動作やデータを観察、追跡してもデータの内容や動作の対応関係の把握が著しく困難となるため、プログラムコードやデータが単純に暗号化されている前の公知技術1,2と比較して、プログラムのデバッグが非常に困難となる点で、実用には多くの課題がある。
【0025】
そこで、これらの問題点を解決するために、本発明の第1の目的は、マルチタスク環境下において、割り込みにより実行が中断された場合でも、内部の実行アルゴリズムとメモリ領域内部のデータ状態の双方を、不正な解析から確実に保護することのできるマイクロプロセッサの提供にある。この目的は、従来技術ではプログラムコードの値を保護することはできたが、例外発生やデバッグ機能によるプログラム実行の中断を利用した解析を防ぐことはできなかったという問題に鑑みてている。そこで、プログラム実行中断時にも、確実にコードを保護することができ、かつ、その保護が、現代のOSが必要とする実行制御機能およびメモリ管理機能の双方と両立するマイクロプロセッサの提供を目的とする。
【0026】
本発明の第2の目的は、異なる暗号化鍵で暗号化された複数のプログラムが実行される場合にも、それぞれのプログラムが互いに独立して、正しく読み書きできるデータ領域を確保したマイクロプロセッサの提供にある。特に、Hartmanによる米国特許第5,224,166号(従来技術1)では、暗号化されていないコードによる暗号化されたデータ領域へのアクセスが禁止されるだけの単純な保護しか行なわれておらず、複数のプログラムがそれぞれ独立に秘密を保護することができなかった。この問題点に鑑みて、複数のアプリケーションがそれぞれ秘密を持つ(暗号化されている)場合、各々の秘密をOSから守るデータ領域を有するマイクロプロセッサの提供を第2の目的とする。
【0027】
本発明の第3の目的は、第2の目的で確保したデータ領域の保護属性(すなわち暗号化属性)を、OSによる不正な書き換えから保護することのできるマイクロプロセッサの提供にある。従来技術1では、プログラムがメモリ上にデータを書きだす直前に、OSがコンテキスト切替を利用してプログラムの実行を中断し、セグメントレジスタに設定された暗号化属性を書き換えることができるという欠点があった。暗号化属性を書き換えることによって平文でデータが書き込まれる状態になると、データは暗号化されずにメモリに書き込まれてしまう。アプリケーションがあるタイミングでセグメントレジスタ値をチェックしたとしても、その後にレジスタ値が書き換えられてしまえば同じことである。そこで、このような改変を禁止または検出して対抗措置をとることのできる機構を備えたマイクロプロセッサの提供を第3の目的とする。
【0028】
本発明の第4の目的は、プログラムがデータ暗号化鍵として任意の値を使用することができ、暗号解析理論上のいわゆる「選択平文攻撃」から暗号化属性を守ることのできるマイクロプロセッサの提供にある。
【0029】
本発明の第5の目的は、プログラムデバッグ、フィードバックのための機構を備えたマイクロプロセッサを提供することにある。すなわち、マイクロプロセッサ自体に平文でプログラムのデバッグを行わせ、また、実行に失敗した場合にプログラムコードの提供者(プログラムベンダ)に不具合情報をフィードバックさせることを意図する。
【0030】
本発明の第6の目的は、上記第1〜第5の目的を、安価かつ高性能に実現することのできるマイクロプロセッサの提供にある。
【0031】
【課題を解決するための手段】
本発明の第1の特徴として、上記第1の目的を達成するために、1チップまたは1パッケージとして構成されるマイクロプロセッサは、読み出し手段としてのバスインターフェイスユニットを介して、プログラムごとに異なるコード暗号化鍵で暗号化された複数のプログラムを、マイクロプロセッサ外部の記憶手段(たとえばメインメモリ)から読み出す。マイクロプロセッサの復号化手段は、読み出した複数のプログラムを、それぞれ対応する復号化鍵で復号化し、命令実行部が、復号化された複数のプログラムを実行する。複数のプログラムのうち、あるプログラムの実行を中断する場合に、実行状態書き込み手段としてのコンテキスト情報暗号化/複号化ユニットは、中断されるプログラムのそれまでの実行状態を示す情報と、このプログラムのコード暗号化鍵とを、マイクロプロセッサに固有の暗号化鍵で暗号化し、暗号化した情報をコンテキスト情報としてマイクロプロセッサ外部の記憶手段に書き込む。中断されたプログラムを再開する場合に、再開手段としての検証ユニットは、暗号化されたコンテキスト情報を、マイクロプロセッサに固有の暗号化鍵に対応する固有の復号化鍵で復号化し、復号化されたコンテキスト情報に含まれるコード暗号化鍵(すなわち再開予定のプログラムのコード暗号化鍵)が、中断されたプログラム本来のコード暗号化鍵と一致した場合にのみ、プログラムの実行を再開する。
【0032】
また、第2および第3の目的を達成するために、マイクロプロセッサは、外部へ読み出すことのできないプロセッサ内部の記憶領域(たとえばレジスタ)と、プログラムの処理対象であるデータのための暗号化属性を、内部の記憶手段に書き込む暗号化属性書き込み手段(たとえば命令TLB)とを、さらに有する。暗号化属性とは、たとえば、プログラムのコード暗号化鍵と、暗号化の対象となるアドレス範囲である。このような暗号化属性の少なくとも一部は、コンテキスト情報に含まれる。
【0033】
コンテキスト情報暗号/複号化ユニットはまた、マイクロプロセッサに固有の秘密情報に基づく署名をコンテキスト情報に付与する。この場合、検証ユニットは、復号化されたコンテキスト情報に含まれる署名が、マイクロプロセッサに固有の秘密情報に基づく本来の署名と一致するかどうか判断し、一致する場合にのみ中断されていたプログラムを再開する。
【0034】
このように、暗号化プログラムによるそれまでの実行状態は、コンテキスト情報として外部メモリに保存されるとともに、実行処理対象であるデータの保護属性は、プロセッサ内部のレジスタに格納されているので、データに対する不正な改変が防止される。
【0035】
本発明の第2の特徴として、上記第4の目的を達成するために、1チップまたは1パッケージとして構成されるマイクロプロセッサは、外部へ読み出すことのできない固有の秘密鍵を内部に保持する。読み出し手段としてのバスインターフェイスユニットは、あらかじめ秘密鍵に対応したマイクロプロセッサに固有の公開鍵によって暗号化されたコード暗号化鍵を、マイクロプロセッサ外部の記憶手段から読み出す。第1の復号化手段としての鍵復号化ユニットは、読み出したコード暗号化鍵を、マイクロプロセッサの秘密鍵を用いて復号化する。バスインターフェイスユニットはまた、それぞれが異なるコード暗号化鍵で暗号化された複数のプログラムを、外部の記憶手段から読み出す。第2の復号化手段としてのコード復号化ユニットは、読み出された複数のプログラムを復号化する。命令実行部は、復号化された複数のプログラムを実行する。複数のプログラムのうち、あるプログラムの実行が中断される場合に、乱数発生機構は、一時的な鍵として乱数を発生する。コンテキスト情報暗号/複号化ユニットは、中断されるプログラムの実行状態を示す情報を生成された乱数で暗号化した第1の値と、この乱数を中断するプログラムのコード暗号化鍵で暗号化した第2の値と、乱数をマイクロプロセッサの秘密鍵で暗号化した第3の値とを、コンテキスト情報として外部の記憶手段に書き込む。
【0036】
プログラムの実行を再開するときは、コンテキスト情報暗号/複号化ユニットは、外部の記憶手段から前記コンテキスト情報を読み出し、秘密鍵を用いて、コンテキスト情報に含まれる第3の値の乱数を復号化し、復号化された乱数を用いて、コンテキスト情報に含まれる実行状態情報を復号化する。同時に、再開される予定のプログラムのコード暗号化鍵を用いて、コンテキスト情報に含まれる第2の値の乱数を復号化する。第2の値をコード暗号化鍵で復号化した乱数と、第3の値を秘密鍵で復号化した一時鍵とを比較し、一致する場合にのみ、プログラムの実行を再開する。
【0037】
このように、それまで実行されていた状態を示すコンテキスト情報は、保存の都度生成される乱数で暗号化され、マイクロプロセッサに固有の秘密鍵による署名が添付されるので、安全なかたちで外部メモリに保存される。
【0038】
本発明の第3の特徴として、前記第1〜第3および第6の目的を達成するために、1チップまたは1パッケージとして構成されるマイクロプロセッサは、プログラムごとに異なる前記暗号化鍵によって暗号化された複数のプログラムを、マイクロプロセッサ外部の記憶手段から読み出して実行する。このマイクロプロセッサは、外部へ読み出すことのできない内部記憶手段(たとえばレジスタ)を有し、レジスタに、各プログラムから参照される(すなわち処理対象となる)データのための暗号化属性と暗号化属性特定情報とを格納する。コンテキスト情報暗号/複号化ユニットは、レジスタに格納された暗号化属性特定情報と関連し、マイクロプロセッサに固有の署名を含む関連情報を、外部の記憶手段に書き込む。保護テーブル管理部は、プログラムが参照するデータのアドレスに基づいて、外部の記憶手段から関連情報を読み込む。検証ユニットは、読み込まれた関連情報に含まれる署名を、秘密鍵によって検証し、それがマイクロプロセッサ固有の署名と一致した場合にのみ、暗号化属性特定情報と読み込まれた関連情報に基づいて、プログラムによるデータの参照を許可する。
【0039】
この構成では、内部レジスタに格納されるべき情報に署名をつけて、外部メモリに書き込んでおき、必要な部分だけをマイクロプロセッサに読み込む。読み込み時に、署名を検証するので、すり替えなどに対する安全性が確保される。扱うプログラムの数が増え、暗号化属性の種類が増大した場合にも、マイクロプロセッサ内部の記憶領域を拡張する必要がなく、コストを低減できる。
【0040】
本発明の、その他の特徴、効果は、図面を参照して以下で述べる詳細な説明により、明らかになるものである。
【0041】
【発明の実施の形態】
(第1実施形態)
図1〜14を参照して、本発明の第1実施形態にかかるマイクロプロセッサについて説明する。本実施形態では、広く普及しているIntel社のPentium Proマイクロプロセッサ(インテル・アーキテクチャ・ソフトウェア・ディベロッパーズ・マニュアル参照)に変更を加えたアーキテクチャを例にとって本発明の構成を説明するが、これは本発明の適用範囲を前記プロセッサに制限するものではない。なお、Intel Pentium Proプロセッサに特徴的な部分や、他のアーキテクチャへの適用については、可能な限り本文中で補足する。
【0042】
また、Pentium Proアーキテクチャではアドレス空間に物理アドレス、リニアアドレス、論理アドレスの3種類の区分があるが、本実施例ではPentiumの用語におけるリニアアドレスを、論理アドレスという呼び方で使用するものとする。
【0043】
以下の説明では、特に断らない限り、保護とはアプリケーションの秘密の保護(すなわち暗号化による保護)を意味する。したがって、通常使われる保護の概念、すなわちあるアプリケーションの動作によって他のアプリケーションの動作が妨害されないこととは区別される。ただし、本発明においては、アプリケーションの秘密の保護と並列して、通常の意味での動作保護機構がオペレーションシステム(OS)によって当然に提供されているものとする(ただし、後者に関しては本発明と直接の関係がないので、説明は省略する。)。
【0044】
また、以下の実施形態では、秘密保護をOSの管理下のアプリケーションの秘密を守るものとして説明しているが、この機構はOSそのものを改竄や解析から守る機構としても利用可能である。
【0045】
図1は本発明の第1実施形態にかかるマイクロプロセッサの基本構成図であり、図2は、図1に示したマイクロプロセッサの詳細構成図である。
【0046】
マイクロプロセッサ101は、プロセッサコア111、命令TLB(変換索引バッファ)121、例外処理部131、データTLB141、2次キャッシュ152を含む。プロセッサコア111は、バスインタフェースユニット112、コード・データ暗号化/復号化処理部113、1次キャッシュ114、および命令実行部115を有する。命令実行部115は、命令フェッチ/デコードユニット214と、命令プール215と、命令実行切替ユニット216と、命令実行完了ユニット217を有する。
【0047】
例外処理部131は、レジスタファイル253、コンテキスト情報暗号/福号化ユニット254、例外処理ユニット255、秘密保護違反検出ユニット256、コード暗号化鍵・署名検証ユニット257を含む。命令TLB121は、ページテーブルバッファ230と、コード復号化鍵バッファ231と、鍵復号化ユニット232を有する。データTLB141は、保護テーブル管理部233を有する。
【0048】
マイクロプロセッサ101は、このマイクロプロセッサに固有の公開鍵Kpと秘密鍵Ksを保存する鍵記憶領域241を有する。今、あるプログラムベンダから所望の実行プログラムAを購入し、実行する場合を考える。プログラムベンダは、実行プログラムAを供給する前に、コード暗号化の共通鍵KcodeでプログラムAを暗号化し(EKcode[A])、暗号化に用いた共通鍵Kcodeをマイクロプロセッサ101の公開鍵Kpで暗号化して(EKp[Kcode])マイクロプロセッサ101に送ってくる。マイクロプロセッサは、この実行プログラムAだけではなく、複数の異なる暗号化プログラムを擬似並列的に(すなわち割り込み中断可能に)処理するマルチタスクプロセッサである。また、暗号化プログラムだけではなく、平文プログラムの実行も当然行う。
【0049】
マイクロプロセッサ101は、バスインターフェイスユニット(読み出し手段)112を介して、プログラムごとに異なるコード暗号化鍵で暗号化された複数のプログラムを、マイクロプロセッサ外部のメインメモリから読み出す。コード復号化ユニット212は、読み出した複数のプログラムを、それぞれ対応する復号化鍵で復号化し、命令実行部115が、復号化された複数のプログラムを実行する。あるプログラムの実行を中断する場合に、例外処理部131のコンテキスト情報暗号化/複号化ユニット254は、中断されるプログラムのそれまでの実行状態を示す情報と、このプログラムのコード暗号化鍵とを、マイクロプロセッサの公開鍵で暗号化し、暗号化した情報をコンテキスト情報としてメインメモリ281に書き込む。中断されたプログラムを再開する場合は、コード暗号化鍵・署名検証ユニット257は、暗号化されたコンテキスト情報を、マイクロプロセッサの秘密鍵で復号化し、復号化されたコンテキスト情報に含まれるコード暗号化鍵(すなわち再開予定のプログラムのコード暗号化鍵)が、中断されたプログラム本来のコード暗号化鍵と一致するかどうかを検証し、一致した場合にのみ、プログラムの実行を再開する。
【0050】
ここで、マイクロプロセッサ101の詳細な構成、機能を説明する前に、まずマイクロプロセッサ101による平文の命令の実行と、暗号化プログラムの実行における処理の流れをおおまかに説明する。
【0051】
マイクロプロセッサ101が平文命令を実行する時は、命令フェッチ/デコードユニット214が、プログラムカウンタ(不図示)の示すアドレスの内容をL1命令キャッシュ213から読み出そうとする。指定のアドレスの内容がキャッシュされていればL1命令キャッシュ213から命令を読み出し、命令プール215に送って命令が実行される。命令プールは複数の命令を並列実行可能であり、実行を行うためのデータの読み出しを、命令実行切替ユニット216に要求してデータを受け取る。命令が並行して実行され、その実行結果が確定すれば、実行結果は命令実行完了ユニット217に送られる。命令実行完了ユニット217は、操作対象がマイクロプロセッサ101内部のレジスタであれば、実行結果をレジスタファイル253に書き込み、操作対象がメモリであれば、L1データキャッシュ218に書き込む。
【0052】
L1データキャッシュ218の内容は、バスインタフェースの制御下にあるL2キャッシュ152でさらにもう一度キャッシュされて、メインメモリ281に書き込まれる。ここでは仮想記憶機構が使われており、論理的なメモリアドレスと物理的なメモリアドレスとの対応関係を定義するのが図3に示すページテーブルである。ページテーブルは、物理メモリ上におかれるデータ構造である。データTLB141は、実際に論理アドレスから物理アドレスへの変換を行うと同時に、データキャッシュを管理する。データTLB141は、マイクロプロセッサ101内部のあるレジスタが示すテーブルの先頭アドレスに基づいて、テーブルの必要な部分を読み込み、論理アドレスから物理アドレスへの変換作業を行う。このとき、メモリ上のページテーブルの全てがデータTLB141に読み込まれるのではなく、アクセスされる論理アドレスに応じて必要な部分だけがページテーブルバッファ234に読み込まれる。
【0053】
キャッシュ動作の基本は、プログラムの命令が暗号化されているかどうかにかかわらず、一定である。すなわち、命令TLB121にページテーブルの一部が読み込まれ、その定義に従ってアドレス変換が行われる。バスインタフェースユニット112は、メインメモリ281またはL2キャッシュ141から命令を読み込み、L1命令キャッシュ213に命令が格納される。L1命令キャッシュ213への命令の読み出しは、複数のワードで構成されるラインと呼ばれる単位で行われ、ワード単位の読み出しよりも高速なアクセスが行われる。
【0054】
実行命令の演算処理対象であるデータについても、物理メモリ上にある同じページテーブルを利用してアドレス変換が行われるが、変換の実行は上述したようにデータTLB141で行われる。
【0055】
ここまでは一般のキャッシュメモリの動作と基本的に同一であり、プロセッサの動作とキャッシュメモリについての詳細は、Curt Schimmel著の「UNIXカーネル内部解析」(ソフトバンク社、1996年)に記載されている。
【0056】
次に、暗号化されたプログラムを実行する場合の動作を説明する。本発明では秘密の保護を受ける実行コードは全て暗号化されていることを前提とし、暗号化されている実行コードのことを保護されたコードとも言う。さらに、同一の暗号化鍵による保護の範囲を保護ドメインと呼ぶ。すなわち、同じ鍵で保護されるコードの集合は同じ保護ドメインに所属し、異なる暗号化鍵で保護されるコードは保護ドメインが異なると言う。
【0057】
まず、メインメモリ281上には、共通鍵方式のブロック暗号アルゴリズムによって暗号化されたプログラムの実行コードが格納されている。プログラムベンダから送られてきた暗号化プログラムのロード方法などについては、同一出願人による特許出願第2000−35898号に記載されるとおりである。暗号ブロックサイズは、ブロックサイズの2のべき乗倍が、キャッシュメモリの読み書きの単位であるラインサイズと一致すれば、どのような値をとってもよい。ただし、ブロックサイズが小さい場合、ブロック長と命令長が一致して、サブルーチンの先頭部分などの予測可能な命令部分と暗号化データの対応関係を記録することによって、簡単に命令が解読されてしまう危険がある。そこで、本発明ではブロックをインタリーブして、ブロック中のデータの間に依存性を持たせ、暗号化されたブロックに複数の命令語やオペランドの情報を含ませる。こうすることにより、命令と暗号化ブロックの対応づけを困難にする。
【0058】
図5は、本発明で行うインタリーブの例を示す。図5に示す例では、キャッシュのラインサイズを32バイト、ブロックサイズを64ビット(すなわち8バイト)としている。インタリーブ前は1ワードは4バイトで構成され、ワードAはA0〜A3の4バイトからなる。1ラインはA〜Hの8ワードで構成されている。これをブロックサイズ64ビットに対応する8バイト単位になるようにインタリーブすると、図5の下の図のように、A0,B0,…,H0がワード0および1に該当する最初のブロックに配置され、A1,B1,…,H1が次のブロックに配置される。
【0059】
インタリーブを施す領域の長さは、長ければ長いほど攻撃は困難となるが、ラインサイズを越えてインタリーブをかけることは、あるキャッシュラインの復号化/暗号化が別のラインの読み出し/書き込みに依存することになり、処理の複雑化と速度低下を招くことになる。インタリーブを施す範囲はキャッシュラインサイズの範囲内にとどめることが望ましい。
【0060】
ここではキャッシュラインに含まれる複数のブロックのデータに依存性を持たせるためにブロックのデータをインタリーブする方法をとっているが、データブロック間に依存性を持たせるための他の方法、例えばブロック暗号のCBC(Cipher Block Chaining)モードなどを使ってもよい。
【0061】
暗号化された実行コードの復号化鍵Kcode(共通鍵アルゴリズムでは暗号化鍵と復号化鍵は同一なので、以下では復号に用いる場合も暗号化鍵という言葉を使う)は、ページテーブルに基づいて決定される。図3および4は、論理アドレスから物理アドレスへの変換テーブル構造を示す。
【0062】
プログラムカウンタの論理アドレス301がある値を示し、その上位ビットのディレクトリ302とテーブル303によって、ページエントリ307−jが指定される。ページエントリ307−jは、キーエントリID307−j−Kを含み、このIDに基づいて、キーテーブル309内で、このページの復号化に使用される鍵エントリ309−mが決定される。キーテーブル309の物理アドレスは、マイクロプロセッサ内部のキーテーブル制御レジスタ308によって指定される。
【0063】
この構成では、ぺージエントリに直接鍵情報をおかずに、鍵エントリのIDを置くことにより、サイズの大きい鍵情報を複数のページで共有して、サイズの限られる命令TLB121上のメモリ領域を節約することができる。
【0064】
本発明の特徴として、キーテーブルのエントリは固定長だが、それぞれのテーブルで使用される鍵の長さは暗号解析能力の向上に対応できるように可変長とし、キーテーブルのキーサイズ領域で指定される。マイクロプロセッサ101に固有の秘密鍵Ksは固定されているが、プログラムの暗号化、復号化に用いられるKcodeの長さは鍵エントリの指定によって変えられるということである。可変長の鍵の位置を指定するため、鍵エントリ309−mには鍵エントリをポイントするフィールド309−m−4があり、キーオブジェクト310のアドレスを示している。
【0065】
キーオブジェクト領域310には、実行コードの暗号化鍵Kcodeが、公開鍵アルゴリズムにより、マイクロプロセッサ101の公開鍵Kpで暗号化された形EKp[Kcode]で格納されている。公開鍵アルゴリズムでデータを安全に暗号化するためには、大きな冗長度が必要なため、暗号化されたデータ長は元のデータ長より長くなる。ここでは、Ks、Kpの長さを1024bビット、Kcodeの長さを64bビットとし、パディングにより256ビットの長さとして、E[Kcode]を1024ビットの長さに暗号化してキーオブジェクト領域310に格納する。Kcodeが長く、1024ビットに格納できない場合は、複数の1024ビットブロックに分割して格納する。
【0066】
図6は、上記の流れをまとめたものである。プログラムカウンタ501は、論理アドレス空間502の上の暗号化されたコード領域503の上のアドレスAddrを指している。論理アドレスAddrは、命令TLB121に読み込まれたページテーブル307に基づいて、物理アドレスAddr’に変換される。これと同時に、暗号化されたコード復号化鍵E[Kcode]がキーテーブル309から取り出され、復号化機能506においてCPUの持つ秘密鍵Ksで復号化されて、カレントコード復号化鍵記憶手段507に格納される。コード暗号のための共通鍵Kcodeは、プログラムベンダにより、マイクロプロセッサ101の公開鍵Kpで暗号化され、Kcodeで暗号化されたプログラムとともに供給されるので、マイクロプロセッサ101の秘密鍵Ksを知らないユーザは、Kcodeを知ることはできない。
【0067】
プログラムベンダは、Kcodeでプログラムの実行コードを暗号化し出荷した後は、Kcodeを安全に保管し、第3者に秘密が洩れないように管理する。
【0068】
全体キーテーブル511と、全体ページテーブル512は、物理メモリ510に置かれ、それぞれの物理アドレスがキーテーブルレジスタ508、CR3レジスタ509によって指定されている。これらの全体テーブルの内容は、バスインタフェースユニット112を介して、必要な部分だけが命令TLB121にキャッシュされる。
【0069】
さて、命令TLB112によって変換された物理アドレスAddr’に対応する内容503がバスインタフェースユニット112によって読み出されると、このページは暗号化されているので、コード復号化ユニット212で復号化される。読み出しは前記キャッシュラインサイズ単位で行われ、ブロック単位で復号化された後、上述したインタリーブの逆処理が行なわれる。復号された結果はL1命令キャッシュ213に格納され、命令として実行される。
【0070】
その他、プログラムのロード手法、リロケーションなどについては、同一出願人による特許出願第2000−35898号に記載されている。
【0071】
このように暗号化されたコードを実行できることにより、本発明のマイクロプロセッサでは、コードを逆アセンブルしてプログラムの動作を解析することを、暗号化アルゴリズムとパラメータを適切に選びさえすれば暗号学的に不可能とすることができる。
【0072】
同様に、ユーザはコード暗号化鍵Kcodeの真の値を知ることができないので、暗号化されたプログラムの一部を改変してユーザがそのアプリケーションが扱うコンテンツの不正コピーを取るなどのユーザの意図に沿った改変も暗号学的に不可能にすることができる。
【0073】
次に、デバッグ機能の抑止について説明する。
【0074】
命令TLB121は、現在実行中のコードが保護されているかどうか(暗号化されているかどうか)を判定することができる。保護されたコードの実行中は、デバッグフラグやデバッグレジスタから暗号化プログラムの解析に侵入されることを防止するため、デバッグレジスタ機能と、ステップ実行機能という2つのデバッグ機能が禁止される。
【0075】
デバッグレジスタ機能とは、プロセッサに備えられたデバッグレジスタに、メモリアクセス範囲や、実行、データとしての読み出し、書き込みなどのアクセス種別を設定しておくことにより、対応するメモリアクセスが発生したときに割り込みが発生する機能である。本実施形態においては、保護されたコードを実行している時は、デバッグレジスタに設定された内容は無視され、デバッグのために割り込みは発生しない。ただし、ページテーブルにデバッグのビットが設定されている場合を除く。ページテーブルのデバッグビットについては後述する。
【0076】
非保護(平文)のコードを実行中は、プロセッサのEFLAGSレジスタのステップ実行ビットをセットすると、1命令を実行する度に割り込みが発生するが、保護されたコードの実行中には、このビットも無視され、割り込みは発生しない。
【0077】
本発明では、実行コードの暗号化による解析の防止に加えて、これらの機能により、デバッグレジスタやデバッグフラグによるプログラムの動的解析を防止することで、ユーザによるプログラムの解析を困難にしている。
【0078】
次に、本発明のマイクロプロセッサの特徴である、マルチタスク環境下でのプログラム実行中断時における、コンテキストの暗号化と署名および検証について説明する。
【0079】
マルチタスク環境でプログラムの実行は、例外によりしばしば中断される。通常、実行が中断された時にはプロセッサが保持する状態は一旦メモリ上に保存され、後でそのプログラムの実行が再開される時に元の状態が復帰される。これにより、複数のプログラムによる処理を疑似的に並行して実行したり、割り込み処理を受け付けることが可能になっている。この中断時の状態情報は、コンテキスト情報と呼ばれる。コンテキスト情報にはアプリケーションが使用するレジスタ情報が含まれ、それに加えて、明示的には見えないがレジスタの情報が含まれる場合がある。
【0080】
従来のプロセッサでは、あるプログラムの実行中に割り込みが発生すると、アプリケーションのレジスタ状態が保持されたままOSの実行コードに制御が移されるので、OSはそのプログラムのレジスタ状態を調べてどのような命令を実行していたかを推定したり、平文のまま保存されたコンテキスト情報を実行の中断中に改変することで、そのプログラムの実行再開後のプログラムの動作を変えることができた。
【0081】
そこで、本発明では、保護されたコードの実行中に割り込みが発生した時に、その直前に実行していたコンテキストを暗号化して保存し、全てのアプリケーションレジスタを暗号化または初期化するとともに、コンテキスト情報にプロセッサによる署名を添付する。中断からの復帰時に署名を検証し、その署名が正しい署名かどうかをチェックする。署名の不整合を検出した場合には復帰を中止して、ユーザによる不正なコンテキスト情報の改変を防止することができる。このとき、暗号化の対象となるレジスタは、図7の701〜720までのユーザレジスタである。
【0082】
Pentium Proアーキテクチャでは、プロセスのコンテキスト情報のメモリ上への保存、復帰をハードウェア的に支援する機構がある。この状態を保存するための領域はTSS(task state segment)と呼ばれる。以下この機構に本発明を適用した例を説明するが、これは本発明の適用をPentium Proアーキテクチャに限定するものではなく、本発明は広く一般のプロセッサアーキテクチャに適用が可能である。
【0083】
例外発生にともなうコンテキスト情報の保存は次の場合に起きる。例外が発生すると、IDT(Interrupt Descriptive Table)と呼ばれる例外処理を記述するテーブルの中から、割り込み原因に対応するエントリが読み出され、そこに記述された処理が実行される。エントリがTSSを示すものであるとき、指示されたTSSに保存されていたコンテキスト情報がプロセッサに復帰される。一方、それまで実行されていたプロセスのコンテキスト情報は、そのときのタスクレジスタ725で指定されたTSS領域に保存される。
【0084】
この自動的なコンテキスト保存機構を使えば、プログラムカウンタやスタックポインタを含めて全てのアプリケーション状態を保存し、復帰時に署名を検証することで改竄の有無を検出することができる。しかし、自動的なコンテキストの保存を行う場合、コンテキストの切替のために大きなオーバヘッドが生じる他に、TSSを使わない割り込み処理ができないなどの問題が生じる。
【0085】
割り込み処理のオーバヘッドを小さくする、あるいは既存プログラムとの互換性を保つためには自動的なコンテキスト保存の機構を使わないことが望ましいが、この場合には、プログラムカウンタはスタック上に保存されてしまい、検証の対象とはできないため、悪意のあるOSによる改竄の対象ともなりうる。両者は目的に応じて使い分けられることが好ましい。そこで、本発明のマイクロプロセッサでは、保護された(暗号化された)実行コードに対しては、安全性を重視して、自動的なコンテキスト保存を採用する。自動的に保存するレジスタは必ずしも全てのレジスタでなくてもよい。
【0086】
本実施例におけるコンテキスト保存と再開処理の特徴は次の3点である。
【0087】
(1)コンテキストを生成したマイクロプロセッサ自体と、コンテキストを生成したプログラムの暗号化鍵Kcodeを知る者だけが、保存されたコンテキストの内容を復号化できる。
【0088】
(2)あるコード暗号鍵Xで保護されたプログラムが中断され、そのコンテキストが保存された場合、その再開処理は非保護のプログラムや別のコード暗号化鍵Yで暗号化されたプログラムの再開に適用することはできない。すなわち、中断から復帰させるべきプログラムが、再開時に別のプログラムに入れ代えられることはない。
【0089】
(3)改変されたコンテキストの復帰を禁止する。すなわち、仮に保存されていたコンテキストが改変されていた場合、そのコンテキストは復帰されない。
【0090】
上記の特徴(1)により、コンテキスト情報の安全性を維持すると同時に、プログラムベンダによるコンテキスト情報の解析は可能にしておくことができる。プログラムベンダがコンテキスト情報を解析する権利を保持していることは、ユーザの使用条件で発生した不具合の原因を解析し、プログラムの品質を維持するためにも重要だからである。
【0091】
特徴(2)は、たとえば攻撃者が、プログラムAの実行によって生成されたコンテキストを、別の暗号プログラムBに適用して、コンテキストに保存された既知の状態からプログラムを再開することによって、プログラムBに含まれるデータやコードの秘密を解析したり動作を改変することを防ぐためのものである。この機能はまた、後述するデータ保護に際して、複数のアプリケーションが互いに独立して、それぞれ排他的に暗号化データを保持するための前提となる。
【0092】
特徴(3)により、プログラムの再開時を利用したコンテキスト情報の改変を厳密に排除することができる。
【0093】
このような機能を持たせる理由は、単にプロセッサの秘密情報に基づいてコンテキスト情報を暗号化しただけでは、秘密情報を、攻撃者の意図に沿ったコンテキスト情報の改変から守ることはできても、コンテキストが無秩序に改変され、ランダムに誤りが生じた状態からプログラムが再開される可能性を排除することができないからである。
【0094】
以下、上記3つの特徴をそなえたコンテキスト保存と検証方法について詳細に説明する。
【0095】
<コンテキスト保存処理>
図8は、第1実施形態のコンテキスト保存形式を概念的に示した図である。保護されたプログラムの実行中にハードウェア、またはソフトウェアが原因の割り込みが発生したとする。割り込みに対応するIDTエントリがTSSを示すものであれば、それまでのプログラムの実行処理が暗号化され、コンテキスト情報として(そのTSSではなく)カレントのタスクレジスタ725が示すTSSに保存される。そして、IDTエントリが示すTSSに保存された実行状態がプロセッサに復帰される。IDTのエントリがTSSを示していない場合、カレントのレジスタの暗号化または初期化のみが行なわれ、TSSの保存は行なわれない。当然そのプログラムの再開は不可能となる。ただし、OSの動作の継続のため、レジスタの暗号化または初期化の対象から、フラグレジスタの一部タスクレジスタを含むシステムレジスタは除外する。
【0096】
図8に示すコンテキストは、実際には、その内容がインタリーブされ、ブロック毎に暗号化されてメモリ上に保存される。まず保存される情報の項目について説明する。先頭には各特権モードに対応したスタックポインタとユーザレジスタ802〜825があり、その次に、TSSのサイズと暗号化の有無を示す1ワード826が置かれる。これはプロセッサが保存されたTSSが暗号化されたものであるかどうかを示すもので、TSSが暗号化された場合でも、この領域は暗号化されずに、平文のまま保存される。続いてデータの保護のために追加されたデータ暗号化制御レジスタ(CY0〜CY3)の領域827〜830と、サイズをブロック長に合わせるためのパディング831が置かれる。最後にコンテキストを暗号化した鍵Krを実行コードの暗号化Kcodeで共通鍵アルゴリズムにより暗号化した値EKcode[Kr]832、コンテキストを暗号化した鍵Krをプロセッサの公開鍵Kpで暗号化した値EKP[Kr]833、そして、これら全体に対するプロセッサの秘密鍵Ksによる署名SKS[message]834が置かれる。また、タスク間の呼出し関係を保持する前回のタスクとのリンク領域801は、OSによるタスクスケジューリングを可能にするため平文のまま保存される。
【0097】
これら実行コードの暗号化や署名生成は、図2に示す例外処理部131の中のコンテキスト情報暗号化/復号化ユニット254によって行なわれ、実行コードの処理対象であるデータの暗号化とは独立した機能に基づく。コンテキスト情報がTSSに保存される際には、別途のデータ暗号化機能によりTSSのアドレスになんらかの暗号化が指定されていたとしても、その指定は無視され、コンテキストの暗号化が行なわれたそのままの状態で保存される。データ暗号化機能の暗号化属性は、それぞれの保護された(暗号化された)プログラムに固有のものであるため、あるプログラムの再開をその機能に依存することができないためである。
【0098】
コンテキストの暗号化にあたっては、まず平文のまま記録されるTSSサイズ領域826のワードが、値0に置き換えられる。そして、図5と関連して説明したのと同様のインタリーブが施されて、コンテキストが暗号化される。このとき、パディング831は暗号化ブロックサイズに合わせてインタリーブが適切に行えるサイズに設定する。
【0099】
ここで、レジスタ値をプロセッサの公開鍵Kpまたはコードの暗号化鍵Kcodeで直接暗号化しないのは、プログラムベンダとプロセッサの両者による暗号化されたコンテキストの解読を可能にし、同時にユーザによるコンテキストの復号化を禁止するためである。
【0100】
プログラムベンダはコードの暗号化鍵Kcodeを知っているので、Kcodeを使用してEKcode[Kr]832を復号化して、コンテキストの暗号化鍵Krを取り出すことができる。また、マイクロプロセッサ101は、内部に持つ秘密鍵KsでEKP[Kr]833を復号化して、Krを取り出すことができる。すなわち、プログラムベンダは、ユーザのマイクロプロセッサの秘密鍵を知ることなく、コンテキスト情報を復号化して不具合の解析を行うことができ、マイクロプロセッサ101自体は、内部に持つ秘密鍵でコンテキスト情報を復号化して実行を再開することができる。いずれの鍵も持たないユーザは、保存されたコンテキスト情報を復号化することはできない。また、コンテキスト情報と、上記EKcode[Kr]、EKP[Kr]に対する署名SKS[message]を、マイクロプロセッサ101の秘密鍵Ksを知らないユーザが偽造することもできない。
【0101】
プログラムベンダとマイクロプロセッサによる互いに独立したコンテキスト情報の復号化を可能とするために、直接Kcodeでコンテキスト情報を暗号化する方法も考えられる。しかし、レジスタの状態が既知の場合、コードの暗号化鍵Kcodeに対して既知平文攻撃が行なわれるおそれがある。すなわち、データを暗号化するための鍵の値が固定されていると、次のような問題がある。ユーザのデータ入力を読み込んで、それを一時的に作業用メモリに暗号化して書き込むというプログラムを実行していたとする。暗号化されて書き込まれるデータは、メモリ上を観察していればわかるので、ユーザは入力の値を変えて何度も入力を繰り返し、それに対応する暗号化されたデータを入手することができる。これは、暗号解析の理論における「選択平文攻撃」が可能であることを意味する。
【0102】
共通鍵暗号アルゴリズムにとって既知平文攻撃は致命的ではないとはいえ、これを回避するに越したことはない。そこで、例外処理部131の乱数発生ユニット252により、コンテキストの保存の都度、乱数Krを生成し、コンテキスト情報暗号/復号化ユニット254に供給する。コンテキスト情報暗号/復号化ユニット254は、乱数Krを用いて、共通鍵アルゴリズムによりコンテキストを暗号化する。そして、乱数Krをコード暗号化鍵Kcodeで同じく共通鍵アルゴリズムにより暗号化した値E[Kr]832として添付する。プロセッサの公開鍵KpによるKrの暗号化EKp[Kr]833は、公開鍵アルゴリズムによる。
【0103】
ここで、乱数は、乱数発生機構252によって生成される。暗号化されているのがプログラムの場合には、通常はプログラムコードには変化がなく、動作の解析をしない限り、対応する平文のコードが不正に入手されることはない。この場合、暗号を破るには「暗号文単独攻撃」を行う必要があり、暗号化鍵の探索は非常に困難である。ところが、ユーザによって入力されたデータを暗号化してメモリに格納する場合には、ユーザが入力データを自由に選択できる。このため、暗号化鍵に対して「選択平文攻撃」という、「暗号文単独攻撃」と比べてはるかに効率的な攻撃が可能となってしまう。選択平文攻撃に対しては、保護されるべき平文に「salt(塩)」と呼ばれる乱数を追加して探索空間を大きくするという対策が可能である。しかし、すべてのデータにsaltの乱数値を組み込んだ形でメモリに保存することを、アプリケーションプログラミングのレベルで実装するのは非常に繁雑であり、プログラミング効率と性能の低下を招くことになる。
【0104】
そこで、乱数発生機構253は、コンテキストの保存の都度、それを暗号化するための乱数(暗号化鍵)を発生する。暗号化鍵を任意に選択できることにより、プロセス間、プロセス−デバイス間の安全な通信を高速化できるという効果も生じる。メモリアクセス時にハードウェアによってデータを暗号化する速度は、ソフトウェアによって暗号化する速度に比べて一般にはるかに速いためである。これに反し、データ領域の暗号化鍵の値が、予め決められた値、例えば実行コードの暗号化鍵と同一のものに制限されていると、別の暗号化鍵で暗号化された他のプログラムや、デバイスとの暗号化されたデータの共有にプロセッサのデータ暗号化機能を使うことができず、プロセッサに設けられたハードウェア暗号化機能の高速性を生かすことができないからである。
【0105】
なお、署名834の生成および再開時に行われる暗号化された乱数E[Kr]832の復号化は、マイクロプロセッサ101だけが行えるという条件を満たしていれば、どのようなアルゴリズムと秘密情報に基づいてもよい。上の例では、ともにマイクロプロセッサ101に固有の秘密鍵Ks(これはコード暗号化鍵Kcodeの復号にも用いられる)を使っているが、それぞれ別の値を使ってもかまわない。
【0106】
また、保存されたコンテキストには暗号化の有無を示すフラグがあり、暗号化されたコンテキスト情報と暗号化されないコンテキスト情報が用途に応じて共存できる。TSSのサイズと暗号化の有無を示すフラグは平文で格納されているので、過去のプログラムとの互換性を維持するのが容易である。
【0107】
<中断されたプログラムの再開処理>
コンテキストを復帰させてプロセスを再開させる時、OSは保存されたTSSを示すTSSデスクリプタへのジャンプまたはcall命令を発行する。
【0108】
図2のブロック図に戻ると、例外処理部131のコード暗号化鍵・署名検証ユニット257は、最初に署名SK [message]834をプロセッサの秘密鍵Kpを使って検証し、検証結果を例外処理ユニット255に送る。検証結果が失敗である場合は、例外処理ユニット255はコンテキストの再開を中止し、例外を発生させる。この検証により、コンテキスト情報が確かに秘密鍵を持つ正当なマイクロプロセッサ101により生成されたものであって、改竄を受けていないことが確認できる。
【0109】
署名の検証に成功すると、コンテキスト情報暗号/復号化ユニット254は、コンテキスト暗号化鍵EKp[Kr]833を秘密鍵Ksで復号化して、乱数Krを取り出す。取り出したKrによりコンテキストを復号化する。一方、プログラムカウンタ(EIP)809に対応するコード復号化鍵Kcodeがページテーブルバッファ230から取り出され、コート暗号化/復号化鍵領域251に送られる。コンテキスト情報暗号/復号化ユニット254は、コード復号化鍵KcodeでEKcode[Kr]832を復号化し、その結果をコード暗号化鍵・署名検証ユニット257に送る。コード暗号化鍵・署名検証ユニット257は、EKcode[Kr]832の復号結果が、マイクロプロセッサの秘密鍵Ksによる復号化結果と一致するかどうかを検証する。この検証により、このコンテキスト情報が秘密鍵Kcodeで暗号化されたコードの実行により生成されたものであることが確認できる。
【0110】
もしコンテキスト情報に対して、このコード暗号化鍵に関する検証を行わない場合には、ユーザが適当な秘密鍵Kaで暗号化したコードをつくり、それを実行して得たコンテキスト情報を、別の秘密鍵Kbで暗号化したコードに適用する攻撃が可能となってしまう。上記の検証はこの攻撃を排除し、保護されたコードのコンテキスト情報の安全性を保証している。
【0111】
この目的は、コンテキスト情報に秘密のコード暗号化鍵Kcodeを追加することによっても達成できるが、本発明では、コンテキスト情報を暗号化する秘密の乱数Krを、プログラムベンダの選んだコード暗号鍵Kcodeで暗号化した値EKcode[Kr]を検証に使うことで、コンテキスト情報の保存に必要なメモリの量を削減し、コンテキスト切替の高速化とメモリの節約の効果を達成している。これはまた、プログラム作成者へのコンテキスト情報のフィードバックをも可能にする。
【0112】
さて、コード暗号化鍵・署名検証ユニット257により、コード暗号化鍵の検証と署名の検証に成功すると、コンテキストがレジスタファイル253に復帰され、プログラムカウンタの値も復帰されるので、制御がコンテキストを生成した実行中断時のアドレスに戻される。
【0113】
いずれかの検証に失敗して、例外処理ユニット255が例外を発生させた場合は、例外の発生アドレスはジャンプまたはcall命令が発行されたアドレスを示す。また、IDTテーブルの割り込み原因の領域にTSSの不正を示す値が格納され、割り込み原因となるアドレスを格納するレジスタにジャンプ先のTSSのアドレスが格納される。これにより、OSはコンテキスト切替失敗の原因を知ることができる。なお、再開処理を高速化するため、コンテキスト情報暗号/復号化ユニット254により復号された実行状態のレジスタファイル253へ供給と、検証ユニット257による検証処理を並行して行ない、検証に失敗した時は以降の処理をとりやめる構成としてもよい。
【0114】
乱数を介したこの暗号化方式の安全性は、使用する乱数系列の予測不可能性に依存するが、予測が困難な乱数をハードウェアによって生成する方法は例えば、小野寺他による日本国特許番号第2980976号に記載されている。
【0115】
プログラムベンダによるコンテキスト情報の解析は、ユーザの使用条件で発生したプログラムの不具合の原因を解析し、プログラムの品質を向上させる上で重要である。本実施例ではその点を鑑み、コンテキストの安全性とプログラムベンダによるコンテキスト情報の解析可能性の両立させる方式を説明しているが、この方式により、コンテキスト保存のオーバヘッドが増えることも事実である。
【0116】
また、マイクロプロセッサの署名によるコンテキスト情報の検証は、不正なコンテキスト情報で保護されたコードを、任意に選んだ値と暗号化鍵の組み合わせにより実行されることを防止しているが、この追加もやはりオーバヘッドを増やしている。
【0117】
プログラムベンダによるコード解析の必要性や、不正なコンテキスト情報によるプログラム再開を排除する機構が必要ない場合は、コードの暗号化鍵を特定する情報を含むコンテキスト情報をプロセッサの持つ秘密鍵で直接暗号化してもよい。これだけでコンテキストの意図的な改竄は暗号学的に不可能、かつ暗号化鍵の異なるプログラムに、コンテキスト情報が適用されることを防ぐことができる。
【0118】
ここで、コンテキスト保存の形式について説明を追加しておく。動作との関係については後述する。
【0119】
図8において、825−1に示すRビットはコンテキストが再開可能かどうかを示すビットである。このビットが1にセットされている場合、上記復帰手順でコンテキストに保存された状態を復帰して実行を再開できるが、値が0の場合には、再開することはできない。これは、暗号化プログラムの実行中に不正が検出されたコンテキストの再開を防ぐことで、再開可能なコンテキストを正しい状態のものに限定できるという効果を有する。
【0120】
825−2に示すUビットはTSSがユーザTSSかシステムTSSかを示すフラグである。このビットが0の場合は保存されたTSSはシステムTSSであり、このビットが1にセットされている場合は保存されたTSSはユーザTSSである。上の例で説明した例外エントリからの特権の変更を伴うタスク切り替えや、タスクゲートの呼出しを通して保存、復帰されるTSSはシステムTSSである。一方、特権の変更を伴わないユーザによるサブルーチン呼出し命令、明示的なコンテキスト保存命令の実行によって保存されるTSSはユーザTSSである。システムTSSとユーザTSSの違いは、TSSの復帰時に現在実行中のプログラムのTSS保存場所を示すタスクレジスタが更新されるかされないかにある。システムTSSの復帰では、現在実行中のプログラムのタスクレジスタが、新しく復帰されるTSSの前回のタスクとのリンク領域801に保存され、新しいTSSのセグメントセレクタがタスクレジスタに読み込まれる。一方、ユーザTSSの復帰では、タスクレジスタの値の更新は行われない。ユーザTSSはプログラムのレジスタ状態の保存、復帰のみを目的としており、特権モードの変更は伴わない。
【0121】
<データ保護>
次に、実行コードの演算処理対象であるデータの保護について説明する。
【0122】
第1実施形態では、データを保護するための暗号化属性は、マイクロプロセッサ101の内部に設けられたCY0〜CY3の4つのレジスタに定義される。図7に示す領域717〜720がこれに該当する。図7では、CY0〜CY2については詳細を省略し、CY3のみを詳細を示している。
【0123】
暗号化属性の各要素を、CY3レジスタ717を例にとって説明する。暗号化される領域の先頭を示す論理アドレスの上位ビットが、ベースアドレス717−1に指定される。領域のサイズはサイズ領域717−4に指定される。サイズはキャッシュライン単位で指定されるため、下位のビットには無効部分がある。データの暗号化鍵は717−5に指定される。共通鍵アルゴリズムを使用しているので、復号化鍵にも717−5を使用する。暗号化鍵の値に0が指定された時、そのレジスタが示す領域は暗号化されていないことを示す。領域の指定はCY0が優先され、以下CY1〜CY3の順番で優先される。例えばCY0とCY1の指定する領域が重なった場合、その領域ではCY0の属性が優先される。また、処理対象のデータではなく、実行コードとしてのメモリアクセスではページテーブルの定義が優先される。
【0124】
717−4はデバッグビットであり、デバッグ状態でのデータ操作を暗号化状態で行うか、平文状態で行うかを選択する。デバッグビットについての詳細は後述する。
【0125】
図10は、実行コードの処理対象であるデータの暗号化、復号化の流れを示す。ここでは、コードが保護された状態、すなわち暗号化された状態で実行されている時のみ、データの保護が行われる。ただし、後述するデバッグ状態でコードが実行されている場合は除外する。コードが保護されている時、暗号化属性レジスタCY0〜3の内容は、図2に示すレジスタファイル253からデータTLB141内にあるデータ暗号化キーテーブル236に読み込まれている。
【0126】
ある命令が論理アドレスAddrにデータを書き込む時、データTLB141は、論理アドレスAddrがCY0〜3の範囲に含まれているかどうかを、データ暗号化キーテーブル236(図2参照)を調べることにより判断する。判断の結果、暗号化属性が指定されていれば、データTLB141は、L1データキャッシュ114からメモリへの対応キャッシュラインのメモリ書き出しの際に、メモリ内容を指定された暗号化鍵で暗号化するように、データ暗号化ユニット220に指示する。
【0127】
読み込みの場合も同様に、対象アドレスが暗号化属性を持っていれば、対応するL1データキャッシュ218のキャッシュラインの読み込みの際に、データ復号化ユニット219に対して、指定された暗号化鍵で復号化するように指示する。
【0128】
第1実施形態では、データ暗号化のためのデータ暗号化属性をすべて、マイクロプロセッサ101内部のレジスタに置き、実行の中断時にレジスタの内容をコンテキスト情報として安全な形でマイクロプロセッサ外部のメモリ(たとえば図2のメインメモリ281)に保存することにより、データ暗号化属性を、OSの特権も含めた不正な書き換えから保護している。
【0129】
データの暗号化、復号化は、コンテキストの暗号化と関連して先に説明したインタリーブを受けたキャッシュライン単位で行われる。このため、L1キャッシュ114上のデータを1ビット書き換えただけでも、メモリ上ではキャッシュライン内の他のビットが書き換えられることになる。データの読み書きの実行はキャッシュライン単位でまとめて行われるため、オーバヘッドの増大はさほど大きくはないが、暗号化されたメモリ領域に対する読み書きは、キャッシュラインサイズ以下の単位では行えないことに注意が必要である。
【0130】
<エントリゲート>
本発明では、保護されていないコードから、保護されたコードに制御が移行できるのは、次の2つの場合に限られる。
【0131】
(1)再開アドレスと一致するコード暗号化鍵で暗号化された(乱数を持つ)コンテキストが再開される場合;
(2)連続したコードの実行またはjump,call命令などにより、保護されないコードから、保護されたコードのエントリゲート命令(EGATE命令)に制御が移る場合。
【0132】
この限定は、攻撃者がコードを任意の場所から実行することによって、コード断片の情報を得ることを防ぐためのものである。(1)の手順については、コンテキストの復帰と関連してすでに説明した。すなわち、中断前に実行していたコードのコード暗号化鍵と一致するコンテキスト情報が含まれていること、およびマイクロプロセッサ101が与えた正しい署名が付加されていることが検証された場合に、保護されたコードの実行制御に移る。
【0133】
(2)の手法は、保護されないコードから保護されたコードへと制御を移す場合には、制御の最初にエントリゲート(egate)命令と呼ぶ特殊な命令を実行しなければ、保護コートの実行に移行できないとする処理である。
【0134】
図9は、エントリゲート命令に基づく保護ドメインの切り替え手順を示す。マイクロプロセッサ101は、例外処理部131のカレントコード暗号化鍵記憶手段251(図2参照)に、現在実行中のコードの暗号化鍵を保持している。まず、ステップ601で、命令の実行にともなってこの鍵の値が変更されたかどうかを判断する。鍵の値の変更が検出された場合(ステップ601でNO)、ステップ602に進み、変更に伴って実行されている命令がエントリゲート(egate)命令であるかどうかを調べる。エントリゲート命令であるということは、それが適正な命令であり、変更されたコードに制御を移行してもかまわないことを意味する。したがって、ステップ602でエントリゲート命令であると判定された場合は(ステップ602でYES)、その命令を実行する。
【0135】
ステップ602でエントリゲート命令でないと判断された場合は(ステップ602でNO)、割り込まれた命令が不適正な命令であることを意味する。この場合、ステップ603に進み、直前に実行されていた命令が暗号化(保護)されたものかどうかを判断する。保護されていない命令であれば、そのまま例外処理を発生させることができるが、保護されている命令である場合、一応その命令の保護を守りつつ例外処理しなければならないからである。
【0136】
したがって、ステップ603で保護されていない命令であると判断された場合は(ステップ603でNO)、そのまま例外処理を行い、保護された命令であると判断された場合には(ステップ604でYES)、保護状態を守ったまま、例外処理を発生させる。
【0137】
このような制御移行の制限により、平文コードから、エントリゲート命令がおかれた場所以外のコードへ、直接制御を移すことが禁止される。コンテキストを復帰させるということは、すでにそのプログラムがエントリゲートを通じて一度実行された状態を復帰させることである。したがって、保護されたプログラムを実行するには、必ずエントリゲートを通らなければならないことになる。プログラム中でエントリゲートを置く場所を最低限に押さえることにより、さまざまなアドレスからプログラムを実行してプログラムの構造を推定する攻撃を防ぐ効果がある。
【0138】
さらに、このエントリゲートでは、データの保護属性レジスタの初期化を行なう。エントリゲートを実行すると、図7に示す保護レジスタCY0〜CY3(717〜720)の鍵領域(CY3では領域717−5)に、乱数Krがロードされる。暗号化対象先頭アドレスを0、サイズをメモリの上限までに設定し、論理アドレス空間のすべてを暗号化対象に設定する。実行コードにデバッグ属性が設定されていなければ、デバッグビット(CY3では717−3)は非デバッグとする。
【0139】
つまり、暗号化コードの実行開始時点では、すべてのメモリアクセスはエントリゲート実行時に決定された乱数Krで暗号化されることになる。また、前述の通り実行コードの暗号化制御はページテーブルの定義が優先される。この乱数Krはコンテキストの暗号化に使われる乱数とは独立に生成される。
【0140】
この機構により、新たに実行される保護されたプログラムは、必ず全てのメモリアクセス開始時にランダムに決定された鍵によって暗号化される設定となる。
【0141】
もちろんこのままではメモリ領域の全体が暗号化されたままなので、メモリを通じてシステムコールのパラメータを渡したり、他のプログラムとのデータ交換をすることができない。そこで、プログラムは順次必要なメモリ領域を平文としてアクセスできるように保護属性レジスタを設定して、自身の処理環境を整え処理を進める。優先度の低いレジスタCY3は最初の乱数で暗号化される設定のままとしておき、その他のレジスタに平文アクセスの設定として暗号化鍵0を設定すれば、必要以外の領域を平文としてアクセスし、暗号化して秘密にするべきデータを誤って平文の領域に書き出してしまう危険を少なくすることができる。
【0142】
保護属性レジスタ以外のレジスタの内容は、エントリゲートにおける初期化でも暗号化せずに、スタックやパラメータの場所を指定するためのポインタを格納しておくことができる。ただし、レジスタに不正な値を設定してエントリゲートを呼び出すことにより、プログラムの秘密が盗まれることがないよう、エントリゲートを通して実行されるプログラムの処理には注意を払う必要がある。
【0143】
プログラミング的には制約され、効率が悪くなるが、安全性を重視すればエントリゲートでは保護属性レジスタ以外の汎用レジスタも含めて、フラグ、プログラムカウンタ以外のすべてのレジスタを初期化する構成としてもよい。この場合でもスタックなどのパラメータはプログラムカウンタの相対アドレス、または絶対アドレスで指定したメモリ領域を通じて受け渡すことが可能である。ただし、ここでもコンテキスト保存の場合と同様、OSの動作の継続のため、レジスタの暗号化または初期化の対象から、フラグレジスタの一部タスクレジスタを含むシステムレジスタは除外する。
【0144】
このように、第1実施形態にかかるマイクロプロセッサ101では、平文状態のプログラムから、保護されたプログラムへと制御が移る際に、最初に実行する命令をエントリゲート命令に制限し、エントリゲート命令の実行によってデータ暗号化属性レジスタを含むレジスタを初期化することで、保護された実行コードの断片的な実行を防ぎ、特にデータ保護状態の不正な設定を防いでいる。
【0145】
次に保護されたプログラムの実行制御について説明する。始めに保護ドメイン内に閉じた呼び出しおよび分岐について説明する。保護ドメイン内の呼び出しは通常のプログラムと全く同一である。図11に、保護ドメイン内の呼び出しおよび分岐の概念を示す。
【0146】
保護ドメインのコード1101の実行は、保護ドメイン外のスレッド1121が、保護ドメインのegate(エントリゲート)命令へと分岐することにより開始される。egate命令の実行によってすべてのレジスタが初期化され、その後、プログラムの実行によって順次データ保護属性が設定される。jmp xxx命令により、保護ドメイン内の分岐先xxx1111に制御が移り(処理1322)、アドレスppp1112にあるcall yyy命令が実行される(処理1123)。スタックメモリ1102に呼び出し元のアドレスppp1112がプッシュされ、呼出先yyy1113へと制御が移る。呼び出し先での処理が完了して、ret命令が実行されると、スタックの戻り番地ppp1112へと制御が移る。実行コードの暗号化鍵が同一である間は実行制御に制限はない。
【0147】
次に保護ドメインから非保護ドメインへの呼び出しおよび分岐について説明する。この制御の移行には、保護ドメインから非保護ドメインへのプログラム作成者の意図しない移行を避けるためと、データ保護状態を保護するために、特殊な命令の実行および以下に説明するユーザTSSの操作を行う。
【0148】
図12は、保護ドメインから非保護ドメインへの呼び出しおよび分岐動作の概念図である。それぞれのドメインに、保護ドメインの実行コード1201と、非保護ドメインの実行コード1202が置かれている。また、ユーザTSS領域1203と、非保護ドメインとのパラメータ受渡し領域1204が設けられている。
【0149】
実行は、スレッド1221がegate命令を実行することに始まる。保護ドメインのプログラムは、非保護ドメインのコードを呼び出す前に、予め定められたパラメータ領域1204にユーザTSS領域1203のアドレスを保存しておく。そしてecall命令を実行して非保護ドメインのコードが呼び出される。ecall命令は2つのオペランドをとる。一つは呼出先のアドレスであり、もう一つは実行状態の保存先である。ecall命令は、呼出時のレジスタ状態(正確にはプログラムカウンタはecall発行後の状態)をオペランドuTSSで指定した領域に、これまでに説明した暗号化TSSと同じ形式で保存する。以下、この領域をユーザTSSと呼ぶ。
【0150】
ユーザTSSとシステムTSSとの違いは、図8に示すユーザレジスタにおいて、TSS上の領域825−2にUフラグがセットされていることである。動作の違いについては、後述する。ユーザTSSのメモリへの保存においても、システムTSSへのコンテキスト情報の保存と同様、ユーザが保護レジスタCY0〜CY3に定義したデータ保護属性は適用されない。
【0151】
呼出先の非保護ドメインのコードでは、ecall命令の実行によりレジスタは初期化されているので、パラメータの受渡しができない。このため、予め定められたアドレスparam1204からパラメータを取得し、必要な処理を行なう。非保護ドメインの中ではプログラミングに制限はない。図12の例では、サブルーチンqqq1213を呼び出している(矢印で示す処理1425)。例えばexxからqqqの呼出しまでの間に、スタックポインタの設定やパラメータのスタックへの複写を行うアダプタコードをおくことにより、サブルーチンqqqが有する呼び出しセマンティクスに、保護ドメインからの呼び出しを適応させることができる。処理結果は、メモリ上のパラメータ領域1204を通じて、呼出元へ送られる(処理1226)。サブルーチンの処理が完了すると、呼出元の保護ドメインへ制御を戻すため、sret命令が発行される(1227)。
【0152】
sret命令も、オペランドを持たないret命令とは異なり、ユーザTSSを指定するオペランドを一つとる。ここではパラメータ領域param1204に格納されたポインタを通じて、間接的にユーザTSS1203を復帰情報として指定している。sret命令によるユーザTSSの復帰が、システムTSSの復帰と大きく異なる点は、ユーザTSSを復帰してもタスクレジスタは全く影響を受けない点である。ユーザTSSのタスクリンクのフィールドは無視される。sret命令のオペランドに825−2Uフラグが0のシステムTSSが指定された場合は、復帰は失敗する。
【0153】
復帰の実行の際には、すでに説明した実行状態の復号化およびコード暗号化鍵と署名の検証が行なわれ、違反が検出された場合、秘密保護違反の例外が発生する。検証に成功すると、呼出元のecall命令の次の命令から実行が再開される。このアドレスはユーザTSSの中で暗号化され署名されているので、偽造することは暗号学的に不可能である。プログラムカウンタを除くすべてのレジスタ呼出前の状態に戻されてしまうので、保護ドメインのコードは、サブルーチンexxの実行結果をパラメータ領域1204から取得する。
【0154】
保護ドメインの処理が完了して制御を非保護ドメインに移す時は、ejmp命令が使われる。ejmp命令はecallとは異なり、状態の保存は行なわない。もしecall,ejmp以外のjmp,call命令によって保護ドメインから非保護ドメインへと制御が移された場合、秘密保護違反の例外が発生して、暗号化されたコンテキスト情報がシステムのTSS領域(タスクレジスタが示す領域)に保存される。なお、このときコンテキスト情報は再開不可にマークされる。なお、保護ドメイン内のアドレスをejmp命令の飛び先として指定しても違反とはならない。
【0155】
以上が保護ドメインから非保護ドメインの呼び出し手順とそれに使用される新たに追加された命令である。
【0156】
アプリケーションによるユーザTSSの復帰の際に、特権を持つOSがユーザTSSをすりかえる攻撃の可能がないわけではない。しかし、そこで交換可能なTSS情報は、保護ドメインのコードの暗号化鍵が正しく管理されている限りは、必ずegateを通って実行を開始され、割り込みまたはユーザによる明示的な実行状態の保存によって保存されたコンテキスト情報だけである。このコンテキスト情報の入れ換えによって、アプリケーションの秘密が洩れる可能性は極めて小さく、かつ、攻撃者にとっては、どのようなコンテキスト情報の入れ替えを行なえばアプリケーションの秘密を取得できるかを予測するのは極めて困難である。
【0157】
上述した保護ドメインから非保護ドメインの呼び出し手順は、呼出先で最初に実行される命令が被呼出し側のegate命令ならば、保護ドメインの間で制御を移す手順に適用することも可能である。
【0158】
この時、両者の間のパラメータの受渡し領域を、予め両者の間で認証鍵交換を行なうことで共有した暗号化鍵によって暗号化しておけば、保護ドメインの間の呼出を安全に行なうことができる。
【0159】
<スレッド間の制御>
次に保護されたプログラムの実行と、その同一プログラムの制御下におけるスレッドとの関係、および、そこに生ずる問題と解決手段について説明する。
【0160】
上記では、暗号化された(保護された)プログラム内部での実行制御自体は、通常のプログラムと全く変わらないことを説明した。このことは、ユーザプログラムのレベルで、スレッドの切替を行なうユーザスレッドについても当てはまることであり、ユーザスレッドでは特にプログラムが保護されていることを意識する必要はない。問題は、カーネルレベルで実現されるスレッドが複数存在する時に、どのようにデータの保護情報を共有するかである。
【0161】
始めに、ユーザスレッドとカーネルスレッドについて簡単に説明する。ユーザスレッドとは、OSによる介入なしに、ユーザプログラムすなわちアプリケーション内部で仮想的に複数のスレッドを並列実行することである。それぞれのスレッドは、独立したスタックとプログラムカウンタ値を持つ。一方、カーネルスレッドは、スレッドの切替をOSに依存するスレッド実装である。機能的な相違としては、ユーザスレッドでは、あるスレッドが自発的にスレッド切替えをするコードを呼び出さない限り、スレッド切替えは発生しないが、カーネルスレッドでは、割り当てた実行時間を超過したスレッドの実行は強制的に停止される。詳細は前述した文献「UNIXカーネル」を参照されたい。
【0162】
内部機構的には、カーネルスレッドではコンテキスト情報がOSに処理され、スレッドの切替が行なわれる。一方、ユーザスレッドではアプリケーションがスレッド切替のコードを持ち、そこでレジスタのコンテキスト保存領域への保存が行なわれる。この動作を行なうのはアプリケーション自身なので、コードが保護されていても全く問題なくスレッド切替の動作が可能であり、かつそれぞれのスレッドはデータ保護状態も共有することができる。唯一注意すべき点は、スレッドコンテキストを保存する領域を暗号化していない場合、スレッドコンテキストをOSや他のアプリケーションに読みとられたり、改竄されるおそれがあることである。スレッドコンテキスト情報は暗号化された領域に保存して、他のプログラムによる読みとりや意図的な改竄を防止することが望ましい。
【0163】
カーネルスレッドにおいては、スレッドの切替えはOSによって行なわれる。例えばあるスレッド処理がタイマ割り込みによって中断されたとき、そのスレッドが割り当てられた処理時間を使い尽くしている場合には、OSのスケジューリング機能が他のスレッドを実行することで、リアルタイム処理における応答性も高められるなどの利点がある。また、複数のカーネルスレッドが動作する機能を備えないOSも、従来のUNIXなどのOSには存在するが、ほとんどすべてのUNIX実装が備える非同期的なシグナル配送機能は、コンテキスト切替の観点から、プロセスのメインのスレッドと独立に実行されるカーネルスレッドの一種と考えてよい。カーネルスレッドのサポートはほとんどのOSの実装に必要な機能である。
【0164】
ところが、保護されたコードに、現在のカーネルスレッドの実装を適用しようとすると問題が生じる。本発明のマイクロプロセッサでは、保存されたコンテキスト情報は暗号化により保護されており、安全性の観点から、その一部を読み出す手段は備えていない。したがって、従来の方法では、別々に起動されたカーネルスレッドがデータ保護状態を共有することはできない。カーネルスレッドはそれぞれが別々のTSSを持つが、コンテキスト情報を単純に別のTSS領域にコピーしたとしても、スタック領域も含めてすべて同一となってしまうため、それらは別々のスレッドとして独立に動作することはできなくなる。
【0165】
そこで、本発明では、本発明のプロセッサに、プログラムによる、ある特定の時点でのコンテキスト情報の保存命令と、以下の手順によってカーネルスレッド間のデータ保護情報とを共有させ、カーネルレベルのマルチスレッド機能を可能にしている。
【0166】
図14は、データ保護属性の共有に使われるスレッドテーブルを示す。スレッドIDは、そのカーネルスレッドのタスクレジスタの値である。スレッドID0は初期化のために特殊な役割を持つ。ユーザTSSは、そのスレッドが保護ドメイン外のサブルーチンを呼ぶ場合などに、状態を保存するためのユーザTSS領域へのポインタを格納する。パラメータは、OSからそれぞれのスレッドへのパラメータ渡しや、逆にスレッドから保護ドメイン外のサブルーチンを呼び出す際、パラメータの渡しに使われる。作業中フラグはテーブルおよびTSS0の書き替えの排他制御に使われる。
【0167】
図13は、同一プログラム下でのデータ保護属性共有の手順を示すフローチャートである。OSは保護ドメインを最初に実行するメインのスレッドの実行前に、図14に示すスレッドテーブルを初期化する。初期化はスレッドID0のユーザTSSフィールドに値0を書き込み、メインのスレッドTSS1のパラメータフィールドに、メインのスレッドの実行に必要なパラメータ、例えば引数などが格納されたパラメータブロックへのポインタを書き込むことによって行われる。
【0168】
ステップ1301で、カーネルスレッドは最初にegateを実行して保護ドメインのコードの実行を開始する。このとき、システムレジスタ以外のレジスタはすべて初期化される。次に、ステップ1302で、コード中に予め埋め込まれたスレッドテーブルのアドレスからスレッドテーブルを読みとり、初期化用のスレッドID0に対応するユーザTSSフィールドの値を見ることによって、そのユーザTSSフィールドで初期化が開始されているかどうかを判断する。ユーザTSSフィールドの値が0であれば、まだ初期化されていない状態である。この場合、スレッドテーブルが未初期化であると判断して(ステップ1302でNO)、ステップ1303に進む。
【0169】
ステップ1303で、スレッドID0の作業中フラグのフィールドに1を書き込み、初期化が開始されたことを示してから、データ暗号化属性を初期化する。データ暗号化属性の初期化は、実行される保護されたアプリケーションに依存する。ここではプログラムのロード時に確保されている固定アドレスの領域に、予めプログラムで決められた暗号化鍵を設定してもよいし、動的にメモリを確保して乱数による暗号化鍵を設定してもよい。データ暗号化属性の設定が完了すると、ステップ1304に進み、たとえばスレッド1(タスクレジスタがシステムTSS1を示している)の実行状態を、ユーザTSSを保存する命令であるstctx命令により、uTSS0の領域に保存する。stctx命令で保存されるTSSは、図8に示す825−2領域のUフラグが1にセットされたユーザTSSとなる。stctxの次の命令がuTSS0の再開時に最初に実行される命令となる。このユーザTSSの保存、復帰は、スレッドを識別するタスクレジスタにはいっさい影響しない(タスクレジスタは、割り込みによって中断されたスレッドに対応するシステムTSSが保存される場所を示す。)。
【0170】
次にステップ1308に進み、テーブルにセットしておいた作業中フラグをクリアし、同一プログラムにおける他のスレッド(たとえばスレッド2)の実行を再開させる。再開処理については、後述する。次にステップ1309で、ltr命令によってタスクレジスタを読み出し、スレッドIDを特定する。そして、ステップ1310で、スレッドテーブルのパラメータに指定された本来の処理を開始する。
【0171】
同一プログラムの下で、割り込みなどにより、他のスレッド2(タスクレジスタがシステムTTS2を示している)がこの保護ドメインのコードを実行する場合も、スレッドテーブルを初期化して、egate命令を実行するまでは同じである。2番目以降のスレッドは、すでに最初のスレッドによって初期化が行われているので、テーブルのスレッドID0に対応するユーザTSSが1にセットされている。したがって、ステップ1302で初期化済みと判断される(1302でYES)。ステップ1305で、スレッドテーブルが作業中にマークされているかどうかを判断する。作業中であれば(1305でYES)、スレッド2は休眠して(ステップ1306)、ステップ1305を繰り返し、テーブルに対する作業の完了により実行が再開されるのを待つ。
【0172】
ステップ1305でテーブルが作業中でなければ(1305でNO)、スレッドID0に対応するユーザTSS0を復帰し、uTSS0の保存直後の状態(ステップ1508)に制御が移る。このとき、uTSS0に保存されたデータ保護状態が復帰される。しかし、このままでは、これからスレッド1を実行するのかスレッド2を実行するのか区別がつかない。そこで、ステップ1309でタスクレジスタを読み出し、自分のスレッドのスレッドIDを特定して、パラメータを読み出し、ステップ1310で、必要な処理(例えばシグナルハンドラ)の実行を行なう。uTSSの復帰ではタスクレジスタは更新されないので、スレッドは自己のスレッドIDを正しく取得できる。
【0173】
一度実行を開始してデータ保護属性を共有したスレッドが、データ暗号化属性を変更する場合には、TSS1のスレッドを例にとれば、スレッドID TSS1に対応するテーブルのパラメータフィールドに必要な情報が含まれたパラメータブロックを書き込み、uTSS1をユーザTSSとして指定して上述のecall命令を発行してからステップ1503へ制御を移す。TSS1の作業中フィールドに作業中フラグを書き込み、他のスレッドに対して休眠を要求し、他のスレッドが休眠状態になるとデータ暗号化属性の変更を開始し、データ暗号化属性の更新が完了すると、uTSS1へと制御を戻す。
【0174】
(第2実施形態)
第1実施形態では、データの暗号化鍵などのデータ暗号化属性を全てマイクロプロセッサ内部のレジスタファイル253に格納していた。この方法では、暗号化属性の種類が保護属性レジスタの数を越えて増えると、保護属性レジスタの入れ替えを余儀なくされ、プログラミングが繁雑になるとともに処理性能の低下につながる。一方、保護属性レジスタの数を増やすとコンテキスト切替の際にメモリに保存するデータの量が増え、やはり処理性能が低下してしまう。プロセス間通信の暗号化を、マイクロプロセッサの暗号化機能によって行う応用を考えれば、通信相手のプロセス毎に別の暗号化鍵を使うのが普通なので、暗号化属性の種類が多くなることは容易に想像できるので、それに対する対策が必要となる。
【0175】
このような場合、一般に情報を直接マイクロプロセッサ内のレジスタに保持するのではなく、外部のメモリ(たとえばメインメモリ281)上のテーブルに書き込んでおき、必要な部分だけを動的にプロセッサ内部に読み込む手法が知られている。しかし、秘密を守るという観点からは、この方法は危険である。なぜなら、メモリ上のテーブルが攻撃者によって別のデータ(たとえば解読可能な鍵)が格納されたテーブルにすりかえられてしまうおそれがあるからである。
【0176】
そこで、本発明の第2実施形態では、秘密保護に必要な情報の中で、動的に読み込まれる部分ごとに、あらかじめマイクロプロセッサによる署名を付加しておく。そして、この部分が外部のメモリテーブルからマイクロプロセッサ内部に読み込まれる時に、署名を検証する。この方式により、毎回のコンテキスト切替の際のオーバヘッドを減少させると同時に、すり替えに対する安全性を保証している。
【0177】
図15は、本発明の第2実施形態にかかるマイクロプロセッサのレジスタファイル253の構成を示す。第2実施形態のマイクロプロセッサは、内部レジスタに、各プログラムから参照されるデータのための暗号化属性をあらかじめ格納する4個の暗号化属性レジスタCY0〜CY3と、暗号化属性を特定するための情報を格納する60ワードのCT0〜CT59を有する。CY0〜CY3は、それぞれが10ワード、CT0〜CT59は、それぞれ4ワードの大きさを持つ。
【0178】
CY0〜CY3はレジスタに暗号鍵フィールドを持っているが、CT0〜CT59は暗号化鍵フィールドを持たず、代わりに鍵へのオフセットアドレスを持っている。CT59のオフセットアドレスは1521−4で示されている。オフセットは鍵格納領域の先頭からアドレスを示し、鍵格納領域の先頭は暗号化属性レジスタCY0で定義される。
【0179】
暗号化属性情報特定レジスタCT59の開始アドレス1521−1は暗号化対象領域の先頭を指定し、サイズ1521−5はその長さを指定する。キーオフセット1521−6は、CY0で指定された鍵格納領域の先頭からの鍵へのオフセットを示し、そのアドレスは鍵の値とハッシュからなる鍵エントリが格納される。Eフラグ1521−4は、そのレジスタが有効かどうかを示し、Dフラグ1521−3はデバッグ状態かどうかを示している。暗号化アルゴリズムと鍵の長さを指定するフィールドはそれぞれ1021−2、1021−7である。このレジスタはSalt1021−8を有する。Saltについては、後述する。
【0180】
図16は、マイクロプロセッサ内部のCY0レジスタおよび暗号化属性情報特定レジスタCT0と、これらのレジスタで定義される外部メモリ上の鍵格納領域の関係を示した図である。暗号化属性レジスタCY0によって定義されるメモリ上の鍵格納領域1601には、各キーエントリ(鍵エントリ)1602、1603、…がある。各キーエントリは、鍵の値を示すフィールド1202−1、1203−1と、この鍵値およびその他の情報についての書名1202−2、1203−2を有する。
【0181】
暗号化属性レジスタCY0〜CY3の初期化時には、暗号化属性情報特定レジスタCT0〜CT59の全てのレジスタの有効フィールド1521−4(図15)がクリアされ、これらのレジスタで指定された暗号化機能が無効となっている。一方、CY0〜CY3は有効で、論理アドレス空間のすべてを、初期化時に選択した乱数で暗号化するよう設定されている。
【0182】
CT0〜CT59の暗号化機能を使う場合は、まず論理アドレス上の鍵の格納領域とその領域のためのマスターキーを選択し、それをCY0に設定して、CY0レジスタの暗号化機能を有効とする。マスターキーはマイクロプロセッサの例外処理部131の乱数生成機構252によって生成されたものでも、予めプログラムに埋め込まれた固定鍵でもよい。
【0183】
次に、外部メモリ上の鍵格納領域1601において、レジスタCT0で使う鍵の格納場所(鍵エントリ)1603を、暗号化属性レジスタCY0に設定したアドレス領域の中で決定して、CT0レジスタのオフセットフィールド1580−6(図15)に書き込む。また、暗号化アルゴリズムと鍵の長さを選択して1580−2,1580−7に書き込む。
【0184】
そして、鍵の値を選択して、鍵値のフィールド1603−1に書き込む。必要に応じてSalt1521−8に乱数を書き込んでから、有効ビットE1521−4を1に設定する。
【0185】
マイクロプロセッサは、保護テーブル管理ユニット233(図2参照)を有する。保護テーブル管理ユニット233は、予め定められたアルゴリズムによって、定められた署名の計算対象について、マイクロプロセッサの秘密鍵Ksに基づく署名を計算する。署名した値を、鍵の値(キーバリュー)に続く署名領域1603−2に書き込む。このとき、保護テーブル管理ユニット233は、鍵と署名の格納領域1603がCY0の範囲に入っているかどうか、およびCY0の暗号化機能は有効かどうかを確認する。鍵領域1603がCY0の範囲外である場合、あるいはCY0の暗号化鍵が0に設定されていて暗号化機能が有効でない場合には、後述するように、マイクロプロセッサの例外処理ユニット255が秘密鍵保護例外を発生させる。CT0〜CT59の安全性はCY0の安全性に依存するので、CY0の暗号化鍵は単に乱数を選ぶだけでなく、使用する暗号化アルゴリズムについて安全なことを確認することが望ましい。
【0186】
署名の計算対象には、暗号化鍵の値1603−1、CT0レジスタ1580の内容、および暗号化鍵の論理アドレスが含まれる。CT0レジスタ1580にはSaltが含まれているので、適切な頻度でSaltの値を変更すれば、攻撃者が過去に使われた暗号化された鍵エントリを再利用して、鍵エントリをすりかえることは、たとえCY0のその他のフィールドの値が同一であったとしてもきわめて困難である。もちろん、全く属性値の異なる鍵エントリを利用した場合の、鍵エントリのすり替えは暗号学的に不可能である。
【0187】
データの読み込みの際には、論理アドレスと、暗号化属性レジスタCY0〜CY3および暗号化属性情報特定レジスタCT0〜CT59を比較し、暗号化属性を決定する。読み込み対象の論理アドレスがCT0で指定された領域ならば、オフセットの示す暗号化鍵を鍵キャッシュに読み込む。コード暗号化鍵・署名検証ユニット257は、読み込まれた鍵の値と、CT0の内容と、鍵のアドレスとから、マイクロプロセッサの公開鍵Kpによって署名を検証する。検証の結果がエラーであれば、秘密保護例外を発生して処理を停止する。検証の結果が正しければ、データTLB141の復号化ユニット237において、取り出された鍵でデータを復号化し、復号化されたデータがデータキャッシュ218に読み込まれる。
【0188】
<再開不能ビット>
検証に失敗して秘密保護例外が発生した場合、コンテキストの再開可能ビットが0にクリアされて、以後そのコンテキストの再開は不可能となる。このような違反が発生するのは、何らかの攻撃者によって、秘密保護のためのデータが破壊されている可能性が高いため、これに続く実行を禁止して、秘密情報の流出を防いでいる。
【0189】
なお、ここでは暗号化属性レジスタCY0〜CY2に、暗号化対象領域の論理アドレスの先頭とサイズを設定する場合を例にとったが、この他にもページテーブルや、セグメントディスクリプタのようなテーブル形式を利用したメモリ暗号化属性の管理方式が考えられる。これらの方式にも本発明が適用されることは言うまでもない。
【0190】
第2実施形態においては、データの暗号化属性の決定には必要のない、サイズの大きな鍵情報をプロセッサ外部のテーブルに格納して、プロセッサ内部のコンテキスト情報のサイズを低減すると同時に、外部のテーブルに格納される鍵情報の一つ一つにハッシュを付加し、読み込み時に検証することで、プロセッサ外部に格納される情報のすりかえによる攻撃を防止している。
【0191】
ここで、署名は、マイクロプロセッサの暗号化属性情報特定レジスタの値を含むデータから生成されているため、暗号化属性情報特定レジスタが有するSaltの値を変えることにより、過去にプロセッサ外部のメモリに書き込んだ鍵エントリを無効化して、過去に使われた鍵エントリの流用を防止することができる。このような署名方法を使用せずに、たとえば、アドレス範囲属性と鍵の値だけから署名を生成するならば、アドレス範囲さえ一致すれば過去に使われた鍵エントリを外部のメモリ上ですりかえる攻撃が可能となってしまう。その一方で、もし署名生成の対象に汎用レジスタが含まれていれば、汎用レジスタの値が変わる都度、署名を生成しなおさなければならなず、性能の低下を招く。
【0192】
本発明では、暗号化属性情報特定レジスタの属性値と、Salt値さえ書き換えなければ、署名を再計算する必要はない。実際の使用では、暗号化属性情報特定レジスタの設定頻度はそれほど高くないと考えられるので、性能の低下を押さえつつ、鍵の値のすりかえを防止することができる。
【0193】
第2実施形態にかかるマイクロプロセッサにおいては、すべての暗号化属性をマイクロプロセッサのレジスタ上に格納する場合と比較して、コンテキスト情報が著しく小さくなり、コンテキスト切替の際の暗号化や署名に必要な計算量や、コンテキストを保存するためのメモリトラフィックを減少させて、プロセッサの性能を向上させることができるのである。
【0194】
署名をメモリ側でなく、レジスタの側においても同様にすり替えを防ぐことができるが、一般に非対称鍵方式を使った安全な署名には、大きなデータ長を必要とするので、レジスタの側にSalt値を置き、メモリ上に署名を置く方がコンテキスト情報を小さくする効果が大きい。
【0195】
本発明では、暗号化エントリを有効にする際に、対応するメモリ上の鍵格納領域1601が暗号化されていること(すなわちエントリに有効な鍵があること)を検証するので、暗号化鍵の保護をさらに確実にしている。
【0196】
<ページテーブル形式>
また、データ保護のテーブル形式を、仮想記憶の管理に使われるページテーブルと同様のアドレス単位ごとに階層化された形式とし、各々のエントリ毎に署名を付加したものにすることも可能である。ページテーブル形式は理論的にはページ毎に異なる暗号化属性を与えることができる。さらに、マイクロプロセッサ内部に保持するデータは、ページテーブルの先頭アドレスとSaltだけでよく、コンテキスト情報の量を小さくすることができるという効果がある。
【0197】
混乱を避けるため以下、マイクロプロセッサ内部でデータ暗号化に使われるテーブルを、暗号化定義ページテーブルと呼ぶことにする。暗号化定義ページテーブルは、外部メモリの仮想記憶ページテーブルとは異なり、ユーザプログラムの論理メモリ空間上に置かれる。
【0198】
また、暗号化定義ページテーブルの各エントリに付与する署名が、単純にプロセッサの暗号化定義ページテーブルレジスタ情報およびエントリに含まれる情報だけから生成される場合、任意のエントリが署名を含んだ状態で交換されたとしても、それを検出することはできない。プロセッサ側に置かれる情報、すなわち暗号化定義ページテーブルレジスタとそれに含まれるSaltが全てのエントリについて共通となってしまうからである。この問題は、暗号化定義ページテーブルの各エントリの署名の計算領域に、エントリが置かれる論理アドレスを含めることによって(すなわち、エントリごとに異なる値が署名に含まれるようにすることによって)、解決される。
【0199】
なお、ページテーブルの初期化は、あらかじめキーバリュー(鍵値)などの属性をメモリのテーブルに書き込んでおき、そのアドレスをマイクロプロセッサ内部の暗号化定義ページテーブルレジスタに設定し、Saltの値を同じレジスタに書き込んでこのレジスタの有効フラグをセットする。有効フラグのセットにより、ページテーブルの各エントリに対する署名がマイクロプロセッサにより計算され、外部メモリ上に書き込まれる。階層化されている場合は階層を順次探索して計算が行なわれる。この処理は、エントリ数に比例した時間を要することに留意しなければならない。
【0200】
<デバッグについて>
実行コードと、その処理対象であるデータの双方が保護されるとしても、そのような機能の開発途上のデバッグ作業では、暗号化することなく平文でデバッグできることが開発効率上望ましい。
【0201】
デバッグに関する設定は2箇所で行う。ひとつは、暗号化コードのページテーブルエントリに設けられた実行コードのデバッグビット307−j−D(図4参照)であり、もうひとつは、図15に示すように、データの暗号化鍵属性を指定するレジスタに設けられた暗号化制御ビット(CY3においては1517−3、CT59においては1521−3)である。後者の第1実施形態における対応ビットは、図7に示す暗号化属性レジスタCY3のビット717−3である。
【0202】
ページテーブルエントリに設けられたデバッグビット307−j−Dがセットされている時、マイクロプロセッサの実行コード復号化ユニット212(図2参照)は迂回され、エントリに対応するメモリ上におかれた実行コードは、平文状態のまま解釈され、実行される。デバッグ状態でコードを実行している間は、プロセッサのデバッグ機能、たとえば第1実施形態と関連して述べたステップ実行機能やデバッグレジスタが有効化される。
【0203】
ここで、ページテーブルのデバッグビットは何ら保護を受けていないが、悪意のあるユーザが、暗号化された実行プログラムのおかれているページテーブルエントリのデバッグビットをセットしたとしても、暗号化された実行プログラムが復号化されずに命令フェッチ/デコード機能214に取り込まれるだけで、正常実行はできないので、プログラムの秘密が洩れるおそれはない。
【0204】
デバッグ実行中は、例外発生時のコンテキスト保存も平文のまま行われる。したがって、コンテキストを暗号化する乱数Krをコード暗号化鍵Kcodeで暗号化した値EKcode[Kr]833は、平文のKrにおきかえられる。この場合コンテキスト情報がコードの暗号鍵と一致するかどうかのチェックを行うことはできないが、デバッグの場合にはこのような攻撃の危険を考慮する必要がない。
【0205】
実行コードの演算処理対象であるデータの暗号化は、第1実施形態においては図7に示す暗号化制御ビット713−3によって、第2実施形態においては図15に示すCY3の暗号化制御ビット1517−3、およびCT59の暗号化制御ビット1521−3によって制御される。暗号化制御ビットが0の時は、デバッグ状態でもデータは暗号化状態で処理される。暗号化制御ビットが1にセットされている時は、デバッグ状態の場合に限りデータは平文のまま処理される。
【0206】
本発明ではデータについて、デバッグ状態で暗号化属性のエントリごとに、暗号化と非暗号化を選択できるようにすることで、別のプログラムやデバイスとの間で行われる暗号化されたデータ送受信のデバッグと、プログラムの内部的なデータの平文状態でのデバッグとを、容易に両立させている。
【0207】
特にコードについてはコードを暗号化せず平文として、ページテーブル上のデバッグフラグをセットするだけで、プログラム自体を再コンパイルすることなくデバッグが行なえる利便性を提供している。
【0208】
処理対象データについては、他のプロセスとの通信に使われる領域は、自プロセスはデバッグモードだったとしても、相手のプロセスがデバッグ状態でない限り平文にしておくことはできない場合がある。そこでコードがデバッグモードで動作している場合のみ有効になる暗号化フラグをデータの暗号化属性に設け、このフラグによって暗号化状態を制御できるようにしている。
【0209】
コードのデバッグには、コード自体の暗号状態と、コードを暗号化する鍵の暗号化状態とで、4通りの組み合わせが考えられる。上述した例は、コード暗号鍵もコードも平文の場合の組み合わせ例である。
【0210】
他のモード(組み合わせ)も考えられる。第1が、コード暗号化鍵エントリもコード自体も暗号化された状態で、デバッグモードでコードを実行できるモードである。第2が、コード暗号化鍵エントリは平文の状態で、コード自体は暗号化された状態で、デバッグモードでコードを実行できるモードである。第3が、コード暗号化鍵エントリは暗号化状態、コードは平文状態の場合である。
【0211】
デバッグの目的からはこれらのモードにはあまり意味を持つものではないが、必要に応じてこれらのモードを備えてもよい。
【0212】
この際に注意しなければならないのは、第1のケースで、暗号化されたコード暗号化鍵エントリに対応する暗号化された実行コードをデバッグモードで実行可能とする場合は、ユーザが暗号化制御のためのビットを操作するだけで、暗号化鍵を知らない保護されたプログラムを、デバッグモードで実行することができてしまう。
【0213】
この場合には、デバッグモードビットを不正に操作されないように、デバッグビットをコード暗号化鍵Kcodeとともに、プロセッサの公開鍵Kpで暗号化するなどの対策を施して、真のコード暗号化鍵を知らないユーザにデバッグビットを操作されないように注意しなければならない。
【0214】
【発明の効果】
以上説明したように、本発明のマイクロプロセッサによれば、マルチタスク環境下で、実行コードと、そのコードの処理対象であるデータの双方を暗号化して保護することにより、オペレーションシステム、あるいは第三者による不正な解析を防止することができる。
【0215】
また、データを暗号化して保存した場合の、暗号化属性の不正な書き換えを防止することが可能になる。
【0216】
また、処理対象であるデータの暗号化鍵として、固定鍵ではなく任意の乱数Krを使用することができ、暗号化されたデータを不正な攻撃から守ることができる。
【0217】
また、平文状態でデバッグを行い、不具合が発見された場合は、実行コードの暗号化鍵を知っているプログラムベンダにエラーをフィードバッグさせることができる。
【0218】
さらに、暗号化属性情報など、秘密保護に必要な情報にマイクロプロセッサの署名をつけて外部のメモリ上に保存し、必要な部分だけをプロセッサ内部のレジスタに読み込み、読み込み時に署名の検証を行うことで、マイクロプロセッサのメモリの増大を防止し、コストを押さえることができる。この方式では、読み込み時のすり替えに対する安全性も保障される。
【図面の簡単な説明】
【図1】本発明の第1実施形態にかかるマイクロプロセッサの基本構成を示す図である。
【図2】図1のマイクロプロセッサの詳細な構成を示す図である。
【図3】図1のマイクロプロセッサにおけるページディレクトリと、ページテーブル形式を示す図である。
【図4】図3に示したページテーブルの詳細と、鍵エントリ形式を示す図である。
【図5】図1のマイクロプロセッサにおけるデータのインタリーブを示す図である。
【図6】第1実施形態における実行命令コードのアドレス変換から復号化までの情報の流れを示す図である。
【図7】第1実施形態にかかるマイクロプロセッサのCPUレジスタの構成を示す図である。
【図8】第1実施形態におけるコンテキスト保存形式を示す図である。
【図9】第1実施形態における保護ドメイン切り替えの手順を示すフローチャートである。
【図10】第1実施形態における、処理対象であるデータの暗号・復号化の情報の流れを示す図である。
【図11】本発明のマイクロプロセッサにおける保護ドメイン内の実行制御を示す図である。
【図12】本発明のマイクロプロセッサにおける保護ドメインから非保護ドメインへの呼び出し、分岐を示す図である。
【図13】本発明のマイクロプロセッサにおけるデータ暗号化属性共有の手順を示すフローチャートである。
【図14】データ保護属性の共有に使用されるスレッドテーブルの図である。
【図15】本発明の第2実施形態にかかるマイクロプロセッサのCPUレジスタ構成を示す図である。
【図16】第2実施形態にかかるマイクロプロセッサにおける鍵格納領域レジスタおよび暗号化属性情報特定レジスタと、それぞれ対応するメモリ上の鍵格納領域の関係を示す図である。
【図17】第2実施形態にかかるマイクロプロセッサにおけるコンテキスト保存形式を示す図である。
【図18】従来技術におけるコンテキスト保存形式を示す図である。
【符号の説明】
101 マイクロプロセッサ
111 プロセッサコア
112 バスインターフェイスユニット(読み出し手段)
113 コード・データ暗号化/複号化処理部
114 1次キャッシュ
115 命令実行部
121 命令TLB
131 例外処理部
141 データTLB
151 2次キャッシュ
212 コード復号化ユニット
219 データ復号化ユニット
220 データ暗号化ユニット
233 保護テーブル管理部
252 乱数発生機構
253 レジスタファイル(プロセッサ外部の記憶手段)
254 コンテキスト情報暗号/複号化ユニット
257 コード暗号化鍵・署名検証ユニット
281 メインメモリ(プロセッサ外部の記憶手段))
307、512 ページテーブル
309、511 キーテーブル
CY0〜CY3 暗号化属性レジスタ
CT0〜CT59 暗号化属性情報特定レジスタ
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a microprocessor capable of preventing unauthorized modification of execution code and data to be processed under a multitask program execution environment, a multitask execution method using the microprocessor, and a multired execution method.
[0002]
[Prior art]
In recent years, the performance of microprocessors has been remarkably improved, and it has become possible to reproduce and edit moving images and voices in addition to conventional calculations and graphics. As a result, users can enjoy a variety of moving images and sounds in a system for end users (hereinafter referred to as a PC) using a microprocessor. Using a PC as a video and audio playback device is not limited to the fact that it can be used for games and other applications in combination with the computational capabilities of the PC, so no fixed hardware is required. There is also an advantage that a user can enjoy the reproduction of moving images and sounds at low cost.
[0003]
However, when the image / sound is handled on the PC, the copyright protection of the image / sound is a problem. In MD and digital video decks, unlimited copying has been prevented by incorporating a mechanism for preventing unauthorized copying into these devices. In that case, it was very rare to make illegal copies by remodeling the device, and it was assumed that even if there was a remodeled device, it could be sufficiently prevented from being widely distributed. In fact, the manufacture and sale of devices for the purpose of unauthorized copying are in the direction of being prohibited by law worldwide, and the damage caused by unauthorized copying is not a problem that greatly threatens the profits of copyright holders.
[0004]
However, it is software that handles data when playing back images and music on a PC. In the PC, the end user can freely modify the software. In the case of software, if there is a certain amount of knowledge, it can be imagined that by analyzing the program, it is possible to modify the software and make illegal copies. Even more problematic is that the software that is made and illegally copied is more likely to spread through media such as networks than hardware.
[0005]
In order to solve this problem, PC software used to play commercial movies and music where copyright is an issue uses technology that prevents the software from being decrypted or tampered with by means such as encrypting the software. ing. This technology is called tamper resistant software technology (David Aucsmith et.al; “Tamper Resistant Software: An Implementation”, Proceeding of the 1996 Intel Software Developer's Conference).
[0006]
In addition, not only moving images and audio, but also tamper-resistant software can be used to illegally copy copyrighted work or know-how that is provided to users through a PC, or to protect the know-how contained in the PC software itself from analysis Technology is effective.
[0007]
However, the tamper-resistant software technology encrypts the part of the program that needs protection at the start of execution, decrypts it before executing it, and encrypts it again after execution. This is a technique that makes analysis with an analysis tool difficult. Therefore, as long as the program can be executed by the processor, it is always possible to analyze the program by analyzing it from the start of the program.
[0008]
This is a hindrance when the copyright holder provides a copyrighted work to a system for reproducing moving images and sounds using a PC.
[0009]
In addition, other tamper-resistant software applications have the same weaknesses, which hinders the application of advanced information services through PCs and programs that include corporate and personal know-how to PCs.
[0010]
The above is a problem that applies to software protection in general, but in addition to this, an operation system (hereinafter abbreviated as “OS” where appropriate) is supposed to be the software foundation of the system for a PC that is an open platform. There is also a problem that is modified as a means of attack. A technically malicious user can modify the OS of his / her own PC and use the privileges of the OS to invalidate the copyright protection mechanism embedded in the application program. This is because the mechanism can be analyzed.
[0011]
A modern OS uses an execution control function provided in a CPU and a privileged operation function for a memory to manage and arbitrate use of resources under the control of a computer. As management targets, network, application level QoS (Quality of Service), and the like have been added in addition to conventional devices, CPUs, and memory resources. However, the basics of resource management are allotment of resources necessary for program execution. That is, the allocation of CPU time for the execution of the program and the allocation of the memory space necessary for the execution are the basis of resource management. Other devices, networks, and application QoS are controlled by controlling the execution of programs that access these resources (by assigning CPU time and memory).
[0012]
The OS has a privilege to perform CPU time allocation and memory allocation. That is, a privilege to stop and restart an application program at an arbitrary point of time for allocating CPU time, and a privilege to move the contents of the memory space allocated to the application at an arbitrary point of time to a memory of a different hierarchy. The latter privilege is also used to hide a (usually) layered memory system with different access speeds and capacities from the application and provide a flat memory space for the application.
[0013]
By having these two privileges, the OS can stop the execution state of the application at any time, take a snapshot, and restart it by copying or rewriting it. This function can also be used as a tool for analyzing secrets of applications.
[0014]
Several techniques for encrypting programs and data to prevent analysis of applications on computers are already known (US Patent No. 4,47,902 by Hampson, US Patent No. 5,224,166 by Hartman, US Patent by Davis) No. 5,806,706, US Pat. No. 5,825,878 by Takahasi, US Pat. No. 6,003,117 by Leonard et.al, JP-A-11-282756, etc.). However, these techniques do not consider protecting the operation of the program and the secret of data from the privileged operation of the operation system as described above.
[0015]
Prior art based on Intel's x86 architecture (Hartman US Pat. No. 5,224,166, “System for seamless processing of encrypted and non-encrypted data and instructions”, hereinafter referred to as “prior art 1”) includes executable code and data. Is encrypted with a predetermined encryption key Kx and stored in a memory. Kx is encrypted with the public key Kp corresponding to the secret key Ks embedded in the processor, and ExKr[Kx] Is given. Therefore, only the processor that knows Ks can decrypt the encrypted execution code in the memory. The encryption key Kx is stored in a register inside the processor called a segment register.
[0016]
With this mechanism, it is possible to protect the secret of the code from the user to some extent by surely encrypting the program code. Further, it is cryptographically difficult for a person who does not know the code encryption key Kx to modify the code as intended, or to create a new code that can be decrypted and executed with the encryption key Kx. Become.
[0017]
[Problems to be solved by the invention]
However, a system to which this technology is applied has a drawback that it is possible to analyze a program by using the privilege of the OS called context switching without decrypting the execution code.
[0018]
Specifically, when execution of a program is interrupted by an interrupt, or when a program voluntarily calls a software interrupt instruction for calling a system call, the OS performs context switching processing for executing another program. I do. Context switching is to save the program execution state (hereinafter referred to as context information) consisting of a set of register values at that time in memory, and to restore the context information of another program previously stored in memory to the register. Operation. A conventional context saving format in the x86 processor is shown in FIG. This includes all register contents used by the application. The interrupted program context information is restored to the original register when the program is resumed. Context switching is an indispensable function for running multiple programs in parallel. In the conventional technology, since the OS can read the register value at the time of context switching, based on how the execution state of the program has changed, not all of the operations performed by the program are performed. Most parts can be estimated.
[0019]
Further, if the timing for generating an exception is controlled by setting a timer or the like, this processing can be performed at an arbitrary execution point of the program. In addition to interrupting and analyzing the execution, it is possible to maliciously rewrite register information. Rewriting of registers not only can change the operation of the program, but also facilitates analysis of the program. Since the OS can save an arbitrary state of the application, it is possible to analyze the operation of the program by repeatedly rewriting the register value and operating the program from the state saved at a certain time. In addition to the above functions, the processor has a debugging support mechanism such as step execution, and there is a disadvantage that the OS can use all these functions to analyze the application.
[0020]
In the prior art 1, regarding data, the program can access the encrypted data only by executing the program through the encrypted code segment. At this time, even if there are programs encrypted with different encryption keys, the encrypted data can be stored using any key regardless of what encryption key the program is encrypted with. There is a problem that it can be read freely from an encrypted program. In the prior art shown here, the OS and the application have a secret independently, and it is not considered that the secret of the application is protected from the OS, and that a plurality of program suppliers have the secret.
[0021]
Of course, it is possible for an existing processor to isolate a memory space between applications or prohibit access to the system memory by an application by a protection function provided in the virtual storage mechanism. However, as long as the virtual storage mechanism is under the management of the OS, it is not possible to depend on the functions under the management of the OS to protect the secret of the application. This is because the OS can access the data ignoring the protection mechanism, and the privilege is indispensable in providing the virtual storage function as described above.
[0022]
As another prior art, Japanese Patent Laid-Open No. 11-282756 (hereinafter referred to as Prior Art 2) discloses a technique of a secret memory provided in a CPU for storing secret information possessed by an application. In this example, a predetermined reference value is required to access data in the secret memory. However, this known technique does not disclose how to protect the reference value for obtaining the access right of the secret data from a plurality of programs operating on the same CPU, particularly the OS.
[0023]
Furthermore, US Pat. No. 5,123,045 (Ostorovsky et.al, hereinafter referred to as Prior Art 3) assumes a subprocessor having a secret key unique to the application, and programs that are stored in the main memory. A system is disclosed in which the operation of a program is not estimated from the access pattern when accessing. The mechanism is that the instruction system for operating the memory is converted into a different instruction system and random memory access is performed.
[0024]
However, this technology requires different sub-processors for each application, which increases the cost. Implementation of compilers and processor hardware that process such instruction systems, and speed-up technology are different from those of current processors. It is quite different and is expected to be very difficult. Above all, with such a processor, it is extremely difficult to grasp the correspondence between the contents of the data and the operation even if the operation and data of the code that actually operates are observed and tracked. Compared with the prior arts 1 and 2 that have not been encrypted, there are many problems in practical use in that it is very difficult to debug a program.
[0025]
Therefore, in order to solve these problems, the first object of the present invention is to provide both an internal execution algorithm and a data state in the memory area even when execution is interrupted by an interrupt in a multitasking environment. Is to provide a microprocessor that can reliably protect against unauthorized analysis. This object is based on the problem that the value of the program code can be protected by the prior art, but the analysis using the occurrence of exception or interruption of the program execution by the debug function cannot be prevented. Accordingly, it is an object of the present invention to provide a microprocessor that can reliably protect code even when program execution is interrupted, and that the protection is compatible with both an execution control function and a memory management function required by a modern OS. To do.
[0026]
A second object of the present invention is to provide a microprocessor that secures a data area in which each program can be read and written correctly independently of each other even when a plurality of programs encrypted with different encryption keys are executed. It is in. In particular, US Pat. No. 5,224,166 by Hartman (Prior Art 1) provides only simple protection that prohibits access to an encrypted data area by an unencrypted code. The programs could not protect the secrets independently. In view of this problem, when a plurality of applications have secrets (encrypted), a second object is to provide a microprocessor having a data area for protecting each secret from the OS.
[0027]
A third object of the present invention is to provide a microprocessor capable of protecting the protection attribute (that is, the encryption attribute) of the data area reserved for the second object from unauthorized rewriting by the OS. The prior art 1 has a drawback in that the OS can interrupt the execution of the program by using context switching and rewrite the encryption attribute set in the segment register immediately before the program writes data in the memory. It was. If the data is written in plain text by rewriting the encryption attribute, the data is written to the memory without being encrypted. Even if the application checks the segment register value at a certain timing, it is the same if the register value is rewritten thereafter. Therefore, a third object is to provide a microprocessor having a mechanism capable of prohibiting or detecting such modification and taking countermeasures.
[0028]
A fourth object of the present invention is to provide a microprocessor that allows a program to use an arbitrary value as a data encryption key and protects the encryption attribute from so-called “selected plaintext attack” in cryptographic analysis theory. It is in.
[0029]
The fifth object of the present invention is to provide a microprocessor having a mechanism for program debugging and feedback. That is, it is intended to cause the microprocessor to debug the program in plain text, and to feed back the defect information to the program code provider (program vendor) when the execution fails.
[0030]
A sixth object of the present invention is to provide a microprocessor capable of realizing the above first to fifth objects at low cost and high performance.
[0031]
[Means for Solving the Problems]
As a first feature of the present invention, in order to achieve the first object, a microprocessor configured as one chip or one package uses different code ciphers for each program via a bus interface unit as a reading means. A plurality of programs encrypted with the encryption key are read from storage means (for example, main memory) outside the microprocessor. The decryption means of the microprocessor decrypts the read plural programs with the corresponding decryption keys, and the instruction execution unit executes the decrypted plural programs. When the execution of a certain program is interrupted among the plurality of programs, the context information encryption / decryption unit as the execution state writing means includes information indicating the previous execution state of the interrupted program, and this program The code encryption key is encrypted with an encryption key unique to the microprocessor, and the encrypted information is written as context information in storage means outside the microprocessor. When resuming an interrupted program, the verification unit as the resuming means decrypts the encrypted context information with a unique decryption key corresponding to the encryption key unique to the microprocessor and decrypts it. The execution of the program is resumed only when the code encryption key included in the context information (that is, the code encryption key of the program to be resumed) matches the original code encryption key of the suspended program.
[0032]
In order to achieve the second and third objects, the microprocessor sets a storage area (for example, a register) in the processor that cannot be read to the outside, and an encryption attribute for data to be processed by the program. And encryption attribute writing means (for example, instruction TLB) for writing to the internal storage means. The encryption attribute is, for example, a program code encryption key and an address range to be encrypted. At least a part of such encrypted attributes is included in the context information.
[0033]
The context information encryption / decryption unit also provides the context information with a signature based on confidential information unique to the microprocessor. In this case, the verification unit determines whether or not the signature included in the decrypted context information matches the original signature based on the confidential information unique to the microprocessor, and the program that has been suspended only when it matches. Resume.
[0034]
As described above, the execution state up to that point by the encryption program is saved in the external memory as context information, and the protection attribute of the data to be executed is stored in a register inside the processor. Unauthorized modification is prevented.
[0035]
As a second feature of the present invention, in order to achieve the fourth object, a microprocessor configured as one chip or one package holds a unique secret key that cannot be read outside. The bus interface unit serving as a reading unit reads a code encryption key encrypted in advance with a public key unique to the microprocessor corresponding to the secret key from a storage unit outside the microprocessor. The key decryption unit as the first decryption means decrypts the read code encryption key using the secret key of the microprocessor. The bus interface unit also reads a plurality of programs, each encrypted with a different code encryption key, from an external storage means. The code decoding unit as the second decoding means decodes the plurality of read programs. The instruction execution unit executes a plurality of decrypted programs. When the execution of a certain program among the plurality of programs is interrupted, the random number generation mechanism generates a random number as a temporary key. The context information encryption / decryption unit encrypts the first value obtained by encrypting the information indicating the execution state of the interrupted program with the generated random number and the code encryption key of the program that interrupts the random number. The second value and the third value obtained by encrypting the random number with the secret key of the microprocessor are written in the external storage means as context information.
[0036]
When resuming the execution of the program, the context information encryption / decryption unit reads the context information from the external storage means, and decrypts the random number of the third value included in the context information using the secret key. The execution state information included in the context information is decoded using the decoded random number. At the same time, the second value random number included in the context information is decrypted using the code encryption key of the program to be resumed. The random number obtained by decrypting the second value with the code encryption key is compared with the temporary key obtained by decrypting the third value with the secret key, and the execution of the program is resumed only when they match.
[0037]
In this way, the context information indicating the state that has been executed until then is encrypted with a random number that is generated each time it is stored, and a signature with a private key unique to the microprocessor is attached, so that the external memory can be safely secured. Saved in.
[0038]
As a third feature of the present invention, in order to achieve the first to third and sixth objects, the microprocessor configured as one chip or one package encrypts with a different encryption key for each program. The plurality of programs read out from the storage means outside the microprocessor are executed. This microprocessor has internal storage means (for example, a register) that cannot be read to the outside, and the encryption attribute and encryption attribute specification for the data referenced from each program (that is, processing target) Store information. The context information encryption / decryption unit writes related information including the signature unique to the microprocessor in association with the encryption attribute specifying information stored in the register in the external storage means. The protection table management unit reads related information from an external storage unit based on the address of data referred to by the program. The verification unit verifies the signature included in the read related information with the private key, and only when it matches the microprocessor specific signature, based on the encryption attribute specifying information and the read related information, Allow program to view data.
[0039]
In this configuration, a signature is attached to information to be stored in the internal register, the information is written in the external memory, and only a necessary part is read into the microprocessor. Since the signature is verified at the time of reading, the safety against replacement is ensured. Even when the number of programs to be handled increases and the types of encryption attributes increase, it is not necessary to expand the storage area inside the microprocessor, and the cost can be reduced.
[0040]
Other features and advantages of the present invention will become apparent from the detailed description given below with reference to the drawings.
[0041]
DETAILED DESCRIPTION OF THE INVENTION
(First embodiment)
A microprocessor according to a first embodiment of the present invention will be described with reference to FIGS. In the present embodiment, the configuration of the present invention will be described using an example of an architecture obtained by changing a widely used Intel Pentium Pro microprocessor (see Intel Architecture Software Developers Manual). The scope of application of the present invention is not limited to the processor. In addition, we will supplement as much of the text as possible about the characteristics of the Intel Pentium Pro processor and its application to other architectures.
[0042]
In the Pentium Pro architecture, the address space includes three types of physical addresses, linear addresses, and logical addresses. In this embodiment, the Pentium terminology uses linear addresses in terms of logical addresses.
[0043]
In the following description, unless otherwise specified, protection means protection of an application secret (that is, protection by encryption). Therefore, it is distinguished from the commonly used protection concept, that is, the operation of one application does not interfere with the operation of another application. However, in the present invention, an operation protection mechanism in the ordinary sense is naturally provided by the operation system (OS) in parallel with the secret protection of the application (however, the latter is different from the present invention. Since there is no direct relationship, explanation is omitted.)
[0044]
In the following embodiments, secret protection is described as protecting the secret of an application managed by the OS. However, this mechanism can also be used as a mechanism for protecting the OS itself from tampering and analysis.
[0045]
FIG. 1 is a basic configuration diagram of the microprocessor according to the first embodiment of the present invention, and FIG. 2 is a detailed configuration diagram of the microprocessor shown in FIG.
[0046]
The microprocessor 101 includes a processor core 111, an instruction TLB (conversion index buffer) 121, an exception processing unit 131, a data TLB 141, and a secondary cache 152. The processor core 111 includes a bus interface unit 112, a code / data encryption / decryption processing unit 113, a primary cache 114, and an instruction execution unit 115. The instruction execution unit 115 includes an instruction fetch / decode unit 214, an instruction pool 215, an instruction execution switching unit 216, and an instruction execution completion unit 217.
[0047]
The exception processing unit 131 includes a register file 253, a context information encryption / encryption unit 254, an exception processing unit 255, a secret protection violation detection unit 256, and a code encryption key / signature verification unit 257. The instruction TLB 121 includes a page table buffer 230, a code decryption key buffer 231, and a key decryption unit 232. The data TLB 141 has a protection table management unit 233.
[0048]
The microprocessor 101 has a key storage area 241 for storing a public key Kp and a secret key Ks unique to the microprocessor. Consider a case where a desired execution program A is purchased from a program vendor and executed. Before supplying the execution program A, the program vendor encrypts the program A with the code encryption common key Kcode (EKcode[A]), the common key Kcode used for encryption is encrypted with the public key Kp of the microprocessor 101 (EKp[Kcode]) sent to the microprocessor 101. The microprocessor is a multitask processor that processes not only the execution program A but also a plurality of different encrypted programs in a pseudo-parallel manner (that is, interrupt interruption is possible). Of course, not only the encryption program but also the plaintext program is executed.
[0049]
The microprocessor 101 reads a plurality of programs encrypted with different code encryption keys for each program from the main memory outside the microprocessor via the bus interface unit (reading unit) 112. The code decryption unit 212 decrypts the read plural programs with the corresponding decryption keys, and the instruction execution unit 115 executes the decrypted plural programs. When the execution of a program is interrupted, the context information encryption / decryption unit 254 of the exception processing unit 131 includes information indicating the execution state of the interrupted program so far, the code encryption key of the program, Is encrypted with the public key of the microprocessor, and the encrypted information is written in the main memory 281 as context information. When resuming the interrupted program, the code encryption key / signature verification unit 257 decrypts the encrypted context information with the secret key of the microprocessor, and encrypts the code included in the decrypted context information. It is verified whether or not the key (that is, the code encryption key of the program to be resumed) matches the original code encryption key of the suspended program, and the execution of the program is resumed only when it matches.
[0050]
Here, before describing the detailed configuration and function of the microprocessor 101, first, the flow of processing in the execution of plaintext instructions and the execution of the encryption program by the microprocessor 101 will be roughly described.
[0051]
When the microprocessor 101 executes a plain text instruction, the instruction fetch / decode unit 214 tries to read the contents of the address indicated by the program counter (not shown) from the L1 instruction cache 213. If the contents of the specified address are cached, the instruction is read from the L1 instruction cache 213 and sent to the instruction pool 215 to be executed. The instruction pool can execute a plurality of instructions in parallel, and requests the instruction execution switching unit 216 to read data for execution, and receives the data. If the instructions are executed in parallel and the execution result is confirmed, the execution result is sent to the instruction execution completion unit 217. The instruction execution completion unit 217 writes the execution result to the register file 253 if the operation target is a register in the microprocessor 101, and writes it to the L1 data cache 218 if the operation target is a memory.
[0052]
The contents of the L1 data cache 218 are further cached again by the L2 cache 152 under the control of the bus interface and written to the main memory 281. Here, a virtual storage mechanism is used, and the page table shown in FIG. 3 defines the correspondence between logical memory addresses and physical memory addresses. The page table is a data structure placed on the physical memory. The data TLB 141 actually performs conversion from a logical address to a physical address, and simultaneously manages the data cache. The data TLB 141 reads a necessary part of the table based on a head address of a table indicated by a register in the microprocessor 101, and performs a conversion operation from a logical address to a physical address. At this time, not all of the page table on the memory is read into the data TLB 141, but only a necessary portion is read into the page table buffer 234 according to the logical address to be accessed.
[0053]
The basis of the cache operation is constant regardless of whether or not the program instructions are encrypted. That is, a part of the page table is read into the instruction TLB 121, and address conversion is performed according to the definition. The bus interface unit 112 reads an instruction from the main memory 281 or the L2 cache 141, and the instruction is stored in the L1 instruction cache 213. Reading of an instruction to the L1 instruction cache 213 is performed in units called lines composed of a plurality of words, and access is performed at a higher speed than reading in units of words.
[0054]
The address conversion is also performed on the data to be processed by the execution instruction using the same page table on the physical memory, but the conversion is performed on the data TLB 141 as described above.
[0055]
The operation up to this point is basically the same as the operation of a general cache memory, and details of the operation of the processor and the cache memory are described in “Unix kernel internal analysis” (Softbank, 1996) by Curt Schimmel. .
[0056]
Next, an operation when an encrypted program is executed will be described. In the present invention, it is assumed that all execution codes subject to secret protection are encrypted, and the encrypted execution code is also referred to as protected code. Furthermore, the scope of protection with the same encryption key is called a protection domain. That is, a set of codes protected with the same key belongs to the same protection domain, and codes protected with different encryption keys have different protection domains.
[0057]
First, an execution code of a program encrypted by a common key block cipher algorithm is stored on the main memory 281. The method for loading the encryption program sent from the program vendor is as described in Japanese Patent Application No. 2000-35898 by the same applicant. The encryption block size may take any value as long as the power of 2 of the block size matches the line size that is a unit of reading and writing of the cache memory. However, if the block size is small, the block length matches the instruction length, and the instruction is easily decoded by recording the correspondence between the predictable instruction part such as the head part of the subroutine and the encrypted data. There is danger. Therefore, in the present invention, the blocks are interleaved so that the data in the block has a dependency, and the information of a plurality of instruction words and operands is included in the encrypted block. This makes it difficult to associate instructions with encrypted blocks.
[0058]
FIG. 5 shows an example of interleaving performed in the present invention. In the example shown in FIG. 5, the cache line size is 32 bytes and the block size is 64 bits (ie, 8 bytes). Before interleaving, one word is composed of 4 bytes, and word A is composed of 4 bytes A0 to A3. One line is composed of 8 words A to H. When this is interleaved so that it becomes a unit of 8 bytes corresponding to a block size of 64 bits, A0, B0,..., H0 are arranged in the first block corresponding to words 0 and 1, as shown in the lower diagram of FIG. , A1, B1,..., H1 are arranged in the next block.
[0059]
The longer the length of the interleaved area, the harder it will be to attack, but interleaving beyond the line size means that the decryption / encryption of one cache line depends on the reading / writing of another line As a result, the processing becomes complicated and the speed is reduced. It is desirable to keep the range for interleaving within the range of the cache line size.
[0060]
Here, a method of interleaving block data is used to give dependency to data of a plurality of blocks included in a cache line, but other methods for giving dependency between data blocks, for example, blocks Cryptographic CBC (Cipher Block Chaining) mode or the like may be used.
[0061]
The decryption key Kcode of the encrypted execution code (since the encryption key and decryption key are the same in the common key algorithm, the term “encryption key” is also used for decryption below) based on the page table. Is done. 3 and 4 show the translation table structure from logical addresses to physical addresses.
[0062]
The logical address 301 of the program counter indicates a certain value, and the page entry 307-j is designated by the high-order bit directory 302 and the table 303. The page entry 307-j includes a key entry ID 307-j-K. Based on this ID, a key entry 309-m used for decryption of this page is determined in the key table 309. The physical address of the key table 309 is specified by the key table control register 308 inside the microprocessor.
[0063]
In this configuration, key information is not placed directly in the page entry, but the key entry ID is placed, so that large-size key information is shared by a plurality of pages, and a memory area on the instruction limited TLB 121 is saved. can do.
[0064]
As a feature of the present invention, the key table entries are fixed length, but the key length used in each table is variable length so that it can cope with the improvement of the cryptographic analysis capability, and is specified in the key size area of the key table. The The secret key Ks unique to the microprocessor 101 is fixed, but the length of the Kcode used for program encryption and decryption can be changed by specifying the key entry. In order to designate the position of the variable-length key, the key entry 309-m has a field 309-m-4 that points to the key entry, and indicates the address of the key object 310.
[0065]
In the key object area 310, an encryption key Kcode of the execution code is encrypted with the public key Kp of the microprocessor 101 by the public key algorithm.KpStored in [Kcode]. In order to securely encrypt data with the public key algorithm, a large redundancy is required, so the encrypted data length is longer than the original data length. Here, the length of Ks and Kp is 1024b bits, the length of Kcode is 64b bits, the length is 256 bits by padding, and E [Kcode] is encrypted to a length of 1024 bits and stored in the key object area 310. Store. When Kcode is long and cannot be stored in 1024 bits, it is divided into a plurality of 1024-bit blocks and stored.
[0066]
FIG. 6 summarizes the above flow. The program counter 501 points to the address Addr on the encrypted code area 503 on the logical address space 502. The logical address Addr is converted into a physical address Addr ′ based on the page table 307 read by the instruction TLB 121. At the same time, the encrypted code decryption key E [Kcode] is taken out from the key table 309, decrypted by the decryption function 506 with the secret key Ks of the CPU, and stored in the current code decryption key storage means 507. Stored. The common key Kcode for code encryption is encrypted by the program vendor with the public key Kp of the microprocessor 101 and supplied together with the program encrypted with Kcode, so that the user who does not know the secret key Ks of the microprocessor 101 Cannot know Kcode.
[0067]
The program vendor encrypts and executes the execution code of the program with Kcode, and stores the Kcode safely and manages it so that the secret is not leaked to a third party.
[0068]
The entire key table 511 and the entire page table 512 are placed in the physical memory 510, and the respective physical addresses are designated by the key table register 508 and the CR3 register 509. Only necessary portions of the contents of these entire tables are cached in the instruction TLB 121 via the bus interface unit 112.
[0069]
Now, when the content 503 corresponding to the physical address Addr 'converted by the instruction TLB 112 is read by the bus interface unit 112, this page is encrypted, and thus is decoded by the code decoding unit 212. Reading is performed in units of the cache line size, and after decoding in units of blocks, the above-described reverse processing of interleaving is performed. The decrypted result is stored in the L1 instruction cache 213 and executed as an instruction.
[0070]
In addition, the program loading method, relocation, and the like are described in Japanese Patent Application No. 2000-35898 by the same applicant.
[0071]
Since the encrypted code can be executed in this way, the microprocessor according to the present invention can analyze the operation of the program by disassembling the code by selecting an encryption algorithm and parameters appropriately. Can be impossible.
[0072]
Similarly, since the user cannot know the true value of the code encryption key Kcode, the user's intention such as modifying a part of the encrypted program and taking an unauthorized copy of the content handled by the application Modifications along the line can also be made cryptographically impossible.
[0073]
Next, suppression of the debug function will be described.
[0074]
The instruction TLB 121 can determine whether the currently executing code is protected (whether it is encrypted). During execution of the protected code, in order to prevent intrusion to the analysis of the encrypted program from the debug flag or the debug register, the two debug functions of the debug register function and the step execution function are prohibited.
[0075]
The debug register function is an interrupt when a corresponding memory access occurs by setting the memory access range and access type such as execution, reading as data, and writing to the debug register provided in the processor. Is a function that occurs. In this embodiment, when a protected code is being executed, the contents set in the debug register are ignored and no interrupt is generated for debugging. However, this excludes when the debug bit is set in the page table. The debug bit of the page table will be described later.
[0076]
While unprotected (plaintext) code is being executed, if the step execution bit in the processor's EFLAGS register is set, an interrupt will be generated each time one instruction is executed. Ignored and no interrupt is generated.
[0077]
In the present invention, in addition to preventing analysis by encrypting the execution code, these functions make it difficult for the user to analyze the program by preventing dynamic analysis of the program by the debug register or the debug flag.
[0078]
Next, context encryption, signature, and verification when program execution is interrupted in a multitasking environment, which is a feature of the microprocessor of the present invention, will be described.
[0079]
In a multitasking environment, program execution is often interrupted by exceptions. Normally, when the execution is interrupted, the state held by the processor is temporarily stored in the memory, and the original state is restored when the execution of the program is resumed later. As a result, it is possible to execute processing by a plurality of programs in a pseudo parallel manner and accept interrupt processing. This state information at the time of interruption is called context information. The context information includes register information used by the application, and in addition, may include register information that is not clearly visible.
[0080]
In the conventional processor, when an interrupt occurs during execution of a certain program, control is transferred to the execution code of the OS while retaining the register state of the application, so the OS checks the register state of the program and determines what instruction It was possible to change the behavior of the program after the execution of the program was resumed by estimating whether the program was executed or by modifying the context information stored in plain text while the execution was suspended.
[0081]
Therefore, in the present invention, when an interrupt occurs during the execution of protected code, the context executed immediately before is encrypted and stored, all application registers are encrypted or initialized, and context information is also stored. Attach a signature from the processor. Verify the signature on return from interruption and check if the signature is correct. When signature inconsistency is detected, restoration can be stopped to prevent unauthorized modification of context information by the user. At this time, the registers to be encrypted are user registers 701 to 720 in FIG.
[0082]
The Pentium Pro architecture has a hardware support mechanism for saving and restoring process context information in memory. An area for storing this state is called a task state segment (TSS). Hereinafter, an example in which the present invention is applied to this mechanism will be described. However, this does not limit the application of the present invention to the Pentium Pro architecture, and the present invention can be widely applied to general processor architectures.
[0083]
Saving context information when an exception occurs occurs in the following cases. When an exception occurs, an entry corresponding to the cause of the interrupt is read from a table describing exception processing called IDT (Interrupt Descriptive Table), and the processing described therein is executed. When the entry indicates a TSS, the context information stored in the indicated TSS is returned to the processor. On the other hand, the context information of the process executed so far is stored in the TSS area designated by the task register 725 at that time.
[0084]
By using this automatic context saving mechanism, it is possible to detect the presence or absence of falsification by saving all application states including the program counter and stack pointer, and verifying the signature when returning. However, when automatic context saving is performed, there arises a problem that, in addition to a large overhead due to context switching, interrupt processing that does not use TSS cannot be performed.
[0085]
In order to reduce the overhead of interrupt processing or maintain compatibility with existing programs, it is desirable not to use an automatic context saving mechanism. In this case, however, the program counter is saved on the stack. Since it cannot be a verification target, it can be a target of falsification by a malicious OS. Both are preferably used according to the purpose. Therefore, the microprocessor of the present invention employs automatic context saving for the protected (encrypted) execution code with an emphasis on safety. Registers to be automatically saved need not be all registers.
[0086]
The features of the context saving and resuming process in this embodiment are the following three points.
[0087]
(1) Only the microprocessor itself that generated the context and the person who knows the encryption key Kcode of the program that generated the context can decrypt the contents of the stored context.
[0088]
(2) When a program protected with a certain code encryption key X is interrupted and its context is saved, the resumption process is to resume an unprotected program or a program encrypted with another code encryption key Y It cannot be applied. That is, the program to be restored from the interruption is not replaced with another program at the time of resumption.
[0089]
(3) The return of the modified context is prohibited. That is, if the saved context has been altered, the context is not restored.
[0090]
With the above feature (1), the context information can be analyzed by the program vendor while maintaining the safety of the context information. The reason why the program vendor holds the right to analyze the context information is important in order to analyze the cause of the failure that has occurred under the use conditions of the user and to maintain the quality of the program.
[0091]
Characteristic (2) is that, for example, an attacker applies a context generated by execution of program A to another cryptographic program B, and restarts the program from a known state stored in the context. It is intended to prevent analysis of secrets of data and codes contained in, and alteration of operations. This function is also a premise for a plurality of applications to independently hold encrypted data independently of each other during data protection described later.
[0092]
With the feature (3), it is possible to strictly eliminate the modification of the context information using the program restart time.
[0093]
The reason for having such a function is that even if the context information is simply encrypted based on the secret information of the processor, the secret information can be protected from modification of the context information in accordance with the attacker's intention. This is because it is impossible to exclude the possibility that the program is resumed from a state where the context is randomly changed and an error occurs randomly.
[0094]
Hereinafter, a context storage and verification method having the above three features will be described in detail.
[0095]
<Context saving process>
FIG. 8 is a diagram conceptually showing the context storage format of the first embodiment. Assume that an interrupt caused by hardware or software occurs during the execution of a protected program. If the IDT entry corresponding to the interrupt indicates TSS, the program execution processing so far is encrypted and stored as context information in the TSS indicated by the current task register 725 (instead of the TSS). Then, the execution state stored in the TSS indicated by the IDT entry is returned to the processor. If the IDT entry does not indicate TSS, only the current register is encrypted or initialized, and the TSS is not saved. Naturally, the program cannot be resumed. However, in order to continue the operation of the OS, system registers including a part of task registers of the flag register are excluded from register encryption or initialization targets.
[0096]
The context shown in FIG. 8 is actually interleaved, encrypted for each block, and stored in the memory. First, information items to be stored will be described. At the top is a stack pointer corresponding to each privileged mode and user registers 802 to 825, followed by one word 826 indicating the size of the TSS and the presence or absence of encryption. This indicates whether or not the TSS stored by the processor is encrypted. Even when the TSS is encrypted, this area is not encrypted but is stored in plain text. Subsequently, areas 827 to 830 of data encryption control registers (CY0 to CY3) added for data protection and padding 831 for adjusting the size to the block length are placed. Finally, a value E obtained by encrypting the key Kr obtained by encrypting the context with the common key algorithm using the encryption code Kcode of the execution codeKcode[Kr] 832, a value E obtained by encrypting the context-encrypted key Kr with the processor public key KpKP[Kr] 833, and the signature S with the processor private key Ks for all of themKS[message] 834 is placed. Also, the link area 801 with the previous task that holds the calling relationship between tasks is stored in plain text to enable task scheduling by the OS.
[0097]
The encryption and signature generation of these execution codes are performed by the context information encryption / decryption unit 254 in the exception processing unit 131 shown in FIG. 2, and are independent of the encryption of the data to be processed by the execution code. Based on function. When the context information is stored in the TSS, even if any encryption is specified for the address of the TSS by a separate data encryption function, the specification is ignored and the context is encrypted. Saved in state. This is because the encryption attribute of the data encryption function is unique to each protected (encrypted) program, and restart of a program cannot depend on the function.
[0098]
In context encryption, first, the word in the TSS size area 826 recorded in plain text is replaced with the value 0. Then, the same interleaving as described with reference to FIG. 5 is performed, and the context is encrypted. At this time, the padding 831 is set to a size that allows appropriate interleaving according to the encryption block size.
[0099]
Here, the fact that the register value is not directly encrypted with the public key Kp of the processor or the encryption key Kcode of the code enables the decryption of the encrypted context by both the program vendor and the processor, and at the same time the decryption of the context by the user This is to prohibit the conversion.
[0100]
Since the program vendor knows the code encryption key Kcode, it uses EKcode[Kr] 832 can be decrypted to extract the context encryption key Kr. Further, the microprocessor 101 uses the secret key Ks held therein toKP[Kr] 833 can be decrypted to extract Kr. In other words, the program vendor can analyze the failure by decrypting the context information without knowing the secret key of the user's microprocessor, and the microprocessor 101 itself decrypts the context information with the internal secret key. Execution can be resumed. A user who does not have any key cannot decrypt the stored context information. Also, context information and the above EKcode[Kr], EKPSignature S for [Kr]KS[message] cannot be forged by a user who does not know the secret key Ks of the microprocessor 101.
[0101]
In order to enable the program vendor and the microprocessor to decrypt the context information independent of each other, a method of directly encrypting the context information with Kcode is also conceivable. However, when the state of the register is known, there is a possibility that a known plaintext attack is performed on the code encryption key Kcode. That is, if the key value for encrypting data is fixed, there are the following problems. Suppose that a user's data input is read and a program for temporarily encrypting and writing it to the working memory is executed. Since the data to be written after being encrypted can be understood by observing the memory, the user can change the input value and repeat the input many times to obtain the corresponding encrypted data. This means that “selective plaintext attack” in the theory of cryptographic analysis is possible.
[0102]
Although known plaintext attacks are not fatal for symmetric encryption algorithms, there is nothing to avoid. Therefore, the random number generation unit 252 of the exception processing unit 131 generates a random number Kr each time the context is stored and supplies the random number Kr to the context information encryption / decryption unit 254. The context information encryption / decryption unit 254 encrypts the context using a common key algorithm using the random number Kr. Then, the random number Kr is attached as a value E [Kr] 832 encrypted by the common key algorithm with the code encryption key Kcode. Kr encryption E with processor public key KpKp[Kr] 833 is based on a public key algorithm.
[0103]
Here, the random number is generated by the random number generation mechanism 252. When the program is encrypted, there is usually no change in the program code, and unless the operation is analyzed, the corresponding plaintext code is not obtained illegally. In this case, in order to break the cipher, it is necessary to perform “ciphertext single attack”, and it is very difficult to search for an encryption key. However, when data input by the user is encrypted and stored in the memory, the user can freely select the input data. For this reason, an attack that is much more efficient than the “ciphertext single attack”, called “selected plaintext attack”, can be performed on the encryption key. For the selected plaintext attack, it is possible to take measures to increase the search space by adding a random number called “salt” to the plaintext to be protected. However, it is very complicated to implement storing the random number value of salt in the memory in a form in which all data is stored at the application programming level, resulting in a decrease in programming efficiency and performance.
[0104]
Therefore, the random number generation mechanism 253 generates a random number (encryption key) for encrypting the context each time the context is stored. Since the encryption key can be arbitrarily selected, there is an effect that secure communication between processes and between process and device can be accelerated. This is because the speed at which data is encrypted by hardware during memory access is generally much faster than the speed at which data is encrypted by software. On the other hand, if the value of the encryption key in the data area is limited to a predetermined value, for example, the same as the encryption key of the execution code, other values encrypted with another encryption key This is because the data encryption function of the processor cannot be used for sharing the encrypted data with the program or the device, and the high speed of the hardware encryption function provided in the processor cannot be utilized.
[0105]
Note that the encrypted random number E [Kr] 832 performed at the time of generating and resuming the signature 834 can be decrypted based on any algorithm and secret information as long as the condition that only the microprocessor 101 can perform the decryption. Also good. In the above example, both use the secret key Ks unique to the microprocessor 101 (which is also used for decryption of the code encryption key Kcode), but different values may be used.
[0106]
The stored context has a flag indicating the presence or absence of encryption, and encrypted context information and unencrypted context information can coexist depending on the application. Since the flag indicating the size of the TSS and the presence / absence of encryption is stored in plain text, it is easy to maintain compatibility with past programs.
[0107]
<Suspended program resume processing>
When returning the context and restarting the process, the OS issues a jump or call instruction to a TSS descriptor indicating the saved TSS.
[0108]
Returning to the block diagram of FIG. 2, the code encryption key / signature verification unit 257 of the exception processing unit 131 first executes the signature S.K s[message] 834 is verified using the secret key Kp of the processor, and the verification result is sent to the exception handling unit 255. If the verification result is unsuccessful, the exception handling unit 255 stops the context restart and generates an exception. By this verification, it can be confirmed that the context information is certainly generated by a valid microprocessor 101 having a secret key and has not been tampered with.
[0109]
If the signature verification is successful, the context information encryption / decryption unit 254 sends the context encryption key EKp[Kr] 833 is decrypted with the secret key Ks to extract the random number Kr. The context is decrypted with the extracted Kr. On the other hand, the code decryption key Kcode corresponding to the program counter (EIP) 809 is extracted from the page table buffer 230 and sent to the code encryption / decryption key area 251. The context information encryption / decryption unit 254 uses the code decryption key Kcode toKcode[Kr] 832 is decrypted, and the result is sent to the code encryption key / signature verification unit 257. The code encryption key / signature verification unit 257KcodeIt is verified whether or not the decryption result of [Kr] 832 matches the decryption result by the microprocessor secret key Ks. By this verification, it can be confirmed that the context information is generated by executing a code encrypted with the secret key Kcode.
[0110]
If the verification of the code encryption key is not performed on the context information, the user creates a code encrypted with an appropriate secret key Ka, and executes the executed context information as another secret. An attack applied to a code encrypted with the key Kb becomes possible. The above verification eliminates this attack and guarantees the security of the context information of the protected code.
[0111]
This object can also be achieved by adding a secret code encryption key Kcode to the context information. However, in the present invention, a secret random number Kr for encrypting the context information is generated using the code encryption key Kcode selected by the program vendor. Encrypted value EKcodeBy using [Kr] for verification, the amount of memory necessary for storing context information is reduced, and the effect of speeding up context switching and saving memory is achieved. This also allows context information feedback to the program creator.
[0112]
When the code encryption key / signature verification unit 257 successfully verifies the code encryption key and the signature, the context is restored to the register file 253 and the value of the program counter is also restored. Returned to the generated address at the time of execution interruption.
[0113]
If any of the verifications fails and the exception processing unit 255 generates an exception, the exception occurrence address indicates the address where the jump or call instruction is issued. In addition, a value indicating that the TSS is illegal is stored in the interrupt cause area of the IDT table, and the address of the jump destination TSS is stored in the register that stores the interrupt cause address. Thereby, the OS can know the cause of the context switching failure. In order to speed up the restart process, the supply to the register file 253 in the execution state decrypted by the context information encryption / decryption unit 254 and the verification process by the verification unit 257 are performed in parallel. A configuration may be adopted in which the subsequent processing is canceled.
[0114]
The security of this encryption method via random numbers depends on the unpredictability of the random number sequence to be used, but a method of generating random numbers that are difficult to predict by hardware is, for example, Japanese Patent No. No. 2980976.
[0115]
The analysis of context information by a program vendor is important for improving the quality of a program by analyzing the cause of a program defect that has occurred under the use conditions of the user. In the present embodiment, in view of this point, a method of achieving both context safety and the possibility of analyzing the context information by the program vendor has been described. However, it is also true that this method increases the overhead of context storage.
[0116]
In addition, the verification of the context information based on the microprocessor signature prevents the code protected by the illegal context information from being executed by a combination of the arbitrarily selected value and the encryption key. The overhead is still increasing.
[0117]
If there is no need for code analysis by the program vendor or a mechanism to eliminate program resumption due to incorrect context information, the context information including information specifying the code encryption key is directly encrypted with the private key of the processor. May be. This alone prevents intentional alteration of the context cryptographically and prevents application of context information to programs with different encryption keys.
[0118]
Here, a description of the format of saving context is added. The relationship with the operation will be described later.
[0119]
In FIG. 8, the R bit indicated by 825-1 is a bit indicating whether or not the context can be resumed. When this bit is set to 1, execution can be resumed by restoring the state stored in the context in the above restoration procedure, but when the value is 0, it cannot be resumed. This has the effect that the resumable contexts can be limited to those in the correct state by preventing the resumption of contexts in which fraud has been detected during the execution of the encryption program.
[0120]
The U bit indicated by 825-2 is a flag indicating whether the TSS is a user TSS or a system TSS. When this bit is 0, the stored TSS is a system TSS, and when this bit is set to 1, the stored TSS is a user TSS. The system TSS is a TSS that is saved and restored through task switching accompanied by a privilege change from the exception entry described in the above example or calling a task gate. On the other hand, a TSS saved by execution of a subroutine call instruction and an explicit context saving instruction by a user without a privilege change is a user TSS. The difference between the system TSS and the user TSS is whether or not the task register indicating the TSS storage location of the currently executing program is updated when the TSS is restored. When the system TSS is restored, the task register of the currently executing program is stored in the link area 801 with the previous task of the newly restored TSS, and the segment selector of the new TSS is read into the task register. On the other hand, when the user TSS returns, the task register value is not updated. The user TSS is only for saving and restoring the register state of the program, and does not involve a change of privileged mode.
[0121]
<Data protection>
Next, protection of data that is an operation processing target of the execution code will be described.
[0122]
In the first embodiment, the encryption attribute for protecting data is defined in four registers CY0 to CY3 provided in the microprocessor 101. Regions 717 to 720 shown in FIG. 7 correspond to this. In FIG. 7, the details of CY0 to CY2 are omitted, and only the details of CY3 are shown.
[0123]
Each element of the encryption attribute will be described using the CY3 register 717 as an example. The upper bit of the logical address indicating the head of the area to be encrypted is designated as the base address 717-1. The size of the area is specified in the size area 717-4. Since the size is specified in units of cache lines, there is an invalid part in the lower bits. The data encryption key is designated 717-5. Since the common key algorithm is used, 717-5 is also used as the decryption key. When 0 is designated as the value of the encryption key, it indicates that the area indicated by the register is not encrypted. In the area designation, CY0 is prioritized, and is prioritized in the order of CY1 to CY3. For example, when the areas designated by CY0 and CY1 overlap, the attribute of CY0 is given priority in that area. In addition, the page table definition is prioritized for memory access as an execution code, not data to be processed.
[0124]
Reference numeral 717-4 denotes a debug bit, which selects whether data operation in the debug state is performed in the encrypted state or in the plaintext state. Details of the debug bit will be described later.
[0125]
FIG. 10 shows the flow of encryption and decryption of data that is the processing target of the execution code. Here, data protection is performed only when the code is executed in a protected state, that is, in an encrypted state. However, it is excluded when the code is executed in the debug state described later. When the code is protected, the contents of the encryption attribute registers CY0 to CY3 are read from the register file 253 shown in FIG. 2 into the data encryption key table 236 in the data TLB 141.
[0126]
When an instruction writes data to the logical address Addr, the data TLB 141 determines whether or not the logical address Addr is included in the range of CY0 to 3 by examining the data encryption key table 236 (see FIG. 2). . If the encryption attribute is specified as a result of the determination, the data TLB 141 encrypts the memory contents with the specified encryption key when writing the corresponding cache line from the L1 data cache 114 to the memory. To the data encryption unit 220.
[0127]
Similarly, in the case of reading, if the target address has the encryption attribute, when the cache line of the corresponding L1 data cache 218 is read, the data decryption unit 219 is sent with the designated encryption key. Instruct to decrypt.
[0128]
In the first embodiment, all the data encryption attributes for data encryption are placed in a register inside the microprocessor 101, and when execution is interrupted, the contents of the register are used as context information in a secure form (for example, memory outside the microprocessor) By storing in the main memory 281) of FIG. 2, the data encryption attribute is protected from unauthorized rewriting including OS privileges.
[0129]
Data encryption / decryption is performed in units of cache lines subjected to the interleaving described above in connection with context encryption. Therefore, even if the data on the L1 cache 114 is rewritten by 1 bit, the other bits in the cache line are rewritten on the memory. Since data read / write operations are performed in units of cache lines, the overhead is not so large, but it should be noted that reading / writing to the encrypted memory area cannot be performed in units smaller than the cache line size. It is.
[0130]
<Entry gate>
In the present invention, control can be transferred from a non-protected code to a protected code only in the following two cases.
[0131]
(1) When a context (with a random number) encrypted with a code encryption key that matches the resume address is resumed;
(2) A case where control is transferred from an unprotected code to an entry gate instruction (EGATE instruction) of a protected code due to continuous code execution or a jump, call instruction or the like.
[0132]
This limitation is intended to prevent an attacker from obtaining code fragment information by executing code from an arbitrary location. The procedure (1) has already been described in connection with the context return. That is, when it is verified that the context information that matches the code encryption key of the code executed before the interruption is included and that the correct signature given by the microprocessor 101 is added, the protection is performed. Move to execution control of the generated code.
[0133]
In the method (2), when control is transferred from an unprotected code to a protected code, if a special instruction called an entry gate (egate) instruction is not executed at the beginning of the control, the protection coat is executed. This is a process that cannot be migrated.
[0134]
FIG. 9 shows a protection domain switching procedure based on the entry gate instruction. The microprocessor 101 holds the encryption key of the currently executed code in the current code encryption key storage unit 251 (see FIG. 2) of the exception processing unit 131. First, in step 601, it is determined whether or not the value of this key has been changed along with the execution of the instruction. If a change in the key value is detected (NO in step 601), the process proceeds to step 602, and it is checked whether or not the instruction being executed along with the change is an entry gate (egate) instruction. Being an entry gate instruction means that it is a proper instruction and control may be transferred to the changed code. Therefore, if it is determined in step 602 that the instruction is an entry gate instruction (YES in step 602), the instruction is executed.
[0135]
If it is determined in step 602 that the instruction is not an entry gate instruction (NO in step 602), it means that the interrupted instruction is an inappropriate instruction. In this case, the process proceeds to step 603, where it is determined whether or not the instruction executed immediately before has been encrypted (protected). If the instruction is not protected, exception processing can be generated as it is. However, if the instruction is protected, exception processing must be performed while protecting the instruction.
[0136]
Therefore, if it is determined in step 603 that the instruction is not protected (NO in step 603), exception processing is performed as it is, and if it is determined that the instruction is protected (YES in step 604). Exceptions are generated while keeping the protection status.
[0137]
Due to such control transfer restrictions, it is prohibited to transfer control directly from the plaintext code to a code other than the place where the entry gate instruction is placed. To restore the context is to restore the state in which the program has already been executed once through the entry gate. Therefore, in order to execute the protected program, it is necessary to pass through the entry gate. By minimizing the place where the entry gate is placed in the program, there is an effect of preventing an attack that estimates the program structure by executing the program from various addresses.
[0138]
Further, the entry gate initializes the data protection attribute register. When the entry gate is executed, the random number Kr is loaded into the key area (the area 717-5 in CY3) of the protection registers CY0 to CY3 (717 to 720) shown in FIG. The encryption target start address is set to 0, the size is set up to the upper limit of the memory, and the entire logical address space is set as the encryption target. If the debug attribute is not set in the execution code, the debug bit (717-3 in CY3) is not debugged.
[0139]
That is, at the start of execution of the encryption code, all memory accesses are encrypted with the random number Kr determined at the time of entry gate execution. In addition, as described above, the definition of the page table has priority in the execution code encryption control. This random number Kr is generated independently of the random number used for context encryption.
[0140]
With this mechanism, a newly executed protected program is always set to be encrypted with a randomly determined key at the start of all memory accesses.
[0141]
Of course, since the entire memory area remains encrypted, it is impossible to pass system call parameters through the memory or exchange data with other programs. Therefore, the program sets the protection attribute register so that the necessary memory area can be accessed sequentially as plain text, and prepares its own processing environment to proceed with the process. If the low-priority register CY3 is set to be encrypted with the first random number, and the encryption key 0 is set as the plaintext access setting in the other registers, the area other than necessary is accessed as plaintext, and the encryption is performed. It is possible to reduce the risk of accidentally writing out data that should be kept secret in the plaintext area.
[0142]
The contents of the registers other than the protection attribute register can be stored with pointers for designating the location of the stack and parameters without being encrypted at the time of initialization at the entry gate. However, it is necessary to pay attention to the processing of the program executed through the entry gate so that the secret of the program is not stolen by setting an illegal value in the register and calling the entry gate.
[0143]
Although limited in terms of programming and inefficient, the entry gate may be configured to initialize all registers other than flags and program counters, including general purpose registers other than protection attribute registers, if safety is important. . Even in this case, parameters such as a stack can be passed through a memory area specified by a relative address or an absolute address of the program counter. However, here, as in the case of context saving, in order to continue the operation of the OS, system registers including a part of the task register of the flag register are excluded from register encryption or initialization targets.
[0144]
As described above, in the microprocessor 101 according to the first embodiment, when control is transferred from the plain text program to the protected program, the instruction to be executed first is limited to the entry gate instruction. By initializing the registers including the data encryption attribute register by execution, fragmented execution of the protected execution code is prevented, and in particular, illegal setting of the data protection state is prevented.
[0145]
Next, execution control of the protected program will be described. First, calls and branches closed in the protection domain are described. Calls in the protection domain are exactly the same as normal programs. FIG. 11 shows the concept of calls and branches within the protection domain.
[0146]
Execution of protection domain code 1101 is initiated by a thread 1121 outside the protection domain branching to a protection domain egate (entry gate) instruction. All registers are initialized by executing the egate instruction, and then the data protection attribute is sequentially set by executing the program. With the jmp xxx instruction, control is transferred to the branch destination xxx 1111 in the protection domain (process 1322), and the call yyy instruction at the address ppp 1112 is executed (process 1123). The caller address ppp 1112 is pushed to the stack memory 1102, and control is transferred to the callee yyy 1113. When processing at the call destination is completed and the ret instruction is executed, control is transferred to the return address ppp 1112 of the stack. There is no restriction on execution control while the encryption key of the execution code is the same.
[0147]
Next, calling and branching from the protection domain to the non-protection domain will be described. This control transfer includes the execution of special instructions and the operation of the user TSS described below in order to avoid unintended transfer of the program creator from the protected domain to the non-protected domain and to protect the data protection state. I do.
[0148]
FIG. 12 is a conceptual diagram of a call and branch operation from a protected domain to a non-protected domain. In each domain, a protection domain execution code 1201 and a non-protection domain execution code 1202 are placed. Further, a user TSS area 1203 and a parameter passing area 1204 between the non-protected domain are provided.
[0149]
Execution begins with thread 1221 executing an egate instruction. The protected domain program stores the address of the user TSS area 1203 in a predetermined parameter area 1204 before calling the non-protected domain code. The ecall instruction is then executed to call the code in the unprotected domain. The ecall instruction takes two operands. One is a call destination address, and the other is an execution state storage destination. The ecall instruction stores the register state at the time of calling (more precisely, the state of the program counter after issuing ecall) in the area specified by the operand uTSS in the same format as the encrypted TSS described so far. Hereinafter, this area is referred to as a user TSS.
[0150]
The difference between the user TSS and the system TSS is that the U flag is set in the area 825-2 on the TSS in the user register shown in FIG. The difference in operation will be described later. In the storage of the user TSS in the memory, the data protection attribute defined by the user in the protection registers CY0 to CY3 is not applied, similarly to the storage of the context information in the system TSS.
[0151]
In the code of the unprotected domain of the call destination, the register cannot be passed because the register is initialized by executing the ecall instruction. For this reason, a parameter is acquired from a predetermined address param 1204 and necessary processing is performed. There are no restrictions on programming within an unprotected domain. In the example of FIG. 12, subroutine qqq1213 is called (process 1425 indicated by an arrow). For example, by placing adapter code that sets the stack pointer and copies parameters to the stack between exx and qqq calls, calls from the protection domain can be adapted to the call semantics of subroutine qqq. . The processing result is sent to the caller through the parameter area 1204 on the memory (processing 1226). When processing of the subroutine is completed, a sret instruction is issued to return control to the caller's protection domain (1227).
[0152]
Unlike the ret instruction having no operand, the sret instruction also takes one operand that specifies the user TSS. Here, the user TSS 1203 is indirectly designated as return information through the pointer stored in the parameter area param 1204. The point that the return of the user TSS by the sret instruction is significantly different from the return of the system TSS is that the task register is not affected at all even when the user TSS is returned. The task link field of user TSS is ignored. If the system TSS with the 825-2U flag set to 0 is specified as the operand of the sret instruction, the return fails.
[0153]
When executing the return, the execution state decryption and code encryption key and signature verification already described are performed, and if a violation is detected, a secret protection violation exception occurs. If verification is successful, execution resumes from the instruction next to the caller's ecall instruction. Since this address is encrypted and signed in the user TSS, it is cryptographically impossible to forge. Since all the registers excluding the program counter are returned to the state before calling the register, the protection domain code obtains the execution result of the subroutine exx from the parameter area 1204.
[0154]
The ejmp instruction is used when processing of the protection domain is completed and control is transferred to the non-protection domain. Unlike ecall, the ejmp instruction does not save the state. If control is transferred from a protected domain to a non-protected domain by a jmp or call instruction other than ecall or ejmp, a secret protection violation exception occurs and the encrypted context information is stored in the system TSS area (task register Is stored in the area indicated by. At this time, the context information is marked as unresumable. Note that specifying an address in the protection domain as the jump destination of the ejmp instruction does not constitute a violation.
[0155]
The above is the calling procedure from the protection domain to the non-protection domain and the newly added instruction used therefor.
[0156]
When an application restores the user TSS, it is not without the possibility that an attack with a privileged OS can replace the user TSS. However, TSS information that can be exchanged there is always started through egate as long as the encryption key of the protection domain code is managed correctly, and saved by interruption or explicit saving of the execution state by the user. Only context information. The possibility that the secret of the application is leaked due to the replacement of this context information is very small, and it is extremely difficult for an attacker to predict what kind of context information should be replaced to obtain the secret of the application. is there.
[0157]
The calling procedure from the protection domain to the non-protection domain described above can be applied to a procedure for transferring control between protection domains if the first instruction executed at the call destination is an egate instruction on the called side.
[0158]
At this time, if the parameter delivery area between the two is encrypted with the encryption key shared by exchanging the authentication key between the two in advance, the call between the protection domains can be performed safely. .
[0159]
<Control between threads>
Next, the relationship between the execution of the protected program and the thread under the control of the same program, and the problems and solutions occurring there will be described.
[0160]
In the above description, it has been explained that the execution control within the encrypted (protected) program itself is not different from that of a normal program. This also applies to a user thread that switches threads at the user program level, and it is not necessary to be aware that the program is protected in the user thread. The problem is how to share data protection information when there are multiple threads implemented at the kernel level.
[0161]
First, a brief description of user threads and kernel threads. The user thread is to virtually execute a plurality of threads in parallel within a user program, that is, an application without intervention by the OS. Each thread has an independent stack and program counter value. On the other hand, the kernel thread is a thread implementation that depends on the OS for thread switching. The functional difference is that in a user thread, thread switching does not occur unless a thread calls a code that performs thread switching spontaneously, but in a kernel thread, execution of a thread that exceeds the assigned execution time is forced. Is stopped. For details, refer to the above-mentioned document “UNIX Kernel”.
[0162]
In terms of internal mechanisms, in the kernel thread, context information is processed by the OS, and the thread is switched. On the other hand, in the user thread, the application has a thread switching code, and is stored in the context storage area of the register. Since it is the application itself that performs this operation, even if the code is protected, the thread switching operation is possible without any problem, and each thread can also share the data protection state. The only point to note is that if the area for storing the thread context is not encrypted, the thread context may be read or altered by the OS or other applications. It is desirable to store thread context information in an encrypted area to prevent reading by other programs and intentional tampering.
[0163]
In the kernel thread, thread switching is performed by the OS. For example, when a certain thread process is interrupted by a timer interrupt, if the thread runs out of the allocated processing time, the OS scheduling function executes another thread, thereby improving the responsiveness in real-time processing. There are advantages such as being enhanced. In addition, an OS that does not have a function for operating a plurality of kernel threads also exists in an OS such as a conventional UNIX, but the asynchronous signal delivery function provided in almost all UNIX implementations is a process from the viewpoint of context switching. You can think of it as a kind of kernel thread that runs independently of the main thread. Kernel thread support is a necessary function for most OS implementations.
[0164]
However, problems arise when trying to apply the current kernel thread implementation to protected code. In the microprocessor of the present invention, the stored context information is protected by encryption, and from the viewpoint of security, means for reading a part thereof is not provided. Therefore, in the conventional method, kernel threads that are started separately cannot share the data protection state. Each kernel thread has a separate TSS, but even if context information is simply copied to another TSS area, it will all be the same, including the stack area, so they operate independently as separate threads. I can't do that.
[0165]
Therefore, in the present invention, the processor of the present invention shares a context information saving instruction at a specific point in time by a program and data protection information between kernel threads according to the following procedure, and a kernel level multi-thread function Is possible.
[0166]
FIG. 14 shows a thread table used for sharing data protection attributes. The thread ID is the value of the task register of the kernel thread. Thread ID0 has a special role for initialization. The user TSS stores a pointer to the user TSS area for saving the state when the thread calls a subroutine outside the protection domain. The parameters are used for passing parameters from the OS to each thread, and conversely, when calling a subroutine outside the protection domain from the thread. The in-work flag is used for exclusive control of rewriting the table and TSS0.
[0167]
FIG. 13 is a flowchart showing a procedure for sharing data protection attributes under the same program. The OS initializes the thread table shown in FIG. 14 before the main thread that executes the protection domain first. Initialization is performed by writing a value 0 in the user TSS field of the thread ID 0 and writing a pointer to a parameter block in which parameters necessary for execution of the main thread, such as arguments, are stored in the parameter field of the main thread TSS 1. Done.
[0168]
In step 1301, the kernel thread first executes egate to start execution of protection domain code. At this time, all registers other than the system register are initialized. Next, in step 1302, the thread table is read from the address of the thread table embedded in the code in advance, and the value of the user TSS field corresponding to the thread ID0 for initialization is looked up to initialize with the user TSS field. Determine if has been started. If the value of the user TSS field is 0, it has not been initialized yet. In this case, it is determined that the thread table has not been initialized (NO in step 1302), and the process proceeds to step 1303.
[0169]
In step 1303, 1 is written in the working flag field of thread ID 0 to indicate that the initialization is started, and then the data encryption attribute is initialized. The initialization of the data encryption attribute depends on the protected application being executed. Here, an encryption key determined in advance by the program may be set in the fixed address area reserved at the time of loading the program, or a memory is dynamically allocated and an encryption key using a random number is set. Also good. When the setting of the data encryption attribute is completed, the process proceeds to step 1304. For example, the execution state of the thread 1 (the task register indicates the system TSS1) is set in the uTSS0 area by the stctx instruction that stores the user TSS. save. The TSS saved by the stctx instruction is the user TSS in which the U flag in the 825-2 area shown in FIG. The instruction next to stctx is the instruction that is executed first when uTSS0 is restarted. This saving and returning of the user TSS has no effect on the task register for identifying the thread (the task register indicates a place where the system TSS corresponding to the thread interrupted by the interrupt is saved).
[0170]
In step 1308, the in-work flag set in the table is cleared, and execution of another thread (for example, thread 2) in the same program is resumed. The restart process will be described later. In step 1309, the task register is read by the ltr instruction to identify the thread ID. In step 1310, the original process specified by the thread table parameter is started.
[0171]
Even when another thread 2 (the task register indicates the system TTS2) executes the code of this protection domain by an interrupt or the like under the same program, the thread table is initialized and the egate instruction is executed. Are the same. Since the second and subsequent threads have already been initialized by the first thread, the user TSS corresponding to the thread ID 0 in the table is set to 1. Therefore, it is determined that initialization has been completed in step 1302 (YES in 1302). In step 1305, it is determined whether the thread table is marked during work. If work is in progress (YES in 1305), thread 2 sleeps (step 1306), repeats step 1305, and waits for execution to be resumed upon completion of work on the table.
[0172]
If the table is not in operation at step 1305 (NO at 1305), the user TSS0 corresponding to the thread ID 0 is restored, and the control shifts to the state immediately after saving uTSS0 (step 1508). At this time, the data protection state stored in uTSS0 is restored. However, in this state, it is not possible to distinguish whether to execute thread 1 or thread 2 from now on. Therefore, the task register is read at step 1309, the thread ID of its own thread is specified, the parameters are read, and necessary processing (for example, signal handler) is executed at step 1310. Since the task register is not updated when uTSS returns, the thread can correctly acquire its own thread ID.
[0173]
When a thread that has started execution once and shared the data protection attribute changes the data encryption attribute, if the TSS1 thread is taken as an example, the necessary information is stored in the parameter field of the table corresponding to the thread ID TSS1. The included parameter block is written, uTSS1 is designated as the user TSS, the above ecall instruction is issued, and then control is passed to step 1503. When a working flag is written in the working field of TSS1 and the other thread is requested to sleep, when the other thread enters the sleep state, the change of the data encryption attribute is started, and the update of the data encryption attribute is completed. , Control is returned to uTSS1.
[0174]
(Second Embodiment)
In the first embodiment, all data encryption attributes such as data encryption keys are stored in the register file 253 inside the microprocessor. In this method, when the number of encryption attribute types exceeds the number of protection attribute registers, the protection attribute registers are forced to be replaced, and programming becomes complicated and processing performance is degraded. On the other hand, when the number of protection attribute registers is increased, the amount of data stored in the memory at the time of context switching increases, and the processing performance also decreases. Considering applications where interprocess communication encryption is performed using the encryption function of the microprocessor, it is common to use a different encryption key for each process of the communication partner, so it is easy to increase the types of encryption attributes. Therefore, it is necessary to take measures against it.
[0175]
In such a case, in general, information is not directly held in a register in the microprocessor, but is written in a table on an external memory (for example, main memory 281), and only a necessary part is dynamically read into the processor. Techniques are known. However, this method is dangerous from the viewpoint of protecting the secret. This is because the table on the memory may be replaced with a table in which another data (for example, a decryptable key) is stored by the attacker.
[0176]
Therefore, in the second embodiment of the present invention, a signature by a microprocessor is added in advance to each part that is dynamically read in information necessary for secret protection. Then, when this part is read from the external memory table into the microprocessor, the signature is verified. This method reduces the overhead during each context switch, and at the same time guarantees safety against switching.
[0177]
FIG. 15 shows the configuration of the register file 253 of the microprocessor according to the second embodiment of the present invention. The microprocessor according to the second embodiment includes four encryption attribute registers CY0 to CY3 that store in advance an encryption attribute for data referred to by each program in an internal register, and an encryption attribute for specifying the encryption attribute. It has 60 words CT0 to CT59 for storing information. Each of CY0 to CY3 has a size of 10 words, and each of CT0 to CT59 has a size of 4 words.
[0178]
CY0 to CY3 have an encryption key field in the register, but CT0 to CT59 do not have an encryption key field, but instead have an offset address to the key. The offset address of CT59 is indicated by 1521-4. The offset indicates an address from the top of the key storage area, and the top of the key storage area is defined by the encryption attribute register CY0.
[0179]
The start address 1521-1 of the encryption attribute information specifying register CT59 specifies the head of the encryption target area, and the size 1521-5 specifies the length thereof. A key offset 1521-6 indicates an offset from the head of the key storage area specified by CY0 to the key, and the address stores a key entry including a key value and a hash. An E flag 1521-4 indicates whether the register is valid, and a D flag 1521-3 indicates whether the register is in a debug state. The fields for specifying the encryption algorithm and the key length are 1021-2 and 1021-7, respectively. This register has Salt1021-8. The Salt will be described later.
[0180]
FIG. 16 is a diagram showing the relationship between the CY0 register and the encryption attribute information specifying register CT0 in the microprocessor and the key storage area on the external memory defined by these registers. The key storage area 1601 on the memory defined by the encryption attribute register CY0 includes key entries (key entries) 1602, 1603,. Each key entry has fields 1202-1 and 1203-1 indicating key values, and book titles 1202-2 and 1203-2 regarding the key values and other information.
[0181]
When the encryption attribute registers CY0 to CY3 are initialized, the valid fields 1521-4 (FIG. 15) of all the registers of the encryption attribute information specifying registers CT0 to CT59 are cleared, and the encryption function designated by these registers is set. It is invalid. On the other hand, CY0 to CY3 are valid, and all the logical address spaces are set to be encrypted with the random number selected at the time of initialization.
[0182]
When using the encryption function of CT0 to CT59, first select the key storage area on the logical address and the master key for that area, set it to CY0, and enable the encryption function of the CY0 register. To do. The master key may be generated by the random number generation mechanism 252 of the exception processing unit 131 of the microprocessor or may be a fixed key embedded in the program in advance.
[0183]
Next, in the key storage area 1601 on the external memory, the storage location (key entry) 1603 of the key used in the register CT0 is determined in the address area set in the encryption attribute register CY0, and the offset field of the CT0 register Write to 1580-6 (FIG. 15). Further, the encryption algorithm and the key length are selected and written in 1580-2 and 1580-7.
[0184]
Then, the key value is selected and written in the key value field 1603-1. A random number is written in the Salt 1521-8 as necessary, and then the valid bit E1521-4 is set to 1.
[0185]
The microprocessor has a protection table management unit 233 (see FIG. 2). The protection table management unit 233 calculates a signature based on the secret key Ks of the microprocessor for a predetermined signature calculation target using a predetermined algorithm. The signed value is written in the signature area 1603-2 following the key value (key value). At this time, the protection table management unit 233 checks whether the key and signature storage area 1603 is within the range of CY0 and whether the encryption function of CY0 is valid. If the key area 1603 is out of the range of CY0, or if the encryption key of CY0 is set to 0 and the encryption function is not valid, the microprocessor exception handling unit 255 is set to the private key as will be described later. Raise a protection exception. Since the security of CT0 to CT59 depends on the security of CY0, it is desirable not only to select a random number for the encryption key of CY0 but also to confirm that the encryption algorithm used is secure.
[0186]
The calculation target of the signature includes the encryption key value 1603-1, the contents of the CT0 register 1580, and the logical address of the encryption key. Since the CT0 register 1580 contains a salt, if the salt value is changed at an appropriate frequency, the attacker can reuse the encrypted key entry used in the past and replace the key entry. Is extremely difficult even if the values of the other fields of CY0 are the same. Of course, when key entries having completely different attribute values are used, the key entries cannot be replaced cryptographically.
[0187]
When data is read, the logical attribute is compared with the encryption attribute registers CY0 to CY3 and the encryption attribute information specifying registers CT0 to CT59 to determine the encryption attribute. If the logical address to be read is an area designated by CT0, the encryption key indicated by the offset is read into the key cache. The code encryption key / signature verification unit 257 verifies the signature with the microprocessor public key Kp from the read key value, the contents of CT0, and the key address. If the verification result is an error, a secret protection exception is generated and the process is stopped. If the verification result is correct, the decryption unit 237 of the data TLB 141 decrypts the data with the extracted key, and the decrypted data is read into the data cache 218.
[0188]
<Unresumable bit>
If verification fails and a secret protection exception occurs, the context resumability bit is cleared to 0 and the context cannot be resumed thereafter. Such a violation occurs because there is a high possibility that the data for secret protection is destroyed by some attacker, and the subsequent execution is prohibited to prevent the leakage of secret information.
[0189]
Here, the case where the start and size of the logical address of the encryption target area are set in the encryption attribute registers CY0 to CY2 is taken as an example, but other table formats such as a page table and a segment descriptor are also used. A method for managing memory encryption attributes using the. Needless to say, the present invention is also applied to these systems.
[0190]
In the second embodiment, large-size key information that is not necessary for determining the encryption attribute of data is stored in a table outside the processor to reduce the size of context information inside the processor, and at the same time, an external table By adding a hash to each piece of key information stored in the server and verifying it at the time of reading, attacks due to replacement of information stored outside the processor are prevented.
[0191]
Here, since the signature is generated from data including the value of the encryption attribute information specifying register of the microprocessor, by changing the Salt value of the encryption attribute information specifying register, the signature is stored in the memory outside the processor in the past. The written key entry can be invalidated to prevent the use of a previously used key entry. For example, if a signature is generated only from the address range attribute and the key value without using such a signature method, an attack that replaces the key entry used in the past in external memory as long as the address range matches. Will be possible. On the other hand, if a general-purpose register is included in the signature generation target, the signature must be generated again each time the value of the general-purpose register changes, resulting in performance degradation.
[0192]
In the present invention, it is not necessary to recalculate the signature unless the attribute value of the encryption attribute information specifying register and the Salt value are rewritten. In actual use, it is considered that the setting frequency of the encryption attribute information specifying register is not so high, so that it is possible to prevent the key value from being replaced while suppressing a decrease in performance.
[0193]
In the microprocessor according to the second embodiment, the context information is significantly smaller than when all the encryption attributes are stored in the registers of the microprocessor, which is necessary for encryption and signature at the time of context switching. Processor performance can be improved by reducing the amount of computation and memory traffic for saving context.
[0194]
Although it is possible to prevent the signature from being replaced on the register side as well as on the memory side, a secure signature using the asymmetric key method generally requires a large data length. Placing the signature on the memory is more effective in reducing the context information.
[0195]
In the present invention, when the encryption entry is validated, it is verified that the corresponding key storage area 1601 on the memory is encrypted (that is, the entry has a valid key). More secure protection.
[0196]
<Page table format>
Also, the data protection table format may be a hierarchical format for each address unit similar to the page table used for virtual memory management, and a signature may be added to each entry. The page table format can theoretically provide different encryption attributes for each page. Furthermore, the data held in the microprocessor need only be the start address of the page table and Salt, and the amount of context information can be reduced.
[0197]
In order to avoid confusion, a table used for data encryption in the microprocessor is hereinafter referred to as an encryption definition page table. Unlike the virtual memory page table in the external memory, the encryption definition page table is placed in the logical memory space of the user program.
[0198]
In addition, when the signature to be assigned to each entry in the encryption definition page table is simply generated from only the encryption definition page table register information of the processor and the information included in the entry, any entry includes a signature. Even if it is exchanged, it cannot be detected. This is because the information placed on the processor side, that is, the encryption definition page table register and the Salt included therein are common to all entries. This problem can be resolved by including the logical address where the entry is placed in the calculation area of the signature for each entry in the encryption definition page table (ie by ensuring that the signature contains a different value for each entry). Is done.
[0199]
For initialization of the page table, an attribute such as a key value (key value) is written in advance in the memory table, the address is set in the encryption definition page table register inside the microprocessor, and the Salt value is the same. Write to a register and set the valid flag for this register. With the validity flag set, a signature for each entry in the page table is calculated by the microprocessor and written to the external memory. When hierarchized, calculations are performed by sequentially searching the hierarchy. It should be noted that this process takes time proportional to the number of entries.
[0200]
<About debugging>
Even if both the execution code and the data to be processed are protected, it is desirable in terms of development efficiency that debugging can be performed in plain text without encryption when developing such functions.
[0201]
Settings related to debugging are performed in two places. One is the debug bit 307-j-D (see FIG. 4) of the execution code provided in the page table entry of the encryption code, and the other is the encryption key attribute of the data as shown in FIG. It is an encryption control bit (1517-3 for CY3 and 1521-3 for CT59) provided in the register to be designated. The corresponding bit in the latter first embodiment is bit 717-3 of the encryption attribute register CY3 shown in FIG.
[0202]
When the debug bit 307-j-D provided in the page table entry is set, the microprocessor's execution code decoding unit 212 (see FIG. 2) is bypassed and executed on the memory corresponding to the entry. The code is interpreted and executed in plain text. While the code is being executed in the debug state, the debug function of the processor, for example, the step execution function and the debug register described in connection with the first embodiment are enabled.
[0203]
Here, the debug bit of the page table is not protected at all, but it is encrypted even if a malicious user sets the debug bit of the page table entry where the encrypted executable program is placed. Since the execution program is not decrypted and is simply taken into the instruction fetch / decode function 214, normal execution cannot be performed, so there is no possibility that the secret of the program will be leaked.
[0204]
During debugging, the context is saved in clear text when an exception occurs. Therefore, a value E obtained by encrypting the random number Kr for encrypting the context with the code encryption key Kcode.Kcode[Kr] 833 is replaced with Kr in plain text. In this case, it is not possible to check whether the context information matches the encryption key of the code, but in the case of debugging, it is not necessary to consider the risk of such an attack.
[0205]
In the first embodiment, encryption of the data to be processed by the execution code is encrypted by the encryption control bit 713-3 shown in FIG. 7 and in the second embodiment by the encryption control bit 1517 of CY3 shown in FIG. -3, and the encryption control bit 1521-3 of CT59. When the encryption control bit is 0, the data is processed in the encrypted state even in the debug state. When the encryption control bit is set to 1, data is processed in plaintext only in the debug state.
[0206]
In the present invention, encryption and non-encryption can be selected for each entry of the encryption attribute in the debug state, so that encrypted data transmission / reception performed with another program or device can be performed. Debugging and debugging in the plaintext state of the internal data of the program are easily made compatible.
[0207]
In particular, the code is not encrypted, but is plain text, and the debugging flag on the page table is simply set. This provides the convenience of debugging without recompiling the program itself.
[0208]
Regarding the data to be processed, the area used for communication with other processes may not be able to be in plain text unless the partner process is in debug state even if the process is in debug mode. Therefore, an encryption flag that is effective only when the code is operating in the debug mode is provided in the data encryption attribute, and the encryption state can be controlled by this flag.
[0209]
There are four possible combinations of code debugging: the encryption state of the code itself and the encryption state of the key for encrypting the code. The above-described example is a combination example when the code encryption key and the code are both in plain text.
[0210]
Other modes (combinations) are also conceivable. The first is a mode in which the code can be executed in the debug mode with the code encryption key entry and the code itself encrypted. Second, the code encryption key entry is in a plain text state, the code itself is in an encrypted state, and the code can be executed in the debug mode. Third, the code encryption key entry is in an encrypted state and the code is in a plain text state.
[0211]
These modes are not meaningful for debugging purposes, but may be provided if necessary.
[0212]
In this case, it is important to note that in the first case, when the encrypted execution code corresponding to the encrypted code encryption key entry can be executed in the debug mode, the user encrypts it. Only by manipulating the control bits, a protected program that does not know the encryption key can be executed in the debug mode.
[0213]
In this case, in order to prevent unauthorized operation of the debug mode bit, measures such as encrypting the debug bit with the code encryption key Kcode and the processor public key Kp are taken to know the true code encryption key. Care must be taken not to manipulate the debug bits to no user.
[0214]
【The invention's effect】
As described above, according to the microprocessor of the present invention, in the multitasking environment, by encrypting and protecting both the execution code and the data to be processed by the code, the operation system or the third Can prevent unauthorized analysis.
[0215]
It is also possible to prevent unauthorized rewriting of the encryption attribute when data is encrypted and stored.
[0216]
In addition, an arbitrary random number Kr can be used as an encryption key of data to be processed instead of a fixed key, and the encrypted data can be protected from unauthorized attacks.
[0217]
Further, when debugging is performed in a plain text state and a defect is found, an error can be fed back to a program vendor who knows the encryption key of the execution code.
[0218]
In addition, information necessary for confidentiality protection, such as encryption attribute information, can be stored in an external memory with a microprocessor signature, and only the necessary part is read into a register inside the processor, and the signature is verified at the time of reading. Thus, the increase in the memory of the microprocessor can be prevented and the cost can be reduced. This method also ensures safety against replacement during reading.
[Brief description of the drawings]
FIG. 1 is a diagram showing a basic configuration of a microprocessor according to a first embodiment of the present invention.
FIG. 2 is a diagram showing a detailed configuration of the microprocessor of FIG. 1;
FIG. 3 is a diagram showing a page directory and a page table format in the microprocessor of FIG. 1;
4 is a diagram showing details of a page table shown in FIG. 3 and a key entry format. FIG.
FIG. 5 is a diagram showing data interleaving in the microprocessor of FIG. 1;
FIG. 6 is a diagram illustrating a flow of information from address conversion to decoding of an execution instruction code in the first embodiment.
FIG. 7 is a diagram showing a configuration of a CPU register of the microprocessor according to the first embodiment.
FIG. 8 is a diagram showing a context storage format in the first embodiment.
FIG. 9 is a flowchart showing a procedure for protection domain switching in the first embodiment;
FIG. 10 is a diagram showing a flow of information for encryption / decryption of data to be processed in the first embodiment.
FIG. 11 is a diagram showing execution control in a protection domain in the microprocessor of the present invention.
FIG. 12 is a diagram showing calls and branches from a protection domain to a non-protection domain in the microprocessor of the present invention.
FIG. 13 is a flowchart showing a procedure for sharing data encryption attributes in the microprocessor of the present invention;
FIG. 14 is a diagram of a thread table used for sharing data protection attributes.
FIG. 15 is a diagram showing a CPU register configuration of a microprocessor according to a second embodiment of the present invention.
FIG. 16 is a diagram illustrating a relationship between a key storage area register and an encryption attribute information specifying register in a microprocessor according to the second embodiment, and a key storage area on a corresponding memory;
FIG. 17 is a diagram showing a context storage format in the microprocessor according to the second embodiment;
FIG. 18 is a diagram illustrating a context saving format in the prior art.
[Explanation of symbols]
101 Microprocessor
111 processor core
112 Bus interface unit (reading means)
113 Code / Data Encryption / Decryption Processing Unit
114 Primary cache
115 Instruction execution unit
121 Instruction TLB
131 Exception handling part
141 Data TLB
151 Secondary cache
212 Code decoding unit
219 Data decryption unit
220 Data encryption unit
233 Protection table management unit
252 Random number generator
253 Register file (memory means external to the processor)
254 Context information encryption / decryption unit
257 Code Encryption Key / Signature Verification Unit
281 Main memory (memory means external to the processor)
307, 512 Page table
309, 511 Key table
CY0 to CY3 Encryption attribute register
CT0 to CT59 Encryption attribute information specific register

Claims (12)

外部へ読み出すことのできない固有の秘密鍵を内部に保持した1チップまたは1パッケージのマイクロプロセッサであって、
あらかじめ前記秘密鍵に対応する公開鍵によって暗号化されたコード暗号化鍵をマイクロプロセッサ外部の記憶手段から読み出す第1の読み出し手段と、
前記第1の読み出し手段で読み出した前記コード暗号化鍵を、前記秘密鍵を用いて復号化する第1の復号化手段と、
プログラムごとに異なる前記コード暗号化鍵によって暗号化された複数のプログラムを、前記マイクロプロセッサ外部の記憶手段から読み出す第2の読み出し手段と、
前記第2の読み出し手段にて読み出した前記複数のプログラムを復号化する第2の復号化手段と、
前記復号化された複数のプログラムを実行する実行手段と、
前記複数のプログラムのうち、一のプログラムの実行を中断する場合に、前記一のプログラムの実行状態を示す情報と、前記プログラムのコード暗号化鍵とを前記公開鍵によって暗号化し、暗号化した情報をコンテキスト情報として、前記マイクロプロセッサ外部の記憶手段に書き込む実行状態書き込み手段と、
前記一のプログラムの実行を再開する場合に、前記マイクロプロセッサ外部の記憶手段から前記コンテキスト情報を読み出し、前記秘密鍵でコンテキスト情報を復号化し、復号化されたコンテキスト情報に含まれるコード暗号化鍵が、前記第1の復号化手段により復号化された前記一のプログラムの前記コード暗号化鍵と一致する場合にのみ、前記一のプログラムの実行を再開する再開手段と、
を具備することを特徴とするマイクロプロセッサ。
A one-chip or one-package microprocessor that internally holds a unique secret key that cannot be read externally,
First reading means for reading a code encryption key encrypted in advance with a public key corresponding to the secret key from storage means outside the microprocessor;
First decryption means for decrypting the code encryption key read by the first read means using the secret key;
A second reading means for reading a plurality of programs encrypted by the code encryption key that is different for each program from a storage means outside the microprocessor;
Second decoding means for decoding the plurality of programs read by the second reading means;
Execution means for executing the plurality of decrypted programs;
When the execution of one program among the plurality of programs is interrupted, the information indicating the execution state of the one program and the code encryption key of the program are encrypted with the public key and encrypted. Execution state writing means for writing to the storage means outside the microprocessor as context information;
When resuming the execution of the one program, the context information is read from storage means outside the microprocessor, the context information is decrypted with the secret key, and the code encryption key included in the decrypted context information is only when matching the code encryption key of said first program decoded by the first decoding means, and resuming resuming means the execution of the one program,
A microprocessor comprising:
外部へ読み出すことのできない固有の秘密鍵を内部に保持する1チップまたは1パッケージのマイクロプロセッサであって、
あらかじめ前記秘密鍵に対応した公開鍵によって暗号化されたコード暗号化鍵をマイクロプロセッサ外部の記憶手段から読み出す第1の読み出し手段と、
前記第1の読み出し手段で読み出した前記コード暗号化鍵を、前記秘密鍵を用いて復号化する第1の復号化手段と、
それぞれが異なる前記コード暗号化鍵で暗号化された複数のプログラムを、前記マイクロプロセッサ外部の記憶手段から読み出す第2の読み出し手段と、
前記第2の読み出し手段によって読み出された複数のプログラムを復号化する第2の復号化手段と、
前記復号化された複数のプログラムを実行する実行手段と、
前記複数のプログラムのうち一のプログラムの実行を中断する場合に、一時鍵として乱数を発生し、前記一のプログラムの実行状態を示す情報を前記一時鍵で暗号化した第1の値と、前記一時鍵を前記一のプログラムのコード暗号化鍵で暗号化した第2の値と、前記一時鍵を前記マイクロプロセッサの秘密鍵で暗号化した第3の値とをコンテキスト情報として前記マイクロプロセッサ外部の記憶手段に書き込む実行状態書き込み手段と、
前記一のプログラムの実行を再開する場合に、前記マイクロプロセッサ外部の記憶手段から前記コンテキスト情報を読み出し、前記秘密鍵を用いて、前記コンテキスト情報に含まれる第3の値としての一時鍵を復号化し、復号化された一時鍵を用いて前記コンテキスト情報に含まれる実行状態情報を復号化するとともに、再開予定のプログラムのコード暗号化鍵を用いて、前記コンテキスト情報に含まれる第2の値としての一時鍵を復号化し、前記第2の値を復号化した一時鍵が、前記第3の値を秘密鍵で復号化した一時鍵と一致する場合にのみ前記一のプログラムの実行を再開する再開手段と、
を具備することを特徴とするマイクロプロセッサ。
A one-chip or one-package microprocessor that internally holds a unique secret key that cannot be read externally,
First reading means for reading a code encryption key previously encrypted with a public key corresponding to the secret key from a storage means outside the microprocessor;
First decryption means for decrypting the code encryption key read by the first read means using the secret key;
Second reading means for reading a plurality of programs each encrypted with a different code encryption key from storage means outside the microprocessor;
Second decoding means for decoding a plurality of programs read by the second reading means;
Execution means for executing the plurality of decrypted programs;
A first value obtained by generating a random number as a temporary key and encrypting information indicating an execution state of the one program with the temporary key when interrupting the execution of the one program among the plurality of programs; The second value obtained by encrypting the temporary key with the code encryption key of the one program and the third value obtained by encrypting the temporary key with the secret key of the microprocessor are used as context information to be external to the microprocessor. Execution state writing means for writing to the storage means;
When resuming the execution of the one program, the context information is read from storage means outside the microprocessor, and the temporary key as the third value included in the context information is decrypted using the secret key. , Using the decrypted temporary key to decrypt the execution state information included in the context information, and using the code encryption key of the program to be resumed as the second value included in the context information Resume means for resuming execution of the one program only when the temporary key is decrypted and the temporary key decrypted with the second value matches the temporary key with the third value decrypted with the secret key When,
A microprocessor comprising:
前記実行状態書き込み手段は、前記マイクロプロセッサに固有の秘密鍵による署名を前記コンテキスト情報に付与し、
前記再開手段は、復号化された前記コンテキスト情報に含まれる前記署名が、前記マイクロプロセッサに固有の秘密鍵による本来の署名と一致する場合にのみ、前記一のプログラムを再開することを特徴とする請求項に記載の1チップまたは1パッケージのマイクロプロセッサ。
The execution state writing means adds a signature with a secret key unique to the microprocessor to the context information,
The restarting means restarts the one program only when the signature included in the decrypted context information matches an original signature with a secret key unique to the microprocessor. The one-chip or one-package microprocessor according to claim 2 .
外部へ読み出すことのできない固有の秘密鍵を内部に保持した1チップまたは1パッケージのマイクロプロセッサであって、
あらかじめ前記秘密鍵に対応する公開鍵によって暗号化された暗号化鍵をマイクロプロセッサ外部の記憶手段から読み出す第1の読み出し手段と、
前記第1の読み出し手段で読み出した前記暗号化鍵を、前記秘密鍵を用いて復号化する第1の復号化手段と、
プログラムごとに異なる前記暗号化鍵によって暗号化された複数のプログラムを、前記マイクロプロセッサ外部の記憶手段から読み出す第2の読み出し手段と、
前記第2の読み出し手段にて読み出した前記複数のプログラムを復号化する第2の復号化手段と、
前記復号化された複数のプログラムを実行する実行手段と、
外部へ読み出すことのできないマイクロプロセッサ内部の記憶手段と、
前記プログラムが処理するデータのコード暗号化鍵及び暗号化の対象となるアドレス範囲を含む暗号化属性を、前記マイクロプロセッサ内部の記憶手段に書き込む暗号化属性書き込み手段と、
前記プログラムが処理するデータを、前記マイクロプロセッサ内部の記憶手段に書き込まれた暗号化属性に基づいて暗号化するデータ暗号化手段と、
前記複数のプログラムのうち、一のプログラムの実行を中断する場合に、前記一のプログラムの実行状態を示し、かつ前記暗号化属性の少なくとも一部を含む実行状態情報と、前記一のプログラムの暗号化鍵とを、前記公開鍵によって暗号化し、暗号化した情報をコンテキスト情報として、前記マイクロプロセッサ外部の記憶手段に書き込む実行状態書き込み手段と、
前記一のプログラムの実行を再開する場合に、前記秘密鍵でコンテキスト情報を復号化し、復号化されたコンテキスト情報に含まれる暗号化鍵が、前記第1の復号化手段により復号化された前記一のプログラムの前記暗号化鍵と一致する場合にのみ、前記一のプログラムの実行を再開する再開手段と、
を具備することを特徴とするマイクロプロセッサ。
A one-chip or one-package microprocessor that internally holds a unique secret key that cannot be read externally,
First reading means for reading from the storage means outside the microprocessor an encryption key encrypted in advance with a public key corresponding to the secret key;
First decryption means for decrypting the encryption key read by the first read means using the secret key;
Second reading means for reading a plurality of programs encrypted by the encryption key different for each program from storage means outside the microprocessor;
Second decoding means for decoding the plurality of programs read by the second reading means;
Execution means for executing the plurality of decrypted programs;
Memory means inside the microprocessor that cannot be read out externally,
Encryption attribute writing means for writing a code encryption key of data processed by the program and an encryption attribute including an address range to be encrypted into a storage means inside the microprocessor;
Data encryption means for encrypting data processed by the program based on an encryption attribute written in a storage means inside the microprocessor;
Among the plurality of programs, when the execution of one program is interrupted, execution state information indicating the execution state of the one program and including at least a part of the encryption attribute, and the encryption of the one program An execution state writing unit that encrypts the encryption key with the public key, and writes the encrypted information as context information in a storage unit outside the microprocessor;
When the execution of the one program is resumed, the context information is decrypted with the secret key, and the encryption key included in the decrypted context information is decrypted by the first decryption means. only if it matches the of the encryption key of the program, and resuming resuming means the execution of the one program,
A microprocessor comprising:
外部へ読み出すことのできない固有の秘密鍵を内部に保持した1チップまたは1パッケージのマイクロプロセッサであって、
あらかじめ前記秘密鍵に対応する公開鍵によって暗号化された暗号化鍵をマイクロプロセッサ外部の記憶手段から読み出す第1の読み出し手段と、
前記第1の読み出し手段で読み出した前記暗号化鍵を、前記秘密鍵を用いて復号化する第1の復号化手段と、
プログラムごとに異なる前記暗号化鍵によって暗号化された複数のプログラムを、前記マイクロプロセッサ外部の記憶手段から読み出す第2の読み出し手段と、
前記第2の読み出し手段にて読み出した前記複数のプログラムを復号化する第2の復号化手段と、
前記復号化された複数のプログラムを実行する実行手段と、
前記プログラムから参照されるデータのコード暗号化鍵及び暗号化の対象となるアドレス範囲を含む暗号化属性と暗号化属性特定情報とが格納された、外部へ読み出すことのできないマイクロプロセッサ内部の記憶手段と、
前記暗号化属性特定情報に関連し、前記暗号化属性に含まれるコード暗号化鍵の値及び前記マイクロプロセッサに固有の署名を含む関連情報を、前記マイクロプロセッサ外部の記憶手段に書き込む関連情報書き込み手段と、
前記プログラムが参照するデータのアドレスに基づいて、前記マイクロプロセッサ外部の記憶手段から、前記関連情報を読み込む関連情報読み込み手段と、
前記読み込み手段により読み込まれた関連情報に含まれる署名を、前記秘密鍵によって検証し、マイクロプロセッサ固有の署名と一致した場合にのみ、前記暗号化属性特定情報および前記読み込まれた関連情報に基づいて、データ参照のための暗号化鍵およびアルゴリズムを決定し、前記プログラムによるデータの参照を許可する許可手段と、
前記プログラムから参照されるデータを、前記マイクロプロセッサ内部の記憶手段に記憶された前記暗号化属性に基づいて暗号化するデータ暗号化手段と、
前記複数のプログラムのうち、一のプログラムの実行を中断する場合に、前記一のプログラムの実行状態を示し、かつ前記暗号化属性の少なくとも一部が含まれた実行状態情報と、前記一のプログラムの暗号化鍵とを、前記公開鍵によって暗号化し、暗号化した情報をコンテキスト情報として、前記マイクロプロセッサ外部の記憶手段に書き込む実行状態書き込み手段と、
前記一のプログラムの実行を再開する場合に、前記秘密鍵でコンテキスト情報を復号化し、復号化された再開予定のプログラムの暗号化鍵が、前記第1の復号化手段により復号化された前記一のプログラムの前記暗号化鍵と一致する場合にのみ、前記一のプログラムの実行を再開する再開手段と、
を具備することを特徴とするマイクロプロセッサ。
A one-chip or one-package microprocessor that internally holds a unique secret key that cannot be read externally,
First reading means for reading from the storage means outside the microprocessor an encryption key encrypted in advance with a public key corresponding to the secret key;
First decryption means for decrypting the encryption key read by the first read means using the secret key;
Second reading means for reading a plurality of programs encrypted by the encryption key different for each program from storage means outside the microprocessor;
Second decoding means for decoding the plurality of programs read by the second reading means;
Execution means for executing the plurality of decrypted programs;
A storage unit in the microprocessor that cannot be read out and stores an encryption attribute including the code encryption key of the data referenced from the program and an address range to be encrypted and encryption attribute specifying information When,
Related information writing means for writing, in the storage means outside the microprocessor, related information including the value of the code encryption key included in the encryption attribute and the signature unique to the microprocessor, related to the encryption attribute specifying information When,
Based on the address of the data to the program refers, from the microprocessor external memory means, the related information reading means for reading the relevant information,
The signature included in the related information read by the reading means is verified by the private key, and only when the signature matches the microprocessor specific signature, based on the encryption attribute specifying information and the read related information. A permission means for determining an encryption key and an algorithm for data reference and permitting the program to refer to the data;
Data encryption means for encrypting data referenced from the program based on the encryption attribute stored in the storage means inside the microprocessor;
Execution state information that indicates an execution state of the one program and includes at least a part of the encryption attribute when execution of the one program among the plurality of programs is interrupted, and the one program Execution state writing means for encrypting the encryption key with the public key, and writing the encrypted information into the storage means outside the microprocessor as context information;
When the execution of the one program is resumed, the context information is decrypted with the secret key, and the decrypted encryption key of the program to be resumed is decrypted by the first decryption means. only if it matches the of the encryption key of the program, and resuming resuming means the execution of the one program,
A microprocessor comprising:
前記関連情報は、前記暗号化属性特定情報と、マイクロプロセッサ固有の秘密情報と、前記関連情報のうちプロセッサ固有の署名を除く部分とに基づいて生成される第2の署名を含むことを特徴とする請求項に記載のマイクロプロセッサ。The related information includes a second signature generated based on the encryption attribute specifying information, microprocessor-specific secret information, and a portion of the related information excluding the processor-specific signature. The microprocessor according to claim 5 . 前記実行手段で実行されるプログラムが変更され、前記プログラムの暗号化鍵が変更された場合は、前記マイクロプロセッサ内部の記憶手段に記録された、前記プログラムから参照されるデータの暗号化属性を初期化することを特徴とする請求項に記載のマイクロプロセッサ。When the program executed by the execution means is changed and the encryption key of the program is changed, the encryption attribute of the data referred to by the program recorded in the storage means inside the microprocessor is initialized. The microprocessor according to claim 4 , characterized in that: プログラムごとに異なる暗号化鍵により暗号化された複数のプログラムを、マイクロプロセッサ外部の記憶手段から読み出す読み出し手段と、
前記読み出し手段により読み出された前記複数のプログラムを復号化する復号化手段と、
前記復号化された複数のプログラムを実行する手段と、
第1の命令の実行に基づく、前記複数のプログラムの中の一のプログラムの実行中に、この実行状態を示す情報と、前記一のプログラムの暗号化鍵とを、コンテキスト情報として前記マイクロプロセッサ外部の記憶手段に書き込む書き込み手段と、
第2の命令の実行に基づいて、前記外部の記憶手段に書き込まれたコンテキスト情報を読み出す読み出し手段と、
前記読み出されたコンテキスト情報に含まれる前記一のプログラムの暗号化鍵と、前記第2の命令の実行に基づき実行しているプログラムの暗号化鍵とを比較し、一致した場合にのみ、前記コンテキスト情報に含まれる実行状態を復元する復元手段と、
を具備することを特徴とする1チップまたは1パッケージのマイクロプロセッサ。
Reading means for reading out a plurality of programs encrypted with different encryption keys for each program from storage means outside the microprocessor;
Decoding means for decoding the plurality of programs read by the reading means;
Means for executing the plurality of decrypted programs;
During execution of one of the plurality of programs based on the execution of the first instruction, information indicating the execution state and the encryption key of the one program are used as context information as external information to the microprocessor. Writing means for writing to the storage means,
Reading means for reading out the context information written in the external storage means based on execution of the second instruction;
The encryption key of the one program included in the read context information is compared with the encryption key of the program being executed based on the execution of the second instruction. Restoring means for restoring the execution state included in the context information;
A one-chip or one-package microprocessor.
読み出し手段、復号化手段、実行手段、実行状態書き込み手段及び再開手段を備えるマイクロプロセッサによるマルチタスク実行方法であって、
前記読み出し手段が、それぞれ異なる暗号化鍵により暗号化された複数のプログラムのうち、一のプログラムを、マイクロプロセッサ外部の記憶手段から読み出すステップと、
前記復号化手段が、前記読み出したプログラムを、このプログラムに対応する復号化鍵で復号化し、前記実行手段が、前記復号化したプログラムを実行するステップと、
前記実行状態書き込み手段が、前記一のプログラムの実行が中断された場合に、前記一のプログラムの実行状態を示す情報と、前記一のプログラムの暗号化鍵とを、前記マイクロプロセッサに固有の暗号化鍵で暗号化し、この暗号化した情報をコンテキスト情報として前記マイクロプロセッサ外部の記憶手段に書き込むステップと、
前記再開手段が、前記コンテキスト情報を、前記マイクロプロセッサに固有の暗号化鍵に対応するマイクロプロセッサに固有の復号化鍵で復号化するステップと、
前記再開手段が、復号化された再開予定のプログラムの暗号化鍵と、前記マイクロプロセッサ外部の記憶手段から読み出した前記一のプログラムの前記暗号化鍵とを比較し、一致した場合にのみ、前記一のプログラムの実行を再開するステップと、
を含むマルチタスク実行方法。
A multitask execution method by a microprocessor comprising a reading means, a decoding means, an execution means, an execution state writing means, and a restarting means,
A step of reading one program out of a plurality of programs encrypted with different encryption keys from storage means outside the microprocessor;
The decryption means decrypts the read program with a decryption key corresponding to the program, and the execution means executes the decrypted program ; and
When the execution state writing means interrupts execution of the one program, information indicating the execution state of the one program and an encryption key of the one program are stored in a cipher unique to the microprocessor. Encrypting with an encryption key, and writing the encrypted information as storage information in a storage means outside the microprocessor;
The restarting means decrypting the context information with a decryption key unique to the microprocessor corresponding to an encryption key unique to the microprocessor;
Said resuming means, the encryption key of the program resume scheduled decoded, comparing the encryption key of the said one of the program read from the microprocessor external storage unit, only if they match, the Resuming execution of a program,
Multitask execution method including
読み出し手段、復号化手段、実行手段、実行状態書き込み手段及び再開手段を備えるマイクロプロセッサによるマルチタスク実行方法であって、
前記読み出し手段が、コード暗号化鍵の各々をあらかじめマイクロプロセッサに固有の公開鍵で暗号化されたコード暗号化鍵を、マイクロプロセッサ外部の記憶手段から読み出し、前記復号化手段が、前記公開鍵に対応するマイクロプロセッサに固有の秘密鍵で復号化するステップと、
前記読み出し手段が、あらかじめ異なる前記コード暗号化鍵で暗号化された複数のプログラムを、前記マイクロプロセッサ外部の記憶手段から読み出して、前記復号化手段が、前記復号化されたコード暗号化鍵で復号化するステップと、
前記実行手段が、前記復号化された複数のプログラムを実行するステップと、
前記実行状態書き込み手段が、前記複数のプログラムのうち、一のプログラムの実行が中断される場合に、当該一のプログラムの実行状態を示す情報と、このプログラムのコード暗号化鍵とを、前記公開鍵によって暗号化し、これをコンテキスト情報として前記マイクロプロセッサ外部の記憶手段に書き込むステップと、
前記読み出し手段が、前記マイクロプロセッサ外部の記憶手段から前記コンテキスト情報を読み出し、前記再開手段が、前記秘密鍵でコンテキスト情報を復号化するステップと、
前記再開手段が、前記復号化されたコンテキスト情報に含まれるコード暗号化鍵と、前記復号化手段により復号化された前記一のプログラムの前記コード暗号化鍵とを比較し、一致する場合にのみ、前記一のプログラムの実行を再開するステップと、
を含むマルチタスク実行方法。
A multitask execution method by a microprocessor comprising a reading means, a decoding means, an execution means, an execution state writing means, and a restarting means,
The reading means reads a code encryption key obtained by previously encrypting each code encryption key with a public key unique to the microprocessor from a storage means outside the microprocessor , and the decrypting means uses the public key as the public key. Decrypting with a secret key unique to the corresponding microprocessor;
The reading unit reads a plurality of programs encrypted in advance with the different code encryption keys from the storage unit outside the microprocessor, and the decrypting unit decrypts with the decrypted code encryption key. Steps to
The execution means executing the plurality of decrypted programs;
When the execution state writing means interrupts execution of one of the plurality of programs, information indicating the execution state of the one program and the code encryption key of the program are disclosed to the public. Encrypting with a key and writing this as context information in a storage means external to the microprocessor;
The reading means reads the context information from storage means outside the microprocessor, and the restarting means decrypts the context information with the secret key;
The resuming unit compares the code encryption key included in the decrypted context information with the code encryption key of the one program decrypted by the decryption unit , and only when they match Resuming execution of the one program;
Multitask execution method including
書き込み手段、読み出し手段、復号化手段、実行手段、データ暗号化手段、実行状態書き込み手段及び再開手段を備えるマイクロプロセッサによるマルチタスク実行方法であって、
前記書き込み手段が、あらかじめ異なる暗号化鍵で暗号化された複数のプログラムの各々の処理対象となるデータのコード暗号化鍵及び暗号化の対象となるアドレス範囲を含む暗号化属性を、外部へ読み出すことのできないマイクロプロセッサ内部の記憶手段に書き込むステップと、
前記読み出し手段が、前記暗号化鍵の各々をあらかじめマイクロプロセッサに固有の公開鍵で暗号化された暗号化鍵を、前記マイクロプロセッサ外部の記憶手段から読み出し、前記復号化手段が、前記公開鍵に対応するマイクロプロセッサに固有の秘密鍵で復号化するステップと、
前記読み出し手段が、前記暗号化された複数のプログラムを、前記マイクロプロセッサ外部の記憶手段から読み出し、前記復号化手段が、前記復号化された暗号化鍵で復号化するステップと、
前記実行手段が、前記復号化された複数のプログラムを実行する実行するステップと、
前記実行状態書き込み手段が、前記複数のプログラムのうち、一のプログラムの実行を中断する場合に、前記一のプログラムの実行状態を示し、かつ前記暗号化属性の少なくとも一部を含む実行状態情報と、前記一のプログラムのコード暗号化鍵とを、前記公開鍵によって暗号化し、これをコンテキスト情報として、前記マイクロプロセッサ外部の記憶手段に書き込むステップと、
前記データ暗号化手段が、前記プログラムの処理対象であるデータを、前記マイクロプロセッサ内部の記憶手段に書き込まれた暗号化属性に基づいて暗号化し、暗号化されたデータを前記マイクロプロセッサ外部の記憶手段に保存するステップと、
前記再開手段が、前記コンテキスト情報を前記マイクロプロセッサの秘密鍵で復号化するステップと、
前記再開手段が、前記復号化されたコンテキスト情報に含まれる暗号化鍵が、前記復号化手段により復号化された前記一のプログラムの前記暗号化鍵とを比較し、一致する場合にのみ、前記一のプログラムの実行を再開するステップと、
を含むマルチタスク実行方法。
A multitask execution method by a microprocessor comprising a writing means, a reading means, a decrypting means, an executing means, a data encrypting means, an execution state writing means, and a resuming means,
The writing means reads out an encryption attribute including a code encryption key of data to be processed and an address range to be encrypted for each of a plurality of programs previously encrypted with different encryption keys. Writing to storage means inside the microprocessor which cannot be performed;
The reading means reads an encryption key obtained by previously encrypting each of the encryption keys with a public key unique to the microprocessor from a storage means outside the microprocessor, and the decrypting means uses the public key as the public key. Decrypting with a secret key unique to the corresponding microprocessor;
The reading means reads the plurality of encrypted programs from the storage means outside the microprocessor, and the decrypting means decrypts with the decrypted encryption key;
The execution means for executing the plurality of decrypted programs; and
Execution state information indicating an execution state of the one program and including at least a part of the encryption attribute when the execution state writing means interrupts execution of the one of the plurality of programs; And encrypting the code encryption key of the one program with the public key and writing it as context information in a storage means outside the microprocessor;
The data encryption means encrypts data to be processed by the program based on an encryption attribute written in the storage means inside the microprocessor, and the encrypted data is stored outside the microprocessor. The steps to save in
The restarting means decrypts the context information with a secret key of the microprocessor;
Said resuming means, the encryption key included in the decoded context information, by comparing the encryption key of the one program that has been decoded by the decoding means, only if they match, the Resuming execution of a program;
Multitask execution method including
読み出し手段、復号化手段、実行手段、実行状態書き込み手段及び復元手段を備えるマイクロプロセッサによるマルチスレッド実行方法であって、
前記読み出し手段が、それぞれ異なる暗号化鍵であらかじめ暗号化された複数のプログラムを前記マイクロプロセッサ外部の記憶手段から読み出して、前記復号化手段が前記読み出した複数のプログラムを復号化してから、前記実行手段が前記復号化した複数のプログラムを実行するステップと、
前記実行状態書き込み手段が、第1の命令の実行に基づき、前記複数のプログラムの中の一のプログラムの実行中に、この実行状態を示す情報と、前記一のプログラムの暗号化鍵とを、コンテキスト情報として前記マイクロプロセッサ外部の記憶手段に書き込むステップと、
前記読み出し手段が、第2の命令の実行に基づいて、前記マイクロプロセッサ外部の記憶手段に書き込まれたコンテキスト情報を読み出すステップと、
前記復元手段が、前記読み出されたコンテキスト情報に含まれる前記一のプログラムの暗号化鍵と、前記第2の命令を実行中のプログラムの前記マイクロプロセッサ外部の記憶手段から読み出された暗号化鍵とを比較し、一致した場合にのみ、前記コンテキスト情報に含まれる実行状態を復元するステップと、
を含むマルチスレッド実行方法。
A multi-thread execution method by a microprocessor comprising a reading means, a decoding means, an executing means, an execution state writing means, and a restoring means,
The reading means reads a plurality of programs previously encrypted with different encryption keys from a storage means outside the microprocessor, and the decrypting means decrypts the read plurality of programs, and then executes the execution. Means for executing the plurality of decrypted programs ;
Based on the execution of the first instruction , the execution state writing means includes information indicating the execution state and the encryption key of the one program during execution of one of the plurality of programs. Writing into the storage means outside the microprocessor as context information;
The reading means reads the context information written in the storage means outside the microprocessor based on the execution of the second instruction;
The restoring means, the encryption key and encryption of the read from the microprocessor external memory means running programs the second instruction of the one of the programs contained in the read context information A key is compared and only when they match, the execution state included in the context information is restored; and
Multi-thread execution method including
JP2000135010A 2000-02-14 2000-05-08 Microprocessor, multitask execution method using the same, and multired execution method Expired - Fee Related JP4226760B2 (en)

Priority Applications (11)

Application Number Priority Date Filing Date Title
JP2000135010A JP4226760B2 (en) 2000-05-08 2000-05-08 Microprocessor, multitask execution method using the same, and multired execution method
US09/781,158 US6983374B2 (en) 2000-02-14 2001-02-13 Tamper resistant microprocessor
US09/781,284 US7270193B2 (en) 2000-02-14 2001-02-13 Method and system for distributing programs using tamper resistant processor
EP01301240A EP1126355A1 (en) 2000-02-14 2001-02-14 Method and system for distributing programs using tamper resistant processor
CNB011045124A CN1220121C (en) 2000-02-14 2001-02-14 Method and system for using interference-free microprocessor to allocate program
KR1020010007301A KR100362219B1 (en) 2000-02-14 2001-02-14 Method and system for distributing programs using tamper resistant processor
DE60135695T DE60135695D1 (en) 2000-02-14 2001-02-14 Fraud-proof microprocessor
CNB011030003A CN1189819C (en) 2000-02-14 2001-02-14 Interference-free microprocessor
KR10-2001-0007300A KR100375158B1 (en) 2000-02-14 2001-02-14 Tamper resistant microprocessor
EP01301241A EP1126356B1 (en) 2000-02-14 2001-02-14 Tamper resistant microprocessor
US11/071,327 US7353404B2 (en) 2000-02-14 2005-03-04 Tamper resistant microprocessor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000135010A JP4226760B2 (en) 2000-05-08 2000-05-08 Microprocessor, multitask execution method using the same, and multired execution method

Publications (2)

Publication Number Publication Date
JP2001318787A JP2001318787A (en) 2001-11-16
JP4226760B2 true JP4226760B2 (en) 2009-02-18

Family

ID=18643178

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000135010A Expired - Fee Related JP4226760B2 (en) 2000-02-14 2000-05-08 Microprocessor, multitask execution method using the same, and multired execution method

Country Status (1)

Country Link
JP (1) JP4226760B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210111881A1 (en) * 2018-04-03 2021-04-15 Daniel Migault Access to content of encrypted data session

Families Citing this family (40)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4153653B2 (en) * 2000-10-31 2008-09-24 株式会社東芝 Microprocessor and data protection method
JP2003051819A (en) * 2001-08-08 2003-02-21 Toshiba Corp Microprocessor
US20030126454A1 (en) * 2001-12-28 2003-07-03 Glew Andrew F. Authenticated code method and apparatus
US7890771B2 (en) 2002-04-17 2011-02-15 Microsoft Corporation Saving and retrieving data based on public key encryption
US7487365B2 (en) * 2002-04-17 2009-02-03 Microsoft Corporation Saving and retrieving data based on symmetric key encryption
KR100505106B1 (en) * 2002-05-29 2005-07-29 삼성전자주식회사 Smart card with enhanced security
WO2004006075A1 (en) * 2002-07-09 2004-01-15 Fujitsu Limited Open type general-purpose attack-resistant cpu, and application system thereof
JP2004126854A (en) * 2002-10-01 2004-04-22 Mitsubishi Electric Corp Attack countermeasure system
JP2004246637A (en) * 2003-02-14 2004-09-02 Fainaaku Kk Information computerization processor, processing device and storage device with the same, related program execution method, and computer program
JP4375980B2 (en) * 2003-03-11 2009-12-02 株式会社エヌ・ティ・ティ・ドコモ Multitask execution system and multitask execution method
US7472285B2 (en) * 2003-06-25 2008-12-30 Intel Corporation Apparatus and method for memory encryption with reduced decryption latency
US8156343B2 (en) * 2003-11-26 2012-04-10 Intel Corporation Accessing private data about the state of a data processing machine from storage that is publicly accessible
WO2005052769A1 (en) 2003-11-28 2005-06-09 Matsushita Electric Industrial Co.,Ltd. Data processing device
JP4629416B2 (en) * 2003-11-28 2011-02-09 パナソニック株式会社 Data processing device
JP4559794B2 (en) * 2004-06-24 2010-10-13 株式会社東芝 Microprocessor
JP4490192B2 (en) 2004-07-02 2010-06-23 株式会社エヌ・ティ・ティ・ドコモ Multitask execution system
US7444523B2 (en) * 2004-08-27 2008-10-28 Microsoft Corporation System and method for using address bits to signal security attributes of data in the address space
CN101233525A (en) 2005-05-26 2008-07-30 松下电器产业株式会社 Data processing device
US7657754B2 (en) * 2005-12-08 2010-02-02 Agere Systems Inc Methods and apparatus for the secure handling of data in a microcontroller
JP2008210038A (en) * 2007-02-23 2008-09-11 Aplix Corp User thread implementing method
JP4874916B2 (en) * 2007-09-28 2012-02-15 株式会社東芝 Content emulation apparatus and content emulation method
US8775824B2 (en) 2008-01-02 2014-07-08 Arm Limited Protecting the security of secure data sent from a central processor for processing by a further processing device
US8332660B2 (en) * 2008-01-02 2012-12-11 Arm Limited Providing secure services to a non-secure application
JP2009278491A (en) * 2008-05-16 2009-11-26 Casio Comput Co Ltd Microprocessor and microprocessor application device
WO2009156402A1 (en) * 2008-06-24 2009-12-30 Nagravision S.A. Secure memory management system and method
US8954752B2 (en) 2011-02-23 2015-02-10 International Business Machines Corporation Building and distributing secure object software
US8578175B2 (en) 2011-02-23 2013-11-05 International Business Machines Corporation Secure object having protected region, integrity tree, and unprotected region
US8819446B2 (en) 2009-06-26 2014-08-26 International Business Machines Corporation Support for secure objects in a computer system
US9954875B2 (en) 2009-06-26 2018-04-24 International Business Machines Corporation Protecting from unintentional malware download
US9298894B2 (en) 2009-06-26 2016-03-29 International Business Machines Corporation Cache structure for a computer system providing support for secure objects
US9846789B2 (en) 2011-09-06 2017-12-19 International Business Machines Corporation Protecting application programs from malicious software or malware
US9087200B2 (en) 2009-12-22 2015-07-21 Intel Corporation Method and apparatus to provide secure application execution
US9864853B2 (en) 2011-02-23 2018-01-09 International Business Machines Corporation Enhanced security mechanism for authentication of users of a system
JP6068325B2 (en) * 2013-12-19 2017-01-25 インテル・コーポレーション Processor that provides secure application execution
FR3043229B1 (en) * 2015-11-03 2018-03-30 Proton World International N.V. SECURE STARTING OF AN ELECTRONIC CIRCUIT
JP6777288B2 (en) * 2019-02-07 2020-10-28 インテル・コーポレーション Processor
JP6987112B2 (en) * 2019-12-02 2021-12-22 三菱電機株式会社 Integrated circuit
FR3111441B1 (en) 2020-06-10 2022-08-05 Proton World Int Nv Secure start of an electronic circuit
CN112199298B (en) * 2020-11-02 2022-05-13 杭州安恒信息技术股份有限公司 Single-step debugging detection method and device and computer readable storage medium
CN114338236B (en) * 2022-03-01 2022-05-13 四川省商投信息技术有限责任公司 Firewall intrusion data analysis method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210111881A1 (en) * 2018-04-03 2021-04-15 Daniel Migault Access to content of encrypted data session
US11968295B2 (en) * 2018-04-03 2024-04-23 Telefonaktiebolaget Lm Ericsson (Publ) Access to content of encrypted data session

Also Published As

Publication number Publication date
JP2001318787A (en) 2001-11-16

Similar Documents

Publication Publication Date Title
JP4226760B2 (en) Microprocessor, multitask execution method using the same, and multired execution method
KR100375158B1 (en) Tamper resistant microprocessor
US7673152B2 (en) Microprocessor with program and data protection function under multi-task environment
US9753865B2 (en) System and methods for executing encrypted code
Lie et al. Implementing an untrusted operating system on trusted hardware
JP4989543B2 (en) Security control in data processing system based on memory domain
JP4074057B2 (en) Method for sharing encrypted data area among tamper resistant processors
KR101457355B1 (en) Method and apparatus to provide secure application execution
JP3866597B2 (en) Internal memory tamper resistant processor and secret protection method
US7073059B2 (en) Secure machine platform that interfaces to operating systems and customized control programs
KR100550593B1 (en) A microprocessor
JP4226816B2 (en) Microprocessor
JP5249399B2 (en) Method and apparatus for secure execution using secure memory partition
US9756048B2 (en) System and methods for executing encrypted managed programs
JP4115759B2 (en) Method and program for using shared library in tamper resistant processor
JP3801833B2 (en) Microprocessor
JP4347582B2 (en) Information processing device
JP4643702B2 (en) Microprocessor
JP4375980B2 (en) Multitask execution system and multitask execution method
Bove Secure Services for Standard RISC-V Architectures

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050307

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080826

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20081022

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: 20081118

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20081127

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111205

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111205

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121205

Year of fee payment: 4

LAPS Cancellation because of no payment of annual fees