JP3866597B2 - Internal memory tamper resistant processor and secret protection method - Google Patents

Internal memory tamper resistant processor and secret protection method Download PDF

Info

Publication number
JP3866597B2
JP3866597B2 JP2002079155A JP2002079155A JP3866597B2 JP 3866597 B2 JP3866597 B2 JP 3866597B2 JP 2002079155 A JP2002079155 A JP 2002079155A JP 2002079155 A JP2002079155 A JP 2002079155A JP 3866597 B2 JP3866597 B2 JP 3866597B2
Authority
JP
Japan
Prior art keywords
memory
secret protection
task
secret
protection attribute
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
JP2002079155A
Other languages
Japanese (ja)
Other versions
JP2003280989A (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 JP2002079155A priority Critical patent/JP3866597B2/en
Priority to KR10-2003-0016803A priority patent/KR100491991B1/en
Priority to EP03251729A priority patent/EP1347384A3/en
Priority to CNB031074170A priority patent/CN1197014C/en
Priority to US10/391,618 priority patent/US7219369B2/en
Publication of JP2003280989A publication Critical patent/JP2003280989A/en
Application granted granted Critical
Publication of JP3866597B2 publication Critical patent/JP3866597B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/16Combinations of two or more digital computers each having at least an arithmetic unit, a program unit and a register, e.g. for a simultaneous processing of several programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/14Protection against unauthorised use of memory or access to memory
    • G06F12/1458Protection against unauthorised use of memory or access to memory by checking the subject access rights
    • G06F12/1466Key-lock mechanism
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/14Protection against unauthorised use of memory or access to memory
    • G06F12/1458Protection against unauthorised use of memory or access to memory by checking the subject access rights
    • G06F12/1466Key-lock mechanism
    • G06F12/1475Key-lock mechanism in a virtual system, e.g. with translation means

Description

【0001】
【発明の属する技術分野】
本発明は、パッケージ内部に、複数のプログラムとその作業領域を格納可能な大容量の内部メモリを有し、マルチタスクのプログラム実行環境下で、実行コードや処理対象データの不正な改変を防止することのできる耐タンパマイクロプロセッサに関する。
【0002】
【発明の背景】
情報システムネットワークとして、オープンシステムが広く普及している。オープンシステムでは、PCなどの一般ユーザ向けコンピュータのハードウェアやシステムプログラム(あるいはOS)の情報が開示されており、エンドユーザは、システムプログラムを変更して望んだ改良を加えることができる。このような環境で、アプリケーションプログラムが扱う情報の著作権や、プログラム自体の著作権を保護するためには、システムのOSがアプリケーションに対して敵対的動作をとり得ることを前提として、プログラムの秘密を守るハードウェアが必要となってくる。こうしたハードウェアを、特にマイクロプロセッサとして実現する試みが提案されている(特願平2000−35898号、Lie et al., “Architectural Support for Copy and Tamper Resistant Software”,; Computer Architecture News 28(5):p168-等)。
【0003】
これらのマイクロプロセッサは、マルチタスク環境で、プログラムとそれが扱う情報の覗き見や改変を防止するために、情報を暗号化する機能を備えている。このようなマイクロプロセッサを耐タンパマイクロプロセッサと呼ぶ。
【0004】
耐タンパマイクロプロセッサの主な目的は、エンドユーザのシステムで動作するアプリケーションの保護を通じて、プログラムやコンテンツ、ネットワークサービスの権利者の権利を保護することである。より具体的には次の3つが挙げられる。
【0005】
(1)プログラムに実装されたアルゴリズムの秘密保護
(2)プログラムに埋め込まれたトレードシークレットおよびコンテンツの、秘密または不正複製からの保護
(3)プログラム動作、処理結果の改変からの保護
プログラムに実装されたアルゴリズムの保護は、プログラムの権利者の保護に必要であり、プログラムに埋め込まれたトレードシークレットの保護は、プログラムが扱い著作権保護されたコンテンツの不正コピーを防止するのに必要である。ネットワークサービスを利用するプログラムが、課金情報をサーバとやりとりするようなアプリケーションでは、課金情報の送信動作を正しく実行し、不正な改変を防止することが、サービスプロバイダの権利の保護に重要である。実際の例として、パーソナルコンピュータ(PC)でDVDを再生するプログラムが解析され、そこからDVDの暗号を解読するためのトレードシークレットが読みとられて不正にDVDをコピーするプログラム(DeCSS)が作られたことはよく知られている。
【0006】
ここで、現在提案されているオープンシステムでのアプリケーションプログラムの秘密保護機構について、本願発明者らの提案(特願2000−35898号、特願2000−135010号、特願2000−333635号、特願2001−024480号)に基づき、簡単に説明する。紹介する例では、ひとつのシステム上で疑似並列的に複数のプログラムベンダのプログラムが実行され、それぞれがそのシステム資源を管理するOSからも独立に秘密を保持できることが特徴である。このような環境を「マルチパーティアプリケーション保護環境」と呼ぶこととする。
【0007】
図11は、これまでに提案されているマルチパーティのアプリケーション保護環境の概要を示す。ターゲットシステム(たとえばPC)1102は、耐タンパのマイクロプロセッサ1103を内蔵し、ハードディスクのような2次記憶1107と、プロセッサ外部のメモリ1108を有する。システム1102と、ユーザ1112で、システム環境1101を構成する。
【0008】
複数の異なるプログラムベンダ1121−1〜1121−nは、暗号化したプログラム1123−1〜1123−nを、それぞれネットワークを介してターゲットシステム1102に配信する。暗号化されたプログラムを保護プログラムと呼ぶ。
【0009】
ベンダから配信された暗号化プログラムは、ターゲットシステム1102の2次記憶1107に蓄積され、実行時に外部メモリ1108上に確保された領域1109に読み込まれる。外部メモリ上では、プログラムは未だ暗号化された状態である。暗号化プログラムは、外部メモリ1108からマイクロプロセッサ1103に取り込まれてはじめて復号される。復号処理は、各プログラムに対応してベンダから送られてきた鍵を用いて、保護機能1106で行なわれる。復号されたプログラムはキャッシュメモリ1104に読み込まれる。プログラムの復号とキャッシュメモリ1104への読み込みは、一度に全体が読み込まれるわけではなく、プログラムの実行にしたがって部分的に行われる。キャッシュメモリに読み込まれたプログラム部分は平文状態である。
【0010】
マイクロプロセッサ1102の内部では、保護機能1106によってプログラムは平文で取り扱われ、OS1110が介在する余地はない。また、キャッシュメモリ1104の内容は、マイクロプロセッサ1103の仕様に定められた操作を除いて外部から直接読み出すことはできない。
【0011】
一方、近年、集積回路技術の発達により、マイクロプロセッサと同一パッケージ内に大容量のメモリを搭載することが可能になっている。このような内部メモリ型のプロセッサでは、最大メモリ用量の制限はあるものの、従来の外部メモリを前提とした耐タンパプロセッサでオーバヘッドとなっていたメモリ読み込み、書き出し時の暗号処理負荷を低減できる可能性がある。
【0012】
しかし、メモリが内部メモリとしてマイクロプロセッサ内部に配置されたとしても、メモリの資源管理はあくまでもOSの管理下にあるので、OSによる敵対動作が十分に考えられる。したがって、内部メモリ型のマイクロプロセッサでは、OSの管理下でのプログラムの秘密保護が必要となってくるが、具体的な秘密保護の実現手段は何ら提案されていない。
【0013】
さらに、内部メモリ型のマイクロプロセッサで、単一のプログラムのみならず、複数の異なる暗号プログラムを擬似並列的に処理する場合に、複数プログラムの秘密保護を個別に保証する必要があるが、これについても、なんら提案されていない。
【0014】
【発明が解決しようとする課題】
内部メモリ型の耐タンパマイクロプロセッサで、秘密保護を保証しつつマルチタスク処理を実現するためには、
(1)複数プログラムを意図的改変から保護できるメモリ操作の統合性(integrity)
(2)OSによる資源管理と内部メモリの秘密保護の両立
(3)タスクとOSとの通信
を考慮する必要がある。
【0015】
具体的には、あるタスクが内部メモリのあるアドレスに対してn回のメモリ操作をおこなう場合、その過程で別のタスクによるメモリ操作からも、OSによる意図的な攻撃からも保護されなければならない。タスクの実行は数多くの命令のステップからなり、それらが正しく実行されてはじめて正しい結果が得られるからである。OSを含む攻撃者が、プログラムのある一部分だけを実行する、あるいは一連のメモリ操作のうち特定操作だけを除外する場合、プログラムの動作が恣意的に変更され、正しいプログラム実行ができなくなる。
【0016】
また、OSが資源管理の一環として行うメモリページの操作時に、メモリの解放を利用した攻撃が考えられ得るが、このような攻撃を排除すべく、資源管理とプログラムの秘密保護を両立させなければならない。
【0017】
さらに、タスクはシステムコールの発する場合、OSとデータ交換するが、このときOSとメモリを共有して通信する必要がある。
【0018】
ここで、従来の外部メモリ型耐タンパマイクロプロセッサの保護機構を、そのまま内部メモリ型に適用したプロセッサを考えてみる。まずメインの内部メモリは、ブロックまたはページと呼ばれる単位(たとえば4Kバイトページ)に分割される。プロセッサ内部には、メモリページ毎にその秘密保護属性を保持するテーブルが設けられ、テーブルエントリが、対応するメモリページの秘密保護属性を保持する。タスクT0 が操作したメモリページの秘密保護属性記述子には、自動的にタスクT0 のID が設定され、OSを含む他のタスクは一切その内容を平文で読み出し、書き換えできなくなる。ただし、OSはメモリページの再利用のために、あるメモリページの秘密保護属性を強制的に解除することができる。メモリページの秘密保護属性が解除されると、ページの内容はすべて消去されたうえで、所定の値に初期化され、もとタスクの秘密は守られる。
【0019】
いま、タスクT0 が、あるアドレスA0 のメモリページM0 に対して、M0 の初期状態からOp〜Op までn回のメモリ操作をおこなうとする。初期状態は不定であってよいが、Op〜Op の操作を確実におこなって、最終状態の結果を得ることが目的である。当然その過程では別のタスクによるメモリ操作が加わってはならない。
【0020】
一般タスクによるメモリ操作は、従来の外部メモリ型の保護機構により排除できる。しかし、OSがページM0 の秘密保護属性を解除した後に、当該ページを攻撃者の意図するデータに書き換える攻撃は、外部メモリ型の保護機構をそのまま内部メモリ型に適用しても、排除できないし、検出もできない。秘密保護属性解除以前のデータの秘密は保護され得るが、他のデータへの置き換えは防止できないのである。
【0021】
結果として、OS特権を持つ攻撃者が、タスクの秘密メモリ内容を意図したように自由に書き換えられることとなってしまう。
【0022】
メモリページの強制的な秘密保護属性の解除は、タスクの秘密保護にとって脅威となる。しかし、マルチタスクのシステム下では、このような強制解除の機能を排除してタスク自身だけが当該保護属性を解除できる構成とすることはできない。なぜなら、一部のタスクによって、過大なメモリが占有されてしまった場合に、OSがそれを制御できなくなるからである。
【0023】
また、OSとタスクが通信するための非保護状態のメモリアクセスと、保護されたメモリアクセスは、共存できるものでなければならない。
【0024】
そこで、本願ではこれらの点に留意しつつ、パッケージ内に比較的大容量の内部メモリを持つマイクロプロセッサにおいて、マルチタスクのプログラム実行環境下で、実行コードや処理対象であるデータの不正な改変を防止できる効率的な内部データ管理を実現する。
【0025】
【課題を解決するための手段】
内部メモリ型耐タンパプロセッサは、以下を備える。
【0026】
(a)異なる暗号鍵で暗号化された複数のプログラムを、各々復号する復号化手段;
(b)復号化手段により復号された複数のプログラムを、メモリページ単位で各々平文にて格納するための内部メモリ;
(c)前記プログラムを内部メモリの他のメモリページに読み込み、タスクとして実行する際に、このタスクがアクセス対象のメモリページ毎に要求する要求秘密保護属性を他のタスクとは排他的に設定し格納する要求秘密保護属性保持部;
(d)メモリページ毎に、当該メモリページのメモリ秘密保護属性を格納するメモリ秘密保護属性保持部;
(e)タスク実行時に、当該タスクがアクセス対象のメモリページについて、メモリ秘密保護属性保持部にメモリ秘密保護属性を設定する秘密保護管理部;および
(f)要求秘密属性保持部に格納された要求秘密保護属性と、メモリ秘密保護属性保持部に格納されたメモリ秘密保護属性とを比較し、一致した場合に当該メモリページへのアクセスを許可するメモリ保護手段。
【0027】
このような内部メモリ型マイクロプロセッサでは、プログラムやデータが平文状態で内部メモリに格納されるので、メモリの読み出し、書き出しに暗号処理を必要としない分、処理能力のオーバーヘッドを解消できる。
【0028】
また複数プログラムを擬似並列的に走らせるマルチタスク環境下で、メモリ資源管理を行うOSが、メモリページの解放を利用して不正処理を意図したとしても、成功しない。タスクがアクセス対象のメモリページに要求する秘密保護属性と、このタスク処理に必要なメモリ領域に設定されている秘密保護属性とが一致しない限り、そのメモリページへのアクセスが許可されないからである。
【0029】
このような構成により、複数プログラムの個々の秘密が保護され、OSによる資源管理と各プログラムの秘密保護が両立する。また、メモリページの秘密保護属性を管理することによって非保護領域を確保し、タスクとOSの通信を保証できる。
【0030】
【発明の実施の形態】
以下の説明において、マイクロプロセッサ外部のメモリに暗号化された状態で格納されたプログラムを読み込んで処理する従来型の耐タンパプロセッサを「外部メモリ型耐タンパプロセッサ」、マイクロプロセッサのパッケージ内にプログラムを平文状態で格納する耐タンパプロセッサを「内部メモリ型の耐タンパプロセッサ」と称する。
【0031】
また本明細書において、プログラムの秘密保護とは、固有のプログラム鍵で暗号化されているプログラムの作業データが、他のプログラムから読み取られないことはもちろんのこと、攻撃者の意図にそったデータの改変や、プログラムの動作の改変といった攻撃も防止することを意味する。
【0032】
<第1実施形態>
図1は、本発明の第1実施形態に係る内部メモリ型の耐タンパプロセッサの概略構成図である。プロセッサ100は、プロセッサパッケージ101内に、プロセッサコア102と、キャッシュモジュール103と、バスインターフェイスユニット(BIU)107と、プライバシマネージャ(秘密保護管理部)301を含むファームウェア(ROM)109と、内部メモリ110を有し、これらは内部バス126を介して相互接続されている。
【0033】
プロセッサコア102は、実行中のプログラムが使用するワーキングレジスタ114と、タスク切り替え部(STS:secure task switcher)115を有する。ワーキングレジスタ114は、MTR(memory type range)レジスタ401を含む。MTRレジスタ401は、タスクがアクセス対象である内部メモリ領域(すなわちメモリページ)に秘密保護を要求するかどうかを指定する要求秘密保護属性(RPA:requested protection attribute)を格納する。タスク切り替え部115は、タスク対応に実行中のレジスタ状態を保持するコンテキストテーブル116と、タスク対応にプログラム暗号鍵などの鍵情報を保持する鍵テーブル(タスクキーテーブル)117を有する。
【0034】
ファームウウェア109には、図示はしないが、プロセッサ100に固有の秘密鍵が格納されている。ファームウェア109は、プライバシマネージャと呼ばれる秘密保護管理部301を含み、内部メモリ110の各メモリページのメモリ秘密保護属性(MPA:memory protection attribute)を管理する。プライバシマネージャ301は、たとえばファームウェアに格納されるプログラムとして実現される。
【0035】
内部メモリ110は、大きく2つの領域に分割される。ユーザエリア111と秘匿エリア112である。ユーザエリア111には、OSやそのシステムエリアを含むユーザプログラムが、実行時に格納される。秘匿エリア112は、プライバシマネージャ301のみが操作できる領域で、メモリ秘密保護属性(MPA:memory protection attribute)テーブル501を格納する。MPAテーブル501は、メモリページごとにその秘密保護属性を格納する。上述したプライバシマネージャ301は、タスクが発行する秘密保護命令に応じて、対応するメモリページに関し、MPAテーブル501にメモリ秘密保護属性を設定する。秘匿エリア112にはOSによる操作がいっさい及ばない。
【0036】
キャッシュモジュール103は、命令キャッシュ104と、データキャッシュ105と、メモリ保護モジュール(メモリ保護手段)106を有する。データキャッシュ105は、プログラムの実行時(すなわち対象領域へのアクセス時)に、内部メモリ110のユーザエリア112のページ内容と、それに対応してMPAテーブル501に保持された秘密保護属性とを読み込む。メモリ保護モジュール106は、データキャッシュ105のキャッシュタグに書き込まれたメモリ秘密保護属性(MPA)と、コア102のMTRレジスタ401から出力されたタスク指定の要求秘密保護属性(RPA)とを比較し、これら2つの属性が一致したときにのみ、対象となるメモリページへのアクセスを許可する。
【0037】
BIU107は、暗号モジュール(復号化手段)108を有し、外部との入出力データを暗号化する。プロセッサ100は、BIU107を介して外部と入出力を行う。外部バスでプロセッサと接続された周辺機器ブリッジチップ122は、内部にバッファメモリ123を有する。周辺機器ブリッジチップ122はフラッシュメモリ121およびHDD125とそれぞれ接続されている。
【0038】
図2は、内部メモリマップを示す。ユーザエリア111と、プライバシマネージャのための領域301は、メモリマップ上で隔離される。メモリマップの前半部分はユーザエリアに割り当てられ、後半部分はプライバシマネージャの領域に割り当てられる。ユーザエリア111におかれた外部プログラムは、プライバシマネージャ301を含むファームフェア領域109に対してアクセスすることはできない。
【0039】
第1実施形態では、説明の単純化のため、仮想アドレス機構をもたない実アドレス方式のプロセッサを仮定する。このような耐タンパプロセッサの動作を以下で説明する。
【0040】
プログラムの読み込みとタスクの生成
図3は、図1のマイクロプロセッサ100によるプログラムAの読み込みとタスク生成の手順を示す概略図である。プログラムAは、プロセッサ100によって実行される前は、暗号化された状態でマイクロプロセッサ外部のフラッシュメモリ121(図1)やHDD124(図1)に格納されている。
【0041】
プログラムAの読み込み以前に、OSや別のプログラムが読み込まれて生成されたタスク1が、ユーザエリア111に読み込まれている。OSはユーザエリア111のアドレス0、Pから始まる領域に、タスク1はアドレスXから始まる領域に読み込まれている。
【0042】
プログラムAは配布鍵302とプログラム本体303で構成される。プログラムAの読み込みにあたって、OSは所定の手順により、暗号化された状態のプログラムAを周辺機器ブリッジチップ122のバッファメモリ123に読み込む。次にOSは、バッファメモリ123のプログラムのアドレス、内部メモリにおけるプログラムの配置アドレスY、およびタスクID(タスクk)を指定して、タスク生成命令を発行する。
【0043】
タスク生成命令が発行されると、制御はOSからプライバシマネージャ301に移る。プライバシマネージャ301は、たとえばファームウェア109に格納されたプログラムとして実装され、プログラムの秘密を守るために外部プログラムであるOSよりも強い特権を持つ。プライバシマネージャ301だけが、内部メモリの秘匿エリア112やコンテキストテーブル116、タスクキーテーブル117を操作できる。
【0044】
プライバシマネージャ301は、バッファメモリ123からプログラムAの配布鍵302を取得し、ファームウェア109に格納されたプロセッサ秘密鍵(不図示)を使って、暗号モジュール108を介して配布鍵302を復号し、プログラム鍵を取り出す。このプログラム鍵を、タスクキーテーブル117のタスクID(すなわちタスクk)に対応するエントリ117−kに格納する。次にプログラム鍵によってバッファメモリ123メモリのプログラム本体303を、暗号モジュール108を介して復号し、内部メモリのプログラム配置アドレスYから始まる領域に復号したプログラムを配置する。
【0045】
さらに、秘匿エリア112のメモリ秘密保護属性(MPA)テーブル501(図1)のプログラム配置領域に対応するエントリに、タスクID(k)を書き込み、これらの領域に保護属性を与えて、他のタスクからのアクセスを防止する。MPAテーブル501のエントリは、後述するように、メモリのページごとに(たとえば4Kバイトを1ページとして)設定される。それまでに実行されていたタスク1のエントリには、タスクID=1が書き込まれており、今回のプログラムAの読み込みによって、タスクID=kが書き込まれる。
【0046】
これでタスク実行の準備が完了し、一度制御がOSに戻された後、OSがタスクID=kの実行開始を指示する命令を発行する。すると、所定のアドレスからプログラムAすなわちタスクkの実行が開始される。なお、第1実施形態ではプライバシマネージャ301はファームウェア109によって実現されるものとしたが、ハードウェアによって実装されてもよい。ハードウェアによる実装の場合は、プライバシマネージャ301のタスク実行準備がなされている間、OSは他のタスクを並行して処理することができ、システムの応答性能が向上する。
【0047】
メモリの確保
さて、生成されたタスクkを実行するにあたって、タスクkは内部メモリ110に必要なメモリ領域を動的に確保する。まずタスクkはOSにメモリ領域を要求する。OSはタスクkに使用可能なメモリ領域、たとえばアドレスZから始まるメモリ領域を割り当てる。タスクkはこの領域を、タスクkのみが排他的にアクセスできる領域として使用するために、領域の秘密保護属性を設定する。秘密保護属性は、タスクkがアドレス領域を指定し、明示的に秘密保護属性設定命令を発行することによって設定される。秘密保護属性の設定は、このタスクのみが行うことができ、たとえOSであっても他のタスクの保護属性を設定することはできない。
【0048】
なお、通常、OSは他のタスクとのメモリ資源をめぐる競合を避けるため、メモリ管理ユニットMMU(不図示)に当該領域の資源保護属性を設定して、他のタスクがアクセスできないようにする。この設定はあくまでOSによる資源保護を目的としたものであり、悪意のあるOSの場合、タスクの秘密を保護する役割をなさないことに注意が必要である。
【0049】
タスクkから保護属性設定命令が発行されると、処理はプライバシマネージャ301に移行する。プライバシマネー301は、MPAテーブル501の指定された領域に対応するエントリに、命令の発行元であるタスクkのIDを書き込み、この領域を他のタスクによるアクセスから保護する。MPAテーブル501の形式は、たとえば図4に示すものである。PAMテーブル502は、各メモリページに対応するエントリ501−1〜501−nを有する。エントリは2つのフィールドを有し、フィールドPには、対応するメモリページの秘密保護の有無を示す秘密保護ビットを格納する。たとえば、秘密保護ビットの値が1のときは、秘密保護ありを意味する。残りのフィールドにはタスクIDが格納される。なお、上述したようにプロセッサが資源管理のためのMMU(不図示)を持つ場合には、プライバシマネージャ301が、保護属性設定命令の発行元タスクが対象領域のアクセス権を持っていることを確認する構成とすることが望ましい。
【0050】
保護タスクによるメモリアクセス
タスクが保護属性の設定されたアドレスをアクセスする際には、アクセスしようとしている対象領域が保護領域であることを指定してアクセスする。この保護領域の指定は、プロセッサコア102にあるMTR(memory tape range)レジスタ401によっておこなわれる。
【0051】
図5は、MTRレジスタ401の形式を示す。MTRレジスタ401は2ワードからなるレジスタであり、第1のワード401aに対象領域の先頭アドレスを、第2のワード401bにサイズを書き込み、さらに、フィールド402に秘密保護ビット1を設定する。これにより、指定されたアドレス領域にタスクが要求する秘密保護属性(RPA:requested protection attribute)が設定される。要求秘密保護ビットに0を書き込むと、それまで設定されていた秘密保護属性が無効となる。
【0052】
あるメモリアクセスが保護になるか、非保護になるかは、MTRレジスタ401によるアドレス範囲の指定と、アクセス対象のアドレスの組み合わせにより決定される。アクセス対象アドレスがMTRレジスタ401の指定範囲内にあれば、それは保護対象となる。タスクが利用できるMTRレジスタは複数個あってもよい。
【0053】
図6は、メモリアクセスの手順を示すフローチャートである。メモリアクセスの手順を説明する。タスクを実行するために、コア102がデータキャッシュ105に読み出し要求を出す時、現在実行中のタスクIDとタスクにより要求される要求秘密保護ビットとが、アドレスとともに出力される(S601)。一方、対象領域のアクセス時には、内部メモリ110のユーザエリア111から内容がデータキャッシュ105に読み込まれる。このとき、MPAテーブル501からメモリアドレスに対応するエントリが読み出され、エントリに記述されたタスクIDとメモリ秘密保護ビットが、対応するキャッシュラインのタグに書き込まれる(S602)。メモリ秘密保護ビットと要求秘密保護ビットとの取得順序は不問であり、同時に行われてもよい。
【0054】
メモリアクセス時にコア102から出力される要求秘密保護属性(RPA)は、あるタスクから見てアクセス対象のメモリに設定されているべきメモリ保護属性である。したがって、この要求秘密保護属性(RPA)と、アクセス対象である内部メモリ領域の秘密保護属性(MPA)とは一致していなければならない。
【0055】
そこで、ステップS603で、メモリ保護モジュール106において、キャッシュタグに書き込まれたメモリ秘密保護ビットと、コア102から出力された要求秘密保護ビットが比較される。比較結果が一致する場合(S603でYES)はステップS604に進み、今度はキャッシュタグに書き込まれたタスクIDと、コア102から出力されたタスクIDが一致するかどうかを判断する。S603とS604の判断順序は問わず、同時であってもよい。
【0056】
秘密保護ビットとタスクIDの双方が一致した場合にのみステップS605へ進み、実行しようとするタスクにメモリページのアクセス権があるかどうかを判断する。これは、OSによる資源保護の関係で、メモリ管理ユニットMMUにおいてタスクによる対象メモリ領域のアクセスが禁止されている場合があるからである。アクセス権が認められていれば(S605でYES)、対象のメモリ領域にアクセスが許可され、ステップS606でメモリ操作が実行される。アクセスが禁止されている場合は(S606でNO)、ステップS608で資源保護例外が発生する。
【0057】
一方、ステップS603で、キャッシュタグに書き込まれたメモリ秘密保護ビットと、コア102から出力されるタスク要求による秘密保護ビットとが不一致の場合(S603でNO)、あるいは、ステップS604でタスクIDが不一致の場合は、ステップS607でプロセッサコア102に対して秘密保護例外の発生を通知する。この結果、このタスクの実行は中断され、再開は不可能となる。
【0058】
たとえば、タスクkが対象領域へアクセスしようとするときに、MTRレジスタ401に正しい保護領域が設定されておらず、秘密保護されている対象領域に対して秘密保護なしとしてアクセスした場合は、たとえタスクIDが一致していても、メモリ保護モジュール106はアクセス違反と判断する。また、コア102から出力される要求保護ビットが、秘密保護指定してメモリアクセスしようとしているときに、キャッシュタグに書き込まれたメモリ保護ビットが秘密保護なしの領域を対象としている場合も同様に、アクセスは許可されない。
【0059】
このような秘密保護例外の判断基準と、資源保護例外の判定基準は、互いの判定結果や順序に依存せず独立である。
【0060】
なお、OSとのデータ交換で、非保護メモリをアクセスする場合には、それはMTRレジスタ401に指定した領域外であり、かつMPAテーブル501のエントリの秘密保護ビットは0のはずなので、アクセスは当然成功する。
【0061】
もしタスクkのために割り当てられた内部メモリのメモリ領域を、他のタスクがアクセスした場合、コア102から送られるタスクIDと、キャッシュタグのタスクIDとが一致しないため、当然秘密保護例外が発生し、違反アクセスをしたタスクの実行が中断される。
【0062】
なお、プログラム領域における保護プログラム領域の保護方法には触れていなかったが、上述したタスク処理と同様に、タスク生成命令によるプログラムのロード時に、対応する領域のMPAテーブル501に秘密保護属性を設定することによって実現される。プログラム領域のメモリアクセスの場合には、要求される秘密保護属性RPAはMTRレジスタ401によって定義されるのではなく、実行中のタスクIDがそのまま使われる。
【0063】
タスクの切替
メモリ操作が適正におこなわれタスクkが実行されているときに、割り込みが発生すると、その時点でのワーキングレジスタ114の情報は、図3に示すように、コンテキストテーブル116のタスクID=kのエントリに一時的に退避され、OSに制御が移される。このコンテキストテーブル116の内容はプライバシマネージャ301のみが知ることができ、OSや他のタスクがその内容を見ることはできない。同じくコア102のMTRレジスタ401も、タスクkが要求する要求保護属性(RPA)を指定するため、タスクkのレジスタ情報として、他のタスクによるアクセスから保護される。
【0064】
OSによるメモリの解放
OSは、秘密保護属性が設定されたメモリを、強制的に解放して他の目的に使うことができる。OSは、解放対象のメモリ領域を指定して秘密保護強制解放命令を発行する。命令の発行により、プライバシマネージャ301は対象領域のMPAテーブル501を保護無しに書き換えると同時に、対応するユーザメモリ領域111を所定の値に初期化して、格納されていた情報を消去する。
【0065】
秘密保護属性が保護無しに書き換えらたことによって、OSはこのメモリ領域を他のタスクに割り当てる、あるいはOS自身で使うなど、別の用途に使うことができる。
【0066】
このメモリ解放機能により、秘密の保護と、OSによる適切なメモリ資源管理が両立する。
【0067】
タスクの終了
OSは、秘密保護されたタスクを終了する時、このタスクIDを指定して、タスク終了命令を発行する。タスク終了命令の発行により、プライバシマネージャ301は、タスクの秘密保護属性が設定されたMPAテーブル501の対応するエントリを、保護無しの値に書き換える。同時に、そのメモリ領域をメモリ解放時と同様に初期化する。このタスク終了機能により、タスクが保持する秘密を漏洩することなく、タスクIDを再利用することができる。
【0068】
メモリアクセスの統合性保証効果
上記したマイクロプロセッサ100の構成により、メモリアクセスの保護が一貫して保証できることを説明する。
【0069】
タスクT0 が、あるアドレスA0 のメモリページM0 に対して、M0の初期状態からOp〜Op までn回のメモリ操作をおこなうとする。初期状態は不定であってよいが、Op〜Op の操作を確実におこなって、最終状態の結果を得る必要がある。その過程で別のタスクによるメモリ操作が加わったり、Op〜Opの操作順序が変更されたり、省略されてもならない。一連の操作の途中で一度ページが初期化されても、結果は期待と異なるものになってしまう。
【0070】
第1実施形態の方法では、最初にタスクT0 がメモリページM0 を確保して秘密保護属性を設定する命令を発行する。これにより、メモリページM0 に対応するMPAテーブル501のエントリに、秘密保護ビット“1”とタスクIDを設定する。その後、MTRレジスタ401にM0 のアドレスを設定して、Op〜Op の操作を行う。プログラム自身は暗号化されており、攻撃者が順序変更などを行うことは困難であり、タスク自身によるメモリページの秘密保護属性設定、MTTレジスタ301の設定、Op〜Op の操作の順序が正しいことは保証される。
【0071】
次に、メモリページM0 は実アドレスによって参照されるため、アドレスとして参照されるページは、常にただひとつだけであることが保証される。
【0072】
したがって、Op〜Op のアクセスにおいて、秘密保護例外が発生せずアクセスが成功したということは、確かに対象メモリページM0 に対してOp〜Op の操作が行われたということになる。
【0073】
また、あるメモリページに秘密保護属性を設定できるのは、タスク自身であり、このタスクは、Op〜Op の操作の前に、1回だけしか秘密保護属性の設定を行っていない。メモリページへのOp〜Op のアクセスは、MTRレジスタ401において秘密保護ビット1を指定して行なわれている。仮にこの間にOSがメモリページの解放を行っていたとすると、Op〜Op においてMTRレジスタ401で指定された保護属性(RPA)と、メモリページの保護属性(MPA)の不一致が生じ、秘密保護例外が発生してタスクの実行はそこで中止されていたはずである。
【0074】
よって、Op〜Op のアクセスにおいて、秘密保護例外が発生せずにアクセスが成功したということは、これらの操作の間に一度もOSによるメモリの解放が行われていないといえる。
【0075】
このように、第1実施形態のマイクロプロセッサの構成により、上述したメモリ操作の統合性、一貫性を保証することができる。そして、このメモリ操作の統合性は、OSによる強制的メモリ解放(資源管理)と、タスクによる非保護メモリページのアクセスと両立している。
【0076】
このような資源管理と秘密保護の両立は、タスクのみがメモリの秘密保護属性を設定できることと、メモリアクセス時に、メモリページに設けられたメモリ保護属性MPAと、タスクが保持す要求保護属性RPAを比較して属性が一致した場合のみアクセスを許可することを組み合わせた結果、実現されるものである。
【0077】
もっとも、MPAとRPAが一致した場合のみメモリアクセスを許可するという構成は、保護メモリと非保護メモリのアクセスが混在する場合において、タスクによる明示の秘密保護属性設定がなくても、単独でメモリ操作の安全性を高める効果がある。
【0078】
<第2実施形態>
第1実施形態では、内部メモリの秘密保護属性の設定は、タスクが発行する明示的な命令によりおこなわれていた。第2実施形態では、メモリの秘密保護属性の設定は、メモリアクセスによって暗黙に行なわれる。すなわち、メモリページが秘密保護されていない状態(すなわちメモリ保護属性MPAが0)のときに、タスクが秘密保護を要求する状態(すなわち要求保護属性RPAの値が1)でメモリにアクセスすると、自動的に対応するMPAエントリのフィールドに、メモリ保護ビット1が設定される。同時にメモリ内容が乱数により初期化される。この構成により、メモリ内容の安全性はさらに向上する。
【0079】
メモリアクセス時に、対象メモリ領域に秘密保護属性定が黙示的に設定されること以外は、第1実施形態と同様である。以下、メモリアクセス時の黙示の秘密保護属性設定について、詳細に説明する。
【0080】
図7は、黙示の秘密保護属性設定を含むメモリアクセスの手順を示すフローチャートである。あるメモリ領域にアクセスするにあたって、それが保護領域としてアクセスされるか否かは、第1実施形態と同様に、MTRレジスタ401のアドレス範囲指定と、対象アドレスの組み合わせにより決定される。
【0081】
まずステップS701で、要求秘密保護属性(RPA)を構成する秘密保護ビットとタスクIDが、対象アドレスとともにコア102から出力される。一方、ステップS702で、キャッシュタグに格納されている対応するメモリページのMPA保護ビットとタスクIDがメモリ保護モジュール106で取得される。
【0082】
ステップS703でRPAとMPAの秘密保護ビットの一致が判定される。一致した場合、ステップS704でタスクIDの一致が判定され、あとは第1実施形態と同様に、S705、S706、S711で資源保護判断が処理される。
【0083】
一致しない場合は(S703でNO)、ステップS707に進み、RPAの秘密保護ビットが1であるか否かを判断する。RPAの秘密保護ビットが1ならば(S707でYES)、ステップS708で処理はプライバシマネージャ301に移り、アクセス対象メモリページのMPAエントリに、秘密保護ビットの値1と、アクセスしたタスクのタスクIDが設定される。さらに、ステップS709で、乱数によってそのページの内容がすべて初期化される。その後、ステップS704へ進んで、タスクIDの一致が判断され、以後の処理は第1実施形態と同様である。
【0084】
ステップS707でRPAの秘密保護ビットが1でないとき(すなわち0のとき)は、そのアクセスは秘密保護違反として扱われ、ステップS710で秘密保護例外が発生する。
【0085】
第2実施形態の構成により、OSによる意図なメモリ改変から、タスクのメモリアクセスが一貫して保護されることを補足説明する。
【0086】
タスクT0 が、あるアドレスA0 のメモリページM0 に対して、M0の初期状態からOp〜Op までn回のメモリ操作をおこなうとする。初期状態は不定であってよいが、Op〜Op の操作を確実におこなって、最終状態の結果を得る必要がある。その過程で別のタスクによるメモリ操作が加わったり、Op〜Opの操作順序が変更されたり、省略されてもならない。一連の操作の途中で一度ページが初期化されても、結果は期待と異なるものになってしまう。
【0087】
第2実施形態の方法では、タスクT0 はMTRレジスタ401にメモリページM0 のアドレスを設定して、メモリページM0 に対してOpのメモリ操作を発行する。その際、メモリページM0 にメモリ秘密保護属性が設定される。初期状態では、メモリページM0 には保護属性がまだ付与されていないはずである。タスクT0 はその後、Op〜Opを行う。
【0088】
まずプログラム自身は暗号化されており、攻撃者が順序変更などを行うことは困難である。したがって、メモリページの秘密保護属性設定、MTRレジスタ401の設定、Op〜Op の操作の順序が正しいことは保証される。
【0089】
次に、メモリページは実アドレスによって参照されるため、あるアドレスで参照されるページは常にただひとつだけである。したがって、Op〜Op のアクセスにおいて、秘密保護例外が発生せずアクセスが成功したということは、確かに対象メモリページM0 に対して、Op〜Op の操作が行われたということになる。
【0090】
また、あるメモリページにそのタスクの秘密保護属性を設定できるのは当該タスクだけであり、このタスクによって秘密保護属性が設定されるのは、Op〜Op の操作の際に限られる。ただし、その際にはメモリページの内容は乱数によって初期化されてしまう。
【0091】
したがって、この間にOSが一旦メモリページの解放を行い、M0 の内容を意図したように書き換えたとしても、その場合、保護属性がクリアされてしまう。この結果、内容は必ず乱数により初期化されてしまい、意図的な改変は成功しない。もちろん、タスクの正常な動作は妨害されるが、その結果が攻撃者の意図した結果を生む可能性は一般に極めて低いといえる。
【0092】
第2実施形態の構成により、タスクの秘密メモリを意図的な改変から保護することができる。このような保護は、OSによる強制的メモリ解放およびタスクによる非保護メモリページのアクセスと両立している。
【0093】
<第3実施形態>
第1および第2の実施形態では、実アドレス方式のマイクロプロセッサを対象として、タスクの秘密の安全性とOSによるメモリ管理が両立し、同時に、タスクとOSの通信が確保され、メモリ操作の一貫性が保証される秘密保護方式を説明した。
【0094】
第3実施形態は、仮想記憶機構を持つ内部メモリ型プロセッサに関する。特に、仮想記憶機構をもつプロセッサにおいて問題となるメモリページすりかえ攻撃の防止を説明する。
【0095】
仮想記憶機構を持つシステムでは、OSは物理メモリの任意のページを任意の仮想アドレスに割り当てることができる。また、この割当はタスクに応じて異なる割当を使うことができる。割当の記述には、ページテーブルと呼ばれる内部メインメモリ上の表が使われる。ページテーブルについては、後述する。
【0096】
メモリアクセスにあたって、仮想アドレスを高速に物理アドレスに変換するために、ページテーブルの必要な部分だけを特殊なキャッシュメモリに読み込んでおくことが多い。この一時メモリはTLB(translation lood-aside buffer)と呼ばれる。
【0097】
ページテーブルのTLBへの読み込みは、プロセッサハードウェアによっておこなわれるものと、ソフトウェアによるものの2種類がある。前者の例にはIntel社のPentiumがあり、後者の例にはMIPS社のR3000がある。第3実施形態でのTLBへの読み込みは、どちらの場合にも適用可能である。
【0098】
図8は、第3実施形態のマイクロプロセッサにおけるTLB構成を示す。第3実施形態での秘密保護属性の設定は、第1実施形態と同じくタスクによる明示の設定とする。したがって、TLB構成以外の部分については、図1に示すものと同様である。
【0099】
まず、内部メモリ110のユーザエリア111に、ページテーブル111−1が設定される。また、MPAテーブル501のエントリ(図4参照)に、タスクIDに加えて当該メモリページに指定された仮想アドレスを格納するフィールドを含む。
【0100】
次に、命令キャッシュ104はP−TLB(104−1)とR−TLB(104−2)を有し、データキャッシュ105も同様に、P−TLB(105−1)とR−TLB(105−2)を有する。R−TLBはアドレス変換のためのTLBである。一方、P−TLBはメモリ秘密保護属性を格納するものであり、R−TLBを補完してタスクの秘密保護をより安全にする。R−TLBとP−TLBのエントリは一対一対応に存在し、R−TLBへ書き込みを行うことによって、後述する処理がP−TLBに対して自動的に行われる。換言すると、P−TLBの更新は、R−TLBの書き込みを契機として間接的に行なわれ、プライバシマネージャ301以外がP−TLBを明示的に操作することはできない。
【0101】
第3実施形態においては、タスクの秘密保護属性の要素として属性指定時の仮想アドレスが保持される。上述したように、第1実施形態と同様に、タスクによる秘密保護属性の設定命令の発行時に、仮想アドレスの設定が行なわれるものとする。仮想アドレスには、タスクが指定したアドレスが使われる。ここでは物理アドレスP0 のメモリページM0 が仮想アドレスV0 にマップされているものとする。この時、プライバシマネージャ301が保護属性を書き込む
MPAテーブル501のエントリとして、メモリページM0 の物理アドレスP0 に対応するエントリが選択される。選択されたMPAエントリには、タスクIDと、メモリページM0 の仮想アドレスV0 が書き込まれる。物理ページに割り当てられる仮想アドレスはタスクによって異なる場合があるが、第3実施例ではタスク間の保護メモリ共有を考えていないため、当該メモリに保護属性が設定されている以上、他タスクのアクセスはありえないので問題はない。
【0102】
図9は、第3実施形態のマイクロプロセッサにおけるメモリアクセスの手順を説明する。
【0103】
ステップS801において、あるメモリページM0 がアクセスされる時、データの読み込みに先立って、アクセス対象の仮想アドレスV0 に対応するエントリが取得される。ステップS802で、取得したエントリを、ページテーブル111−1からデータキャッシュ105のR−TLBにロードして、仮想アドレスV0 から物理アドレスP0 への変換の準備が行われる。R−TLBへのロードは、ハードウェアまたはソフトウェア(OS) によって行われる。
【0104】
ロードが行われると、ステップS803で自動的に、変換先の物理アドレスP0 に対応するMPAエントリがプライバシマネージャ301によって読み出される。ステップS804で、MPAテーブル501から読み出された設定時の仮想アドレスV0 が、変換元であるR−TLMの仮想アドレスと照合され、一致するかどうか判断される。
【0105】
一致すれば(S804でYES)、TLBロードは成功する。一致しなければ(S804でNO)TLBロードは失敗し、ステップS806で秘密保護例外が発生する。
【0106】
TLBのロードが成功すると、対応するデータキャッシュのP−TLB(105−1)に、MPAエントリのタスクIDと、秘密保護の有無が書き込まれる。さらに、R−TLB(105−2)を参照したアドレス変換の結果読み込まれるキャッシュラインのタグに、対応するP−TLB(105−1)のエントリに書かれたタスクIDと秘密保護の有無が書き込まれる。その後の処理は第1実施形態の処理と同様である。
【0107】
第1実施形態においては、物理メモリ対応に保持されるメモリ保護属性(MPA)とタスクが要求する要求保護属性(RPA)には、それぞれ秘密保護ビットとタスクIDが含まれ、その比較はコアからのメモリアクセス要求時に行なわれていた。
【0108】
第3実施形態においては、メモリ保護属性(MPA)と要求保護属性(RPA)の比較は、ページ単位に行なわれるTLBのロード時と、ワード単位に行なわれるメモリアクセス時に分散して行われる。TLBのロード時には、タスクが要求する仮想アドレスV0 と、MPAテーブル501に保持された保護属性設定時の仮想アドレスが比較されている。メモリアクセス時には、第1実施形態と同様に、秘密保護ビットとタスクIDが比較されている。
【0109】
第3実施形態でも基本的には、タスクの実行の結果生成された要求保護属性RPAと、対象領域であるメモリの保護属性を記述するメモリ保護属性MPA とが比較されているが、比較が属性の項目毎に、時間的に分散して、異なる粒度でなされている点が異なる。
【0110】
第3実施形態の構成は、以下のような攻撃に対して、メモリ操作の統合性を保証できる点で有効である。
【0111】
あるタスクについて、保護属性が設定されたメモリページM0 、M を、それぞれ仮想アドレスV0 、V に配置し、その後処理Op 〜Op を実施する場合を考える。Op 〜Opの処理はあらかじめV0 とV のどちらで行われるか決まっている。
【0112】
ところが、仮想記憶機構を使えば、Op 〜Op の操作の任意の時点で物理メモリページM0 、M の仮想アドレス上の配置を入れ換えることができる。例えば、メモリページMに対する操作がメモリクリアであれば、操作対象のメモリページの仮想アドレスを入れ換えることで、メモリページM0 をクリアすることができてしまう。この場合、処理はプログラム作成者の意図とは異なったものとなるが、第1実施形態のような実アドレスのみを前提とした構成では、このようなすり替え攻撃を防ぐことはできない。
【0113】
第3実施形態では、メモリ秘密保護属性設定時に参照した仮想アドレスを、物理メモリページの秘密保護属性定義として保存しておき、アドレス変換の実行時に変換対象の仮想アドレスと、保存されたアドレスとを比較する。そして不一致が生じた場合にアクセスを禁止することにより、上述したメモリページ再配置攻撃を防止している。第3実施形態では、TLBのロード時に比較処理することで処理の効率化をはかっているが、プロセッサコアによるメモリ参照の都度、比較を行ってもよい。この場合、効率は多少低下するものの、同様の効果が得られる。
【0114】
なお上記の例では、仮想メモリを用いた場合のメモリアクセスの統合性保証を、タスクが明示的にメモリ秘密保護属性設定命令を発行する構成と組み合わせて説明した。しかし、仮想アドレスの比較処理そのものは、単独で使用しても仮想記憶を利用したメモリ交換攻撃の防止に有効であることを付け加えておく。
【0115】
また、秘密保護属性命令の発行時には、対応する物理アドレスの変換を定義したP−TLBをいったんフラッシュしておくことが望ましい。秘密保護属性命令の発行前に読み込まれたTLBエントリが残存する場合、不都合が生じるからである。たとえば、非保護状態のTLBエントリを参照した結果読み込まれたキャッシュラインをタスクが参照すると、期待に反して秘密保護属性が設定されておらず、秘密保護例外が発生して処理が中止されてしまう。そこで、秘密保護属性命令発行時には、P−TLBをフラッシュすることが望ましい。
【0116】
<第4実施形態>
第1〜第3実施形態では、内部メモリ型耐タンパプロセッサにおいて、タスクによる排他的なメモリアクセスを実現する構成を説明した。
【0117】
第4実施形態では、秘密を共有する複数のタスクが、あるメモリ領域を共有でき、かつ秘密を保持しないタスクには排他的なアクセスを可能にする構成例を説明する。
【0118】
第4実施形態においても、基本構成は図1に示す第1実施形態の構成と同様である。したがって、以下では変更点を中心に説明することとする。
【0119】
まず、タスクが内部メモリの共有領域にアクセスするための秘密保護情報はMTRレジスタ401に保持される。第1および第2実施形態では、MTRレジスタ401にはアドレス領域のみが保持されていたが、第4実施形態では、アドレス領域に加えて、共有のための秘密値が保持される。秘密値はタスクが秘密保護属性設定時に指定する。そして、この秘密値はメモリ参照時に要求秘密保護属性(RPA)として使用される。なお、秘密値の長さは総当たり攻撃を防止するため、128bit 以上であることが望ましい。
【0120】
また、この秘密値は、タスクによりメモリページに秘密保護属性が設定される時にも指定され、MPAテーブル501の対応するエントリに格納される。したがって、第4実施形態では、MPAテーブル501のエントリに格納されるのは、保護の有無、タスクID、仮想アドレス、秘密値の4項目となる。
【0121】
プログラムのロード時に、プログラム領域のメモリ保護属性(MPA)が設定される場合、MPAエントリの秘密値には、プログラムを暗号化していたプログラム鍵の値が書き込まれる。
【0122】
図10は、第4実施形態のマイクロプロセッサにおけるメモリアクセスの手順を示す。
【0123】
アクセスの可否は、すでに説明した第1〜第3実施形態と同様、プロセッサコア102から出力される要求秘密保護属性(RPA)と、キャッシュタグに格納されたメモリ秘密保護属性(MPA)の一致によって判定される。
【0124】
すなわち、ステップS901で、コアからは保護の有無を示す秘密保護ビット、タスクID、仮想アドレス、秘密値が得られ、ステップS902で、キャッシュタグに書き込まれたメモリ保護ビット,タスクID,仮想アドレス、秘密値が得られる。コアからの出力される4項目のうち、要求秘密保護属性(RPA)として使用されるのは、タスクIDを除く3項目である。これは、タスク間でメモリが共有されるため、判定基準をタスクIDに依存せず、秘密値の合致におきかえたためである。
【0125】
ステップS903で、メモリ保護モジュール106において、コアから出力されたRPAの秘密保護ビットと、キャッシュタグに書き込まれたMPAの秘密保護ビットが比較される。不一致の場合は、第1〜第3実施形態と同様に、ステップS908で秘密保護例外が発生する。
【0126】
ステップS903で、両者の秘密保護ビットが一致する場合は、ステップS904、S905で、両者(RPAとMPA)の仮想アドレスと秘密値とが、それぞれ比較される。一致しない場合は、ステップS908で秘密保護例外が発生する。
【0127】
秘密保護の面で秘密保護ビット、仮想アドレス、秘密値のすべてが一致したならば(S903〜S905ですべてYES)、ステップS906に進み、資源保護の面でタスクIDが一致するかどうかを判断する。不一致の場合はステップS909で資源保護例外が発生する。一致する場合は、ステップS907でメモリ操作が実行される。
【0128】
第4実施形態のマイクロプロセッサの具体的な利用態様としては、たとえば複数のプログラムにあらかじめ共通の秘密Xが埋め込まれており、あるプログラムから生成されたタスクAが共有メモリ領域を確保して秘密値Xを設定しておき、別のタスクBがMTRレジスタ401に秘密値Xを設定してアクセスする例が挙げられる。秘密値Xは、あらかじめ定められたもの以外に、Diffy-Hellman 法などのよく知られた鍵共有方式によって共有されたものでもよい。
【0129】
図10のフローチャートで説明したように、秘密値Xを知らないタスクによるこのメモリ共有領域へのアクセスは秘密保護例外となり、当然失敗する。したがって、秘密値Xを知るタスクだけの排他的なメモリ共有が実現できる。
【0130】
第4実施形態では、メモリ領域の排他的な(安全な)共有を、タスクによるメモリ秘密保護属性の設定命令と組み合わせて説明した記述した。しかし、秘密値をMPA,RPAに利用してメモリ領域の共有を安全に行う方法は、タスクが発行した秘密保護属性の設定命令の存在に依存するわけではなく、単独でタスク間の安全なメモリ共有を可能にすることを付記しておく。
【0131】
【発明の効果】
以上説明したように、内部メモリ型のマイクロプロセッサにおいて、マルチタスク環境下において、OSによる内部メモリの資源管理と秘密保護とを両立させ、OSとタスクとの通信を確保しつつ、複数プログラムを意図的改変から保護することができる。
【図面の簡単な説明】
【図1】本発明の第1実施形態に係る内部メモリ型耐タンパプロセッサの概略構成図である。
【図2】図1の耐タンパプロセッサにおける内部メモリマップの図である。
【図3】図1の耐タンパプロセッサにおけるタスク開始とメモリ確保を説明するための図である。
【図4】図1の耐タンパプロセッサにおけるMPAテーブルの構成例を示す図である。
【図5】図1の耐タンパプロセッサにおけるMTRレジスタの構成例を示す図である。
【図6】図1の耐タンパプロセッサのメモリアクセス手順を示すフローチャートである。
【図7】本発明の第2実施形態に係るメモリアクセス手順を示すフローチャートである。
【図8】本発明の第3実施形態に係る耐タンパプロセッサの秘密保護機構の概略構成図である。
【図9】第3実施形態の耐タンパプロセッサのメモリアクセス手順を示すフローチャートである。
【図10】本発明の第4実施形態の耐タンパプロセッサにおけるメモリアクセス手順を示すフローチャートである。
【図11】一般的なマルチパーティのアプリケーション保護環境を示す概略図である。
【符号の説明】
100 内部メモリ型耐タンパプロセッサ
101 プロセッサパッケージ
102 プロセッサコア
103 キャッシュモジュール
104 命令キャッシュ
105 データキャッシュ
104−1、105−1 P−TLB
104−2、105−2 R−TLB
106 メモリ保護モジュール(メモリ保護手段)
107 バスインターフェイスユニット
108 暗号モジュール(復号化手段)
109 ファームウェア
110 内部メモリ
111 ユーザエリア
111−1 ページテーブル
112 秘匿エリア
114 ワーキングレジスタ
116 タスクコンテキストテーブル
117 タスクキーテーブル
301 プライバシマネージャ(秘密保護管理部)
401 MTRレジスタ(要求秘密保護属性保持部)
501 MPAテーブル(メモリ秘密保護属性保持部)
[0001]
BACKGROUND OF THE INVENTION
The present invention has a large-capacity internal memory capable of storing a plurality of programs and their work areas inside the package, and prevents unauthorized modification of execution code and processing target data in a multitask program execution environment. The present invention relates to a tamper resistant microprocessor.
[0002]
BACKGROUND OF THE INVENTION
Open systems are widely used as information system networks. In the open system, information on computer hardware and system programs (or OSs) for general users such as PCs is disclosed, and the end user can change the system programs and make the desired improvements. In such an environment, in order to protect the copyright of the information handled by the application program and the copyright of the program itself, the secret of the program is premised on the assumption that the OS of the system can take hostile actions on the application. Hardware that protects is needed. An attempt to realize such hardware as a microprocessor has been proposed (Japanese Patent Application No. 2000-35898, Lie et al., “Architectural Support for Copy and Tamper Resistant Software” ,; Computer Architecture News 28 (5) : p168- etc.).
[0003]
These microprocessors have a function of encrypting information in order to prevent peeping and modification of the program and information handled in the multitask environment. Such a microprocessor is called a tamper resistant microprocessor.
[0004]
The main purpose of tamper resistant microprocessors is to protect the rights of rights holders of programs, content and network services through the protection of applications running on end user systems. More specifically, there are the following three.
[0005]
(1) Secret protection of algorithms implemented in programs
(2) Protection of trade secrets and content embedded in the program from confidential or unauthorized copying
(3) Protection from program operation and modification of processing results
Protection of the algorithm implemented in the program is necessary to protect the rights holder of the program, and protection of the trade secret embedded in the program is necessary to prevent unauthorized copying of copyrighted content handled by the program It is. In an application in which a program that uses a network service exchanges billing information with a server, it is important for protecting the rights of the service provider to correctly execute the billing information transmission operation and prevent unauthorized modification. As an actual example, a program for playing a DVD on a personal computer (PC) is analyzed, and a trade secret for decrypting the DVD encryption is read therefrom, and a program for illegally copying the DVD (DeCSS) is created. It is well known.
[0006]
Here, regarding the secret protection mechanism of the application program in the currently proposed open system, the proposals of the present inventors (Japanese Patent Application No. 2000-35898, Japanese Patent Application No. 2000-135010, Japanese Patent Application No. 2000-333635, Japanese Patent Application No. 2001-024480) will be briefly described. In the example to be introduced, programs of a plurality of program vendors are executed on a single system in a pseudo-parallel manner, and each can hold a secret independently from an OS that manages the system resources. Such an environment is referred to as a “multi-party application protection environment”.
[0007]
FIG. 11 shows an overview of a multi-party application protection environment proposed so far. A target system (for example, PC) 1102 incorporates a tamper-resistant microprocessor 1103 and has a secondary storage 1107 such as a hard disk and a memory 1108 outside the processor. A system environment 1101 is configured by the system 1102 and the user 1112.
[0008]
A plurality of different program vendors 1121-1 to 1121-n distribute the encrypted programs 1123-1 to 1123-n to the target system 1102 via the network, respectively. The encrypted program is called a protection program.
[0009]
The encryption program distributed from the vendor is accumulated in the secondary storage 1107 of the target system 1102, and is read into the area 1109 secured on the external memory 1108 at the time of execution. The program is still encrypted on the external memory. The encryption program is not decrypted until it is taken into the microprocessor 1103 from the external memory 1108. The decryption process is performed by the protection function 1106 using the key sent from the vendor corresponding to each program. The decrypted program is read into the cache memory 1104. The decryption of the program and the reading into the cache memory 1104 are not read all at once, but are partially performed according to the execution of the program. The program portion read into the cache memory is in plain text.
[0010]
Inside the microprocessor 1102, the program is handled in plain text by the protection function 1106, and there is no room for the OS 1110 to intervene. Further, the contents of the cache memory 1104 cannot be directly read from the outside except for the operations defined in the specifications of the microprocessor 1103.
[0011]
On the other hand, in recent years, with the development of integrated circuit technology, it has become possible to mount a large-capacity memory in the same package as the microprocessor. In such an internal memory type processor, although there is a limit on the maximum memory capacity, there is a possibility of reducing the encryption processing load at the time of memory reading / writing which has been an overhead in the tamper-resistant processor based on the conventional external memory. There is.
[0012]
However, even if the memory is arranged as an internal memory inside the microprocessor, the resource management of the memory is strictly under the management of the OS, and therefore the hostile operation by the OS can be considered sufficiently. Therefore, in the internal memory type microprocessor, it is necessary to protect the secret of the program under the management of the OS, but no concrete means for realizing the secret protection has been proposed.
[0013]
Furthermore, when an internal memory type microprocessor processes not only a single program but also a plurality of different cryptographic programs in a pseudo-parallel manner, it is necessary to individually guarantee the secret protection of the multiple programs. However, no proposal has been made.
[0014]
[Problems to be solved by the invention]
In order to realize multitask processing while guaranteeing confidentiality protection with an internal memory type tamper resistant microprocessor,
(1) Integrity of memory operations that can protect multiple programs from intentional modification
(2) Compatibility of OS resource management and internal memory secret protection
(3) Communication between task and OS
Need to be considered.
[0015]
Specifically, when a certain task performs n memory operations on an address in the internal memory, it must be protected from memory operations by other tasks and intentional attacks by the OS in the process. . Task execution consists of a number of instruction steps, and the correct result is obtained only when they are executed correctly. When an attacker including an OS executes only a part of a program or excludes only a specific operation from a series of memory operations, the operation of the program is arbitrarily changed, and correct program execution cannot be performed.
[0016]
Also, when operating the memory page as part of resource management by the OS, an attack using memory release can be considered. However, in order to eliminate such an attack, both resource management and program secret protection must be compatible. Don't be.
[0017]
Further, when a system call is issued, the task exchanges data with the OS. At this time, it is necessary to communicate with the OS while sharing the memory.
[0018]
Consider a processor in which the protection mechanism of a conventional external memory type tamper resistant microprocessor is applied to the internal memory type as it is. First, the main internal memory is divided into units called blocks or pages (for example, 4 Kbyte pages). A table is provided in the processor for holding the secret protection attribute for each memory page, and the table entry holds the secret protection attribute of the corresponding memory page. Task T0 The secret attribute descriptor of the memory page operated by0 ID is set, and other tasks including the OS cannot read and rewrite the contents in plain text. However, the OS can forcibly release the secret protection attribute of a certain memory page in order to reuse the memory page. When the secret protection attribute of the memory page is canceled, the contents of the page are all erased and initialized to a predetermined value, and the secret of the original task is protected.
[0019]
Task T now0 Is an address A0 Memory page M0 Against M0  From the initial state of Op1~ Opn Suppose n times of memory operations are performed. The initial state may be indefinite, but Op1~ Opn The purpose of this is to ensure that the final state is obtained. Naturally, the memory operation by another task should not be added in the process.
[0020]
Memory operations by general tasks can be eliminated by a conventional external memory type protection mechanism. However, OS is page M0 The attack that rewrites the page to the data intended by the attacker after releasing the secret protection attribute cannot be eliminated or detected even if the external memory type protection mechanism is applied to the internal memory type as it is. Although the secret of the data before the release of the secret protection attribute can be protected, the replacement with other data cannot be prevented.
[0021]
As a result, an attacker with OS privileges can freely rewrite the secret memory contents of the task as intended.
[0022]
Forcibly releasing the secret protection attribute of the memory page is a threat to the secret protection of the task. However, under a multitasking system, such a forced release function cannot be eliminated and only the task itself can release the protection attribute. This is because when an excessive memory is occupied by some tasks, the OS cannot control it.
[0023]
In addition, the unprotected memory access and the protected memory access for communication between the OS and the task must be able to coexist.
[0024]
Therefore, in the present application, with these points in mind, in a microprocessor having a relatively large internal memory in a package, unauthorized modification of executable code or data to be processed is performed under a multitask program execution environment. Realize efficient internal data management that can be prevented.
[0025]
[Means for Solving the Problems]
The internal memory type tamper resistant processor includes:
[0026]
(A) Decryption means for decrypting each of a plurality of programs encrypted with different encryption keys;
(B) an internal memory for storing a plurality of programs decrypted by the decryption means in plain text in units of memory pages;
(C) When the program is read into another memory page of the internal memory and executed as a task, the request secret protection attribute that this task requests for each memory page to be accessed is set exclusively with other tasks. Request secret protection attribute holding unit to be stored;
(D) a memory secret protection attribute holding unit for storing a memory secret protection attribute of the memory page for each memory page;
(E) a secret protection management unit that sets a memory secret protection attribute in a memory secret protection attribute holding unit for a memory page accessed by the task when the task is executed; and
(F) The request secret protection attribute stored in the request secret attribute holding unit is compared with the memory secret protection attribute stored in the memory secret protection attribute holding unit, and if they match, access to the memory page is permitted. Memory protection measure.
[0027]
In such an internal memory type microprocessor, since the program and data are stored in the internal memory in a plain text state, the overhead of processing capacity can be eliminated as much as encryption processing is not required for reading and writing of the memory.
[0028]
Further, even if an OS that manages memory resources intends to perform illegal processing using memory page release under a multitasking environment in which a plurality of programs are run in a pseudo-parallel manner, it does not succeed. This is because access to the memory page is not permitted unless the secret protection attribute requested by the task to the memory page to be accessed matches the secret protection attribute set in the memory area necessary for the task processing.
[0029]
With such a configuration, individual secrets of a plurality of programs are protected, and resource management by the OS and secret protection of each program are compatible. In addition, by managing the secret protection attribute of the memory page, it is possible to secure a non-protected area and guarantee communication between the task and the OS.
[0030]
DETAILED DESCRIPTION OF THE INVENTION
In the following description, a conventional tamper resistant processor that reads and processes a program stored in an encrypted state in a memory outside the microprocessor is referred to as an “external memory type tamper resistant processor”, and the program is stored in the microprocessor package. A tamper resistant processor that stores data in a plain text state is referred to as an “internal memory tamper resistant processor”.
[0031]
Also, in this specification, program confidentiality protection means that the work data of a program encrypted with a unique program key cannot be read from other programs, and data that is intended by the attacker. It also means preventing attacks such as modification of programs and modification of program operations.
[0032]
<First Embodiment>
FIG. 1 is a schematic configuration diagram of an internal memory type tamper resistant processor according to the first embodiment of the present invention. The processor 100 includes a processor core 102, a cache module 103, a bus interface unit (BIU) 107, firmware (ROM) 109 including a privacy manager (secret protection management unit) 301, and an internal memory 110. Which are interconnected via an internal bus 126.
[0033]
The processor core 102 includes a working register 114 used by a program being executed and a task switching unit (STS: secure task switcher) 115. The working register 114 includes a memory type range (MTR) register 401. The MTR register 401 stores a requested secret protection attribute (RPA) that specifies whether or not the task requests secret protection for an internal memory area (that is, a memory page) to be accessed. The task switching unit 115 includes a context table 116 that holds a register state being executed corresponding to a task, and a key table (task key table) 117 that holds key information such as a program encryption key corresponding to a task.
[0034]
Although not shown, the firmware 109 stores a secret key unique to the processor 100. The firmware 109 includes a secret protection management unit 301 called a privacy manager, and manages a memory secret protection attribute (MPA) of each memory page in the internal memory 110. The privacy manager 301 is realized as a program stored in firmware, for example.
[0035]
The internal memory 110 is roughly divided into two areas. A user area 111 and a secret area 112. The user area 111 stores an OS and a user program including the system area at the time of execution. The secret area 112 is an area that can be operated only by the privacy manager 301, and stores a memory secret protection attribute (MPA) table 501. The MPA table 501 stores the secret protection attribute for each memory page. The privacy manager 301 described above sets the memory secret protection attribute in the MPA table 501 for the corresponding memory page in accordance with the secret protection command issued by the task. No operation by the OS is performed in the secret area 112.
[0036]
The cache module 103 includes an instruction cache 104, a data cache 105, and a memory protection module (memory protection means) 106. The data cache 105 reads the page contents of the user area 112 of the internal memory 110 and the secret protection attribute held in the MPA table 501 correspondingly when the program is executed (that is, when the target area is accessed). The memory protection module 106 compares the memory secret protection attribute (MPA) written in the cache tag of the data cache 105 with the task-specified request secret protection attribute (RPA) output from the MTR register 401 of the core 102, and Only when these two attributes match, access to the target memory page is permitted.
[0037]
The BIU 107 has an encryption module (decryption means) 108 and encrypts input / output data with the outside. The processor 100 performs input / output with the outside via the BIU 107. The peripheral device bridge chip 122 connected to the processor via an external bus has a buffer memory 123 therein. The peripheral device bridge chip 122 is connected to the flash memory 121 and the HDD 125, respectively.
[0038]
FIG. 2 shows an internal memory map. The user area 111 and the privacy manager area 301 are isolated on the memory map. The first half of the memory map is assigned to the user area, and the second half is assigned to the privacy manager area. An external program placed in the user area 111 cannot access the firmware area 109 including the privacy manager 301.
[0039]
In the first embodiment, for simplicity of explanation, a real address type processor having no virtual address mechanism is assumed. The operation of such a tamper resistant processor will be described below.
[0040]
Load programs and generate tasks
FIG. 3 is a schematic diagram showing a procedure for reading the program A and generating a task by the microprocessor 100 of FIG. Before being executed by the processor 100, the program A is encrypted and stored in the flash memory 121 (FIG. 1) and the HDD 124 (FIG. 1) outside the microprocessor.
[0041]
Before the program A is read, the task 1 generated by reading the OS or another program is read into the user area 111. The OS is read into an area starting from addresses 0 and P of the user area 111, and the task 1 is read into an area starting from the address X.
[0042]
Program A is composed of a distribution key 302 and a program body 303. When reading the program A, the OS reads the encrypted program A into the buffer memory 123 of the peripheral device bridge chip 122 according to a predetermined procedure. Next, the OS designates the program address in the buffer memory 123, the program placement address Y in the internal memory, and the task ID (task k), and issues a task generation instruction.
[0043]
When a task generation command is issued, control is transferred from the OS to the privacy manager 301. The privacy manager 301 is implemented as a program stored in the firmware 109, for example, and has stronger privileges than the OS that is an external program in order to protect the secret of the program. Only the privacy manager 301 can operate the secret area 112 of the internal memory, the context table 116, and the task key table 117.
[0044]
The privacy manager 301 acquires the distribution key 302 of the program A from the buffer memory 123, decrypts the distribution key 302 via the encryption module 108 using the processor private key (not shown) stored in the firmware 109, and Take out the key. This program key is stored in the entry 117-k corresponding to the task ID (that is, task k) in the task key table 117. Next, the program main body 303 in the buffer memory 123 memory is decrypted via the encryption module 108 using the program key, and the decrypted program is placed in an area starting from the program placement address Y in the internal memory.
[0045]
Further, the task ID (k) is written in the entry corresponding to the program placement area of the memory secret protection attribute (MPA) table 501 (FIG. 1) of the secret area 112, and the protection attribute is given to these areas, so that other tasks Prevent access from. As will be described later, an entry in the MPA table 501 is set for each page of the memory (for example, 4K bytes as one page). Task ID = 1 is written in the entry of task 1 that has been executed so far, and task ID = k is written by reading program A this time.
[0046]
Thus, preparation for task execution is completed, and once control is returned to the OS, the OS issues an instruction to instruct the start of execution of task ID = k. Then, execution of the program A, that is, the task k is started from a predetermined address. In the first embodiment, the privacy manager 301 is realized by the firmware 109, but may be implemented by hardware. In the case of implementation by hardware, the OS can process other tasks in parallel while the privacy manager 301 is preparing for task execution, and the response performance of the system is improved.
[0047]
Secure memory
Now, when executing the generated task k, the task k dynamically secures a necessary memory area in the internal memory 110. First, task k requests a memory area from the OS. The OS allocates a memory area that can be used for task k, for example, a memory area starting from address Z. The task k sets the secret protection attribute of the area in order to use this area as an area that can be exclusively accessed only by the task k. The secret protection attribute is set by task k designating an address area and explicitly issuing a secret protection attribute setting command. Only this task can set the secret protection attribute, and even the OS cannot set the protection attribute of other tasks.
[0048]
Normally, the OS sets a resource protection attribute of the area in a memory management unit MMU (not shown) so as to prevent other tasks from accessing the memory management unit MMU (not shown) in order to avoid contention with other tasks. This setting is only for the purpose of protecting resources by the OS, and it should be noted that the malicious OS does not serve to protect the secret of the task.
[0049]
When a protection attribute setting command is issued from task k, the process proceeds to privacy manager 301. The privacy money 301 writes the ID of the task k, which is the instruction issue source, in the entry corresponding to the designated area of the MPA table 501, and protects this area from access by other tasks. The format of the MPA table 501 is, for example, as shown in FIG. The PAM table 502 has entries 501-1 to 501-n corresponding to each memory page. The entry has two fields, and the field P stores a secret protection bit indicating whether or not the corresponding memory page is protected. For example, when the value of the secret protection bit is 1, it means that there is secret protection. Task IDs are stored in the remaining fields. As described above, when the processor has an MMU (not shown) for resource management, the privacy manager 301 confirms that the task that issued the protection attribute setting instruction has the right to access the target area. It is desirable to adopt a configuration that does this.
[0050]
Memory access by protection task
When a task accesses an address for which a protection attribute is set, the task is accessed by specifying that the target area to be accessed is a protection area. This protection area is designated by an MTR (memory tape range) register 401 in the processor core 102.
[0051]
FIG. 5 shows the format of the MTR register 401. The MTR register 401 is a register composed of two words. The start address of the target area is written in the first word 401 a, the size is written in the second word 401 b, and the secret protection bit 1 is set in the field 402. As a result, a secret protection attribute (RPA) requested by the task is set in the designated address area. When 0 is written in the request secret protection bit, the secret protection attribute set up to that point becomes invalid.
[0052]
Whether a certain memory access is protected or unprotected is determined by the combination of the address range specified by the MTR register 401 and the address to be accessed. If the access target address is within the designated range of the MTR register 401, it becomes a protection target. There may be a plurality of MTR registers that can be used by a task.
[0053]
  FIG. 6 is a flowchart showing a memory access procedure. A memory access procedure will be described. When the core 102 issues a read request to the data cache 105 in order to execute the task, the currently executing task ID and the request secret protection bit requested by the task are output together with the address (S601). On the other hand, when the target area is accessed, the contents are read from the user area 111 of the internal memory 110 into the data cache 105. At this time, the entry corresponding to the memory address is read from the MPA table 501, and the task ID and the memory secret protection bit described in the entry are written to the tag of the corresponding cache line (S602). The acquisition order of the memory secret protection bit and the request secret protection bit is not questioned and may be performed simultaneously.
[0054]
The requested secret protection attribute (RPA) output from the core 102 at the time of memory access is a memory protection attribute that should be set in the memory to be accessed as seen from a certain task. Therefore, this required secret protection attribute (RPA) must match the secret protection attribute (MPA) of the internal memory area to be accessed.
[0055]
  Therefore, in step S603, the memory protection module 106 compares the memory secret protection bit written in the cache tag with the request secret protection bit output from the core 102. If the comparison results match (YES in S603), the process proceeds to step S604, where it is determined whether the task ID written in the cache tag matches the task ID output from the core 102. The determination order of S603 and S604 is not limited and may be simultaneous.
[0056]
Only when both the secret protection bit and the task ID match, the process proceeds to step S605, and it is determined whether or not the task to be executed has the memory page access right. This is because access to the target memory area by a task may be prohibited in the memory management unit MMU due to resource protection by the OS. If the access right is granted (YES in S605), access to the target memory area is permitted, and the memory operation is executed in step S606. If access is prohibited (NO in S606), a resource protection exception occurs in step S608.
[0057]
  On the other hand, if the memory secret protection bit written in the cache tag does not match the secret protection bit output from the core 102 in step S603 (NO in S603), or the task ID does not match in step S604. In this case, the occurrence of a secret protection exception is notified to the processor core 102 in step S607. As a result, the execution of this task is interrupted and cannot be resumed.
[0058]
  For example, when task k tries to access the target area, if the correct protected area is not set in the MTR register 401 and the target area protected by the secret is accessed as having no secret protection, the task Even if the IDs match, the memory protection module 106 determines an access violation. Similarly, when the request protection bit output from the core 102 is trying to access the memory by specifying the secret protection, the memory protection bit written in the cache tag is targeted for the area without the secret protection. Access is not allowed.
[0059]
Such a criterion for determining a secret protection exception and a criterion for determining a resource protection exception are independent of each other's determination result and order.
[0060]
Note that when accessing the unprotected memory by exchanging data with the OS, it is outside the area specified in the MTR register 401, and the secret protection bit of the entry in the MPA table 501 should be 0, so access is natural. success.
[0061]
If another task accesses the memory area of the internal memory allocated for task k, the task ID sent from the core 102 does not match the task ID of the cache tag, so a secret protection exception naturally occurs. Then, the execution of the task with illegal access is interrupted.
[0062]
Although the protection method of the protection program area in the program area was not mentioned, the secret protection attribute is set in the MPA table 501 of the corresponding area when the program is loaded by the task generation instruction, as in the task processing described above. Is realized. In the case of memory access in the program area, the required secret protection attribute RPA is not defined by the MTR register 401, but the task ID being executed is used as it is.
[0063]
Switching tasks
When an interrupt occurs when the memory operation is properly performed and the task k is executed, the information in the working register 114 at that time is the entry of task ID = k in the context table 116 as shown in FIG. Are temporarily saved, and control is transferred to the OS. Only the privacy manager 301 can know the contents of the context table 116, and the OS and other tasks cannot see the contents. Similarly, the MTR register 401 of the core 102 is protected from access by other tasks as register information of the task k because the request protection attribute (RPA) requested by the task k is designated.
[0064]
Memory release by OS
The OS can forcibly release the memory in which the secret protection attribute is set and use it for other purposes. The OS issues a secret protection forced release command specifying the memory area to be released. When the command is issued, the privacy manager 301 rewrites the MPA table 501 of the target area without protection, and at the same time, initializes the corresponding user memory area 111 to a predetermined value and erases the stored information.
[0065]
When the secret protection attribute is rewritten without protection, the OS can use this memory area for other tasks such as allocating the memory area to another task or using the OS itself.
[0066]
With this memory release function, both secret protection and appropriate memory resource management by the OS are achieved.
[0067]
End of task
When the OS ends the task protected by secret, the OS designates this task ID and issues a task end command. When the task end instruction is issued, the privacy manager 301 rewrites the corresponding entry in the MPA table 501 in which the task secret protection attribute is set to a value without protection. At the same time, the memory area is initialized in the same manner as when the memory is released. With this task end function, the task ID can be reused without leaking the secret held by the task.
[0068]
Memory access integrity guarantee effect
It will be described that the memory access protection can be consistently ensured by the configuration of the microprocessor 100 described above.
[0069]
Task T0 Is an address A0 Memory page M0 Against M0From the initial state of Op1~ Opn Suppose n times of memory operations are performed. The initial state may be indefinite, but Op1~ Opn It is necessary to obtain the final state result by reliably performing the operation. In the process, memory operation by another task is added, Op1~ OpnThe order of operations must not be changed or omitted. Even if the page is initialized once during a series of operations, the result will be different from what is expected.
[0070]
In the method of the first embodiment, first, the task T0 Is memory page M0 Is issued and a command to set the secret protection attribute is issued. As a result, the memory page M0 The secret protection bit “1” and the task ID are set in the entry of the MPA table 501 corresponding to. After that, M is stored in the MTR register 401.0Set the address of1~ Opn Perform the operation. The program itself is encrypted, and it is difficult for an attacker to change the order. The task itself sets the memory page secret protection attribute, sets the MTT register 301, Op1~ Opn It is guaranteed that the sequence of operations is correct.
[0071]
Next, memory page M0 Is referenced by a real address, so it is guaranteed that there is always only one page referenced as an address.
[0072]
Therefore, Op1~ Opn If the access succeeds without a secret protection exception, it is true that the target memory page M0Op to1~ Opn It means that the operation was performed.
[0073]
Also, it is the task itself that can set the secret protection attribute for a certain memory page.1~ Opn Prior to this operation, the secret protection attribute is set only once. Op to memory page1~ Opn Is accessed by designating the secret protection bit 1 in the MTR register 401. If the OS is releasing memory pages during this time, Op1~ Opn In this case, the protection attribute (RPA) designated by the MTR register 401 and the protection attribute (MPA) of the memory page do not coincide with each other, a secret protection exception occurs, and the execution of the task should have been stopped there.
[0074]
Therefore, Op1~ Opn In this access, the fact that the access was successful without generating a secret protection exception means that the memory has not been released by the OS during these operations.
[0075]
As described above, the configuration of the microprocessor according to the first embodiment can guarantee the integrity and consistency of the memory operation described above. This integration of memory operations is compatible with both forced memory release (resource management) by the OS and access to unprotected memory pages by tasks.
[0076]
This balance between resource management and secret protection is that only the task can set the secret protection attribute of the memory, and when accessing the memory, the memory protection attribute MPA provided in the memory page and the request protection attribute RPA held by the task are set. This is realized as a result of a combination of permitting access only when the attributes match in comparison.
[0077]
However, the configuration in which memory access is permitted only when MPA and RPA match is the same, even when protected memory and non-protected memory access coexist, even if there is no explicit secret protection attribute setting by the task, the memory operation is performed independently. It has the effect of improving the safety of
[0078]
Second Embodiment
In the first embodiment, the setting of the secret protection attribute of the internal memory is performed by an explicit command issued by the task. In the second embodiment, the setting of the secret protection attribute of the memory is implicitly performed by memory access. That is, when a memory page is not protected (that is, the memory protection attribute MPA is 0) and the task accesses the memory in a state where the task requests secret protection (that is, the value of the request protection attribute RPA is 1), Thus, the memory protection bit 1 is set in the field of the corresponding MPA entry. At the same time, the memory contents are initialized with random numbers. With this configuration, the security of the memory contents is further improved.
[0079]
Similar to the first embodiment, except that the secret protection attribute is implicitly set in the target memory area at the time of memory access. The implicit secret protection attribute setting at the time of memory access will be described in detail below.
[0080]
FIG. 7 is a flowchart showing a memory access procedure including implicit secret protection attribute setting. Whether or not a certain memory area is accessed as a protection area is determined by a combination of the address range designation of the MTR register 401 and the target address, as in the first embodiment.
[0081]
First, in step S701, the secret protection bit and the task ID constituting the requested secret protection attribute (RPA) are output from the core 102 together with the target address. On the other hand, in step S702, the MPA protection bit and the task ID of the corresponding memory page stored in the cache tag are acquired by the memory protection module 106.
[0082]
In step S703, it is determined whether the secret protection bits of RPA and MPA match. If they match, it is determined in step S704 that the task IDs match, and the resource protection determination is processed in steps S705, S706, and S711 as in the first embodiment.
[0083]
If they do not match (NO in S703), the process advances to step S707 to determine whether or not the secret protection bit of RPA is 1. If the secret protection bit of the RPA is 1 (YES in S707), the process moves to the privacy manager 301 in step S708, and the value 1 of the secret protection bit and the task ID of the accessed task are stored in the MPA entry of the memory page to be accessed. Is set. In step S709, all the contents of the page are initialized with random numbers. Thereafter, the process proceeds to step S704, where the matching of task IDs is determined, and the subsequent processing is the same as in the first embodiment.
[0084]
When the secret protection bit of RPA is not 1 in step S707 (that is, 0), the access is treated as a secret protection violation, and a secret protection exception occurs in step S710.
[0085]
A supplementary explanation will be given that the memory access of the task is consistently protected from intentional memory modification by the OS by the configuration of the second embodiment.
[0086]
Task T0 Is an address A0 Memory page M0 Against M0From the initial state of Op1~ Opn Suppose n times of memory operations are performed. The initial state may be indefinite, but Op1~ Opn It is necessary to obtain the final state result by reliably performing the operation. In the process, memory operation by another task is added, Op1~ OpnThe order of operations must not be changed or omitted. Even if the page is initialized once during a series of operations, the result will be different from what you expect.
[0087]
In the method of the second embodiment, task T0 Memory page M in the MTR register 4010 Set the address of memory page M0 Op to1Issue memory operations for. At that time, memory page M0 Is set with the memory secret protection attribute. In the initial state, memory page M0 Should not have been given a protection attribute yet. Task T0 Then, Op1~ OpnI do.
[0088]
First, the program itself is encrypted, and it is difficult for an attacker to change the order. Therefore, the secret protection attribute setting of the memory page, the setting of the MTR register 401, the Op1~ Opn It is guaranteed that the sequence of operations is correct.
[0089]
Next, since a memory page is referenced by a real address, there is always only one page referenced by a certain address. Therefore, Op1~ Opn If the access succeeds without a secret protection exception, it is true that the target memory page M0 , Op1~ Opn It means that the operation was performed.
[0090]
In addition, only the task can set the secret protection attribute of the task in a certain memory page, and the secret protection attribute is set by this task in Op.1~ Opn Limited to the operation. However, in this case, the contents of the memory page are initialized with random numbers.
[0091]
Therefore, during this time, the OS once releases the memory page, and M0 Even if the contents are rewritten as intended, the protection attribute is cleared in that case. As a result, the contents are always initialized with random numbers, and intentional modification is not successful. Of course, although the normal operation of the task is hindered, it is generally very unlikely that the result will produce the intended result of the attacker.
[0092]
With the configuration of the second embodiment, the secret memory of the task can be protected from intentional modification. Such protection is compatible with forced memory release by the OS and access to unprotected memory pages by tasks.
[0093]
<Third Embodiment>
In the first and second embodiments, the security of task secrets and the memory management by the OS are compatible for the real address type microprocessor, and at the same time, the communication between the task and the OS is ensured and the memory operation is consistent. The secret protection method that guarantees the security is explained.
[0094]
The third embodiment relates to an internal memory type processor having a virtual storage mechanism. In particular, prevention of a memory page replacement attack, which is a problem in a processor having a virtual memory mechanism, will be described.
[0095]
In a system having a virtual storage mechanism, the OS can allocate an arbitrary page of physical memory to an arbitrary virtual address. In addition, this assignment can use a different assignment depending on the task. A table on the internal main memory called a page table is used for the description of allocation. The page table will be described later.
[0096]
In memory access, in order to convert a virtual address into a physical address at high speed, only a necessary part of a page table is often read into a special cache memory. This temporary memory is called a TLB (translation load-aside buffer).
[0097]
There are two types of page table reading into the TLB, one performed by processor hardware and the other by software. The former example is Intel Pentium and the latter is MIPS R3000. Reading into the TLB in the third embodiment is applicable to either case.
[0098]
FIG. 8 shows a TLB configuration in the microprocessor of the third embodiment. The secret protection attribute setting in the third embodiment is an explicit setting by a task as in the first embodiment. Therefore, portions other than the TLB configuration are the same as those shown in FIG.
[0099]
First, the page table 111-1 is set in the user area 111 of the internal memory 110. Further, the entry (see FIG. 4) of the MPA table 501 includes a field for storing the virtual address designated in the memory page in addition to the task ID.
[0100]
Next, the instruction cache 104 has P-TLB (104-1) and R-TLB (104-2), and the data cache 105 similarly has P-TLB (105-1) and R-TLB (105-). 2). R-TLB is a TLB for address translation. On the other hand, the P-TLB stores the memory secret protection attribute, and complements the R-TLB to make the task secret protection more secure. The R-TLB and P-TLB entries exist in a one-to-one correspondence, and processing described later is automatically performed on the P-TLB by writing to the R-TLB. In other words, the update of the P-TLB is indirectly performed in response to the writing of the R-TLB, and only the privacy manager 301 can explicitly operate the P-TLB.
[0101]
In the third embodiment, a virtual address at the time of attribute designation is held as an element of the task secret protection attribute. As described above, similarly to the first embodiment, it is assumed that a virtual address is set when a secret protection attribute setting command is issued by a task. The address specified by the task is used as the virtual address. Here, physical address P0 Memory page M0 Is the virtual address V0 Is mapped to. At this time, the privacy manager 301 writes the protection attribute.
As an entry in the MPA table 501, a memory page M0 Physical address P0 The entry corresponding to is selected. The selected MPA entry includes a task ID and a memory page M0 Virtual address V0 Is written. Although the virtual address assigned to the physical page may differ depending on the task, in the third embodiment, since protection memory sharing between tasks is not considered, as long as the protection attribute is set in the memory, access of other tasks is There is no problem because it is impossible.
[0102]
FIG. 9 illustrates a memory access procedure in the microprocessor of the third embodiment.
[0103]
In step S801, a certain memory page M0 Is accessed, prior to reading the data, the virtual address V to be accessed0An entry corresponding to is obtained. In step S802, the acquired entry is loaded from the page table 111-1 to the R-TLB of the data cache 105, and the virtual address V0 To physical address P0Preparation for conversion to is done. Loading to the R-TLB is performed by hardware or software (OS).
[0104]
When the load is performed, the conversion destination physical address P is automatically set in step S803.0 Is read by the privacy manager 301. In step S804, the virtual address V at the time of setting read from the MPA table 5010 Are compared with the virtual address of the R-TLM that is the conversion source to determine whether or not they match.
[0105]
If they match (YES in S804), the TLB load is successful. If they do not match (NO in S804), the TLB load fails, and a secret protection exception occurs in step S806.
[0106]
When the TLB is successfully loaded, the task ID of the MPA entry and the presence / absence of secret protection are written in the P-TLB (105-1) of the corresponding data cache. Further, the task ID written in the entry of the corresponding P-TLB (105-1) and the presence or absence of secret protection are written in the tag of the cache line read as a result of the address conversion referring to the R-TLB (105-2). It is. Subsequent processing is the same as that of the first embodiment.
[0107]
In the first embodiment, the memory protection attribute (MPA) held corresponding to the physical memory and the request protection attribute (RPA) requested by the task include the secret protection bit and the task ID, respectively. It was done at the time of memory access request.
[0108]
In the third embodiment, the comparison between the memory protection attribute (MPA) and the request protection attribute (RPA) is performed in a distributed manner at the time of TLB loading performed in units of pages and memory access performed in units of words. Virtual address V requested by task when TLB is loaded0 And the virtual address at the time of setting the protection attribute held in the MPA table 501 are compared. When accessing the memory, the secret protection bit and the task ID are compared as in the first embodiment.
[0109]
Even in the third embodiment, basically, the request protection attribute RPA generated as a result of task execution is compared with the memory protection attribute MPA describing the protection attribute of the memory that is the target area. Each item is different in that it is dispersed in time and made with different granularities.
[0110]
The configuration of the third embodiment is effective in that the integrity of memory operations can be guaranteed against the following attacks.
[0111]
Memory page M with protection attribute set for a task0 , M1 To virtual addresses V0 , V1 And then processing Op1 ~ Opn Consider the case of implementing. Op1 ~ OpnProcess in advance V0 And V1 It has been decided in either.
[0112]
However, if you use the virtual memory mechanism, Op1 ~ Opn Physical memory page M at any point in the operation of0 , M1 The arrangement on the virtual address can be changed. For example, memory page M1If the operation on the memory is clear, the virtual address of the memory page to be manipulated is replaced, thereby the memory page M0 Can be cleared. In this case, the processing is different from the intention of the program creator, but such a substitution attack cannot be prevented with the configuration based on only the real address as in the first embodiment.
[0113]
In the third embodiment, the virtual address referred to when the memory secret protection attribute is set is stored as the secret protection attribute definition of the physical memory page, and the virtual address to be converted and the stored address are stored when executing the address conversion. Compare. The memory page relocation attack described above is prevented by prohibiting access when a mismatch occurs. In the third embodiment, the processing efficiency is improved by performing the comparison process when the TLB is loaded. However, the comparison may be performed each time the memory is referred to by the processor core. In this case, although the efficiency is somewhat reduced, the same effect can be obtained.
[0114]
In the above example, the guarantee of memory access integrity when using a virtual memory is described in combination with a configuration in which a task explicitly issues a memory secret protection attribute setting command. However, it is added that the virtual address comparison process itself is effective for preventing a memory exchange attack using virtual memory even when used alone.
[0115]
Also, when issuing a secret protection attribute command, it is desirable to once flush the P-TLB that defines the conversion of the corresponding physical address. This is because inconvenience arises when the TLB entry read before issuing the secret protection attribute command remains. For example, if a task references a cache line that has been read as a result of referring to an unprotected TLB entry, the secret protection attribute is not set contrary to expectation, and a secret protection exception occurs and processing is aborted. . Therefore, it is desirable to flush the P-TLB when issuing a secret protection attribute command.
[0116]
<Fourth embodiment>
In the first to third embodiments, the configuration for realizing exclusive memory access by a task in the internal memory type tamper resistant processor has been described.
[0117]
In the fourth embodiment, a configuration example in which a plurality of tasks sharing a secret can share a certain memory area and allows exclusive access to a task that does not hold a secret will be described.
[0118]
Also in the fourth embodiment, the basic configuration is the same as the configuration of the first embodiment shown in FIG. Therefore, the following description will focus on the changes.
[0119]
First, secret protection information for a task to access a shared area of the internal memory is held in the MTR register 401. In the first and second embodiments, only the address area is held in the MTR register 401. In the fourth embodiment, in addition to the address area, a secret value for sharing is held. The secret value is specified by the task when setting the secret protection attribute. This secret value is used as a requested secret protection attribute (RPA) when referring to the memory. The length of the secret value is desirably 128 bits or more in order to prevent brute force attacks.
[0120]
This secret value is also specified when the secret protection attribute is set in the memory page by the task, and is stored in the corresponding entry of the MPA table 501. Therefore, in the fourth embodiment, the items stored in the entry of the MPA table 501 are the four items of presence / absence of protection, task ID, virtual address, and secret value.
[0121]
When the memory protection attribute (MPA) of the program area is set when the program is loaded, the value of the program key that encrypted the program is written in the secret value of the MPA entry.
[0122]
FIG. 10 shows a memory access procedure in the microprocessor of the fourth embodiment.
[0123]
As in the first to third embodiments described above, whether or not access is possible depends on a match between the requested secret protection attribute (RPA) output from the processor core 102 and the memory secret protection attribute (MPA) stored in the cache tag. Determined.
[0124]
That is, in step S901, a secret protection bit indicating task protection, a task ID, a virtual address, and a secret value are obtained from the core. In step S902, the memory protection bit, task ID, virtual address, A secret value is obtained. Of the four items output from the core, three items excluding the task ID are used as the request secret protection attribute (RPA). This is because the memory is shared between the tasks, and the determination criterion is not dependent on the task ID, and the secret value is matched.
[0125]
In step S903, the memory protection module 106 compares the RPA secret protection bit output from the core with the MPA secret protection bit written in the cache tag. If they do not match, a secret protection exception occurs in step S908 as in the first to third embodiments.
[0126]
If the secret protection bits of both match at step S903, the virtual addresses of both (RPA and MPA) are compared with the secret value at steps S904 and S905, respectively. If they do not match, a secret protection exception occurs in step S908.
[0127]
If the secret protection bit, virtual address, and secret value all match in terms of secret protection (YES in S903 to S905), the process proceeds to step S906 to determine whether the task IDs match in terms of resource protection. . If they do not match, a resource protection exception occurs in step S909. If they match, a memory operation is executed in step S907.
[0128]
As a specific usage mode of the microprocessor of the fourth embodiment, for example, a common secret X is embedded in advance in a plurality of programs, and a task A generated from a certain program secures a shared memory area and a secret value An example is given in which X is set and another task B accesses the MTR register 401 by setting the secret value X. The secret value X may be shared by a well-known key sharing method such as Diffy-Hellman method other than a predetermined value.
[0129]
As described with reference to the flowchart of FIG. 10, access to this memory shared area by a task that does not know the secret value X results in a secret protection exception and naturally fails. Therefore, exclusive memory sharing of only tasks that know the secret value X can be realized.
[0130]
In the fourth embodiment, the exclusive (safe) sharing of the memory area has been described in combination with the setting instruction of the memory secret protection attribute by the task. However, the method of securely sharing the memory area by using the secret value for MPA and RPA does not depend on the presence of a secret protection attribute setting command issued by the task, and is a safe memory between tasks alone. Note that sharing is possible.
[0131]
【The invention's effect】
As described above, in an internal memory type microprocessor, in a multitasking environment, the OS manages both internal memory resource management and secret protection, and secures communication between the OS and the task while intending multiple programs. Protection from mechanical modification.
[Brief description of the drawings]
FIG. 1 is a schematic configuration diagram of an internal memory tamper resistant processor according to a first embodiment of the present invention.
FIG. 2 is a diagram of an internal memory map in the tamper resistant processor of FIG. 1;
3 is a diagram for explaining task start and memory allocation in the tamper resistant processor of FIG. 1; FIG.
4 is a diagram showing a configuration example of an MPA table in the tamper resistant processor of FIG. 1. FIG.
FIG. 5 is a diagram illustrating a configuration example of an MTR register in the tamper resistant processor of FIG. 1;
6 is a flowchart showing a memory access procedure of the tamper resistant processor of FIG. 1;
FIG. 7 is a flowchart showing a memory access procedure according to the second embodiment of the present invention.
FIG. 8 is a schematic configuration diagram of a secret protection mechanism of a tamper resistant processor according to a third embodiment of the present invention.
FIG. 9 is a flowchart illustrating a memory access procedure of the tamper resistant processor according to the third embodiment.
FIG. 10 is a flowchart showing a memory access procedure in the tamper resistant processor according to the fourth embodiment of the present invention.
FIG. 11 is a schematic diagram illustrating a typical multi-party application protection environment.
[Explanation of symbols]
100 Internal memory tamper resistant processor
101 processor package
102 processor core
103 Cache module
104 Instruction cache
105 Data cache
104-1 and 105-1 P-TLB
104-2, 105-2 R-TLB
106 Memory protection module (memory protection means)
107 Bus interface unit
108 Cryptographic module (decryption means)
109 Firmware
110 Internal memory
111 User area
111-1 Page table
112 Secret area
114 Working register
116 Task context table
117 Task key table
301 Privacy Manager (Secret Protection Management Department)
401 MTR register (request secret protection attribute holding unit)
501 MPA table (memory secret protection attribute holding unit)

