JP4374476B2 - Cache memory and control method thereof - Google Patents

Cache memory and control method thereof Download PDF

Info

Publication number
JP4374476B2
JP4374476B2 JP2004153520A JP2004153520A JP4374476B2 JP 4374476 B2 JP4374476 B2 JP 4374476B2 JP 2004153520 A JP2004153520 A JP 2004153520A JP 2004153520 A JP2004153520 A JP 2004153520A JP 4374476 B2 JP4374476 B2 JP 4374476B2
Authority
JP
Japan
Prior art keywords
data
cache memory
replica
written
original data
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 - Lifetime
Application number
JP2004153520A
Other languages
Japanese (ja)
Other versions
JP2005338946A (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.)
Japan Science and Technology Agency
National Institute of Japan Science and Technology Agency
Original Assignee
Japan Science and Technology Agency
National Institute of Japan Science and Technology Agency
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 Japan Science and Technology Agency, National Institute of Japan Science and Technology Agency filed Critical Japan Science and Technology Agency
Priority to JP2004153520A priority Critical patent/JP4374476B2/en
Publication of JP2005338946A publication Critical patent/JP2005338946A/en
Application granted granted Critical
Publication of JP4374476B2 publication Critical patent/JP4374476B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)
  • Storage Device Security (AREA)
  • Executing Machine-Instructions (AREA)

Description

本発明は、スタック・スマッシングに対する防御方法に関し、解析/変換を必要としない動的検出型の防御方法となるキャッシュ・メモリ及びその制御方法に関する。   The present invention relates to a defense method against stack smashing, and more particularly to a cache memory and a control method thereof that are dynamic detection type defense methods that do not require analysis / conversion.

近年、バッファ・オーバフローの脆弱性を活用した悪質プログラムによる被害が急増している。例えば、代表的なものとして2001年に猛威を振ったCode Redや、2003年のBlasterなどがある。悪質プログラムは、攻撃対象となるコンピュータが正規アプリケーションを実行している最中にバッファ・オーバフローを引き起こさせ、強制的にプログラムの実行制御を乗っ取る。したがって、特権モードでの実行中にバッファ・オーバフローが発生した場合、悪質プログラムは特権モードで実行されることになる。その結果、ファイルの削除や改ざんが可能となり多大なる被害をもたらす。CERTによって発せられた勧告(1996〜2001年)の内、バッファ・オーバフローに関連するものの割合を図10に示す。図から分かるように、多くの悪質プログラムはバッファ・オーバフローの脆弱性を利用しており、その防御策が極めて重要となる。   In recent years, the damage caused by malicious programs using the buffer overflow vulnerability has increased rapidly. For example, typical examples are Code Red, which raged in 2001, and Blaster in 2003. The malicious program causes a buffer overflow while the computer to be attacked is executing a legitimate application, forcibly taking over the execution control of the program. Therefore, if a buffer overflow occurs during execution in privileged mode, the malicious program will be executed in privileged mode. As a result, the file can be deleted or altered, resulting in great damage. Figure 10 shows the proportion of recommendations issued by CERT (1996-2001) related to buffer overflow. As can be seen from the diagram, many malicious programs use the buffer overflow vulnerability, and its countermeasures are extremely important.

悪質プログラムは、関数呼び出し後にバッファ・オーバフローを引き起こしてスタックを破壊する(スタック・スマッシングという)。そして、関数呼出し側への戻りアドレスを悪質プログラム・コードの先頭アドレスへと改ざんすることで、プログラムの実行制御を乗っ取る。このようなスタック・スマッシングの原因となるバッファ・オーバフローの脆弱性は、strcpyやstrcatなどのC標準ライブラリ内に存在する。これらの関数では、文字列をローカル変数に代入する際に領域サイズのチェックを行わない。そのため、ローカル変数で指定したバッファ・サイズより大きな文字列等を代入した場合、確保されたローカル変数メモリ領域の境界を越えて書込みを行う。   The malicious program causes a buffer overflow after the function call and destroys the stack (called stack smashing). Then, the program execution control is taken over by altering the return address to the function call side to the head address of the malicious program code. The buffer overflow vulnerability that causes such stack smashing exists in C standard libraries such as strcpy and strcat. These functions do not check the region size when assigning a character string to a local variable. Therefore, when a character string larger than the buffer size specified by the local variable is substituted, writing is performed across the boundary of the reserved local variable memory area.

スタック・スマッシング発生時の様子を図11に示す。ここでは、strcpyを用いて文字列コピーを行う関数gが、関数fによって呼出される場合を想定している。通常、関数gが呼出された際、関数fへの戻りアドレスをスタックに保存する。そして、関数gでの処理終了後、この戻りアドレスをPCに復元する事で関数呼出し側へと実行制御が移る。これに対し、バッファ境界をチェックしない文字列コピーによりスタック・スマッシングが発生した場合、スタック領域に対して悪質プログラム・コードが上書きされる。また、関数fへの戻りアドレスが悪質コードの先頭アドレスへと改ざんされる。その結果、呼出し元関数fへ復帰する際には改ざんされた戻りアドレスが用いられ、その結果としてスタック内部の悪質プログラム・コードへと実行制御が移る。   FIG. 11 shows the situation when stack smashing occurs. Here, it is assumed that the function g that performs string copy using strcpy is called by the function f. Normally, when the function g is called, the return address to the function f is saved on the stack. Then, after the processing in the function g is completed, the execution control is transferred to the function calling side by restoring the return address to the PC. On the other hand, when stack smashing occurs due to a character string copy that does not check the buffer boundary, the malicious program code is overwritten on the stack area. In addition, the return address to the function f is altered to the head address of the malicious code. As a result, when returning to the caller function f, the altered return address is used, and as a result, execution control is transferred to the malicious program code in the stack.

これまでに、スタック・スマッシングに対する様々な防御方法が提案された。これらは、バッファ・オーバフロー回避のためのコード解析や変換の有無、ならびに、スタック・スマッシングの検出時期によって以下のように分類できる。   So far, various defense methods against stack smashing have been proposed. These can be classified as follows according to the presence or absence of code analysis and conversion for avoiding buffer overflow, and the detection timing of stack smashing.

(1)静的解析かつ静的検出型:プログラム・コードを静的に解析してバッファ・オーバフロー発生可能場所を検査する。例えば、文字列操作に限定し、「コピー元の文字列サイズ」が「コピー先のローカル変数領域サイズ」を超えていないか検査する方法などがある(参考文献1:D.Wagner, J.S.Foster, E.A.Brewer, and A.Aiken, "A First Step Towards Automated Detection of Buffer Overrun Vulnerabilities," Proc. of the Network and Distributed System Security Symposium, Feb. 2000.)。   (1) Static analysis and static detection type: A program code is statically analyzed to check a place where a buffer overflow can occur. For example, there is a method for checking whether the “copy source character string size” exceeds the “copy destination local variable area size” or not (Reference 1: D. Wagner, JSFoster, EABrewer, and A. Aiken, "A First Step Towards Automated Detection of Buffer Overrun Vulnerabilities," Proc. Of the Network and Distributed System Security Symposium, Feb. 2000.).

