JP2009230479A - Microprocessor - Google Patents

Microprocessor Download PDF

Info

Publication number
JP2009230479A
JP2009230479A JP2008075229A JP2008075229A JP2009230479A JP 2009230479 A JP2009230479 A JP 2009230479A JP 2008075229 A JP2008075229 A JP 2008075229A JP 2008075229 A JP2008075229 A JP 2008075229A JP 2009230479 A JP2009230479 A JP 2009230479A
Authority
JP
Japan
Prior art keywords
address
memory
return address
storage
instruction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
JP2008075229A
Other languages
Japanese (ja)
Inventor
Hoshi Okuhara
保史 奥原
Yasuhiro Ohira
康弘 大平
Hajime Tsuchiya
元 土屋
Wataru Furuichi
済 古市
Masayuki Yageta
雅之 谷下田
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
Toshiba Electronic Device Solutions Corp
Original Assignee
Toshiba Corp
Toshiba Microelectronics 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, Toshiba Microelectronics Corp filed Critical Toshiba Corp
Priority to JP2008075229A priority Critical patent/JP2009230479A/en
Publication of JP2009230479A publication Critical patent/JP2009230479A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Executing Machine-Instructions (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a microprocessor for performing at a high speed buffer overflow detection for preventing stack smashing. <P>SOLUTION: A return address and a storage address of the return address are separately stored when the return address is stored by a procedure program called by a procedure calling operation, and a buffer overflow detection circuit is added , which compares the separately stored return address with a value to detect that buffer overflow occurs in being different when the return address is read by a return operation to a calling source. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、スタックスマッシング攻撃によるバッファオーバーフロー発生を検出する技術に関する。   The present invention relates to a technique for detecting occurrence of a buffer overflow due to a stack smashing attack.

近年、コンピュータシステムを使用者の意図しないように動作させて被害を与える悪質プログラムの存在が問題となっている。悪質プログラムを実行させる方法には、バッファオーバーフローを利用する方法があり、その中でも特に、スタックのオーバーフローを利用するスタックスマッシング(stack smashing)と呼ばれる方法が利用されることが多い。   In recent years, the existence of malicious programs that cause damage by causing a computer system to operate unintentionally has become a problem. As a method for executing a malicious program, there is a method using a buffer overflow, and among them, a method called stack smashing that uses a stack overflow is often used.

スタックスマッシング発生の様子を、図8を用いて簡単に説明する。悪意プログラムによる手続きXが呼び出された時、(a)に示すように通常の手続き呼び出し手順で行われるように、スタックポインタレジスタ(SP)とフレームポインタレジスタ(FP)を更新して、手続きX用のスタック領域が確保される。このスタック領域には、プロセッサのレジスタや処理において使用するデータなどが通常保存されている。そして、この手続きXから新たな手続きYを呼び出せるように、スタックポインタ(SP)+20のアドレスに手続きXの呼び出し元への戻り番地(Return Addr.)が保存される。   A state of occurrence of stack smashing will be briefly described with reference to FIG. When the procedure X by the malicious program is called, the stack pointer register (SP) and the frame pointer register (FP) are updated so as to be performed in the normal procedure call procedure as shown in (a), and the procedure X is used. Stack area is secured. This stack area normally stores processor registers and data used in processing. Then, the return address (Return Addr.) To the caller of the procedure X is stored at the address of the stack pointer (SP) +20 so that a new procedure Y can be called from the procedure X.

しかし、手続きXの処理プログラムの例えば入力データをデータバッファに保存する処理において、スタック領域に確保したデータバッファサイズ以上のデータが入力されると、入力データの数の上限の確認がなされていないシステム関数などが利用された場合、(b)に示すようにデータバッファサイズを超えて書込みが行われる。   However, in the process of saving the input data in the data buffer of the procedure X processing program, for example, if data larger than the data buffer size secured in the stack area is input, the upper limit of the number of input data is not confirmed When a function or the like is used, writing is performed exceeding the data buffer size as shown in (b).

このようにすると、手続きXの処理で最初に保存した手続き呼び出し元への戻り番地(Return Addr.)の情報は、あふれたデータで上書きされて、手続きXの処理の終了段階で悪意プログラムが書き換えた戻り番地(Return Addr.)の命令を実行させるようすることができる。   In this way, the information of the return address (Return Addr.) To the procedure caller that was first saved in the procedure X process is overwritten with overflowing data, and the malicious program is rewritten at the end of the procedure X process. The instruction of the return address (Return Addr.) Can be executed.

この問題に対して、スタックに保存された戻り番地(Return Addr.)とスタック中の配列などのバッファ領域との間にガード変数を格納して、手続き呼び出し元への復帰動作時に、ガード変数の有効性を確認してから戻り番地を読み込むようにすることでスタックスマッシングを防止する技術がある(例えば、特許公報1参照。)。   To solve this problem, a guard variable is stored between the return address (Return Addr.) Stored in the stack and a buffer area such as an array in the stack, and when returning to the procedure caller, There is a technique for preventing stack smashing by reading the return address after confirming the validity (see, for example, Patent Publication 1).

また、コンピュータのプロセッサとキャッシュメモリに改造を加えて、手続きXの呼び出し時に戻り番地(Return Addr.)をキャッシュメモリに書込む時に、同時にその複製(レプリカ)をキャッシュメモリ内に保存し、呼び出し元へのリターン時にメモリから読み出された戻り番地(Return Addr.)とレプリカデータとを比較回路で比較して、一致することを確認するようにしてスタックスマッシングを防止する技術がある(例えば、特許公報2参照。)。
特開2001−216161号公報 特開2005−338946号公報
Further, the computer processor and the cache memory are modified, and when the return address (Return Addr.) Is written into the cache memory when the procedure X is called, a copy (replica) is simultaneously stored in the cache memory, and the caller There is a technique for preventing stack smashing by comparing a return address (Return Addr.) Read from a memory at the time of return to a replica data with a replica circuit and confirming that they match (for example, patents) (See Publication 2).
JP 2001-216161 A JP 2005-338946 A

しかしながら、ガード変数を用いソフトウェアによってバッファオーバーフローを検出する方法は、検出手順のプログラムコードを挿入できるようにした拡張コンパイラなどを用いることでソースプログラムの修正量を減少させることができるが、手続きXの呼び出し時および呼び出し元へのリターン時に、戻り番地(Return Addr.)をチェックするための余分なプログラムコードが挿入されることに伴う実行時間のオーバーヘッドが生じるという問題がある。   However, the method of detecting a buffer overflow by software using a guard variable can reduce the amount of correction of the source program by using an extended compiler or the like that can insert the program code of the detection procedure. When calling and returning to the caller, there is a problem that an overhead of execution time due to insertion of extra program code for checking a return address (Return Addr.) Occurs.

また、プロセッサとキャッシュメモリの一部を改良しハードウェアによってバッファオーバーフローを検出する方法は、プログラムの再コンパイルの量を減少させるとともに、プログラム実行時間のオーバーヘッドが少なくなるが、手続きXの呼び出しの繰り返しが多い時にも100%の検出を維持するためには、キャッシュメモリに保存される戻り番地のレプリカデータの追い出しを生じさせないWay数の多いキャッシュメモリが必要となり、回路規模が増加する問題となる。回路規模の増加を抑制するため、Way数が少ないキャッシュメモリを使用する場合は、レプリカデータの記憶領域が不足してレプリカデータが追い出されて100%の検出ができない問題がある。   Further, the method of detecting a buffer overflow by hardware by improving a part of the processor and the cache memory reduces the amount of program recompilation and reduces the overhead of program execution time. However, the procedure X is called repeatedly. In order to maintain 100% detection even when there is a large amount of data, a cache memory with a large number of ways that does not cause the replica data at the return address stored in the cache memory to be expelled is required, which increases the circuit scale. When a cache memory with a small number of ways is used in order to suppress an increase in circuit scale, there is a problem that a replica data storage area is insufficient and replica data is evicted and 100% cannot be detected.

本発明は、上記問題を解決するためになされたもので、実行時間のオーバーヘッドの少ないハードウェアによるバッファオーバーフロー検出を可能としながら、少ない付加回路規模で100%のバッファオーバーフロー検出を実現するプロセッサを提供することを目的とする。   The present invention has been made to solve the above-described problem, and provides a processor that realizes 100% buffer overflow detection with a small additional circuit scale while enabling detection of buffer overflow by hardware with low execution time overhead. The purpose is to do.

上記目的を達成するために、本発明のマイクロプロセッサは、手続き呼び出し分岐命令を有し、呼び出し元への戻り番地をメモリに保存できるマイクロプロセッサであって、前記呼び出し元への戻り番地を前記メモリに保存する保存動作を検出する保存検出手段と、前記保存検出手段で検出された保存動作における戻り番地と、その戻り番地を保存する保存番地とを記憶する前記メモリとは異なる記憶手段と、前記メモリの前記保存番地からの読み出し動作を検出する読み出し検出手段と、前記読み出し検出手段で読み出し動作を検出した時に、前記メモリから読み出した戻り番地と前記記憶手段から読み出した戻り番地とを比較して、その比較内容が一致しない時にバッファオーバーフローが発生していることを検出するバッファオーバーフロー検出手段とを有することを特徴とする。   To achieve the above object, a microprocessor of the present invention is a microprocessor having a procedure call branch instruction and capable of storing a return address to a caller in a memory, wherein the return address to the caller is stored in the memory. A storage detection unit for detecting a storage operation to be stored in the storage unit, a storage unit different from the memory for storing a return address in the storage operation detected by the storage detection unit, and a storage address for storing the return address; Read detection means for detecting a read operation from the storage address of the memory, and when a read operation is detected by the read detection means, the return address read from the memory is compared with the return address read from the storage means. , Buffer overflow to detect that a buffer overflow has occurred when the comparison contents do not match And having a low detection means.

本発明によれば、呼び出し元手続きへの復帰の際に、あらかじめスタック領域に保存された戻り番地と保護されたCAMメモリ中に保存された戻り番地をハードウェアで比較することで、バッファオーバーフローの検出が可能となる。このバッファオーバーフロー検出の一連の処理で、CAMメモリ中のエントリの外部メモリへの退避処理、および外部メモリ中のエントリをCAMメモリへ復帰処理についてプログラムによる処理が必要となるが、CAMメモリのエントリ数を最適化することで、プログラム支援を最小限にすることが可能であり、ガード変数などのソフトウェアプログラムによる検出手法よりも高速にバッファオーバーフローを検出することができる。   According to the present invention, when returning to the caller procedure, the return address stored in the stack area in advance and the return address stored in the protected CAM memory are compared by hardware, so that the buffer overflow Detection is possible. This series of buffer overflow detection processing requires processing by a program for saving entries in the CAM memory to the external memory and restoring the entries in the external memory to the CAM memory. The number of entries in the CAM memory By optimizing, it is possible to minimize program support, and it is possible to detect a buffer overflow faster than a detection method using a software program such as a guard variable.

また、CAMメモリのエントリを容量の大きな外部メモリへ退避、復帰させることができるので、全てのバッファオーバーフロー検出が実現できる。   In addition, since entries in the CAM memory can be saved and restored to a large-capacity external memory, all buffer overflows can be detected.

更にまた、対象となるスタック動作に係るプログラム部分を変更する必要がないので再コンパイルや再設計作業を減らすことができる。   Furthermore, since it is not necessary to change the program part related to the target stack operation, recompilation and redesign work can be reduced.

以下、本発明の実施例を説明する。   Examples of the present invention will be described below.

本発明に係るバッファオーバーフロー検出回路を有するマイクロプロセッサの実施例を、図1乃至図7を参照して説明する。   An embodiment of a microprocessor having a buffer overflow detection circuit according to the present invention will be described with reference to FIGS.

図1は、実施例に係るバッファオーバーフロー検出回路を有するマイクロプロセッサ100とプログラムやデータを記憶する外部メモリ200とを外部バス300で接続されたコンピュータシステム1の主要な構成を示すブロック図である。コンピュータシステム1は、図示しないが標準的なコンピュータシステムに装備されるシステム外部との入出力装置や表示装置や記憶装置などを含むことができる。   FIG. 1 is a block diagram illustrating a main configuration of a computer system 1 in which a microprocessor 100 having a buffer overflow detection circuit according to an embodiment and an external memory 200 for storing programs and data are connected by an external bus 300. Although not shown, the computer system 1 can include an input / output device, a display device, a storage device, and the like that are provided in a standard computer system.

図1に示すマイクロプロセッサ100は、MIPSアーキテクチャのプロセッサ部にバッファオーバーフロー検出回路400を付加した構成となっている。このプロセッサ部は、CPU制御回路110、命令レジスタ120、レジスタファイル130、バスインターフェースユニット140等で構成されている。バスインターフェースユニット140と外部メモリ200とは、データバス302を介して互いに接続されてデータが送受され、アドレスバス301によりアドレスが送受される。なお、ブロック図の接続図が煩雑となるため、命令コード(データ)や一部のデータおよびアドレスの信号線ならびに制御線は図示を省略している。   The microprocessor 100 shown in FIG. 1 has a configuration in which a buffer overflow detection circuit 400 is added to the processor unit of the MIPS architecture. The processor unit includes a CPU control circuit 110, an instruction register 120, a register file 130, a bus interface unit 140, and the like. The bus interface unit 140 and the external memory 200 are connected to each other via the data bus 302 to transmit / receive data, and the address bus 301 transmits / receives an address. Since the connection diagram of the block diagram becomes complicated, the instruction code (data), part of the data and address signal lines and control lines are not shown.

バッファオーバーフロー検出回路400は、命令レジスタ120に記憶され解釈される命令の種別を検出するロード・ストア・JAL命令検出回路410と、バッファオーバーフロー検出回路400の動作を制御し、プロセッサ部への割り込み動作によってバッファオーバーフローの発生を通知したりしてプロセッサ部との連係動作を開始させる制御回路420と、JAL(Jump And Link)命令で分岐動作を行うとともに分岐元への戻り番地を記憶するレジスタ番号を保存するRRレジスタ430と、戻り番地を保存する番地を記憶する保存番地レジスタ440と、戻り番地を記憶する戻り番地レジスタ450と、保存番地をタグとしその保存番地と組となる戻り番地をデータとするエントリを複数記憶するCAM(Content Addressable Memory)メモリ500と、戻り番地レジスタ450からの戻り番地とCAM500より読み出された戻り番地のデータとを比較する比較回路510とから構成される。   The buffer overflow detection circuit 400 controls the operation of the load / store / JAL instruction detection circuit 410 that detects the type of instruction stored and interpreted in the instruction register 120 and the buffer overflow detection circuit 400, and performs an interrupt operation to the processor unit. The control circuit 420 for notifying the occurrence of buffer overflow or starting the linking operation with the processor unit, and the register number for performing the branch operation with a JAL (Jump And Link) instruction and storing the return address to the branch source RR register 430 to save, save address register 440 to store the address to save the return address, return address register 450 to store the return address, and the return address paired with the save address as a tag and the save address as data CAM (Conte nt Addressable Memory) memory 500, and a comparison circuit 510 that compares the return address from the return address register 450 with the data at the return address read from the CAM 500.

CPU制御回路110は、外部メモリ200からインターフェースユニット140、データバス131を介して命令レジスタ120に読み込まれた命令を解読実行してマイクロプロセッサ100の内部動作を制御するとともに、次に実行する命令の読み込み動作を制御してプログラムの実行順序を制御する。すなわち、解読された命令が分岐命令でなければ、CPU制御回路110に内蔵され図示しないプログラムカウンタから出力されるアドレスをアドレスバス111に出力して、バスインターフェースユニット140を介してアドレスを外部メモリ200に出力する。そして、外部メモリ200の該当するアドレスから読み出された次の命令を命令レジスタ120に読み込む。   The CPU control circuit 110 decodes and executes an instruction read into the instruction register 120 from the external memory 200 via the interface unit 140 and the data bus 131 to control the internal operation of the microprocessor 100, and the instruction to be executed next. Control the read operation to control the program execution order. That is, if the decoded instruction is not a branch instruction, an address output from a program counter (not shown) built in the CPU control circuit 110 is output to the address bus 111, and the address is transferred to the external memory 200 via the bus interface unit 140. Output to. Then, the next instruction read from the corresponding address in the external memory 200 is read into the instruction register 120.

また例えば、命令レジスタ120にSW命令(Store Word:ストア・ワード[レジスタの1ワード長のデータをメモリに保存する命令])が読み込まれていて、その命令が解読実行される場合、SW命令で指定されたレジスタファイル130のレジスタ(ソースレジスタ)からデータを読み出してデータバス131に出力する。同時に、CPU制御回路110内において解読実行中の命令に含まれるアドレス情報やSW命令で指定されたレジスタファイル130のレジスタから読み出されたデータから生成したアドレスをアドレスバス111に出力する。そして、それぞれのバス131,111に接続されたバスインターフェースユニット140を介して、外部アドレスバス301と外部データバス302に接続された外部メモリ200の指定されたアドレスに当該データを書き込むように制御する。なお、データ演算を行う演算回路や、CPU制御回路110及びプロセッサ部の各要素間を接続する制御/状態信号なども図示を省略している。また、説明の都合上プロセッサをMIPSアーキテクチャのプロセッサとしているが、他のアーキテクチャのプロセッサであっても良い。   Also, for example, when the SW instruction (Store Word: an instruction for storing data of one word length of the register in the memory) is read into the instruction register 120 and the instruction is decoded and executed, the SW instruction Data is read from the register (source register) of the designated register file 130 and output to the data bus 131. At the same time, the address generated from the address information included in the instruction being decoded in the CPU control circuit 110 and the data read from the register of the register file 130 specified by the SW instruction is output to the address bus 111. Then, the bus interface unit 140 connected to each of the buses 131 and 111 is controlled to write the data to the designated address of the external memory 200 connected to the external address bus 301 and the external data bus 302. . Note that an arithmetic circuit that performs data arithmetic operations, a control / status signal that connects each element of the CPU control circuit 110 and the processor unit, and the like are also not shown. Further, for convenience of explanation, the processor is a MIPS architecture processor, but a processor of another architecture may be used.

次に、本発明のバッファオーバーフロー検出回路400が対象とするスタックのバッファオーバーフローの検出動作を説明する。   Next, the operation of detecting the buffer overflow of the stack targeted by the buffer overflow detection circuit 400 of the present invention will be described.

図2は、実施例に係るバッファオーバーフロー検出回路400の主要な制御処理手順を示すフローチャートである。図3は、C言語で記述された手続きXの呼び出し(Procedure call)処理を含むソースプログラムの例を示すソースプログラムリストである。図4および図5は、図3のソースプログラムをコンパイラ(プログラム)でコンパイルして得られたアセンブリコードリストの一部である。図6は、MIPSアーキテクチャプロセッサのレジスタの使用目的の慣例を示す表で、コンパイラなどが特別に指定されない時にレジスタの使用目的を標準的に割り付ける時に参照するものである。図7は、手続き呼び出しおよび呼び出し元への復帰動作時のスタック領域の使用状況の変化を示す図である。   FIG. 2 is a flowchart illustrating a main control processing procedure of the buffer overflow detection circuit 400 according to the embodiment. FIG. 3 is a source program list showing an example of a source program including a procedure X calling process (Procedure call) described in C language. 4 and 5 are part of an assembly code list obtained by compiling the source program of FIG. 3 with a compiler (program). FIG. 6 is a table showing conventions for the purpose of use of registers of the MIPS architecture processor, and is referred to when the purpose of use of registers is normally assigned when a compiler or the like is not specified. FIG. 7 is a diagram showing a change in the usage state of the stack area during the procedure call and the return operation to the caller.

実施例のバッファオーバーフロー検出回路400の動作を説明する前に、図3のプログラムの実行において、スタック領域がどのように利用されるのかについて図7を用いて説明する。図3のプログラムは実施例説明のための簡単なCプログラムの例であり、main関数からkeisan関数なる手続きXの呼び出しが行われ、keisan関数の処理が終了すると、リターン命令によって手続きXの呼び出し元のmain関数に処理が戻るプログラムである。   Before describing the operation of the buffer overflow detection circuit 400 of the embodiment, how the stack area is used in the execution of the program of FIG. 3 will be described with reference to FIG. The program in FIG. 3 is an example of a simple C program for explaining the embodiment. When the procedure X called the keisan function is called from the main function and the processing of the keisan function is completed, the caller of the procedure X is returned by a return instruction. This is a program that returns processing to the main function.

手続きXの呼び出しの際、まず必要なスタック領域が確保された後、そのスタック領域に呼び出し元へのリターンアドレス(戻り番地)をセーブ(レジスタの内容を外部メモリにストア命令で書込み保存)する。呼び出された手続きの処理が行われた後、スタック領域にセーブされたリターンアドレスをロード(外部メモリから指定されたレジスタに読込む)し、スタック領域を開放し、ロードしたリターンアドレスへジャンプ(分岐)することで手続きXの呼び出し元の関数へ戻ることになる。   When the procedure X is called, a necessary stack area is secured first, and then the return address (return address) to the caller is saved in the stack area (the contents of the register are written and saved in the external memory by a store instruction). After the called procedure is processed, the return address saved in the stack area is loaded (read from the external memory into the specified register), the stack area is released, and the jump to the loaded return address (branch) ) To return to the function that called the procedure X.