Claims (6)

異なる暗号鍵で暗号化された複数のプログラムを各々復号する復号化手段と、
前記復号化手段により復号された複数のプログラムを、メモリページ単位で各々平文にて格納するための内部メモリと、
前記プログラムを前記内部メモリの他のメモリページに読み込み、タスクとして実行する際に、該タスクがアクセス対象の前記メモリページ毎に要求する要求秘密保護属性を、他のタスクとは排他的に設定し格納する要求秘密保護属性保持部と、
前記メモリページ毎に、当該メモリページのメモリ秘密保護属性を格納するメモリ秘密保護属性保持部と、
前記タスク実行時に、当該タスクがアクセス対象の前記メモリページについて、前記メモリ秘密保護属性保持部に、前記メモリ秘密保護属性を設定する秘密保護管理部と、
前記要求秘密属性保持部に格納された前記要求秘密保護属性と、前記メモリ秘密保護属性保持部に格納された前記メモリ秘密保護属性とを比較し、一致した場合に当該メモリページへのアクセスを許可するメモリ保護手段と
前記内部メモリの仮想アドレスを物理アドレスに変換するアドレス変換手段と
を具備し、前記メモリ秘密保護属性保持部は、前記メモリページの物理アドレス毎に前記メモリ秘密保護属性を格納し、前記メモリ秘密保護属性保持部及び前記要求秘密保護属性保持部は、それぞれアクセス対象であるメモリページの仮想アドレスを更に格納し、前記メモリ保護手段が、前記仮想アドレスから前記物理アドレスへの変換時に、前記メモリ秘密保護属性保持部の仮想アドレスと前記要求秘密保護属性保持部の仮想アドレスとを比較し、一致した場合にアドレス変換を行うことを特徴とする内部メモリ型の耐タンパマイクロプロセッサ。
Decryption means for decrypting each of a plurality of programs encrypted with different encryption keys;
An internal memory for storing a plurality of programs decrypted by the decrypting means in plaintext in units of memory pages;
When the program is read into another memory page of the internal memory and executed as a task, the request secret protection attribute that the task requests for each memory page to be accessed is set exclusively with the other task. A request secret protection attribute holding unit to store;
For each memory page, a memory secret protection attribute holding unit that stores a memory secret protection attribute of the memory page;
A secret protection management unit that sets the memory secret protection attribute in the memory secret protection attribute holding unit for the memory page to be accessed by the task when the task is executed;
The request secret protection attribute stored in the request secret attribute holding unit is compared with the memory secret protection attribute stored in the memory secret protection attribute holding unit, and if they match, access to the memory page is permitted. and memory protection means that,
Address conversion means for converting a virtual address of the internal memory into a physical address, and the memory secret protection attribute holding unit stores the memory secret protection attribute for each physical address of the memory page; The memory secret protection attribute holding unit and the request secret protection attribute holding unit each further store a virtual address of a memory page to be accessed, and the memory protection unit converts the virtual address into the physical address, An internal memory type tamper resistant microprocessor characterized in that a virtual address of the memory secret protection attribute holding unit and a virtual address of the requested secret protection attribute holding unit are compared and address conversion is performed when they match .
前記メモリ秘密保護属性保護部と、前記要求秘密保護属性保護部は、前記タスクを識別するためのタスク識別子を更に格納し、
前記メモリ保護手段は、前記要求秘密保護属性と前記メモリ秘密保護属性を比較するとともに、各々対応する前記タスク識別子を比較し、前記要求秘密保護属性と前記メモリ秘密保護属性が一致し、かつ各々対応する前記タスク識別子が一致した場合にのみ当該メモリページへのアクセスを許可することを特徴とする請求項1に記載の内部メモリ型の耐タンパマイクロプロセッサ。
The memory secret protection attribute protection unit and the request secret protection attribute protection unit further store a task identifier for identifying the task,
The memory protection means compares the requested secret protection attribute with the memory secret protection attribute, compares the corresponding task identifiers with each other, and the requested secret protection attribute and the memory secret protection attribute coincide with each other. 2. The internal memory type tamper resistant microprocessor according to claim 1, wherein access to the memory page is permitted only when the task identifiers match.
前記秘密保護管理部は、前記タスクが発行する命令に基づいて、前記メモリ秘密保護属性保持部に前記メモリ秘密保護属性を設定することを特徴とする請求項1に記載の内部メモリ型の耐タンパマイクロプロセッサ。  2. The internal memory type tamper resistance according to claim 1, wherein the secret protection management unit sets the memory secret protection attribute in the memory secret protection attribute holding unit based on an instruction issued by the task. Microprocessor. 前記秘密保護管理部は、前記タスクが前記アクセス対象であるメモリページにアクセスする際に、前記比較結果に基づいて前記メモリ秘密保護属性を設定することを特徴とする請求項1に記載の内部メモリ型の耐タンパマイクロプロセッサ。  2. The internal memory according to claim 1, wherein the secret protection management unit sets the memory secret protection attribute based on the comparison result when the task accesses the memory page to be accessed. Type tamper resistant microprocessor. 前記秘密保護管理部は、前記タスクがアクセス対象の前記メモリページ毎に要求する要求秘密保護属性が、秘密保護を要求し、該アクセス対象のメモリページのメモリ秘密保護属性が非秘密保護の属性であった場合には、前記メモリ秘密保護属性を秘密保護の属性とし、当該メモリページを初期化することを特徴とする請求項4に記載の内部メモリ型の耐タンパマイクロプロセッサ。  The secret protection management unit requests the secret protection attribute requested for each memory page to be accessed by the task to request secret protection, and the memory secret protection attribute of the memory page to be accessed is an attribute of non-secret protection. 5. The internal memory type tamper resistant microprocessor according to claim 4, wherein if there is, the memory secret protection attribute is set as a secret protection attribute and the memory page is initialized. 前記内部メモリは複数のタスクによって共有される共有領域を有し、
前記メモリ秘密保護属性と、前記要求秘密保護属性は、前記共有のための秘密値を各々含み、
前記メモリ保護手段は、前記メモリ秘密保護属性に含まれる前記秘密値と、前記要求秘密保護属性に含まれる前記秘密値とを比較し、一致した場合にのみ前記共有領域へのアクセスを許可することを特徴とする請求項1に記載の内部メモリ型の耐タンパマイクロプロセッサ。
The internal memory has a shared area shared by a plurality of tasks,
The memory secret protection attribute and the requested secret protection attribute each include a secret value for the sharing;
The memory protection means compares the secret value included in the memory secret protection attribute with the secret value included in the requested secret protection attribute, and permits access to the shared area only when they match. The internal memory type tamper resistant microprocessor according to claim 1.
JP2002079155A 2002-03-20 2002-03-20 Internal memory tamper resistant processor and secret protection method Expired - Fee Related JP3866597B2 (en)