(2)静的解析/変換かつ動的検出型:プログラムの静的解析により、スタック・スマッシングを検出するためのコード変換をコンパイル時に行う。参考文献2(U.Erlingsson and F.B.Schneider, "SASI Enforcement of Security Policies: A Retrospective," Proc. of the workshop on New security paradigm, 1999.)で提案されたSASIでは、実行の振舞いを監視するリファレンス・モニタ(RM)をコード中に挿入する。例えば、バッファ・オーバフローの危険性があるコード部分に対し、領域チェックを行うためのRMコードを挿入する。また、参考文献3(C.Cowan, C.Pu, D.Maier, H.Hinton, J.Walpole, P.Bakke, S.Beattie, A.Grier, P.Wagle, and Q.Zhang, "StackGuard: Automatic Adaptive Detection and Prevention of Buffer-Overflow Attacks," Proc. of 7th USENIX Security Symposium, Jan, 1998.)で提案されたStackGuardでは、canary wordと呼ばれる乱数を生成して戻りアドレスと共にスタックへ格納する。canaryは戻りアドレスの直後にプッシュされるため、スタック・スマッシングが発生した場合にはcanary値も改ざんされる。よって、関数呼出し時と復帰時のcanary値を比較する事で戻りアドレスの改ざんを検査できる。   (2) Static analysis / conversion and dynamic detection type: Code conversion for detecting stack smashing is performed at compile time by static analysis of a program. SASI proposed in Reference 2 (U. Erlingsson and FB Schneider, "SASI Enforcement of Security Policies: A Retrospective," Proc. Of the workshop on New security paradigm, 1999.) Insert the monitor (RM) into the code. For example, an RM code for performing a region check is inserted into a code portion where there is a risk of buffer overflow. Reference 3 (C. Cowan, C. Pu, D. Maier, H. Hinton, J. Walpole, P. Bakke, S. Beattie, A. Grier, P. Wagle, and Q. Zhang, "StackGuard: In StackGuard proposed by Automatic Adaptive Detection and Prevention of Buffer-Overflow Attacks, "Proc. Of 7th USENIX Security Symposium, Jan, 1998.", a random number called a canary word is generated and stored in a stack along with a return address. Since canary is pushed immediately after the return address, the canary value is also altered when stack smashing occurs. Therefore, by comparing the canary value at the time of function call and return, alteration of the return address can be inspected.

(3)動的解析/変換かつ動的検出型:プログラム実行中にコードの解析や変換を行う。先に説明した静的解析や変換を行う方式とは異なり、オブジェクト・コードの互換性を保つ事ができる。具体的には、バイナリ変換を行うことで、リファレンス・モニタに相当するバッファ・オーバフロー検査用コードを動的に生成する方法などがある(参考文献4:A.Baratloo, N.Singh, and T.Tsai, "Transparent Run-Time Defense Against Stack Smashing Attacks," Proc. of 2000 USENIX Annual Technical Conference, June 2000.)(参考文献5:K.Scott and J.Davidson, "Safe Virtual Execution Using Software Dynamic Translation," Proc. of the 18th Computer Security Applications Conference, Dec. 2002.)。   (3) Dynamic analysis / conversion and dynamic detection type: Analyzes and converts code during program execution. Unlike the static analysis and conversion methods described above, object code compatibility can be maintained. Specifically, there is a method of dynamically generating a buffer overflow check code corresponding to a reference monitor by performing binary conversion (Reference 4: A. Baratloo, N. Singh, and T.). Tsai, "Transparent Run-Time Defense Against Stack Smashing Attacks," Proc. Of 2000 USENIX Annual Technical Conference, June 2000. (Reference 5: K. Scott and J. Davidson, "Safe Virtual Execution Using Software Dynamic Translation," Proc. Of the 18th Computer Security Applications Conference, Dec. 2002.).

(4)解析/変換を必要としない動的検出型:コード解析や変換を行う事無く、戻りアドレス保護を実現する方式である。ソフトウェア・アプローチとしては、安全性を保障したCライブラリ(libsafeと呼ばれる)を提供する方法や、OSの介在により動的にcanaryを追加する方法などが提案されている(参考文献4参照)(参考文献6:M.Frantzen and M.Shuey, "StackGhost: Hardware Facilitated Stack Protection," Proc. of the 10th USENIX Security Symposium, Aug. 2001.)。一方、ハードウェア・アプローチとしては、プロセッサ内部に戻りアドレス専用スタックであるSRAS(Secure Return Address Stack)を搭載する方法が提案されている(参考文献7:R。B。Lee、 D。K。Karig、 J。P。McGregor、 and Z。Shi、 "Enlisting Hardware Architecture to Thwart Malicious Code Injection、" Proc。 of the Int。 Conf。 on Security in Pervasive Computing、 Mar。 2003。)。戻りアドレスをプッシュする際、それと同時にSRASにも戻りアドレスを書込む。そして、関数から復帰する時、メモリ・スタックならびにSRASからポップした戻りアドレスを比較する。比較結果が不一致であればスタック・スマッシングが発生していることになる。
R。B。Lee、 D。K。Karig、 J。P。McGregor、 and Z。Shi、 "Enlisting Hardware Architecture to Thwart Malicious Code Injection、" Proc。 of the Int。 Conf。 on Security in Pervasive Computing、 Mar。 2003。
(4) Dynamic detection type that does not require analysis / conversion: A method for realizing return address protection without code analysis or conversion. As a software approach, a method of providing a C library (called libsafe) that guarantees safety, a method of dynamically adding canary through the intervention of the OS, etc. have been proposed (see Reference 4) (reference) Reference 6: M. Frantzen and M. Shuey, "StackGhost: Hardware Facilitated Stack Protection," Proc. Of the 10th USENIX Security Symposium, Aug. 2001.). On the other hand, as a hardware approach, a method of mounting a secure return address stack (SRAS) which is a return address dedicated stack inside the processor has been proposed (reference 7: R. B. Lee, D. K. Karig. , J. P. McGregor, and Z. Shi, "Enlisting Hardware Architecture to Thwart Malicious Code Injection," Proc. Of the Int. Conf. On Security in Pervasive Computing, Mar. 2003.). When pushing the return address, write the return address to SRAS at the same time. When returning from the function, the return addresses popped from the memory stack and SRAS are compared. If the comparison results do not match, stack smashing has occurred.
R. B. Lee, D. K. Karig, J. P. McGregor, and Z. Shi, "Enlisting Hardware Architecture to Thwart Malicious Code Injection," Proc. of the Int. Conf. on Security in Pervasive Computing, Mar. 2003.

本発明では、前記分類中(4)解析/変換を必要としない動的検出型のハードウェア・アプローチの1つである前記SRASに着目した。このSRASによれば、オブジェクト・コードの互換性を完全に保つことができ、また、CライブラリやOSといったシステム・ソフトウェアの変更は伴わない。しかしながら、前記したようにSRASは、小容量スタック・メモリとしてプロセッサ内部に実装され、関数呼出しのネストに伴い容量が不足した場合には,保護された安全な主記憶領域との間でエントリの追出し/リフィルが行われるという課題を有する。また、SRASはスタックのため、単体でLIFO動作と異なる関数制御(例えばsetjmpやlongjmp)に対応することができないという課題を有する。さらに、プロセッサの内部構造に大きな影響を与えるという課題を有し、実製品化導入の困難性を有している。   In the present invention, attention is paid to the SRAS, which is one of the dynamic detection type hardware approaches that do not require analysis / conversion during the classification (4). According to SRAS, object code compatibility can be maintained completely, and system software such as C library and OS is not changed. However, as described above, SRAS is implemented as a small-capacity stack memory inside the processor, and when capacity is insufficient due to nesting of function calls, entry of entries to and from the protected safe main storage area is performed. / Has the problem of being refilled. Further, since SRAS is a stack, it has a problem that it cannot cope with function control (for example, setjmp or longjmp) different from LIFO operation by itself. Furthermore, there is a problem that the internal structure of the processor is greatly affected, and there is a difficulty in introducing an actual product.

本発明は前記課題を解決するためになされ、プロセッサの内部構造に大きな影響を与えることなく、主にキャッシュ・メモリに対して改良を加えることでスタック・スマッシングを判別可能なキャッシュ・メモリ及びその制御方法を提供することを目的とする。   The present invention has been made to solve the above-mentioned problems, and a cache memory capable of discriminating stack smashing by mainly improving the cache memory without greatly affecting the internal structure of the processor and its control It aims to provide a method.

本発明に係るキャッシュ・メモリ制御方法は、プロセッサからキャッシュ・メモリに書き込むべきデータがあるとき、当該書き込むべきデータが関数戻りアドレス値である場合には、通常通りキャッシュ・メモリに書き込むべきデータをオリジナルデータとして書き込むと共に、当該オリジナルデータと同一内容のレプリカデータを作成しオリジナルデータと対応付けてキャッシュ・メモリに書き込み、オリジナルデータがプロセッサから関数戻りアドレスとして読み出されるとき、当該オリジナルデータに対応するレプリカデータを読み出し、オリジナルデータとレプリカデータとが一致するか否かを比較するものである。このように本発明においては、プロセッサからキャッシュ・メモリに書き込むべきデータがあるとき、当該書き込むべきデータが関数戻りアドレス値である場合には、通常通りキャッシュ・メモリに書き込むべきデータをオリジナルデータとして書き込むと共に、当該オリジナルデータと同一内容のレプリカデータを作成しオリジナルデータと対応付けてキャッシュ・メモリに書き込み、オリジナルデータがプロセッサから関数戻りアドレスとして読み出されるとき、当該オリジナルデータに対応するレプリカデータを読み出し、オリジナルデータとレプリカデータとが一致するか否かを比較するので、スタック・スマッシングがなされた場合にはオリジナルデータが改ざんされ、レプリカデータと比較した場合には不一致となって改ざんがあったことを判別することができる。特に、本発明はキャッシュ・メモリ制御方法を改良してなされるものであり、プロセッサの内部構造に与える影響が少なく導入も行い易い。したがって、アウト・オブ・オーダ実行や高度な分岐予測機構を搭載した複雑なプロセッサに対しても容易に適用できる。また、前記SRASと異なり、LIFO動作と異なる関数制御(例えばsetjmpやlongjmp)の場合でもソフトウェアの介在無しに対応できる。さらには、前記したSRASと異なり、キャッシュ・メモリ内部のレプリカデータを作成しているため、大量の戻りアドレスを格納することができ、追い出しにも該当し難い。   In the cache memory control method according to the present invention, when there is data to be written to the cache memory from the processor, if the data to be written is a function return address value, the data to be written to the cache memory is normally written as usual. Write data as data, create replica data with the same contents as the original data, write it to the cache memory in association with the original data, and when the original data is read out as a function return address from the processor, the replica data corresponding to the original data And compare whether or not the original data and the replica data match. Thus, in the present invention, when there is data to be written from the processor to the cache memory, if the data to be written is a function return address value, the data to be written to the cache memory is written as original data as usual. In addition, replica data having the same content as the original data is created and written in the cache memory in association with the original data.When the original data is read out as a function return address from the processor, the replica data corresponding to the original data is read out, Since it is compared whether or not the original data and the replica data match, the original data is falsified when stack smashing is performed, and the original data and the replica data are not matched when compared with the replica data. That Tsu can be determined. In particular, the present invention is made by improving the cache memory control method, has little influence on the internal structure of the processor, and is easy to introduce. Therefore, it can be easily applied to a complex processor equipped with out-of-order execution and an advanced branch prediction mechanism. Further, unlike the SRAS, even in the case of function control (for example, setjmp or longjmp) different from the LIFO operation, it is possible to cope with no software intervention. Further, unlike the SRAS described above, since the replica data in the cache memory is created, a large amount of return addresses can be stored and it is difficult to correspond to eviction.

また、本発明に係るキャッシュ・メモリ制御方法は必要に応じて、前記レプリカデータのキャッシュ・メモリからの追い出しを禁止するものである。このように本発明においては、レプリカデータのキャッシュ・メモリからの追い出しを禁止するので、レプリカデータのキャッシュ・メモリからの追い出しがなく、レプリカデータは必ずキャッシュ・メモリ上に存在し、オリジナルデータとの比較を必ず行うことができ、すなわち、スタック・スラッシングの発生を常に判別することができる。   The cache memory control method according to the present invention prohibits the replica data from being purged from the cache memory as necessary. As described above, in the present invention, since the eviction of replica data from the cache memory is prohibited, there is no eviction of the replica data from the cache memory, and the replica data always exists on the cache memory, A comparison can always be made, that is, the occurrence of stack thrashing can always be determined.