以下、シェルプログラム(コンピュータシステムカーネルプログラムとユーザの間のインタープリタプログラム)が動作してアクセス可能なコンピュータシステムで、ユーザがmain関数のプログラムを起動させて、上述の一連の動作を行わせた時の実際のプログラムの流れで説明する。   Hereinafter, when the shell program (the interpreter program between the computer system kernel program and the user) is operated and accessed, the user starts the main function program and performs the above-described series of operations. This will be explained in the actual program flow.

まず、シェルプログラムから図5に示すmain関数が呼び出されるが、この時main関数で必要となるスタック領域が確保され、そのスタック領域に呼び出し元のシェルプログラムへのリターンアドレスが保存される。そのスタック領域の使用状況は、図7(a)のようになる。その後、main関数のJAL命令(図5の5A行目)によりkeisan関数に対する手続きXの呼び出しが実行される。図6に示すように、MIPSアーキテクチャのプロセッサでは、32個のレジスタの使用目的が慣例的に定められていて、このJAL命令実行において、命令で特別に指定しない限りレジスタ番号「31」のレジスタにリターンアドレスが格納されると、図5のkeisan関数へジャンプする。   First, the main function shown in FIG. 5 is called from the shell program. At this time, a stack area necessary for the main function is secured, and a return address to the calling shell program is stored in the stack area. The usage status of the stack area is as shown in FIG. Thereafter, the call of procedure X to the keisan function is executed by the JAL instruction of the main function (line 5A in FIG. 5). As shown in FIG. 6, in the processor of the MIPS architecture, the purpose of use of 32 registers is customarily determined. In the execution of this JAL instruction, the register number “31” is assigned to the register unless otherwise specified by the instruction. When the return address is stored, the process jumps to the keisan function of FIG.