Priority Applications (5)

Application Number Priority Date Filing Date Title
JP2002079155A JP3866597B2 (en) 2002-03-20 2002-03-20 Internal memory tamper resistant processor and secret protection method
KR10-2003-0016803A KR100491991B1 (en) 2002-03-20 2003-03-18 Tamper resistant processor of internal memory type and method for protecting secret
EP03251729A EP1347384A3 (en) 2002-03-20 2003-03-20 Internal memory type tamper resistant microprocessor with secret protection function
CNB031074170A CN1197014C (en) 2002-03-20 2003-03-20 Internal memory type anti-falsification processor and security method
US10/391,618 US7219369B2 (en) 2002-03-20 2003-03-20 Internal memory type tamper resistant microprocessor with secret protection function

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002079155A JP3866597B2 (en) 2002-03-20 2002-03-20 Internal memory tamper resistant processor and secret protection method

Publications (2)

Publication Number Publication Date
JP2003280989A JP2003280989A (en) 2003-10-03
JP3866597B2 true JP3866597B2 (en) 2007-01-10

Family

ID=27785307

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002079155A Expired - Fee Related JP3866597B2 (en) 2002-03-20 2002-03-20 Internal memory tamper resistant processor and secret protection method

Country Status (5)

Country Link
US (1) US7219369B2 (en)
EP (1) EP1347384A3 (en)
JP (1) JP3866597B2 (en)
KR (1) KR100491991B1 (en)
CN (1) CN1197014C (en)