また、本発明に係るキャッシュ・メモリ制御方法は、プロセッサからキャッシュ・メモリに書き込むべきデータがあるとき、当該書き込むべきデータが関数戻りアドレス値である場合には、通常通りキャッシュ・メモリに書き込むべきデータをオリジナルデータとして書き込むと共に、当該オリジナルデータと同一内容のレプリカデータを複数作成しオリジナルデータとそれぞれ対応付けてキャッシュ・メモリに書き込み、オリジナルデータがプロセッサから関数戻りアドレスとして読み出されるとき、当該オリジナルデータに対応するレプリカデータを読み出し、オリジナルデータと少なくとも1つのレプリカデータとが一致するか否かを比較するものである。このように本発明においては、プロセッサからキャッシュ・メモリに書き込むべきデータがあるとき、当該書き込むべきデータが関数戻りアドレス値である場合には、通常通りキャッシュ・メモリに書き込むべきデータをオリジナルデータとして書き込むと共に、当該オリジナルデータと同一内容のレプリカデータを複数作成しオリジナルデータとそれぞれ対応付けてキャッシュ・メモリに書き込み、オリジナルデータがプロセッサから関数戻りアドレスとして読み出されるとき、当該オリジナルデータに対応するレプリカデータを読み出し、オリジナルデータと少なくとも1つのレプリカデータとが一致するか否かを比較するので、レプリカデータを複数作成し、オリジナルデータと対応付けてキャッシュ・メモリに書き込まれており、一部のレプリカデータがキャッシュ・メモリから追い出しがなされた場合でも残りのレプリカデータでオリジナルデータとの比較ができ、オリジナルデータとの比較ができるように信頼性を向上させることができる。ここで、作成される複数レプリカデータの数は多いほど信頼性を向上させることができるが、キャッシュ・メモリ上の領域を確保する必要があり追い出しの発生率を高める要因ともなる。   Further, the cache memory control method according to the present invention is such that when there is data to be written from the processor to the cache memory, if the data to be written is a function return address value, the data to be written to the cache memory as usual. Is created as original data, and a plurality of replica data having the same contents as the original data are created and written in the cache memory in association with the original data, and when the original data is read out from the processor as a function return address, Corresponding replica data is read, and it is compared whether or not the original data matches at least one replica data. Thus, in the present invention, when there is data to be written from the processor to the cache memory, if the data to be written is a function return address value, the data to be written to the cache memory is written as original data as usual. In addition, a plurality of replica data having the same contents as the original data are created and written in the cache memory in association with the original data, and when the original data is read out from the processor as a function return address, the replica data corresponding to the original data is Since reading and comparing whether or not the original data and at least one replica data match each other, a plurality of replica data are created and associated with the original data and written to the cache memory. Replica data can improve the reliability as can be compared with the original data in the remaining of the replica data even when the flush is made from the cache memory, it is compared with the original data. Here, as the number of multiple replica data to be created increases, the reliability can be improved. However, it is necessary to secure an area on the cache memory, which increases the occurrence rate of eviction.

また、本発明に係るキャッシュ・メモリ制御方法は必要に応じて、レプリカデータの書き込みに伴い、LRUまたはMRUアルゴリズムに基づきキャッシュ・メモリ中からデータの追い出しを行い当該追い出し部分にレプリカデータの書き込みを行うものである。MRUアルゴリズムに基づき追い出しを行った場合には、レプリカデータが追い出しの対象とされ難くなるため安全性は向上する。しかしながら、キャッシュ・ヒット率が低下する。一方、LRUアルゴリズムに基づき追い出しを行った場合には、レプリカデータが追い出しの対象とされ易くなるため安全性は低下するものの、キャッシュ・ヒット率が改善する。   In addition, the cache memory control method according to the present invention performs data eviction from the cache memory based on the LRU or MRU algorithm and writes the replica data to the eviction portion as needed when the replica data is written. Is. When eviction is performed based on the MRU algorithm, the replica data is less likely to be evicted, so safety is improved. However, the cache hit rate decreases. On the other hand, when the eviction is performed based on the LRU algorithm, the replica data is likely to be a target of the eviction, so the safety is lowered but the cache hit rate is improved.

また、本発明に係るキャッシュ・メモリ制御方法は必要に応じて、前記オリジナルデータとの比較が終了したレプリカデータが存在する場合には、かかるレプリカデータを優先的に追い出し対象とするものである。このように本発明においては、前記オリジナルデータとの比較が終了したレプリカデータが存在する場合には、かかるレプリカデータを優先的に追い出し対象とするので、通常キャッシュ・メモリは採用するLRUアルゴリズムに基づき追い出し対象となるデータを特定するが、既に役目を果たしたレプリカデータが再び使用される可能性が低く、かかるレプリカデータを追い出し対象とすることで、キャッシュ・ヒット率を向上させることができる。   The cache memory control method according to the present invention preferentially targets such replica data to be expelled when there is replica data that has been compared with the original data, if necessary. As described above, in the present invention, when there is replica data that has been compared with the original data, the replica data is preferentially evicted. Therefore, the normal cache memory is based on the LRU algorithm employed. Although data to be evicted is specified, it is unlikely that replica data that has already played a role will be used again. By making such replica data to be evicted, the cache hit rate can be improved.

また、本発明に係るキャッシュ・メモリは必要に応じて、プロセッサが実行する命令列を監視する命令監視手段を設け、当該命令監視手段が現在のメモリ・アクセスが関数戻りアドレスを対象としていることを検出するものである。このように本発明においては、プロセッサが実行する命令列を監視する命令監視手段を設け、当該命令監視手段が現在のメモリ・アクセスが関数戻りアドレスを対象としていることを検出するので、プロセッサ自ら関数戻りアドレスを対象とするメモリ・アクセスであることをキャッシュ・メモリに出力信号を出力して知らせることなく、キャッシュ・メモリが主体的となって、命令監視手段によりプロセッサからのメモリ・アクセスが関数戻りアドレスを対象とするものか否かを判別することができ、プロセッサが本発明に係るキャッシュ・メモリ特有の動作を行う必要がなく、すなわち、プロセッサに設計変更が生じることなく導入が行い易い。   Further, the cache memory according to the present invention is provided with an instruction monitoring means for monitoring an instruction sequence executed by the processor, if necessary, and the instruction monitoring means indicates that the current memory access is for a function return address. It is to detect. As described above, in the present invention, the instruction monitoring means for monitoring the instruction sequence executed by the processor is provided, and the instruction monitoring means detects that the current memory access is for the function return address. Without the output signal being sent to the cache memory to inform the cache memory that the memory access is targeted for the return address, the cache memory becomes the main component, and the memory access from the processor is returned to the function by the instruction monitoring means. It is possible to determine whether or not the address is intended, and it is not necessary for the processor to perform an operation peculiar to the cache memory according to the present invention, that is, the processor can be easily introduced without a design change.

(本発明の第1の実施形態)
本発明の第1の実施形態に係るキャッシュ・メモリ制御方法を図1ないし図4に基づき説明する。図1は一般のセットアソシエイティブ方式のキャッシュ・メモリの構成図、図2は本実施形態に係るセットアソシエイティブ方式のキャッシュ・メモリの構成図及び図3及び図4は本実施形態に係るキャッシュ・メモリの動作フローチャートである。
(First embodiment of the present invention)
A cache memory control method according to the first embodiment of the present invention will be described with reference to FIGS. 1 is a configuration diagram of a general set associative cache memory, FIG. 2 is a configuration diagram of a set associative cache memory according to the present embodiment, and FIGS. 3 and 4 are cache caches according to the present embodiment. It is an operation | movement flowchart of memory.

本実施形態に係るキャッシュ・メモリ制御方法は、プロセッサからキャッシュ・メモリに書き込むべきデータがあるとき、この書き込むべきデータが関数戻りアドレス値である場合には、通常通りキャッシュ・メモリに書き込むべきデータをオリジナルデータとして書き込むと共に、このオリジナルデータと同一内容のレプリカデータを作成しオリジナルデータと対応付けてキャッシュ・メモリに書き込み、オリジナルデータがプロセッサから関数戻りアドレス値として読み出されるとき、オリジナルデータに対応するレプリカデータを読み出し、オリジナルデータとレプリカデータとが一致するか否かを比較する構成である。   In the cache memory control method according to the present embodiment, when there is data to be written from the processor to the cache memory, if the data to be written is a function return address value, the data to be written to the cache memory is changed as usual. When the original data is written as the original data, the replica data having the same contents as the original data is created and associated with the original data and written to the cache memory. When the original data is read out from the processor as the function return address value, the replica corresponding to the original data In this configuration, the data is read and whether or not the original data and the replica data match each other.

このキャッシュ・メモリ制御方法を具体的にキャッシュ・メモリ連装方式の1つであるセットアソシエイティブ方式のキャッシュ・メモリに適用した場合について説明する。ここで、まず、一般のセットアソシエイティブ方式のキャッシュ・メモリについて制御方法の観点から図1に基づき説明を行う。なお、他のキャッシュ・メモリ連装方式であっても適用することができ、例えば、フルアソシエイティブ方式のキャッシュ・メモリ連装方式には適用することができる。   The case where this cache memory control method is applied to a set associative cache memory, which is one of the cache memory concatenation methods, will be specifically described. Here, first, a general set-associative cache memory will be described with reference to FIG. 1 from the viewpoint of a control method. Note that the present invention can also be applied to other cache / memory combination schemes, for example, a full-associative cache / memory combination scheme.