このkeisan関数の最初の部分では、まずkeisan関数用のスタック領域が確保され(図4の4A行目)、さらに呼び出し元のmain関数へのリターンアドレスがそのスタック領域に保存される(図4の4B行目)。そして、スタック領域の使用状況は、図7(b)のようになる。図4に示すkeisan関数の処理において、スタック領域に保存しておいたリターンアドレスがレジスタ番号「31」のレジスタにロードされ(図4の4C行目)、keisan関数の最初に確保(図4の4A行目)したスタック領域を開放(図4の4D行目)した後に、ジャンプ命令(図4の4E行目)を実行することで呼び出し元のmain関数へ戻る。この時の、スタック領域の使用状況は、図7(c)のようになる。   In the first part of this keisan function, first, a stack area for the keisan function is secured (line 4A in FIG. 4), and the return address to the caller main function is stored in the stack area (FIG. 4). 4B line). The usage status of the stack area is as shown in FIG. In the process of the keisan function shown in FIG. 4, the return address stored in the stack area is loaded into the register of register number “31” (line 4C in FIG. 4), and secured at the beginning of the keisan function (in FIG. 4). After releasing the stack area (line 4A) (line 4D in FIG. 4), the jump function (line 4E in FIG. 4) is executed to return to the caller main function. The usage status of the stack area at this time is as shown in FIG.