Families Citing this family (61)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2403562A (en) * 2003-07-04 2005-01-05 Hewlett Packard Development Co Secure processing environment in which executable code for services is only received by a secure loading process through the service request interface
JP4263976B2 (en) * 2003-09-24 2009-05-13 株式会社東芝 On-chip multi-core tamper resistant processor
EP1523228A3 (en) * 2003-10-09 2008-03-05 Matsushita Electric Industrial Co., Ltd. Mobile terminal, circuit board, circuit board design aiding apparatus and method, design aiding program, and storage medium having stored therein design aiding program
FI120638B (en) * 2003-12-17 2009-12-31 Nokia Corp Data security system used by Java applications
US7590845B2 (en) 2003-12-22 2009-09-15 Lenovo Singapore Pte. Ltd. Key cache management through multiple localities
JP4282472B2 (en) * 2003-12-26 2009-06-24 株式会社東芝 Microprocessor
JP4574994B2 (en) * 2004-01-26 2010-11-04 東芝マイクロエレクトロニクス株式会社 Microcomputer with external memory
WO2005096120A1 (en) * 2004-04-02 2005-10-13 Matsushita Electric Industrial Co., Ltd. Execution device
JP4612461B2 (en) * 2004-06-24 2011-01-12 株式会社東芝 Microprocessor
JP4559794B2 (en) 2004-06-24 2010-10-13 株式会社東芝 Microprocessor
JP4490192B2 (en) * 2004-07-02 2010-06-23 株式会社エヌ・ティ・ティ・ドコモ Multitask execution system
JP4204522B2 (en) * 2004-07-07 2009-01-07 株式会社東芝 Microprocessor
US7779239B2 (en) * 2004-07-28 2010-08-17 Intel Corporation User opt-in processor feature control capability
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
US7502928B2 (en) 2004-11-12 2009-03-10 Sony Computer Entertainment Inc. Methods and apparatus for secure data processing and transmission
JP4551231B2 (en) * 2005-01-31 2010-09-22 日本電信電話株式会社 Program execution protection system and program execution protection method
WO2006082985A2 (en) 2005-02-07 2006-08-10 Sony Computer Entertainment Inc. Methods and apparatus for providing a secure booting sequence in a processor
JP4606339B2 (en) 2005-02-07 2011-01-05 株式会社ソニー・コンピュータエンタテインメント Method and apparatus for performing secure processor processing migration
WO2006082994A2 (en) * 2005-02-07 2006-08-10 Sony Computer Entertainment Inc. Methods and apparatus for facilitating a secure session between a processor and an external device
KR100670005B1 (en) * 2005-02-23 2007-01-19 삼성전자주식회사 Apparatus for verifying memory integrity remotely for mobile platform and system thereof and method for verifying integrity
JP4738068B2 (en) * 2005-06-17 2011-08-03 富士通セミコンダクター株式会社 Processor and system
US7571298B2 (en) * 2005-06-30 2009-08-04 Intel Corporation Systems and methods for host virtual memory reconstitution
JP2007058588A (en) * 2005-08-24 2007-03-08 Toshiba Corp Processor having program protection function
US7739726B2 (en) * 2005-11-14 2010-06-15 Route1 Inc. Portable device for accessing host computer via remote computer
US20070143459A1 (en) * 2005-12-19 2007-06-21 Lucent Technologies Inc. Protection of privacy-sensitive information through redundancy, encryption and distribution of information
US20070162475A1 (en) * 2005-12-30 2007-07-12 Intel Corporation Method and apparatus for hardware-based dynamic escape detection in managed run-time environments
TW200805065A (en) * 2006-01-17 2008-01-16 Nxp Bv Region protection unit, instruction set and method for protecting a memory region
US7991965B2 (en) 2006-02-07 2011-08-02 Intel Corporation Technique for using memory attributes
EP2009917B1 (en) * 2006-04-24 2016-09-28 Panasonic Intellectual Property Management Co., Ltd. Data processing device, data processing method, data processing program, recording medium containing the data processing program, and integrated circuit
JP2008009933A (en) * 2006-06-30 2008-01-17 Toshiba Corp Memory device and its control method
US20080016305A1 (en) * 2006-07-12 2008-01-17 International Business Machines Corporation Implementation of Soft Protections to Safeguard Program Execution
US7762553B2 (en) * 2006-11-25 2010-07-27 Harris Curtis J Form-fitting electronic game controller cover
US7610448B2 (en) * 2006-12-27 2009-10-27 Intel Corporation Obscuring memory access patterns
EP2120178A4 (en) * 2007-02-08 2010-12-08 Nec Corp Access control system, access control method, electronic device, and control program
JP4976991B2 (en) * 2007-11-22 2012-07-18 株式会社東芝 Information processing apparatus, program verification method, and program
US8477946B2 (en) * 2008-02-27 2013-07-02 International Business Machines Corporation Method and apparatus for protecting encryption keys in a logically partitioned computer system environment
US8726042B2 (en) * 2008-02-29 2014-05-13 Microsoft Corporation Tamper resistant memory protection
JP5322620B2 (en) 2008-12-18 2013-10-23 株式会社東芝 Information processing apparatus, program development system, program verification method, and program
US8549260B2 (en) * 2009-01-29 2013-10-01 Infineon Technologies Ag Apparatus for processing data and method for generating manipulated and re-manipulated configuration data for processor
JP5171907B2 (en) * 2010-09-13 2013-03-27 株式会社東芝 Information processing apparatus and information processing program
CN102436559B (en) 2010-09-29 2016-06-01 联想(北京)有限公司 A kind of state switching method and system
CN103582889B (en) * 2011-06-06 2015-11-25 株式会社索思未来 Content-data renovation process and thumbnail image generation method
JP5316592B2 (en) * 2011-06-09 2013-10-16 富士通セミコンダクター株式会社 Secure processor program
KR101944010B1 (en) * 2012-02-24 2019-01-30 삼성전자 주식회사 Method and apparatus for detecting tampered application
US9430384B2 (en) * 2013-03-31 2016-08-30 Intel Corporation Instructions and logic to provide advanced paging capabilities for secure enclave page caches
US9767044B2 (en) * 2013-09-24 2017-09-19 Intel Corporation Secure memory repartitioning
US9411600B2 (en) * 2013-12-08 2016-08-09 Intel Corporation Instructions and logic to provide memory access key protection functionality
US9703715B2 (en) * 2013-12-28 2017-07-11 Intel Corporation Shared memory in a secure processing environment
US10049216B2 (en) * 2014-02-06 2018-08-14 Intel Corporation Media protection policy enforcement for multiple-operating-system environments
FR3035241B1 (en) * 2015-04-16 2017-12-22 Inside Secure METHOD OF SHARING A MEMORY BETWEEN AT LEAST TWO FUNCTIONAL ENTITIES
US10007446B2 (en) * 2015-05-05 2018-06-26 Macronix International Co., Ltd. Method, apparatus, and storage medium for writing data into persistent storage device
US9875189B2 (en) 2015-06-12 2018-01-23 Intel Corporation Supporting secure memory intent
GB2539433B8 (en) * 2015-06-16 2018-02-21 Advanced Risc Mach Ltd Protected exception handling
EP3443432A4 (en) * 2016-04-12 2020-04-01 Guardknox Cyber Technologies Ltd. Specially programmed computing systems with associated devices configured to implement secure lockdowns and methods of use thereof
US10884952B2 (en) * 2016-09-30 2021-01-05 Intel Corporation Enforcing memory operand types using protection keys
CN108229207B (en) * 2016-12-09 2021-09-14 上海新微技术研发中心有限公司 SOC chip with memory internal data tamper-proof mechanism and method
CN111868700B (en) * 2018-02-28 2024-04-19 索尼公司 Memory management system, memory management method, and information processing apparatus
GB2572158B (en) * 2018-03-20 2020-11-25 Advanced Risc Mach Ltd Random tag setting instruction
GB2575878B (en) 2018-07-27 2021-06-09 Advanced Risc Mach Ltd Binary search procedure for control table stored in memory system
US11226894B2 (en) 2018-12-21 2022-01-18 Micron Technology, Inc. Host-based flash memory maintenance techniques
CN114996725B (en) * 2022-05-06 2023-07-28 北京中科昊芯科技有限公司 Method for protecting development program and processor

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4558176A (en) * 1982-09-20 1985-12-10 Arnold Mark G Computer systems to inhibit unauthorized copying, unauthorized usage, and automated cracking of protected software
US5628023A (en) * 1993-04-19 1997-05-06 International Business Machines Corporation Virtual storage computer system having methods and apparatus for providing token-controlled access to protected pages of memory via a token-accessible view
US5666411A (en) * 1994-01-13 1997-09-09 Mccarty; Johnnie C. System for computer software protection
US5845129A (en) * 1996-03-22 1998-12-01 Philips Electronics North America Corporation Protection domains in a single address space
JP3790323B2 (en) * 1997-04-16 2006-06-28 株式会社ルネサステクノロジ Data transfer control device, microcomputer and data processing system
US5991399A (en) * 1997-12-18 1999-11-23 Intel Corporation Method for securely distributing a conditional use private key to a trusted entity on a remote system
US6105137A (en) * 1998-07-02 2000-08-15 Intel Corporation Method and apparatus for integrity verification, authentication, and secure linkage of software modules
JP2000066956A (en) 1998-08-17 2000-03-03 Nec Corp Access right setting/verification system for shared memory
US6775779B1 (en) * 1999-04-06 2004-08-10 Microsoft Corporation Hierarchical trusted code for content protection in computers
DE19925195A1 (en) 1999-06-01 2000-12-07 Giesecke & Devrient Gmbh Memory management method for monitoring access to data or programs e.g. for chip card, by allocating attributes to memory addresses to permit or deny access
WO2001016759A1 (en) 1999-08-31 2001-03-08 Cryptec Systems, Inc. Smart card memory management system and method