一般のセットアソシエイティブ方式のキャッシュ・メモリは、図1に示すように、複数のタグ11(tag)を配列要素として持つタグ部12と、かかるタグ11に対応して所定データ領域を確保しているデータ領域21を配列要素として持つデータ領域部22とから構成されるウェイ31(way)を複数有する。また、タグ11(又はデータ領域)の配列要素番号順に、インデックスが割り付けられている。そして、タグを上位ビットとし、インデックスを下位ビットとするメモリ参照アドレスが示すメモリのデータをキャッシュ・メモリはデータ領域21に書き込んでいる。このセットアソシエイティブ方式のキャッシュ・メモリの動作を、ストア(Store)、ロード(Load)の動作に分けて順に説明する。まず、ストアは、プロセッサからデータと共にメモリ参照アドレスがキャッシュ・メモリに対して送られてくる。キャッシュ・メモリはこのメモリ参照アドレスを所定上位ビットをタグとし、残りの下位ビットをインデックスとし、インデックスに基づきセット41が特定され、タグが同一のウェイ31があれば選択し、かかる同一のウェイ31がない場合には適当にウェイ31を選択する。選択されたウェイ31のタグ部12に書き込み、さらに、このタグ部12に対応するデータ領域21に対してプロセッサからのデータを上書きする。ここで、キャッシュ・メモリの書き込み方式はライトバック方式とする。次にロードは、プロセッサからメモリ参照アドレスがキャッシュ・メモリに対して送られてくる。キャッシュ・メモリはこのメモリ参照アドレスをストアと同様にタグとインデックスに分け、インデックスに対応するセット41を読み出し、読み出された各データ領域21のデータのうち比較器において各データのタグとメモリ参照アドレス中のタグとを比較し該当するデータをプロセッサに送り出す。それと同時に、比較器において送り出された各データのタグとメモリ参照アドレス中のタグとを比較し、該当するデータがあるか否かの旨をプロセッサに通知する。   As shown in FIG. 1, a general set-associative cache memory has a tag unit 12 having a plurality of tags 11 (tags) as array elements and a predetermined data area corresponding to the tags 11. A plurality of ways 31 (way) including a data area portion 22 having the data area 21 as an array element. Also, indexes are assigned in the order of array element numbers of the tag 11 (or data area). Then, the cache memory writes the data of the memory indicated by the memory reference address with the tag as the upper bit and the index as the lower bit in the data area 21. The operation of the set associative cache memory will be described in order by dividing it into a store operation and a load operation. First, in the store, a memory reference address is sent to the cache memory together with data from the processor. The cache memory uses the memory reference address as a predetermined upper bit as a tag and the remaining lower bits as an index. A set 41 is specified based on the index, and if there is a way 31 having the same tag, the same way 31 is selected. If there is not, the way 31 is appropriately selected. The data is written to the tag portion 12 of the selected way 31 and the data from the processor is overwritten on the data area 21 corresponding to the tag portion 12. Here, the write method of the cache memory is a write back method. Next, the memory reference address is sent from the processor to the cache memory. The cache memory divides this memory reference address into a tag and an index in the same manner as the store, reads out the set 41 corresponding to the index, and in the comparator of the data in each data area 21 read out, refers to the tag and memory of each data The tag in the address is compared and the corresponding data is sent to the processor. At the same time, the tag of each data sent out by the comparator is compared with the tag in the memory reference address, and the processor is notified whether there is corresponding data.

次に、本発明のキャッシュ・メモリについて図2に基づき前記一般のセットアソシエイティブ方式のキャッシュ・メモリ(以下、一般のキャッシュ・メモリとする)と比較しながら説明する。本発明のキャッシュ・メモリにあっては、読み出し専用のレプリカデータ(セットアソシエイティブ方式では各データ領域21のデータをラインと呼ぶ場合もあり、この呼称に従えばレプリカラインとなる)を同一セット41内に作成した点、ウェイ31の各タグとデータ領域21の組合せに対してレプリカデータ用のフラグ(R-flag)を設けた点、レプリカデータ用のマルチプレクサ(Replica-MUX)を備えた点、比較器においてタグの照合するだけでなく前記レプリカデータ用のフラグも照合する点、さらに、比較器により照合し読み出されたオリジナルデータとレプリカデータの比較を行うデータ内容比較器51を備えた点が、前記一般のキャッシュ・メモリとの相違点となる。この相違により、セットアソシエイティブ方式において、前記したようなレプリカデータをオリジナルデータと対応付け、また、オリジナルデータとレプリカデータとが一致するか否かを比較することが可能となる。ただし、一つの実装形式に過ぎず、本発明がこの実装方式に限定されるものではない。
レプリカデータ用のフラグは、対応するデータ領域21内のデータがレプリカデータであるか否かを示すものであり、1ビットからなる。
Next, the cache memory of the present invention will be described with reference to FIG. 2 in comparison with the general set associative cache memory (hereinafter referred to as a general cache memory). In the cache memory of the present invention, read-only replica data (in the set associative method, the data in each data area 21 may be referred to as a line, and according to this designation, it becomes a replica line) is the same set 41. A point created inside, a point provided with a replica data flag (R-flag) for each tag of the way 31 and the data area 21, a point equipped with a replica data multiplexer (Replica-MUX), The comparator includes not only the tag verification but also the replica data flag verification, and further includes a data content comparator 51 for comparing the original data read by the comparator with the replica data. However, this is different from the general cache memory. Due to this difference, in the set associative method, it becomes possible to associate the replica data as described above with the original data, and to compare whether the original data and the replica data match. However, it is only one mounting format, and the present invention is not limited to this mounting method.
The replica data flag indicates whether or not the data in the corresponding data area 21 is replica data, and consists of 1 bit.

また、前記一般のキャッシュ・メモリは、データ領域21に書き込む又は読み出す対象が関数戻りアドレスか否かに拘らず、同じようにストア又はロードを行っているが、本発明のキャッシュ・メモリは、書き込むべきデータが関数戻りアドレス値である場合、関数戻りアドレス値として読み出される場合に処理を切り分けているため、対象となるデータが関数戻りアドレス値であるか否かを判断する必要がある。プロセッサは自己の動作であるため、簡易にはプロセッサの通知によりキャッシュ・メモリは前記関数戻りアドレス値であるか否かを判断することができる。より望ましくは、キャッシュ・メモリがプロセッサの通知を受けることなく単独で、例えば、プロセッサの命令種別に基づき判断したり、または、プロセッサ内の関数戻りアドレス専用のレジストを見張っておき、かかるレジストにデータが書き込まれキャッシュ・メモリに送り出されることにより、実現することができる。このような実現方法によれば、プロセッサの本キャッシュ・メモリによる仕様変更は最小限に抑えられるという長所を有する。   The general cache memory stores or loads in the same manner regardless of whether the object to be written to or read from the data area 21 is a function return address. However, the cache memory of the present invention performs writing. When the data to be processed is a function return address value, the process is separated when it is read as the function return address value. Therefore, it is necessary to determine whether the target data is a function return address value. Since the processor performs its own operation, it is possible to easily determine whether or not the cache memory is the function return address value by notification from the processor. More preferably, the cache memory alone is not notified of the processor, for example, based on the instruction type of the processor, or the register dedicated to the function return address in the processor is watched and data is stored in the register. Is written and sent to the cache memory. According to such a realization method, there is an advantage that the specification change by the cache memory of the processor can be minimized.

次に、本実施形態に係るキャッシュ・メモリの動作について図3及び図4に基づき説明する。ここで、キャッシュ・ヒットの場合について説明するが、ミスの場合でもライン・リプレイスがなされることを除けば、同様の動作となる。   Next, the operation of the cache memory according to the present embodiment will be described with reference to FIGS. Here, the case of a cache hit will be described, but the same operation is performed except that a line replacement is performed even in the case of a miss.

まず、キャッシュ・メモリは、プロセッサからの通知に基づき関数戻りアドレス値を対象とするストア若しくはロードであるか否かを判断し(ステップ101)、関数戻りアドレス値を対象とするものではないと判断した場合には、前記した通りの一般のキャッシュ・メモリの動作がなされてストア若しくはロードを行う。ここで、関数戻りアドレス値を対象としなければ、レプリカデータ用の動作はなされない。前記ステップ101において、キャッシュ・メモリにより関数戻りアドレス値を対象とするものであると判断された場合には、操作命令がストアかロードのどちらであるかを判断する(ステップ102)。キャッシュ・メモリがストアと判断した場合には、一般のキャッシュ・メモリと同様に、メモリ参照アドレスの中のインデックスを用いてアクセス対象となるセット41(参照セットする)を特定する(ステップ103)。そして、特定された参照セット内において、同一タグ11を有し、レプリカデータ用のフラグが無効であるデータ領域21に関数戻りアドレス値をオリジナルデータとして書き込む(ステップ104)。   First, based on the notification from the processor, the cache memory determines whether it is a store or load that targets the function return address value (step 101), and determines that it is not intended for the function return address value. In such a case, the general cache memory is operated as described above to store or load. Here, unless the function return address value is targeted, the operation for replica data is not performed. If it is determined in step 101 that the function return address value is targeted by the cache memory, it is determined whether the operation instruction is a store or load (step 102). When it is determined that the cache memory is a store, the set 41 to be accessed (reference set) is specified using the index in the memory reference address as in the case of a general cache memory (step 103). Then, in the identified reference set, the function return address value is written as original data in the data area 21 having the same tag 11 and invalid replica data flag (step 104).

ここまでの動作説明ではキャッシュ・ミスを想定していないが、前記オリジナルデータでキャッシュ・ミスが生じる場合を想定する場合には、特定された参照セット内において、同一タグ11を有し、レプリカデータ用のフラグが無効であるデータ領域21があるか否かを判断し、あると判断された場合に関数戻りアドレス値をオリジナルデータとして書き込み、ないと判断された場合にMRUアルゴリズムに基づきウェイ31を選択し、かかるウェイ31のデータ領域21に関数戻りアドレス値をオリジナルデータとして書き込むといった動作が挿入された構成となる。   In the operation description so far, a cache miss is not assumed. However, when it is assumed that a cache miss occurs in the original data, the same reference tag 11 is included in the identified reference set, and the replica data It is determined whether there is a data area 21 for which the flag for use is invalid. If it is determined that there is a data area 21, the function return address value is written as original data. The operation of selecting and writing the function return address value as the original data in the data area 21 of the way 31 is inserted.

次に、前記参照セットにおいて、同一タグ11を有し、レプリカデータ用のフラグが有効であるレプリカデータ用のデータ領域21があるか否かを判断する(ステップ201)。かかるレプリカデータ用のデータ領域21があると判断した場合には、かかるレプリカデータ用のデータ領域21に前記オリジナルデータと同一の関数戻りアドレス値を書き込む(ステップ202)。ステップ201において、かかるレプリカデータ用のデータ領域21がないと判断した場合には、MRUアルゴリズムに基づきウェイ31を選択し、かかるウェイ31のデータ領域21に前記オリジナルデータと同一の関数戻りアドレス値を書き込む(ステップ203)。ここで、書き込んだデータ領域21に対応するレプリカデータ用のフラグが無効の場合には、有効にしておく。また、MRUアルゴリズムを選択したのは、レプリカデータがライン・リプレイスの対象となり難くなり、安全性が向上するからである。しかしながら、キャッシュ・ヒット率が低下する可能性がある。一方、LRUアルゴリズムを採用していれば、レプリカデータがライン・リプレイスの対象となり易くなり、安全性は低下するものの、キャッシュ・ヒット率の低下を小さくすることができる。   Next, it is determined whether or not there is a data area 21 for replica data having the same tag 11 and having a valid replica data flag in the reference set (step 201). If it is determined that there is a data area 21 for such replica data, the same function return address value as that of the original data is written in the data area 21 for such replica data (step 202). If it is determined in step 201 that there is no data area 21 for such replica data, the way 31 is selected based on the MRU algorithm, and the same function return address value as that of the original data is set in the data area 21 of the way 31. Write (step 203). Here, when the replica data flag corresponding to the written data area 21 is invalid, it is made valid. The MRU algorithm is selected because the replica data becomes difficult to be subject to line replacement, and the safety is improved. However, the cache hit rate may be reduced. On the other hand, if the LRU algorithm is employed, replica data is likely to be subject to line replacement, and although the safety is reduced, the reduction in the cache hit rate can be reduced.

前記ステップ102において、操作命令がロードであると判断した場合には、プロセッサからのメモリ参照アドレスからインデックスを導き、かかるインデックスから参照セットを特定する(ステップ301)。参照セットの全データ領域21のデータとタグ11とを読み出す(ステップ302)。比較器においてメモリ参照アドレスのタグと読み出されたタグ11とを比較し、タグが同一のデータをプロセッサに送り出す(ステップ303)。ここで、キャッシュ・ミスが生じた場合には、ライン・リプレイスがなされる。   If it is determined in step 102 that the operation instruction is a load, an index is derived from the memory reference address from the processor, and a reference set is specified from the index (step 301). Data in all the data areas 21 of the reference set and the tag 11 are read (step 302). In the comparator, the tag of the memory reference address is compared with the read tag 11, and data having the same tag is sent to the processor (step 303). Here, when a cache miss occurs, line replacement is performed.

次に、参照セットにおいて、同一タグを有し、レプリカデータ用のフラグが有効であるレプリカデータ用のデータ領域21があるか否かを判断する(ステップ401)。かかるレプリカデータ用のデータ領域21がない場合には、その旨(単にレプリカデータがないだけでなく、レプリカデータがないため安全性を保障することができない旨であってもよい)をプロセッサに伝える(ステップ402)。かかるレプリカデータ用のデータ領域21がある場合には、かかるデータ領域21のレプリカデータをデータ内容比較器51に出力する(ステップ403)。データ内容比較器51は、プロセッサに出力されたオリジナルデータをも受け取り、入力されたレプリカデータとの比較を行う(ステップ404)。データ内容比較器51がオリジナルデータとレプリカデータとが一致していると判断した場合には、何もせずに終了する(ステップ405)。前記ステップ404において、データ内容比較器51がオリジナルデータとレプリカデータとが一致していないと判断した場合には、プロセッサにその旨(単に、一致していないだけでなく、スタックスマッシングが発生している可能性がある旨を伝える)を出力して終了する(ステップ406)。   Next, in the reference set, it is determined whether or not there is a data area 21 for replica data having the same tag and having a valid replica data flag (step 401). If there is no data area 21 for such replica data, that fact (not only there is no replica data, but it may be that there is no replica data and safety cannot be guaranteed) is transmitted to the processor. (Step 402). If there is such a data area 21 for replica data, the replica data of the data area 21 is output to the data content comparator 51 (step 403). The data content comparator 51 also receives the original data output to the processor and compares it with the input replica data (step 404). If the data content comparator 51 determines that the original data and the replica data match, the process ends without doing anything (step 405). If the data content comparator 51 determines in step 404 that the original data and the replica data do not match, the processor (not only does not match, but stack smashing occurs). Is output) and the process ends (step 406).

前記ステップ405においては、安全である旨のSafe信号をプロセッサに出力してもよい。この場合であっても、プロセッサはSafe信号を入力されるまで待つ必要はなく、少なくとも悪質コードに制御が移行する前までにプロセッサが認識できればよい。このようにSafe信号を導入した場合であっても、キャッシュ・アクセス時間の増加は殆んど生じない。   In the step 405, a Safe signal indicating that it is safe may be output to the processor. Even in this case, it is not necessary for the processor to wait until the Safe signal is input, as long as the processor can recognize at least before the control is transferred to the malicious code. Even when the Safe signal is introduced in this way, the cache access time hardly increases.

このように本実施形態に係るキャッシュ・メモリの制御方法によれば、プロセッサからキャッシュ・メモリに書き込むべきデータがあるとき、当該書き込むべきデータが関数戻りアドレス値である場合には、通常通りキャッシュ・メモリに書き込むべきデータをオリジナルデータとして書き込むと共に、当該オリジナルデータと同一内容のレプリカデータを作成しオリジナルデータと対応付けてキャッシュ・メモリに書き込み、オリジナルデータがプロセッサから関数戻りアドレスとして読み出されるとき、当該オリジナルデータに対応するレプリカデータを読み出し、オリジナルデータとレプリカデータとが一致するか否かを比較するので、スタック・スマッシングがなされた場合にはオリジナルデータが改ざんされ、レプリカデータと比較した場合には不一致となって改ざんがあったことを判別することができる。   As described above, according to the cache memory control method according to the present embodiment, when there is data to be written to the cache memory from the processor, when the data to be written is a function return address value, the cache memory is normally used. The data to be written to the memory is written as original data, and replica data having the same contents as the original data is created and associated with the original data and written to the cache memory. When the original data is read from the processor as a function return address, The replica data corresponding to the original data is read and compared to determine whether the original data and the replica data match. Therefore, if stack smashing is performed, the original data is falsified and compared with the replica data. If you can judge that there has been tampering not matched.

なお、本実施形態においては、関数戻りアドレス値を対象としないストアである場合にはレプリカデータ用のフラグを用いていないが、参照セットを特定した後のウェイ31を選択する場合に、かかるレプリカデータ用のフラグを見るようにすることもでき、すなわち、レプリカデータ用のフラグが有効となっている場合には、かかるデータ領域21にデータを書き込まない構成にすることもでき、常に、レプリカデータがキャッシュ・メモリ上にあることが保障され、必ず、オリジナルデータとレプリカデータとの比較が可能となる。このとき、関数戻りアドレスを対象とするロードが終了した後に、かかる関数戻りアドレスに係るレプリカデータ用のフラグを無効にする必要がある。それは、かかるレプリカデータ用のフラグにより、かかるラインにはライン・リプレイスが生じることなく、プロセスの終了までキャッシュ・メモリが解放されなくなるからである。   In the present embodiment, the replica data flag is not used when the store does not target the function return address value. However, when the way 31 after specifying the reference set is selected, such a replica is used. It is also possible to look at the data flag, that is, when the replica data flag is valid, the data area 21 can be configured not to write data, and the replica data is always set. Is guaranteed to be in the cache memory, and comparison between the original data and the replica data is always possible. At this time, after the load for the function return address is completed, the replica data flag related to the function return address needs to be invalidated. This is because such a flag for replica data does not cause line replacement in such a line, and the cache memory is not released until the end of the process.

また、本実施形態においては、キャッシュ・メモリがLRUアルゴリズムに基づきライン・リプレイスの対象とするラインを決定することができるが、既に関数戻りアドレスがロードされていて使用済みのレプリカデータが存在する場合には、かかるレプリカデータを優先的にライン・リプレイスの対象とすることができる。この実現は、LRUアルゴリズムを構成するフラグ、若しくは、表の内容を変更することにより実現することができる。これによれば、再び書き込まれる可能性が低いレプリカデータを包含するラインがライン・リプレイスの対象となって、キャッシュ・ヒット率を向上させることができる。   In this embodiment, the cache memory can determine the line to be replaced based on the LRU algorithm, but the function return address has already been loaded and there is used replica data. In this case, such replica data can be preferentially targeted for line replacement. This realization can be realized by changing the flag constituting the LRU algorithm or the contents of the table. According to this, a line including replica data that is unlikely to be written again becomes a target of line replacement, and the cache hit rate can be improved.

(本発明の第2の実施形態)
本発明の第2の実施形態に係るキャッシュ・メモリ制御方法を前記図3及び図4に基づき説明する。
本実施形態に係るキャッシュ・メモリ制御方法は、プロセッサからキャッシュ・メモリに書き込むべきデータがあるとき、当該書き込むべきデータが関数戻りアドレス値である場合には、通常通りキャッシュ・メモリに書き込むべきデータをオリジナルデータとして書き込むと共に、当該オリジナルデータと同一内容のレプリカデータを複数作成しオリジナルデータとそれぞれ対応付けてキャッシュ・メモリに書き込み、オリジナルデータがプロセッサから関数戻りアドレスとして読み出されるとき、当該オリジナルデータに対応するレプリカデータを読み出し、オリジナルデータと少なくとも1つのレプリカデータとが一致するか否かを比較する構成である。前記第1の実施形態に係るキャッシュ・メモリ制御方法との違いは、オリジナルデータに対するレプリカデータを複数作成し、それぞれオリジナルデータと対応付けて書き込むことである。
(Second embodiment of the present invention)
A cache memory control method according to the second embodiment of the present invention will be described with reference to FIGS.
In the cache memory control method according to the present embodiment, when there is data to be written from the processor to the cache memory, if the data to be written is a function return address value, the data to be written to the cache memory is changed as usual. In addition to writing as original data, multiple replica data with the same contents as the original data are created and associated with the original data and written to the cache memory. When the original data is read out from the processor as a function return address, it corresponds to the original data. The replica data to be read is read, and whether or not the original data matches at least one replica data is compared. The difference from the cache memory control method according to the first embodiment is that a plurality of replica data for the original data is created and written in association with the original data.

本実施形態に係るキャッシュ・メモリでも前記第1の実施形態に係るキャッシュ・メモリ連装方式の1つであるセットアソシエイティブ方式のキャッシュ・メモリに適用した場合について説明する。オリジナルデータと複数のレプリカデータとの総和が連想度を超えることはできないため、レプリカデータは「連想度―1」[個]を生成することができることとなる。このようにレプリカデータを前記第1の実施形態に係るキャッシュ・メモリと異なり、複数生成することで、ライン・リプレイスが生じて一個のレプリカデータが他のデータに上書きされた場合であっても、他のレプリカデータが残っているので、オリジナルデータとレプリカデータとの比較は可能となり、信頼性を高めることができるメリットがある。   The case where the cache memory according to the present embodiment is applied to a set-associative cache memory which is one of the cache memory concatenation system according to the first embodiment will be described. Since the sum of the original data and the plurality of replica data cannot exceed the association degree, “association degree-1” [pieces] can be generated from the replica data. In this way, unlike the cache memory according to the first embodiment, by generating a plurality of replica data, even if one replica data is overwritten with other data by causing line replacement, Since other replica data remains, it is possible to compare the original data with the replica data, and there is an advantage that the reliability can be improved.

次に、本実施形態に係るキャッシュ・メモリの動作について説明する。大部分は前記第1の実施形態に係る動作と重複するため、相違するステップのみを指摘する。ストアにおいては、前記ステップ105まで同一の動作であり、ステップ201ないしステップ203をレプリカデータの個数に応じてループして行い、かかる個数のレプリカデータを生成する必要がある。ロードにおいては、前記ステップ401では、1つのレプリカデータがあればオリジナルデータとの比較が可能となるため、複数のレプリカデータがキャッシュ・メモリ上にある場合には、かかる複数のレプリカデータの中から1つのレプリカデータを選択する。その余の動作は同じである。   Next, the operation of the cache memory according to this embodiment will be described. Since most of the operations overlap with the operation according to the first embodiment, only the steps that are different will be pointed out. In the store, the operation is the same up to step 105, and it is necessary to perform steps 201 to 203 in a loop according to the number of replica data to generate the number of replica data. In loading, in step 401, if there is one replica data, it can be compared with the original data. Therefore, when a plurality of replica data is on the cache memory, the replica data is selected from the plurality of replica data. One replica data is selected. The other operations are the same.

このように本実施形態に係るキャッシュ・メモリ制御方法によれば、プロセッサからキャッシュ・メモリに書き込むべきデータがあるとき、当該書き込むべきデータが関数戻りアドレス値である場合には、通常通りキャッシュ・メモリに書き込むべきデータをオリジナルデータとして書き込むと共に、当該オリジナルデータと同一内容のレプリカデータを複数作成しオリジナルデータとそれぞれ対応付けてキャッシュ・メモリに書き込み、オリジナルデータがプロセッサから関数戻りアドレスとして読み出されるとき、当該オリジナルデータに対応するレプリカデータを読み出し、オリジナルデータと少なくとも1つのレプリカデータとが一致するか否かを比較するので、レプリカデータを複数作成し、オリジナルデータと対応付けてキャッシュ・メモリに書き込まれており、一部のレプリカデータがキャッシュ・メモリから追い出しがなされた場合でも残りのレプリカデータでオリジナルデータとの比較ができ、オリジナルデータとの比較ができるように信頼性を向上させることができる。ここで、作成される複数レプリカデータの数は多いほど信頼性を向上させることができるが、キャッシュ・メモリ上の領域を確保する必要があり追い出しの発生率を高める要因ともなる。   As described above, according to the cache memory control method according to the present embodiment, when there is data to be written from the processor to the cache memory, when the data to be written is a function return address value, the cache memory is normally used. In addition to writing the data to be written as original data, creating a plurality of replica data having the same contents as the original data and writing them to the cache memory in association with the original data, when the original data is read from the processor as a function return address, Since replica data corresponding to the original data is read out and compared with whether or not the original data matches at least one replica data, a plurality of replica data is created and associated with the original data and cached. Even if some replica data is evicted from the cache memory, the remaining replica data can be compared with the original data and reliability can be compared with the original data. Can be improved. Here, as the number of multiple replica data to be created increases, the reliability can be improved. However, it is necessary to secure an area on the cache memory, which increases the occurrence rate of eviction.

以下、本発明に係るキャッシュ・メモリの実施に相当する実験を行ったので、以下説明する。始めに、実験環境を説明する。提案方式の有効性を評価するため、 SimpleScalarツールセットVer.3.0dを改良して本発明に係るキャッシュ・メモリ(以下、SCacheとする)を実装した(参考文献:SimpleScalar Tool Sets, http://www.simplescalar.com/)。また、SPEC2000ベンチマーク・サイトより7つの整数プログラムと4つの浮動小数点プログラムを用いてアウト・オブ・オーダ実行のサイクルレベル・シミュレーションを行った(参考文献:SPEC(Standard Performance Evaluation Corporation, http://www.specbench.org/)。入力データとしてはSPECより提供されるsmall inputを使用している。L1データ・キャッシュ・サイズは16KB、ラインサイズは32B、連想度は4と仮定し、その他のプロセッサ構成に関する詳細なパラメータはSimplescalarのデフォルト値を用いた。SCacheでは、戻りアドレスがロードされる時、レプリカ・ラインが存在する場合には安全性を保障できる。以下の式で安全性を評価する。

Figure 0004374476
Hereinafter, an experiment corresponding to the implementation of the cache memory according to the present invention was performed, which will be described below. First, the experimental environment will be explained. In order to evaluate the effectiveness of the proposed method, SimpleScalar tool set Ver.3.0d was improved and the cache memory according to the present invention (hereinafter referred to as SCache) was implemented (reference: SimpleScalar Tool Sets, http: // www.simplescalar.com/). In addition, a cycle level simulation of out-of-order execution was performed from the SPEC2000 benchmark site using seven integer programs and four floating point programs (reference: SPEC (Standard Performance Evaluation Corporation, http: // www .specbench.org /) Small input provided by SPEC is used as input data, assuming that L1 data cache size is 16KB, line size is 32B, association level is 4, and other processor configurations The default parameters of Simplescalar are used for the detailed parameters of SCache, and when the return address is loaded, safety can be guaranteed if a replica line exists.
Figure 0004374476

ここで、Nraldはプログラム実行におけるIRAロードの総数である。ここでIRA(Issued Return Address)ロードとは、キャッシュ・メモリに対して発行された戻りアドレス・ロードの事である。また、Nv-raldは戻りアドレス改ざんを検出できない(安全性を保障できない)IRAロード総数を示す。一方、消費エネルギーに関しては以下の式で評価する。

Figure 0004374476
Here, Nrald is the total number of IRA loads in program execution. Here, the IRA (Issued Return Address) load is a return address load issued to the cache memory. Nv-rald indicates the total number of IRA loads in which return address alteration cannot be detected (security cannot be guaranteed). On the other hand, energy consumption is evaluated by the following formula.
Figure 0004374476

ここで、ErdとEwtは、それぞれ、L1キャッシュ・メモリの読出し/書込み総消費エネルギーである。また、Ewbはレプリカ・ラインの作成に伴うライトバック総消費エネルギーを表す。さらに、Empはキャッシュ・ミス発生において消費されるエネルギーを示す。実際には、0.18μmCMOSプロセスを用いて1ウェイ分(4KB)のSRAMアレイのレイアウト設計ならびに負荷容量抽出を行い、プリチャージ動作も含めた1ビット当たりの読出し/書込み消費エネルギーを測定した。また、その結果に基づき、キャッシュ・アクセスにおける消費エネルギーを換算した。なお、Empの値はメモリ階層構造に大きく依存する。そこで、1回の下位メモリ階層アクセスに要するエネルギーは、従来型キャッシュ・メモリにおける平均読出し消費エネルギーの10倍と仮定した。   Here, Erd and Ewt are the total read / write energy consumption of the L1 cache memory, respectively. Ewb represents the total write-back energy consumption associated with the creation of the replica line. Further, Emp indicates the energy consumed when a cache miss occurs. Actually, layout design and load capacity extraction of SRAM array for 1 way (4KB) was performed using 0.18μm CMOS process, and read / write energy consumption per bit including precharge operation was measured. Based on the results, energy consumption for cash access was converted. The value of Emp largely depends on the memory hierarchical structure. Therefore, it is assumed that the energy required for one access to the lower memory hierarchy is 10 times the average read energy consumption in the conventional cache memory.

(実験結果(安全性))本評価ではキャッシュ・メモリの連想度を4と仮定しているため、LRUまたはMRUアルゴリズムに基づき最大3個のレプリカ・ラインを生成可能である。そこで、これらの組合せに関して安全性を評価した。実験結果を図5に表す。また、従来キャッシュ(CONV)におけるミス率とIRAロード数(Nrald)、ならびに、各SCacheモデルにおけるミス率を図8に示す。ここで、LRU1RならびにLRU2Rは、それぞれ、LRU配置アルゴリズムに基づき1個もしくは2個のレプリカ・ラインを生成するモデルである。同様に、MRU1RとMRU2Rは配置アルゴリズムにMRU方式を用いている。ALLは、参照セット中の全ライン(ただし、マスタ・ラインを除く)にレプリカ・ラインを生成する。   (Experimental result (safety)) In this evaluation, it is assumed that the association degree of the cache memory is 4, so that a maximum of 3 replica lines can be generated based on the LRU or MRU algorithm. Therefore, safety was evaluated for these combinations. The experimental results are shown in FIG. FIG. 8 shows the miss rate and the number of IRA loads (Nrald) in the conventional cache (CONV), and the miss rate in each SCache model. Here, LRU1R and LRU2R are models that generate one or two replica lines based on the LRU placement algorithm, respectively. Similarly, MRU1R and MRU2R use the MRU method for the placement algorithm. ALL generates replica lines for all lines in the reference set (except the master line).

本シミュレーションではL1キャッシュ・ミス時のライン置換えアルゴリズムにLRU方式を採用している。そのため、LRU1Rで作成したレプリカ・ラインは他アクセスによって容易にキャッシュ・メモリから追出される。これに対し、LRU2Rではレプリカ・ラインのキャッシュ生存期間が長くなるため、より高い安全性を実現している。また、同様の理由により、MRU方式の採用によっても安全性は向上している。全てのSCacheモデルを比較した場合、ALLが最も高い安全性を達成しており、多くのプログラムで99.7%以上のIRAロードの安全性を保障することができた。一方、図8で示すように、生成するレプリカ・ライン数の増加、または、MRU方式の採用に伴い、キャッシュ・ミス率が高くなっている。したがって、性能を重視する場合には、ミス率の低下と安全性の向上を考慮してMRU1Rを選択することが適切であると考える。なお、SCacheでの戻りアドレス書込み時、前記したように、同一タグを有するレプリカ・ラインがすでに存在する場合にはそれらへの上書きを行う。よって、LRU領域にこのようなレプリカ・ラインが存在する場合、MRU1RはLRU1Rと同じ動作となる。そのため、MRU方式においても、作成されるレプリカ・ライン数を増加することで安全性が向上する。   In this simulation, the LRU method is adopted as the line replacement algorithm at L1 cache miss. Therefore, the replica line created by LRU1R is easily removed from the cache memory by another access. On the other hand, LRU2R achieves higher security because the cache lifetime of the replica line is longer. For the same reason, the safety is improved by adopting the MRU method. When all SCache models were compared, ALL achieved the highest level of safety, and many programs were able to guarantee an IRA road safety of more than 99.7%. On the other hand, as shown in FIG. 8, the cache miss rate has increased with the increase in the number of replica lines to be generated or the adoption of the MRU method. Therefore, when performance is important, it is considered appropriate to select MRU1R in consideration of lowering the error rate and improving safety. When writing a return address in SCache, as described above, if a replica line having the same tag already exists, it is overwritten. Therefore, when such a replica line exists in the LRU area, MRU1R performs the same operation as LRU1R. Therefore, even in the MRU system, safety is improved by increasing the number of replica lines to be created.

(実験結果(消費エネルギー))前記消費エネルギー・モデルに基づき評価した結果を図6に示す。ここで、図6は、不必要なウェイ・アクセスを回避するウェイ予測キャッシュ(参考文献:K.Inoue, T.Ishihara, and K.Murakami, "Way-Predicting Set-Associative Cache for High Performance and Low Energy Consumption," Proc. of the Int. Symp.on Low Power Electronics and Design, pp. 273--275, Aug. 1999.)を基準とした際の消費エネルギー・オーバヘッドを表している。この図6から、レプリカ・ライン数の増加に伴いオーバヘッドが大きくなっている事が分かる。特に、最も多くのレプリカ・ラインを生成するALLでは、最大で約23%の消費エネルギー・オーバヘッドが発生した(197.parser)。   (Experimental result (consumed energy)) FIG. 6 shows the result of evaluation based on the consumed energy model. Here, FIG. 6 shows a way prediction cache that avoids unnecessary way access (reference: K. Inoue, T. Ishihara, and K. Murakami, “Way-Predicting Set-Associative Cache for High Performance and Low Energy. Consumption, "Proc. Of the Int. Symp.on Low Power Electronics and Design, pp. 273--275, Aug. 1999.). As can be seen from FIG. 6, the overhead increases as the number of replica lines increases. In particular, ALL, which generates the most replica lines, generated a maximum energy consumption overhead of about 23% (197.parser).

消費エネルギーを詳細に解析するため、前記式(2)に関する内訳を測定した。その結果を図7に示す。ここでは、紙面の都合上、消費エネルギー・オーバヘッドが最も大きな2つの整数プログラム(197.parser,255.vortex)と浮動小数点プログラム(177.mesa,183.equake)、ならびに、最もオーバヘッドが小さい2つのプログラム(181.mcf,179.art)での結果を示している。従来キャッシュ(CONV)と比較して、読出し消費エネルギーErdは全てのSCacheモデルにおいてほぼ同じ増加率である。これは、レプリカ・ライン作成数ならびに配置アルゴリズムに関わらず、戻りアドレス・ロード発行時に全てのウェイが活性化されるためである。反対に、書込み消費エネルギーEwtは作成されるレプリカ・ライン数に比例して増加する。また、Empはミス率の増加に伴い大きくなっている。特に177.mesaにおいて、従来方式と比較した場合、ALLモデルは大幅なヒット率の低下を引き起こしており(図8を参照)、その影響によるEmpの増加が顕著に現れている。   In order to analyze the energy consumption in detail, the breakdown of the equation (2) was measured. The result is shown in FIG. Here, due to space limitations, two integer programs (197.parser, 255.vortex) and floating point programs (177.mesa, 183.equake) with the largest energy consumption overhead and two with the smallest overhead The result in the program (181.mcf, 179.art) is shown. Compared with the conventional cache (CONV), the read consumption energy Erd is almost the same rate of increase in all SCache models. This is because all ways are activated when a return address load is issued regardless of the number of replica lines created and the placement algorithm. On the contrary, the write energy consumption Ewt increases in proportion to the number of replica lines created. In addition, Emp is increasing as the miss rate increases. In particular, in 177.mesa, when compared with the conventional method, the ALL model causes a significant decrease in the hit rate (see FIG. 8), and the increase in Emp due to the influence appears remarkably.

オーバヘッドの小さい181.mcfならびに190.artとその他を比較した場合、これら2つのプログラムではキャッシュ・ミスによる消費エネルギーが多くの割合を占めている。実際、図8で示すように、これらプログラムのミス率は極めて高い。このように、従来のミス率と比較して、SCacheによるミス率の増加が十分小さい場合、Empに関する消費エネルギー・オーバヘッドが隠蔽される。また、本評価で基準としているウェイ予測方式では、ミス率の増加と共にウェイ予測による消費エネルギー削減効果が低減する。これらの理由により、SCacheの採用に伴う消費エネルギー・オーバヘッドは小さくなったものと考える。
一方、全てのプログラムにおいて、LRU1RとMRU1R、LRU2RとMRU2Rをそれぞれ比較した場合、消費エネルギーに関する差は殆ど見られない。生成するレプリカ・ライン数が同じ場合、配置アルゴリズムには関係なくキャッシュ消費エネルギーはほぼ同一となる。これに対し、MRU方式の場合はヒット率の低下を招くが、それによる消費エネルギー・オーバヘッドが比較的小さかった。このような結果を考慮し、レプリカ・ラインの配置アルゴリズムにはMRU方式が適していると考える。
When comparing 181.mcf and 190.art, which have a small overhead, with these two programs, energy consumption due to cache misses accounts for a large percentage. In fact, as shown in FIG. 8, the error rate of these programs is extremely high. Thus, when the increase in the miss rate due to SCache is sufficiently small compared to the conventional miss rate, the energy consumption overhead related to Emp is concealed. Further, in the way prediction method used as a reference in this evaluation, the energy consumption reduction effect by way prediction is reduced as the miss rate increases. For these reasons, the energy overhead associated with the adoption of SCache has been reduced.
On the other hand, in all programs, when comparing LRU1R and MRU1R, and LRU2R and MRU2R, respectively, there is almost no difference in energy consumption. When the number of replica lines to be generated is the same, the cache consumption energy is almost the same regardless of the placement algorithm. On the other hand, in the case of the MRU method, the hit rate is lowered, but the energy consumption overhead is relatively small. Considering these results, we consider that the MRU method is suitable for the replica line placement algorithm.

(実験結果(性能))SCacheではレプリカ・ラインをキャッシュ内セットに生成するため、キャッシュ・ミス率の増加に伴う性能オーバヘッドが生じる。各ベンチマークにおける性能オーバヘッドを図9に示す。生成するレプリカ・ライン数が最大であるALLモデルにおいて、最悪の場合でも性能低下は1.1%(177.mesa)である。また、その他のモデルに関しては、197.paserを除く全てのプログラムにおいて0.2%以下の性能オーバヘッドである。これは、保護すべき戻りアドレスの数に対し、データキャッシュ・メモリは十分な容量を有するためである。以上より、提案手法による性能低下は無視できる程度に小さいと考える。   (Experimental Result (Performance)) In SCache, a replica line is generated in a set in the cache, so that a performance overhead is accompanied by an increase in the cache miss rate. The performance overhead in each benchmark is shown in FIG. In the ALL model that generates the maximum number of replica lines, the performance degradation is 1.1% (177.mesa) even in the worst case. For other models, all programs except 197.paser have a performance overhead of 0.2% or less. This is because the data cache memory has a sufficient capacity for the number of return addresses to be protected. From the above, the performance degradation due to the proposed method is considered to be negligible.

(結論)本稿では、スタック・スマッシングに対するアーキテクチャ・アプローチとしてセキュア・キャッシュ(SCache)を提案した。SCacheでは、キャッシュ・メモリの大容量領域を活用して戻りアドレスを保護する。実験を行った結果、多くのプログラムで99.7%以上の戻りアドレス・ロードに関して安全性を保障することができた。また、消費エネルギー解析を行った結果、安全性を重要視する場合には全てのラインに複製を生成するALLモデルが、一方、ある程度の安全性を維持しつつ低消費エネルギー化が要求される場合にはMRU方式に基づくMRU1Rが適切であると分かった。   (Conclusion) In this paper, we proposed Secure Cache (SCache) as an architectural approach to stack smashing. SCache uses a large area of cache memory to protect the return address. As a result of experiments, many programs were able to guarantee safety for return address loads of 99.7% or more. In addition, as a result of energy consumption analysis, when safety is a priority, the ALL model that generates duplicates for all lines requires low energy consumption while maintaining a certain level of safety. It was found that MRU1R based on MRU method is appropriate.

一般のセットアソシエイティブ方式のキャッシュ・メモリの構成図である。It is a block diagram of a general set associative cache memory. 第1の実施形態に係るセットアソシエイティブ方式のキャッシュ・メモリの構成図である。1 is a configuration diagram of a set associative cache memory according to a first embodiment. FIG. 本発明の第1の実施形態に係るキャッシュ・メモリの動作フローチャートである。3 is an operation flowchart of the cache memory according to the first embodiment of the present invention. 本発明の第1の実施形態に係るキャッシュ・メモリの動作フローチャートである。3 is an operation flowchart of the cache memory according to the first embodiment of the present invention. 実施例の危険な戻りアドレス・ロード発生率を示すグラフである。It is a graph which shows the dangerous return address load incidence rate of an Example. 実施例の消費エネルギー・オーバヘッドを示すグラフである。It is a graph which shows the energy consumption overhead of an Example. 実施例の消費エネルギーの内訳を示すグラフである。It is a graph which shows the breakdown of the energy consumption of an Example. 実施例のキャッシュ・ミス率の表である。It is a table | surface of the cache miss rate of an Example. 実施例の性能のオーバヘッドの示すグラフである。It is a graph which shows the overhead of the performance of an Example. バッファ・オーバフロー示すグラフである。It is a graph which shows a buffer overflow. スタック・スマッシングの動作原理を示す図である。It is a figure which shows the operation | movement principle of stack | smashing.

符号の説明Explanation of symbols

11 タグ
12 タグ部
21 データ領域
22 データ領域部
31 ウェイ
41 セット
51 データ内容比較器

11 Tag 12 Tag part 21 Data area 22 Data area part 31 Way 41 Set 51 Data content comparator

Claims (6)

プロセッサからキャッシュ・メモリに書き込むべきデータがあるとき、当該書き込むべきデータが関数戻りアドレス値である場合には、通常通りキャッシュ・メモリに書き込むべきデータをオリジナルデータとして書き込むと共に、当該オリジナルデータと同一内容のレプリカデータを作成しオリジナルデータと対応付けてキャッシュ・メモリに書き込み、
オリジナルデータがプロセッサから関数戻りアドレスとして読み出されるとき、当該オリジナルデータに対応するレプリカデータを読み出し、オリジナルデータとレプリカデータとが一致するか否かを比較することを
特徴とするキャッシュ・メモリ制御方法。
When there is data to be written to the cache memory from the processor, if the data to be written is a function return address value, the data to be written to the cache memory is written as the original data as usual, and the same contents as the original data Create replica data of and write it to the cache memory in association with the original data.
A cache memory control method, wherein when original data is read from a processor as a function return address, replica data corresponding to the original data is read, and whether or not the original data and the replica data match is compared.
前記請求項1に記載のキャッシュ・メモリ制御方法において、
前記レプリカデータのキャッシュ・メモリからの追い出しを禁止することを
特徴とするキャッシュ・メモリ制御方法。
In the cache memory control method according to claim 1,
A cache memory control method, which prohibits eviction of the replica data from the cache memory.
プロセッサからキャッシュ・メモリに書き込むべきデータがあるとき、当該書き込むべきデータが関数戻りアドレス値である場合には、通常通りキャッシュ・メモリに書き込むべきデータをオリジナルデータとして書き込むと共に、当該オリジナルデータと同一内容のレプリカデータを複数作成しオリジナルデータとそれぞれ対応付けてキャッシュ・メモリに書き込み、
オリジナルデータがプロセッサから関数戻りアドレスとして読み出されるとき、当該オリジナルデータに対応するレプリカデータを読み出し、オリジナルデータと少なくとも1つのレプリカデータとが一致するか否かを比較することを
特徴とするキャッシュ・メモリ制御方法。
When there is data to be written to the cache memory from the processor, if the data to be written is a function return address value, the data to be written to the cache memory is written as the original data as usual, and the same contents as the original data Create multiple replica data of each and write them to the cache memory in association with the original data,
When the original data is read from the processor as a function return address, the replica data corresponding to the original data is read, and whether or not the original data matches at least one replica data is compared. Control method.
前記請求項1または3に記載のキャッシュ・メモリ制御方法において、
レプリカデータの書き込みに伴い、LRUまたはMRUアルゴリズムに基づきキャッシュ・メモリ中からデータの追い出しを行い当該追い出し部分にレプリカデータの書き込みを行うことを
特徴とするキャッシュ・メモリ制御方法。
In the cache memory control method according to claim 1 or 3,
A cache memory control method comprising: purging data from a cache memory based on an LRU or MRU algorithm and writing replica data to the eviction portion when replica data is written.
前記請求項1ないし4のいずれかに記載のキャッシュ・メモリ制御方法において、
前記オリジナルデータとの比較が終了したレプリカデータが存在する場合には、かかるレプリカデータを優先的に追い出し対象とすることを
特徴とするキャッシュ・メモリ制御方法。
In the cache memory control method according to any one of claims 1 to 4,
A cache memory control method characterized in that when there is replica data for which comparison with the original data has been completed, the replica data is preferentially ejected.
プロセッサが実行する命令列を監視する命令監視手段を設け、当該命令監視手段が現在のメモリ・アクセスが関数戻りアドレスを対象としていることを検出する前記請求項1ないし5のいずれかに記載のキャッシュ・メモリ制御方法を適用したキャッシュ・メモリ。

Instruction monitoring means for monitoring the instruction sequence executed by a processor provided, cache according to any one of the claims 1 detects that the instruction monitor means the current memory access is directed to the function return address 5 -Cache memory to which memory control method is applied.

JP2004153520A 2004-05-24 2004-05-24 Cache memory and control method thereof Expired - Lifetime JP4374476B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004153520A JP4374476B2 (en) 2004-05-24 2004-05-24 Cache memory and control method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004153520A JP4374476B2 (en) 2004-05-24 2004-05-24 Cache memory and control method thereof

Publications (2)

Publication Number Publication Date
JP2005338946A JP2005338946A (en) 2005-12-08
JP4374476B2 true JP4374476B2 (en) 2009-12-02

Family

ID=35492484

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004153520A Expired - Lifetime JP4374476B2 (en) 2004-05-24 2004-05-24 Cache memory and control method thereof

Country Status (1)

Country Link
JP (1) JP4374476B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5141234B2 (en) 2007-12-19 2013-02-13 日本電気株式会社 Hierarchical storage control device, hierarchical storage control system, hierarchical storage control method used therefor, and program thereof
JP5039728B2 (en) * 2009-02-24 2012-10-03 三菱重工業株式会社 Method for protecting stack area data in computer memory
JP6733843B1 (en) * 2020-02-12 2020-08-05 オムロン株式会社 Data processing device, control method and program
JP6721140B1 (en) * 2020-03-09 2020-07-08 オムロン株式会社 Data processing device, data processing method and program

Also Published As

Publication number Publication date
JP2005338946A (en) 2005-12-08

Similar Documents

Publication Publication Date Title
JP4625839B2 (en) Method and apparatus for detecting and recovering from buffer overflow attack
US10810309B2 (en) Method and system for detecting kernel corruption exploits
Aweke et al. ANVIL: Software-based protection against next-generation rowhammer attacks
US7594111B2 (en) Secure execution of a computer program
Kim et al. Hardware-based always-on heap memory safety
US7603704B2 (en) Secure execution of a computer program using a code cache
US20190042453A1 (en) Hardware based technique to prevent critical fine-grained cache side-channel attacks
US20190132115A1 (en) Techniques for preventing memory timing attacks
US20170364679A1 (en) Instrumented versions of executable files
US11783032B2 (en) Systems and methods for protecting cache and main-memory from flush-based attacks
US20150370496A1 (en) Hardware-Enforced Prevention of Buffer Overflow
CN110036377B (en) Cacheable but not speculatively accessed memory types
CN110851836B (en) Active defense method for Meltdown attack
US7774587B2 (en) Dynamic redundancy checker against fault injection
US10885184B1 (en) Rearranging executables in memory to prevent rop attacks
US11500785B2 (en) Systems and methods for memory safety with random embedded secret tokens
JP4374476B2 (en) Cache memory and control method thereof
EP4390708A1 (en) Selective memory duplication control
CN116720191A (en) Processor data prefetching security enhancement method for relieving cache side channel attack
Inoue Energy-security tradeoff in a secure cache architecture against buffer overflow attacks
Wolff et al. Embedded system protection from software corruption
Inoue Lock and unlock: A data management algorithm for a security-aware cache
TW201939272A (en) Branch target variant of branch-with-link instruction
Kao et al. Lightweight hardware return address and stack frame tracking to prevent function return address attack
KR102474874B1 (en) Buffer management system and method for identifying ransomware attacks

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20061201

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090804

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090804

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

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20090824

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20120918

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20120918

Year of fee payment: 3

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

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

Free format text: PAYMENT UNTIL: 20120918

Year of fee payment: 3

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

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

Free format text: PAYMENT UNTIL: 20120918

Year of fee payment: 3

S631 Written request for registration of reclamation of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313631

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

Free format text: PAYMENT UNTIL: 20120918

Year of fee payment: 3

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350