図5のmain関数の処理においても同様に、スタック領域に保存しておいて呼び出し元のシェルスクリプトへのリターンアドレスをレジスタ番号「31」のレジスタにロードした後に、スタック領域を開放してジャンプ命令を実行することで呼び出し元のシェルプログラムへ戻る。   Similarly, in the processing of the main function in FIG. 5, after saving the stack area and loading the return address to the caller shell script into the register of register number “31”, the stack area is released and a jump instruction is issued. To return to the calling shell program.

上記のような手続きXの呼び出し時、および呼び出し元への復帰時の処理を踏まえた上で、実施例のプロセッサ100のバッファオーバーフロー検出回路400の動作を説明する。   The operation of the buffer overflow detection circuit 400 of the processor 100 according to the embodiment will be described in consideration of the processing at the time of calling the procedure X and returning to the caller.

図2のフローチャートに示すように、まず、外部メモリ200から命令レジスタ120に読み込まれた命令が、JAL命令であるかロード・ストア・JAL命令検出回路410を用いてモニターする(ステップS100)。JAL命令以外の命令の場合は、外部メモリ200から命令レジスタ120に読み込まれた次の命令に対して、ステップS100を繰り返し実行する。   As shown in the flowchart of FIG. 2, first, it is monitored using the load / store / JAL instruction detection circuit 410 whether the instruction read from the external memory 200 into the instruction register 120 is a JAL instruction (step S100). In the case of an instruction other than the JAL instruction, step S100 is repeatedly executed for the next instruction read from the external memory 200 into the instruction register 120.

ロード・ストア・JAL命令検出回路410によってJAL命令であることを検出した時は、信号線411を介して制御回路420に通知されたJAL命令のrd番号(rdは、リターンアドレス(戻り番地)が格納されるレジスタの識別情報であるレジスタ番号。図4、図5のJAL命令はオペランドによる指定がないのでレジスタの使用目的の慣例どおりにレジスタ番号「31」となる)を信号線421を介してRRレジスタ430に保存する(ステップS110)。   When the load / store / JAL instruction detection circuit 410 detects that the instruction is a JAL instruction, the rd number (rd is the return address) of the JAL instruction notified to the control circuit 420 via the signal line 411. The register number which is the identification information of the register to be stored.The JAL instruction of FIGS.4 and 5 is not specified by the operand, so the register number is "31" in accordance with the conventional usage purpose of the register) via the signal line 421 The data is stored in the RR register 430 (step S110).

次に、命令レジスタ120に読み込まれた次の命令が、JAL命令かまたはストア命令であるかをロード・ストア・JAL命令検出回路410によってモニターする(ステップS120)。JAL(分岐動作と分岐元への戻り番地をレジスタに保存する)命令かまたはストア(レジスタの内容をメモリに保存する)命令以外の命令の場合は、命令レジスタ120に読込まれた次の命令に対して、ステップS120を繰り返し実行する。そして、JAL命令が検出された場合は、ステップS110に戻る。   Next, the load / store / JAL instruction detection circuit 410 monitors whether the next instruction read into the instruction register 120 is a JAL instruction or a store instruction (step S120). In the case of an instruction other than a JAL instruction (which stores the branch operation and the return address to the branch source in a register) or a store instruction (which stores the register contents in memory), the next instruction read into the instruction register 120 On the other hand, step S120 is repeatedly executed. If a JAL instruction is detected, the process returns to step S110.

一方、ストア命令が検出された場合は、RRレジスタ430に保存されたレジスタ番号が信号線431を介してロード・ストア・JAL命令検出回路410に入力されているので、ストア命令のソースレジスタ番号とRRレジスタ430に保存されたレジスタ番号が一致するかを調べる(ステップS130)。不一致の場合は、ステップS120に戻り、次に読み込まれる命令のモニターを行う。   On the other hand, when a store instruction is detected, the register number stored in the RR register 430 is input to the load / store / JAL instruction detection circuit 410 via the signal line 431. It is checked whether or not the register numbers stored in the RR register 430 match (step S130). If they do not match, the process returns to step S120, and the next instruction to be read is monitored.

レジスタ番号が一致した場合、CPU制御回路110がアドレスバス111に出力したストア命令の指定するストアアドレスを制御回路420に入力する。制御回路420は、信号線422を介して保存番地レジスタ440に受信したストアアドレスを記憶させる。また、ストア命令で指定されてデータバス131に出力されたソースレジスタのデータ(リターンアドレス)を制御回路420に入力される。制御回路420は信号線423を介して戻り番地レジスタ450に受信したリターンアドレスを記憶させる(ステップS140)。   If the register numbers match, the store address specified by the store instruction output from the CPU control circuit 110 to the address bus 111 is input to the control circuit 420. The control circuit 420 stores the received store address in the storage address register 440 via the signal line 422. Further, the data (return address) of the source register specified by the store instruction and output to the data bus 131 is input to the control circuit 420. The control circuit 420 stores the received return address in the return address register 450 via the signal line 423 (step S140).

次に、保存番地レジスタ440に記憶された保存番地をタグとし、戻り番地レジスタ450に記憶された戻り番地をデータとするエントリをそれぞれ信号線441および信号線451を介してCAMメモリ500に書み込み記憶させる(ステップS150)。このCAMメモリ500にエントリ書込みステップS150において、CAMメモリ500に書込み余地がない時、CAMメモリ500は信号線502によって制御回路420にエントリFULL状態(F)であることを通知する。   Next, an entry having the storage address stored in the storage address register 440 as a tag and the return address stored in the return address register 450 as data is written to the CAM memory 500 via the signal line 441 and the signal line 451, respectively. (Step S150). In the entry writing step S150 in the CAM memory 500, when there is no room for writing in the CAM memory 500, the CAM memory 500 notifies the control circuit 420 that it is in the entry FULL state (F) through the signal line 502.

これを受けて制御回路420は、CAMメモリ500への書込み動作を停止して、信号線424を介してCPU制御回路110にエントリFULLの割込みを通知する。CPU制御回路110は、割込み通知を受け付けると、エントリFULLの割込み処理プログラムを起動して、CAMエントリRead命令を実行することで、CAMメモリ500の最も古いCAMエントリを図示しないタグおよびデータレジスタに読み込んだ後、それを外部メモリ200に退避させる。   In response to this, the control circuit 420 stops the writing operation to the CAM memory 500 and notifies the CPU control circuit 110 of the entry FULL interrupt via the signal line 424. Upon receiving the interrupt notification, the CPU control circuit 110 starts the entry FULL interrupt processing program and executes the CAM entry Read instruction, thereby reading the oldest CAM entry in the CAM memory 500 into a tag and data register (not shown). After that, it is saved in the external memory 200.

このタグおよびデータレジスタにアクセスしてプロセッサ部のレジスタファイル130のレジスタとの間で読み書きする専用命令としては、MIPSアーキテクチャの場合、CoProcessorMove命令(mfc2)などが用いられる。割込み処理後、プロセッサ部は中断したプログラム処理を再開させ、制御回路420はCAMメモリ500へのエントリ書込みを行う。ちなみに、市販のマイクロプロセッサには、内蔵するMMU(Memory Management Unit:メモリ管理ユニット)にCAMメモリ技術を使用するものがあり、専用命令などを用いて内蔵するCAMメモリへアクセスすることができる。   In the case of the MIPS architecture, a CoProcessor Move instruction (mfc2) or the like is used as a dedicated instruction for accessing the tag and data register and reading / writing from / to the register of the register file 130 of the processor unit. After the interrupt process, the processor unit resumes the interrupted program process, and the control circuit 420 writes an entry to the CAM memory 500. Incidentally, some commercially available microprocessors use CAM memory technology for a built-in MMU (Memory Management Unit), and can access a built-in CAM memory using a dedicated instruction or the like.

次に、命令レジスタ120に読み込まれた次の命令が、JAL命令かまたはロード命令であるかをロード・ストア・JAL命令検出回路410によってモニターする(ステップS160)。JAL命令かまたはロード命令以外の命令の場合は、命令レジスタ120に読込まれた次の命令に対してステップS160を繰り返し実行する。   Next, the load / store / JAL instruction detection circuit 410 monitors whether the next instruction read into the instruction register 120 is a JAL instruction or a load instruction (step S160). If the instruction is not a JAL instruction or a load instruction, step S160 is repeatedly executed for the next instruction read into the instruction register 120.

JAL命令が検出された場合は、ステップS110に戻る。   If a JAL instruction is detected, the process returns to step S110.

ロード・ストア・JAL命令検出回路410によってロード命令が検出された場合は、CPU制御回路110が信号線111に出力したロード命令が指定するアクセスアドレスを制御回路420に入力する。そして、制御回路420は信号線422を介して保存番地レジスタ440にアドレスを記憶する。また、ロード命令で指定されたアクセスアドレスがCPU制御回路110から出力されてアドレスバス111を介してバスインターフェースユニット140に入力される。さらに、バスインターフェースユニット140からメモリアドレスバス301を介して外部メモリ200に読み出しアクセスが行われる。そして外部メモリ200から読み出された戻り番地がメモリデータバス302を介してバスインターフェースユニット140に入力され、バスインターフェースユニット140よりデータバス131を介して制御回路420に入力される。そして、制御回路420は信号線423を介して戻り番地レジスタ450に戻り番地を記憶させる。そうして、保存番地レジスタ440に記憶されたアクセスアドレスをタグとして、CAMメモリ500へアクセスする(ステップS170)。   When the load instruction is detected by the load / store / JAL instruction detection circuit 410, the access address specified by the load instruction output to the signal line 111 by the CPU control circuit 110 is input to the control circuit 420. Then, the control circuit 420 stores the address in the storage address register 440 via the signal line 422. The access address specified by the load instruction is output from the CPU control circuit 110 and input to the bus interface unit 140 via the address bus 111. Further, read access is performed from the bus interface unit 140 to the external memory 200 via the memory address bus 301. The return address read from the external memory 200 is input to the bus interface unit 140 via the memory data bus 302, and is input from the bus interface unit 140 to the control circuit 420 via the data bus 131. Then, the control circuit 420 stores the return address in the return address register 450 via the signal line 423. Then, the CAM memory 500 is accessed using the access address stored in the storage address register 440 as a tag (step S170).

保存番地レジスタ440に記憶されたアクセスアドレスをタグとしたエントリがCAMメモリ500に存在しない(ヒットしない)場合は、ステップS160に戻る。   If the entry with the access address stored in the storage address register 440 as a tag does not exist (does not hit) in the CAM memory 500, the process returns to step S160.

保存番地レジスタ440に記憶されたアクセスアドレスをタグとしたエントリがCAMメモリ500に存在した(ヒットした)場合は、CAMメモリ500からヒットしたことが信号線502を介して制御回路420に通知される。制御回路420は、戻り番地レジスタ450の戻り番地とCAMメモリ500から読み出された戻り番地とをそれぞれ信号線452および信号線501を介して比較回路510に入力して、比較回路510で比較する(ステップS180)。   If an entry with the access address stored in the storage address register 440 as a tag is present (hit) in the CAM memory 500, the control circuit 420 is notified via the signal line 502 that the CAM memory 500 has been hit. . The control circuit 420 inputs the return address of the return address register 450 and the return address read from the CAM memory 500 to the comparison circuit 510 via the signal line 452 and the signal line 501, respectively, and compares them by the comparison circuit 510. (Step S180).

比較回路510の比較結果が一致した時は、スタック領域に保存された手続きXの呼び出し元への戻り番地の書き換えがなく、手続きXの呼び出し処理が正常に終了したことと判断できる。そして、比較回路510から出力される比較結果511を入力する制御回路420は、保存番地レジスタ440に記憶されたアクセスアドレスをタグとするエントリを無効化する処理を行って、CAMメモリ500より一致したエントリを削除する(ステップS190)。このCAMメモリ500にエントリ削除ステップS190において、CAMメモリ500のエントリが無くなる時、CAMメモリ500は信号線502によって制御回路420にエントリEMPTY状態(E)であることを通知する。   When the comparison results of the comparison circuit 510 match, it can be determined that the return address to the caller of the procedure X stored in the stack area is not rewritten, and the call processing of the procedure X is normally completed. Then, the control circuit 420 that inputs the comparison result 511 output from the comparison circuit 510 performs a process of invalidating the entry with the access address stored in the storage address register 440 as a tag, and matches with the CAM memory 500. The entry is deleted (step S190). In the entry deletion step S190 in the CAM memory 500, when there are no more entries in the CAM memory 500, the CAM memory 500 notifies the control circuit 420 that it is in the entry EMPTY state (E) through the signal line 502.

制御回路420は、信号線424を介してCPU制御回路110にエントリEMPTYの割込みを通知する。CPU制御回路110は、割込み通知を受け付けると、エントリEMPTYの割込みプログラムを起動して、外部メモリ200に退避しているエントリの有無を調べる。そして、エントリが無い場合は割込みを終了し、エントリがある時は、外部メモリ200からエントリを読み出して、CAMメモリ500にエントリを書込んで、割込みプログラムを終了して、プロセッサ部が中断していた処理を再開させる。   The control circuit 420 notifies the interrupt of the entry EMPTY to the CPU control circuit 110 via the signal line 424. When receiving the interrupt notification, the CPU control circuit 110 activates the interrupt program of the entry EMPTY and checks whether there is an entry saved in the external memory 200. If there is no entry, the interrupt is terminated. If there is an entry, the entry is read from the external memory 200, the entry is written in the CAM memory 500, the interrupt program is terminated, and the processor unit is interrupted. Restart the process.

次に、CAMメモリ500に記憶された有効なエントリ数が「0」であるか調べる(ステップS200)。エントリ数が「0」でない時は、ステップS160に戻り、エントリ数が「0」の時は、ステップS100に戻る。   Next, it is checked whether the number of valid entries stored in the CAM memory 500 is “0” (step S200). When the number of entries is not “0”, the process returns to step S160, and when the number of entries is “0”, the process returns to step S100.

ステップS180において、比較回路510での比較結果が一致しない場合は、スタック領域に保存されていた戻り番地が書き換えられていることを示し、比較回路510から出力される比較結果511を受ける制御回路420は、信号線424を介してCPU制御回路110にバッファオーバーフロー検出割込みを行う(ステップS210)。   In step S180, if the comparison result in the comparison circuit 510 does not match, the control circuit 420 that receives the comparison result 511 output from the comparison circuit 510 indicates that the return address stored in the stack area has been rewritten. Performs a buffer overflow detection interrupt to the CPU control circuit 110 via the signal line 424 (step S210).

上述のようにバッファオーバーフロー検出回路400は動作し、呼び出された手続きプログラムで呼び出し元へのリターンアドレスをスタック領域に保存する際に、CAMメモリ500にもリターンアドレスを書込み保存する。   As described above, the buffer overflow detection circuit 400 operates, and when the return address to the caller is stored in the stack area by the called procedure program, the return address is written and stored in the CAM memory 500 as well.

このCAMメモリ500中のリターンアドレスへのアクセスは、バッファオーバーフロー検出回路400に組み込まれた制御手順に従って上述のように手続き呼び出し時および呼び出し元へのリターン時に行われるリターンアドレスへのアクセスと並列に行うように限定されるため、悪意プログラムなどによってスタックバッファオーバーフローのような操作を行うプログラムでは、リターンアドレスを改変することはできない。このようにCAMメモリ500中のリターンアドレスは保護されるので、呼び出し元手続きへの復帰の際に、あらかじめスタック領域に保存されたリターンアドレスとCAMメモリ500中に保存されたリターンアドレスを比較することで、バッファオーバーフローの検出が可能となる。   The access to the return address in the CAM memory 500 is performed in parallel with the access to the return address performed at the time of calling the procedure and returning to the caller as described above in accordance with the control procedure incorporated in the buffer overflow detection circuit 400. Therefore, the return address cannot be modified by a program that performs an operation such as a stack buffer overflow by a malicious program or the like. Since the return address in the CAM memory 500 is protected in this way, the return address stored in the stack area in advance is compared with the return address stored in the CAM memory 500 when returning to the calling procedure. Thus, buffer overflow can be detected.

これら一連の処理で、CAMメモリ500中のエントリの外部メモリ200への退避処理、および外部メモリ200中のエントリをCAMメモリ500へリストア(復帰処理)についてのみプロセッサが実行するソフトウェア(プログラム)の処理の介在が必要となるが、CAMメモリ500のエントリ数を最適化することで、ソフトウェア支援を最小限にすることが可能であり、ガード変数などのソフトウェアプログラムによる検出手法よりも高速にバッファオーバーフローを検出することができる。   In this series of processing, software (program) processing executed by the processor only for saving the entries in the CAM memory 500 to the external memory 200 and restoring (returning) the entries in the external memory 200 to the CAM memory 500. However, by optimizing the number of entries in the CAM memory 500, software support can be minimized, and buffer overflow can be performed faster than detection methods using software programs such as guard variables. Can be detected.

また、CAMメモリ500のエントリを容量の大きな外部メモリへ退避、復帰させることができるので、100%のバッファオーバーフロー検出が実現できる。更にまた、対象となるスタック動作に係るプログラム部分を変更する必要がないので再コンパイルや再設計作業を減らすことができる。   In addition, since entries in the CAM memory 500 can be saved and restored to an external memory having a large capacity, 100% buffer overflow detection can be realized. Furthermore, since it is not necessary to change the program part related to the target stack operation, recompilation and redesign work can be reduced.

本発明は、上記実施例に限定されるものではなく、発明の要旨を逸脱しない範囲で、種々、変形して実施できることは勿論である。   The present invention is not limited to the above-described embodiments, and it is needless to say that various modifications can be made without departing from the spirit of the invention.

例えば、保存番地と戻り番地(リターンアドレス)の組(エントリ)を記憶するCAMメモリをLIFO(Last−In First−Out)動作するLIFOメモリとすることができて、ストア命令を検出し、そのソースレジスタのレジスタ番号がRR430に記憶されたレジスタ番号と一致した場合に、ストア命令のアクセスアドレスの保存番地と保存データの戻り番地の組をLIFOメモリに記憶するようにする。そして、ロード命令を検出し、そのアクセスアドレスがLIFOメモリに記憶された保存番地と一致した場合に、ロード命令で読み出されたデータがLIFOメモリに記憶された戻り番地と一致するかを調べ、不一致の場合にバッファオーバーフローが発生したことを検出するようにすることができる。保存番地レジスタ440とLIFOメモリの保存番地記憶部からの出力を比較する回路の追加などが必要となるが、メモリの構成がCAMメモリに比べて簡単なLIFOメモリを使用することができる。   For example, a CAM memory that stores a pair (entry) of a storage address and a return address (return address) can be a LIFO memory that operates as a LIFO (Last-In First-Out), and a store instruction is detected and its source When the register number of the register matches the register number stored in the RR 430, a set of the storage address of the access address of the store instruction and the return address of the storage data is stored in the LIFO memory. Then, when the load instruction is detected and the access address matches the storage address stored in the LIFO memory, it is checked whether the data read by the load instruction matches the return address stored in the LIFO memory, When there is a mismatch, it can be detected that a buffer overflow has occurred. Although it is necessary to add a circuit for comparing the output from the storage address register 440 and the storage address storage unit of the LIFO memory, it is possible to use a LIFO memory having a simpler memory configuration than the CAM memory.

本発明に係るマイクロプロセッサの実施例の構成を示すブロック図。The block diagram which shows the structure of the Example of the microprocessor which concerns on this invention. 本実施例のバッファオーバーフロー検出回路の主要な制御手順を示すフローチャート図。The flowchart figure which shows the main control procedures of the buffer overflow detection circuit of a present Example. mainおよびkeisan関数のソースプログラムのリスト。A list of source programs for the main and keisan functions. keisan関数のアセンブリコードのリスト。A list of assembly code for the keisan function. main関数のアセンブリコードのリスト(続き)。List of assembly code for the main function (continued). MIPSアーキテクチャプロセッサのレジスタの使用目的の慣例を示す表。A table showing conventions for the intended use of registers in the MIPS architecture processor. 手続き呼び出しおよび呼び出し元への戻り動作時のスタック領域の使用状況を示す図。The figure which shows the use condition of a stack area at the time of a procedure call and return operation | movement to a caller. バッファオーバーフロー操作によるスタックスマッシングの発生の様子を示す図。The figure which shows the mode of generation | occurrence | production of stack smashing by buffer overflow operation.

符号の説明Explanation of symbols

1 コンピュータシステム
100 マイクロプロセッサ
110 CPU制御回路
111 アドレスバス
120 命令レジスタ
130 レジスタファイル
131 データバス
140 バスインターフェースユニット
200 外部メモリ
300 外部バス
301 外部アドレスバス
302 外部データバス
400 バッファオーバーフロー検出回路
410 ロード・ストア・JAL命令検出回路
420 制御回路
430 RRレジスタ
440 保存番地レジスタ
450 戻り番地レジスタ
500 CAMメモリ
510 比較回路
1 Computer System 100 Microprocessor 110 CPU Control Circuit 111 Address Bus 120 Instruction Register 130 Register File 131 Data Bus 140 Bus Interface Unit 200 External Memory 300 External Bus 301 External Address Bus 302 External Data Bus 400 Buffer Overflow Detection Circuit 410 Load Store Store JAL instruction detection circuit 420 Control circuit 430 RR register 440 Storage address register 450 Return address register 500 CAM memory 510 Comparison circuit

Claims (5)

手続き呼び出し分岐命令を有し、呼び出し元への戻り番地をメモリに保存できるマイクロプロセッサであって、
前記呼び出し元への戻り番地を前記メモリに保存する保存動作を検出する保存検出手段と、
前記保存検出手段で検出された保存動作における戻り番地と、その戻り番地を保存する保存番地とを記憶する前記メモリとは異なる記憶手段と、
前記メモリの前記保存番地からの読み出し動作を検出する読み出し検出手段と、
前記読み出し検出手段で読み出し動作を検出した時に、前記メモリから読み出した戻り番地と前記記憶手段から読み出した戻り番地とを比較して、その比較内容が一致しない時にバッファオーバーフローが発生していることを検出するバッファオーバーフロー検出手段と
を有することを特徴とするマイクロプロセッサ。
A microprocessor that has a procedure call branch instruction and can store the return address to the caller in memory,
Storage detection means for detecting a storage operation for storing the return address to the caller in the memory;
A storage unit different from the memory for storing a return address in the storage operation detected by the storage detection unit and a storage address for storing the return address;
Read detection means for detecting a read operation from the storage address of the memory;
When a read operation is detected by the read detection means, the return address read from the memory is compared with the return address read from the storage means, and a buffer overflow occurs when the comparison contents do not match. A microprocessor having a buffer overflow detecting means for detecting.
前記記憶手段は、前記保存番地をタグとし前記戻り番地をデータとする組をエントリとして記憶するCAMメモリで構成されることを特徴とする請求項1に記載のマイクロプロセッサ。   2. The microprocessor according to claim 1, wherein the storage means is constituted by a CAM memory that stores, as an entry, a set in which the storage address is a tag and the return address is data. 前記保存検出手段は、手続き呼び出し分岐命令実行後、レジスタの内容をメモリに保存させるストア命令で手続き呼び出し分岐命令において前記呼び出し元への戻り番地を記憶するレジスタの内容が前記メモリに保存されることを検出することを特徴とする請求項1に記載のマイクロプロセッサ。   The save detection means is a store instruction that saves the contents of a register in a memory after execution of a procedure call branch instruction, and the contents of a register that stores a return address to the caller in the procedure call branch instruction is saved in the memory. The microprocessor according to claim 1, wherein: 前記読み出し検出手段は、戻り番地と保存番地が前記記憶手段に記憶された後、メモリからレジスタにデータを読み出すロード命令の読み出し番地が前記記憶手段に記憶された保存番地と一致することを検出することを特徴とする請求項1に記載のマイクロプロセッサ。   The read detection means detects that the read address of the load instruction for reading data from the memory to the register matches the save address stored in the storage means after the return address and the save address are stored in the storage means. The microprocessor according to claim 1. 手続き呼び出し分岐命令を有し、呼び出し元への戻り番地をメモリに保存できるマイクロプロセッサであって、
手続き呼び出し分岐命令が実行される時に呼び出し元への戻り番地を保存するレジスタ識別情報を記憶するレジスタ識別情報記憶手段と、
前記手続き呼び出し分岐命令が実行された後に、ストア命令が実行される時に前記レジスタ識別情報記憶手段に記憶された前記レジスタ識別情報で識別されるレジスタに保存されていたデータがメモリに保存される場合に、保存番地と保存データとを同時に記憶する前記メモリとは異なる記憶手段と、
前記ストア命令が実行された後に、ロード命令が実行される時に前記記憶手段の前記保存番地より前記メモリから読み出されるデータと、前記記憶手段に同時に記憶された前記保存データとを比較して、その比較内容が一致しない時にバッファオーバーフローが発生していることを検出するバッファオーバーフロー検出手段と
を有することを特徴とするマイクロプロセッサ。
A microprocessor that has a procedure call branch instruction and can store the return address to the caller in memory,
Register identification information storage means for storing register identification information for storing a return address to the caller when a procedure call branch instruction is executed;
When the data stored in the register identified by the register identification information stored in the register identification information storage means is stored in the memory when the store instruction is executed after the procedure call branch instruction is executed Storage means different from the memory for simultaneously storing the storage address and the storage data;
After the store instruction is executed, when the load instruction is executed, the data read from the memory from the storage address of the storage means is compared with the stored data simultaneously stored in the storage means, And a buffer overflow detecting means for detecting that a buffer overflow has occurred when the comparison contents do not match.
JP2008075229A 2008-03-24 2008-03-24 Microprocessor Withdrawn JP2009230479A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008075229A JP2009230479A (en) 2008-03-24 2008-03-24 Microprocessor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008075229A JP2009230479A (en) 2008-03-24 2008-03-24 Microprocessor

Publications (1)

Publication Number Publication Date
JP2009230479A true JP2009230479A (en) 2009-10-08

Family

ID=41245784

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008075229A Withdrawn JP2009230479A (en) 2008-03-24 2008-03-24 Microprocessor

Country Status (1)

Country Link
JP (1) JP2009230479A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015011436A (en) * 2013-06-27 2015-01-19 株式会社デンソー Processor
JP2015191658A (en) * 2014-03-28 2015-11-02 インテル・コーポレーション Return-target restrictive return instructions from procedure, processors, methods, and systems
US10261814B2 (en) 2014-06-23 2019-04-16 Intel Corporation Local service chaining with virtual machines and virtualized containers in software defined networking

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015011436A (en) * 2013-06-27 2015-01-19 株式会社デンソー Processor
JP2015191658A (en) * 2014-03-28 2015-11-02 インテル・コーポレーション Return-target restrictive return instructions from procedure, processors, methods, and systems
US9703948B2 (en) 2014-03-28 2017-07-11 Intel Corporation Return-target restrictive return from procedure instructions, processors, methods, and systems
US10261814B2 (en) 2014-06-23 2019-04-16 Intel Corporation Local service chaining with virtual machines and virtualized containers in software defined networking

Similar Documents

Publication Publication Date Title
KR101835250B1 (en) Detection of unauthorized memory modification and access using transactional memory
US8161273B2 (en) Method and apparatus for programmatically rewinding a register inside a transaction
US8316366B2 (en) Facilitating transactional execution in a processor that supports simultaneous speculative threading
KR101249693B1 (en) Selecting subroutine return mechanisms
US20050240701A1 (en) Interrupt control apparatus
KR102344010B1 (en) Handling of inter-element address hazards for vector instructions
CN108780397B (en) Program loop control
CN111133418B (en) Allowing non-aborted transactions after exception mask update instructions
US8181063B2 (en) Computer device, continuing operation method for computer device, and program
JP5245237B2 (en) Error handling method
JP2009230479A (en) Microprocessor
JP5215655B2 (en) Data processing apparatus and bus access control method in data processing apparatus
CN115576734B (en) Multi-core heterogeneous log storage method and system
US6889315B2 (en) Processor and method of controlling the same
JP2004326331A (en) Unauthorized memory access detection method and program of the same
US7890740B2 (en) Processor comprising a first and a second mode of operation and method of operating the same
JP2001306334A (en) Emulation device
JP2562838B2 (en) Processor and store buffer control method
CN106537342B (en) Dynamic saving of registers in transactions
JPH08137748A (en) Computer having copy back cache and copy back cashe control method
JP3762608B2 (en) Computer and its control method
KR20080044652A (en) Method for debugging by using stack of cpu
JP2870405B2 (en) Information processing device
JP2015115052A (en) Microprocessor, computer, method of coping with abnormality, and abnormality countermeasure program
JP3748191B2 (en) Computer and its control method

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20110607