Also Published As

Publication number Publication date
US20030182571A1 (en) 2003-09-25
EP1347384A3 (en) 2004-08-11
CN1445680A (en) 2003-10-01
KR20030076336A (en) 2003-09-26
CN1197014C (en) 2005-04-13
US7219369B2 (en) 2007-05-15
KR100491991B1 (en) 2005-05-30
JP2003280989A (en) 2003-10-03
EP1347384A2 (en) 2003-09-24

Similar Documents

Publication Publication Date Title
JP3866597B2 (en) Internal memory tamper resistant processor and secret protection method
JP4226816B2 (en) Microprocessor
US7721114B2 (en) Method for using shared library in tamper resistant microprocessor
JP4098478B2 (en) Microprocessor
JP5175856B2 (en) Protection and method of flash memory block in secure device system
JP4226760B2 (en) Microprocessor, multitask execution method using the same, and multired execution method
US7694151B1 (en) Architecture, system, and method for operating on encrypted and/or hidden information
EP1826701B1 (en) Secure processor
CN109766164B (en) Access control method, memory management method and related device
CN109800050B (en) Memory management method, device, related equipment and system of virtual machine
EP1220079A2 (en) Method for sharing encrypted data region among processes in tamper resistant processor
KR101054981B1 (en) Computer-implemented methods, information processing systems, and computer-readable recording media for securely storing the context of a program
KR20010082631A (en) Tamper resistant microprocessor
EP1536307B1 (en) Encryption of system paging file
US7603566B2 (en) Authenticated process switching on a microprocessor
JP4643702B2 (en) Microprocessor
JP4375980B2 (en) Multitask execution system and multitask execution method

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20060412

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060627

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060825

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20061005

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

Free format text: PAYMENT UNTIL: 20101013

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20111013

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20111013

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20121013

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20131013

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees