WO2010032330A1 - 情報処理装置及びそのメモリ保護方法 - Google Patents
情報処理装置及びそのメモリ保護方法 Download PDFInfo
- Publication number
- WO2010032330A1 WO2010032330A1 PCT/JP2008/067100 JP2008067100W WO2010032330A1 WO 2010032330 A1 WO2010032330 A1 WO 2010032330A1 JP 2008067100 W JP2008067100 W JP 2008067100W WO 2010032330 A1 WO2010032330 A1 WO 2010032330A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- memory
- area
- trap
- trap type
- application
- Prior art date
Links
- 230000010365 information processing Effects 0.000 title claims abstract description 32
- 238000000034 method Methods 0.000 title claims description 33
- 230000006378 damage Effects 0.000 claims abstract description 11
- 230000004044 response Effects 0.000 claims description 18
- 238000010586 diagram Methods 0.000 description 4
- 230000007257 malfunction Effects 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000015556 catabolic process Effects 0.000 description 1
- 238000006731 degradation reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/14—Protection against unauthorised use of memory or access to memory
- G06F12/1416—Protection against unauthorised use of memory or access to memory by checking the object accessibility, e.g. type of access defined by the memory independently of subject rights
- G06F12/1425—Protection against unauthorised use of memory or access to memory by checking the object accessibility, e.g. type of access defined by the memory independently of subject rights the protection being physical, e.g. cell, word, block
- G06F12/1441—Protection against unauthorised use of memory or access to memory by checking the object accessibility, e.g. type of access defined by the memory independently of subject rights the protection being physical, e.g. cell, word, block for a range
Definitions
- the present invention relates to an information processing apparatus and a memory protection method for preventing memory destruction due to unauthorized writing in the information processing apparatus.
- An application (process) operating on an operating system (OS: Operating System) of the information processing apparatus acquires a memory area from the OS in response to a dynamic memory allocation request. Thereafter, the application may perform illegal writing to an area other than the acquired memory area. In this case, since the memory area used for another purpose is destroyed, a trouble such as malfunction or abnormal termination of the application occurs.
- OS Operating System
- the prior art shown in FIG. 2 is known as a memory protection method for preventing memory destruction due to illegal writing.
- a memory 200 as a main storage device
- an application 210 that uses the memory
- an OS 220 that allocates memory in response to a dynamic memory allocation request from the application.
- the application 210 issues a memory allocation request to the OS 220 in order to secure a data area to be used by itself (block 212).
- the OS 220 secures the memory area 202 and sets an inaccessible attribute to the memory area 204 continuous with the memory area (blocks 222 and 224).
- memory management is performed in units of a specific size of memory block, and when a memory allocation request is issued from the application 210, the OS 220 sets an inaccessible attribute to one memory block 204. To do. Then, the OS 220 secures a memory area 202 having a size requested by the application from the end of the memory block immediately before the memory block 204 toward the top.
- the OS 220 allocates the memory area 202 to the application 210 (block 226).
- the application 210 can write to the memory area 202.
- the application 210 may issue an access request to the area 204 with the inaccessible attribute set beyond the memory area 202 (block 214). In that case, an exception interrupt occurs, and the OS 220 prevents unauthorized writing to the memory area 204 by executing access exception processing (block 228).
- FIG. 3 is a diagram for explaining the problems of the prior art shown in FIG.
- the address of the allocated memory must be aligned with the page boundary.
- the address of the allocated memory may not match the page boundary. is there. Since an error occurs when such an address is accessed, it is necessary to adjust the alignment by securing an extra memory.
- the present disclosure has been made in view of the above-described problems, and an object of the present disclosure is to determine the size of an access prohibited area for generating a trap when an illegal write is performed by an application. By making it possible to set an arbitrary size that does not depend on the management unit and making alignment adjustment unnecessary, it is possible to effectively use memory resources and prevent memory destruction due to unauthorized writing.
- An information processing apparatus and a memory protection method thereof are provided.
- one or a plurality of address setting registers in which a memory area is set, and one or a plurality of address setting registers provided corresponding to the address setting registers are set.
- a trap type setting register, a trap mechanism that generates a trap of the trap type set in the corresponding trap type setting register in response to an access request to the memory area set in each of the address setting registers, and a user In response to the input, the prohibited area size setting means for setting the access prohibited area size in advance, and in response to a memory allocation request from the application, the memory area is allocated as an accessible area to the application, and the accessible area Immediately after the access having the access prohibited area size
- an information processing apparatus including illegal access processing means for generating a memory image of the application and terminating the application abnormally when a type of trap
- a memory protection method executed by the information processing apparatus described above and a program that causes the information processing apparatus to execute the memory protection method.
- an access prohibition area is provided immediately after the memory area allocated to the application, and the access prohibition area is set in the address setting register.
- The When the application tries to access the access prohibited area, a trap occurs in the information processing apparatus.
- a memory image (core file) of the application is immediately generated and the application is abnormally terminated.
- the user can set in advance the size of the access-prohibited area for generating a trap when an illegal write is performed by an application with an arbitrary size that does not depend on the memory management unit of the OS. Therefore, the user can freely change the size of the access-prohibited area according to the assumed size of memory destruction due to illegal writing. Also, alignment adjustment is not necessary. As a result, it is possible to effectively use the memory resources, and it is possible to prevent the destruction of the memory due to the illegal writing.
- FIG. It is a figure for demonstrating destruction of the memory by improper writing. It is a figure for demonstrating the prior art example of the memory protection method which prevents destruction of the memory by improper writing. It is a figure for demonstrating the problem of the prior art shown by FIG. It is a figure which shows the hardware constitutions of one Embodiment of the information processing apparatus by this indication technique. It is a flowchart which shows the process at the time of memory allocation. It is a flowchart which shows the process at the time of memory access. It is a figure which illustrates the setting of a memory area. It is a figure for demonstrating the operation
- FIG. 4 is a diagram illustrating a hardware configuration of an embodiment of the information processing apparatus according to the present disclosure.
- the information processing apparatus includes a CPU (Central Processing Unit) 400, a memory 460, a magnetic disk device 470, a keyboard 480, and a display 490.
- the CPU 400 executes an OS and applications loaded on the memory 460 as a main storage device.
- the CPU 400 also includes a plurality of address setting registers 410, a plurality of trap type setting registers 420, an address match circuit 430, and an address trap generation circuit 440.
- the plurality of address setting registers 410 addresses for designating memory areas are set.
- the plurality of trap type setting registers 420 are provided corresponding to the plurality of address setting registers 410, and a trap type is set for each of them.
- the trap type is information indicating the type of trap that induces the occurrence of an exception or the like.
- the address match circuit 430 and the address trap generation circuit 440 generate trap type traps set in the corresponding trap type setting register 420 in response to an access request to the memory area set in each of the address setting registers 410. It is a trap mechanism.
- FIG. 5 is a flowchart showing processing at the time of memory allocation. It is assumed that the size of the access prohibited area to be provided immediately after the memory area allocated to the application is set in advance by the method described by the user in the setting file.
- the application issues a memory allocation request to the OS (block 502).
- the OS secures a memory area having the requested memory size as an accessible area (block 504).
- the OS sets the start address and end address of the secured memory area (accessible area) in one of the address setting registers 410 (block 506).
- the OS sets, for example, “# 10” in the corresponding trap type setting register 420 as a trap type indicating that the accessible area is accessed by a normal access request with respect to the secured memory area (block 508). .
- This trap type is determined so as not to overlap with other trap types already provided in the information processing apparatus.
- the OS acquires an access-prohibited area size described in advance in the setting file by the user (block 510). Then, the OS provides an access prohibition area having the acquired access prohibition area size immediately after the memory area allocated to the application, and sets the start address and end address of the access prohibition area as another one of the address setting register 410. (Block 512).
- the OS sets, for example, “# 11” in the corresponding trap type setting register 420 as a trap type for the access prohibited area indicating that the access prohibited area is accessed by an unauthorized access request (block). 514). This trap type is determined so as not to overlap with other trap types already provided in the information processing apparatus. Finally, the OS allocates the reserved memory area (accessible area) to the requesting application (block 516). This completes the memory allocation process.
- FIG. 6 is a flowchart showing processing at the time of memory access.
- an application issues an instruction with memory access, ie, a memory access request (block 602).
- the address match circuit 430 compares the access address according to the memory access request with the start address and end address set in each address setting register 410, so that the access address is an address in the accessible area, and Then, it is determined whether the access address is an address in the access prohibited area (block 604).
- the access address is an address in the accessible area
- the reading or writing process is normally executed (block 606).
- the address trap generation circuit 440 generates a trap of the trap type “# 10”, which is set in the corresponding trap type setting register 420 and indicates that it has been accessed by a normal access request (block 608).
- the OS executes access log collection (block 610).
- the trap type “#” indicating that the address trap generation circuit 440 is accessed by an unauthorized access request set in the corresponding trap type setting register 420. 11 ′′ traps are generated (block 612).
- the OS In response to this trap, the OS generates a memory image (core file) of the process (application) that issued the memory access, and forcibly terminates the process (block 614).
- FIG. 7 is a diagram illustrating setting of the memory area.
- the memory area from the address “A” to the address “B” is an accessible area assigned to the application.
- the memory area from the address “C” to the address “D” following the accessible area is an access prohibited area provided corresponding to the accessible area.
- a memory area from address “E” to address “F” is an accessible area
- a memory area from address “G” to address “H” is an access-prohibited area.
- FIG. 8 is a diagram for explaining an operation corresponding to the setting of the memory area shown in FIG.
- Each address setting register 410 includes a start address register and an end address register.
- the address “A” is set in the start address register of one address setting register 410 and the address “B” is set in the end address register.
- the address “C” is set in the start address register of the other address setting register 410, and the address “D” is set in the end address register. Furthermore, the trap type “# 11”, which is prepared for the access prohibited area and indicates that access has been made by an unauthorized access request, is set in the trap type setting register 420 corresponding to the address setting register 410. The same applies to the accessible area from the address “E” to “F” and the access prohibited area from the address “G” to “H”.
- a corresponding trap is generated, and the OS that receives the trap collects an access log.
- an application attempts to write illegally beyond the memory area allocated by the OS, a corresponding trap is generated, and the OS that receives the trap immediately generates a memory image (core file) for the application. And terminate abnormally. For this reason, it is possible to detect illegal writing at an early stage.
- the trap type reported by the hardware can be set according to the usage, and multiple types of traps are prepared, so that the access log is collected according to the area accessed by the application or the core of the corresponding application. You can change whether a file is created and terminated abnormally.
- the access prohibited area can be set with an arbitrary size without depending on the memory management unit of the OS. Further, as illustrated in FIG. 9, the disclosed information processing apparatus can set a plurality of access prohibited areas in the same page.
- each of the address setting registers 410 is configured to include a start address register in which the start address of the memory area is set and an end address register in which the end address of the memory area is set. Yes.
- each of the address setting registers 410 may be configured to include a start address register in which the start address of the memory area is set and an area size register in which the size of the memory area is set. .
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
- Storage Device Security (AREA)
Abstract
アプリケーションによる不当な書込みが行われようとした際にトラップを発生させるためのアクセス禁止領域のサイズをOSのメモリ管理単位に依存しない任意のサイズで設定することができるようにし、アライメントの調整も不要とすることで、メモリ資源を有効に活用することを可能としつつ、不当な書込みによるメモリの破壊を防止する情報処理装置。この情報処理装置は、アプリケーションからのメモリ割当て要求に応じて、アクセス可能領域を割当てるとともに、その直後に予め設定されたサイズのアクセス禁止領域を設け、該アクセス禁止領域をアドレス設定レジスタに設定し、かつ、当該禁止領域へのアクセスにより発生するトラップのタイプをトラップタイプ設定レジスタに設定する。この情報処理装置は、そのトラップが発生した場合、該アプリケーションのメモリイメージを生成して該アプリケーションを異常終了させる。
Description
本発明は、情報処理装置、及び、情報処理装置において不当な書込みによるメモリの破壊を防止するメモリ保護方法に関する。
情報処理装置のオペレーティングシステム(OS:Operating System)上で動作するアプリケーション(プロセス)は、メモリの動的割当て要求によりOSからメモリ領域を獲得する。その後、アプリケーションが、獲得されたメモリ領域以外の領域へ不当な書込みを行うことがある。その場合には、別の用途で使用されているメモリ領域が破壊されることとなるため、当該アプリケーションが誤動作し又は異常終了するなどのトラブルが発生する。
特に、アプリケーションが、獲得したメモリ領域を超える書込みを行うことにより、次の領域を破壊してしまうケースが多い。例えば、図1に示されるように、8バイトの領域しか獲得されていないにもかかわらず、9バイト分のデータが書込まれることで、獲得された領域の次の領域が1バイト破壊されるようなケースである。
このように、あるプロセス(処理)が不当な書込みによりメモリ領域を破壊した後に、当該プロセスがその破壊された領域を参照して誤動作又は異常終了する場合がある。その場合、不当な書込みを行ったプロセスとメモリ破壊を検出するプロセスとのタイミングが異なるため、原因の特定が困難となる。特に、不当な書込みが行われた時点から破壊された領域が参照される時点までの時間が長い場合には、メモリ破壊の原因の特定が更に困難となる。
不当な書込みによるメモリの破壊を防止するメモリ保護方法として、図2に示される従来技術が知られている。かかる従来技術は、その構成として、主記憶装置としてのメモリ200と、メモリを使用するアプリケーション210と、アプリケーションからの動的メモリ割当て要求に応じてメモリを割当てるOS220と、を含む。
アプリケーション210は、自らが使用するデータ領域を確保するため、OS220へメモリ割当て要求を発行する(ブロック212)。OS220は、アプリケーション210からのメモリ割当て要求に対して、メモリ領域202を確保するとともに、当該メモリ領域に連続するメモリ領域204に対しアクセス不可属性を設定する(ブロック222及び224)。
具体的には、このシステムでは、特定の大きさのメモリブロック単位でメモリ管理がされており、アプリケーション210からメモリ割当て要求が発行されると、OS220は一つのメモリブロック204にアクセス不可属性を設定する。そして、OS220は、メモリブロック204の直前のメモリブロックの終端を起点にして先頭に向かってアプリケーションが要求した大きさのメモリ領域202を確保する。
そして、OS220は、アプリケーション210にメモリ領域202を割当てる(ブロック226)。アプリケーション210は、メモリ領域202を割当てられると、メモリ領域202に対して書込みを行うことができる。しかし、アプリケーション210は、メモリ領域202を超えて、アクセス不可属性が設定された領域204へのアクセス要求を発行する場合がある(ブロック214)。その場合には、例外割込みが発生し、OS220は、アクセス例外処理を実行することでメモリ領域204への不当な書込みを防止する(ブロック228)。
図3は、図2に示される従来技術の問題点について説明するための図である。この従来技術では、アプリケーションからのメモリ割当て要求時に、必ずアクセス不可属性が設定されるメモリブロックが余分に確保される必要がある。このメモリブロックは、最小でもOSのメモリ管理単位(ページ、例えば、1ページ=8KBとする)となるため、メモリ資源の無駄が多い。
また、割当てられるメモリのアドレスはページ境界に合わせる必要がある。しかし、上述の従来技術のようにメモリブロックの終端を起点にして、先頭に向かって要求された大きさのメモリ領域を割当てる手法では、割当てられたメモリのアドレスがページ境界に合わない可能性がある。このようなアドレスにアクセスするとエラーが発生するため、メモリを余分に確保してアライメントを調整する必要がある。
本開示技術は、上述した問題点に鑑みてなされたものであり、その目的は、アプリケーションによる不当な書込みが行われようとした際にトラップを発生させるためのアクセス禁止領域のサイズをOSのメモリ管理単位に依存しない任意のサイズで設定することができるようにし、アライメントの調整も不要とすることで、メモリ資源を有効に活用することを可能としつつ、不当な書込みによるメモリの破壊を防止する情報処理装置及びそのメモリ保護方法を提供することにある。
上記目的を達成するために、本開示技術によれば、メモリ領域が設定される一又は複数のアドレス設定レジスタと、前記アドレス設定レジスタに対応して設けられトラップタイプが設定される一又は複数のトラップタイプ設定レジスタと、前記アドレス設定レジスタの各々に設定されたメモリ領域へのアクセス要求に応じて、対応するトラップタイプ設定レジスタに設定されたトラップタイプのトラップを生成するトラップ機構と、使用者からの入力に応じて、予めアクセス禁止領域サイズを設定する禁止領域サイズ設定手段と、アプリケーションからのメモリ割当て要求に応じて、該アプリケーションに対しメモリ領域をアクセス可能領域として割当てるとともに、該アクセス可能領域の直後に該アクセス禁止領域サイズを有するアクセス禁止領域を設け、該アクセス禁止領域を第一のアドレス設定レジスタに設定し、かつ、第一のトラップタイプを対応する第一のトラップタイプ設定レジスタに設定するメモリ割当て手段と、該第一のトラップタイプのトラップが発生した場合に、該アプリケーションのメモリイメージを生成して該アプリケーションを異常終了させる不当アクセス処理手段と、を具備する情報処理装置が提供される。
さらに、本開示技術の他の面によれば、上述の情報処理装置で実行されるメモリ保護方法と、情報処理装置に当該メモリ保護方法を実行させるプログラムと、が提供される。
開示の情報処理装置及びそのメモリ保護方法によれば、アプリケーションからのメモリ割当て要求時に、アプリケーションに割当てられたメモリ領域の直後にアクセス禁止領域が設けられ、そのアクセス禁止領域がアドレス設定レジスタに設定される。アプリケーションがアクセス禁止領域にアクセスしようとした際には、情報処理装置においてトラップが発生する。これにより、アプリケーションが獲得したメモリ領域のサイズを超える不当な書込みが行われようとした場合、即座に該当アプリケーションのメモリイメージ(コアファイル)が生成されて、該当アプリケーションが異常終了せしめられる。生成されたアプリケーションのメモリイメージを解析すれば、不当な書込みを行おうとしたプロセスが容易に特定される。
使用者は、アプリケーションによる不当な書込みが行われようとした際にトラップを発生させるためのアクセス禁止領域のサイズをOSのメモリ管理単位に依存しない任意のサイズで予め設定することができる。そのため、使用者は、不当な書込みによるメモリ破壊の想定サイズに応じてアクセス禁止領域のサイズを自由に変更することができる。また、アライメントの調整も必要でない。結果として、メモリ資源を有効に活用することが可能とされつつ、不当な書込みによるメモリの破壊が防止される。
400 CPU
410 アドレス設定レジスタ
420 トラップタイプ設定レジスタ
430 アドレスマッチ回路
440 アドレストラップ発生回路
460 メモリ
470 磁気ディスク装置
480 キーボード
490 ディスプレイ
410 アドレス設定レジスタ
420 トラップタイプ設定レジスタ
430 アドレスマッチ回路
440 アドレストラップ発生回路
460 メモリ
470 磁気ディスク装置
480 キーボード
490 ディスプレイ
以下、添付図面を参照して本実施形態について説明する。図4は、本開示技術による情報処理装置の一実施形態のハードウェア構成を示す図である。この情報処理装置は、CPU(Central Processing Unit:中央処理ら装置)400、メモリ460、磁気ディスク装置470、キーボード480及びディスプレイ490を含む。CPU400は、主記憶装置としてのメモリ460にロードされたOS及びアプリケーションを実行する。また、CPU400は、複数のアドレス設定レジスタ410、複数のトラップタイプ設定レジスタ420、アドレスマッチ回路430及びアドレストラップ発生回路440を備える。
複数のアドレス設定レジスタ410には、各々、メモリ領域を指定するためのアドレスが設定される。複数のトラップタイプ設定レジスタ420は、複数のアドレス設定レジスタ410に対応して設けられたものであり、その各々にはトラップタイプが設定される。ここで、トラップタイプとは、例外等の発生を誘引するトラップの種類を表す情報である。アドレスマッチ回路430及びアドレストラップ発生回路440は、アドレス設定レジスタ410の各々に設定されたメモリ領域へのアクセス要求に応じて、対応するトラップタイプ設定レジスタ420に設定されたトラップタイプのトラップを生成するトラップ機構である。
図5は、メモリ割当て時の処理を示すフローチャートである。なお、使用者が設定ファイルに記述する方法等により、アプリケーションに割当てられたメモリ領域の直後に設けられるべきアクセス禁止領域のサイズが予め設定されているものとする。
まず、アプリケーションが、OSに対してメモリ割当て要求を発行する(ブロック502)。それを受けて、OSは、要求されたメモリサイズを有するメモリ領域をアクセス可能領域として確保する(ブロック504)。次いで、OSは、確保したメモリ領域(アクセス可能領域)の開始アドレスと終了アドレスとをアドレス設定レジスタ410の一つに設定する(ブロック506)。
また、OSは、確保したメモリ領域に対し、アクセス可能領域が正常なアクセス要求によりアクセスされたことを表すトラップタイプとして例えば“#10”を対応するトラップタイプ設定レジスタ420に設定する(ブロック508)。なお、このトラップタイプは、当該情報処理装置において既に設けられている他のトラップタイプと重複しないように決定される。
次いで、OSは、使用者によって設定ファイルに予め記述されているアクセス禁止領域サイズを取得する(ブロック510)。そして、OSは、アプリケーションに割当てたメモリ領域の直後に、取得したアクセス禁止領域サイズを有するアクセス禁止領域を設け、そのアクセス禁止領域の開始アドレスと終了アドレスとをアドレス設定レジスタ410の他の一つに設定する(ブロック512)。
また、OSは、そのアクセス禁止領域に対して、不当なアクセス要求によりアクセスされたことを表すアクセス禁止領域用のトラップタイプとして例えば“#11”を対応するトラップタイプ設定レジスタ420に設定する(ブロック514)。なお、このトラップタイプは、当該情報処理装置において既に設けられている他のトラップタイプと重複しないように決定される。最後に、OSは、確保したメモリ領域(アクセス可能領域)を要求元のアプリケーションに割当てる(ブロック516)。以上でメモリ割当て処理が終了する。
図6は、メモリアクセス時の処理を示すフローチャートである。まず、アプリケーションが、メモリアクセスを伴う命令すなわちメモリアクセス要求を発行する(ブロック602)。すると、アドレスマッチ回路430が、そのメモリアクセス要求によるアクセスアドレスを、各アドレス設定レジスタ410に設定された開始アドレス及び終了アドレスと比較することにより、当該アクセスアドレスがアクセス可能領域内のアドレスか、及び、当該アクセスアドレスがアクセス禁止領域内のアドレスか、を判定する(ブロック604)。
このとき、当該アクセスアドレスがアクセス可能領域内のアドレスである場合には、正常に読出し又は書込み処理が実行される(ブロック606)。次いで、アドレストラップ発生回路440が、対応するトラップタイプ設定レジスタ420に設定された、正常なアクセス要求によりアクセスされたことを表すトラップタイプ“#10”のトラップを生成する(ブロック608)。OSは、このトラップを受けて、アクセスログの採取を実行する(ブロック610)。
一方、当該アクセスアドレスがアクセス禁止領域内のアドレスである場合、アドレストラップ発生回路440が、対応するトラップタイプ設定レジスタ420に設定された、不当なアクセス要求によりアクセスされたことを表すトラップタイプ“#11”のトラップを生成する(ブロック612)。OSは、このトラップを受けて、メモリアクセスを発行したプロセス(アプリケーション)のメモリイメージ(コアファイル)を生成して、該当プロセスを強制終了させる(ブロック614)。
図7は、メモリ領域の設定を例示する図である。図7に示される例では、アドレス“A”からアドレス“B”までのメモリ領域が、アプリケーションに割当てられたアクセス可能領域である。そして、当該アクセス可能領域に続くアドレス“C”からアドレス“D”までのメモリ領域が、当該アクセス可能領域に対応して設けられたアクセス禁止領域である。同様に、アドレス“E”からアドレス“F”までのメモリ領域がアクセス可能領域で、アドレス“G”からアドレス“H”までのメモリ領域がアクセス禁止領域である。
図8は、図7に示されるメモリ領域の設定に対応する動作について説明するための図である。各アドレス設定レジスタ410は、開始アドレスレジスタと終了アドレスレジスタとを含む。図7に示されるメモリ領域の設定に対応して、一つのアドレス設定レジスタ410の開始アドレスレジスタにはアドレス“A”が設定されるとともに、その終了アドレスレジスタにはアドレス“B”が設定される。更に、当該アドレス設定レジスタ410に対応するトラップタイプ設定レジスタ420には、アクセス可能領域用に用意された、正常なアクセス要求によりアクセスされたことを表すトラップタイプ“#10”が設定される。
もう一つのアドレス設定レジスタ410の開始アドレスレジスタにはアドレス“C”が設定されるとともに、その終了アドレスレジスタにはアドレス“D”が設定される。更に、当該アドレス設定レジスタ410に対応するトラップタイプ設定レジスタ420には、アクセス禁止領域用に用意された、不当なアクセス要求によりアクセスされたことを表すトラップタイプ“#11”が設定される。アドレス“E”から “F”までのアクセス可能領域、及び、アドレス“G”から“H”までのアクセス禁止領域についても同様である。
かくして、図7及び図8に示される例では、アドレス“A”から“B”までのメモリ領域又はアドレス“E”から “F”までのメモリ領域、すなわち、アクセス可能領域への正常なアクセス要求があった場合には、トラップタイプ“#10”のトラップが生成される。そのトラップを受けて、OSはメモリアクセスログを採取する。
一方、アドレス“C”から“D” までのメモリ領域又はアドレス“G”から“H”までのメモリ領域、すなわち、アクセス禁止領域へのアクセス要求があった場合には、不当なアクセス要求によりアクセスされたことを表すトラップタイプ“#11” のトラップが生成される。そのトラップを受けて、OSは、メモリイメージ(コアファイル)を作成するとともに該当プロセス(アプリケーション)を異常終了させる。
このように、本実施形態では、アプリケーションがOSから割当てられたメモリ領域をアクセスすると、対応するトラップが生成され、そのトラップを受信したOSが、アクセスログを採取する。一方、アプリケーションがOSから割当てられたメモリ領域を超えた不当な書込みを行おうとすると、対応するトラップが生成され、そのトラップを受信したOSが、即座に該当アプリケーションのメモリイメージ(コアファイル)を生成して異常終了させる。そのため、不当な書込みを早期に検出することが可能となる。
本開示技術では、用途に合わせてハードウェアが報告するトラップタイプが設定可能とされ、トラップの種類が複数用意されることで、アプリケーションがアクセスした領域によってアクセスログを採取するか又は該当アプリケーションのコアファイルを生成して異常終了させるかを変更することができる。
アプリケーションが獲得したメモリ領域以外の領域への不当な書込み要求がアプリケーションから発行されると、即座にアプリケーションのコアファイルが生成されてアプリケーションが異常終了せしめられる。そのため、不当な書込みを行おうとしたプロセスを容易に特定することができる。また、情報処理装置のトラップ機構を利用してメモリアクセスを監視することになるため、デバッガなどのソフトウェアで全てのメモリアクセスを監視する必要がなく、これによる性能劣化はほとんどない。
前述のように、図2及び図3に示される従来技術では、アプリケーションがメモリ割当て要求を発行する度に、OSのメモリ管理単位分(ページ、例えば、1ページ=8KBとする)の使用できない領域が発生していた。本開示技術では、OSのメモリ管理単位に依存せず、任意のサイズでアクセス禁止領域を設定することができるため、余分なメモリ確保は必要ない。また、図9に示されるように、開示の情報処理装置は、同一ページ内にアクセス禁止領域を複数設定することができる。
なお、本実施形態では、アドレス設定レジスタ410の各々は、メモリ領域の開始アドレスが設定される開始アドレスレジスタと、メモリ領域の終了アドレスが設定される終了アドレスレジスタと、を含むように構成されている。それに代えて、アドレス設定レジスタ410の各々が、メモリ領域の開始アドレスが設定される開始アドレスレジスタと、メモリ領域のサイズが設定される領域サイズレジスタと、を含むように構成することも可能である。
Claims (8)
- メモリ領域が設定されるアドレス設定レジスタと、
前記アドレス設定レジスタに対応して設けられトラップタイプが設定されるトラップタイプ設定レジスタと、
前記アドレス設定レジスタの各々に設定されたメモリ領域へのアクセス要求に応じて、対応するトラップタイプ設定レジスタに設定されたトラップタイプのトラップを生成するトラップ機構と、
使用者からの入力に応じて、予めアクセス禁止領域サイズを設定する禁止領域サイズ設定手段と、
アプリケーションからのメモリ割当て要求に応じて、該アプリケーションに対しメモリ領域をアクセス可能領域として割当てるとともに、該アクセス可能領域の直後に該アクセス禁止領域サイズを有するアクセス禁止領域を設け、該アクセス禁止領域を第一のアドレス設定レジスタに設定し、かつ、第一のトラップタイプを対応する第一のトラップタイプ設定レジスタに設定するメモリ割当て手段と、
該第一のトラップタイプのトラップが発生した場合に、該アプリケーションのメモリイメージを生成して該アプリケーションを異常終了させる不当アクセス処理手段と、
を具備する情報処理装置。 - 前記メモリ割当て手段は、アプリケーションにメモリ領域をアクセス可能領域として割当てる際、更に、該アクセス可能領域を第二のアドレス設定レジスタに設定し、かつ、第二のトラップタイプを対応する第二のトラップタイプ設定レジスタに設定し、
該情報処理装置は、該第二のトラップタイプのトラップが発生した場合にメモリアクセスのログを採取するメモリアクセスログ採取手段、を更に具備する、
請求項1に記載の情報処理装置。 - 前記アドレス設定レジスタの各々は、メモリ領域の開始アドレスが設定される開始アドレスレジスタと、メモリ領域の終了アドレスが設定される終了アドレスレジスタと、を含む、請求項1に記載の情報処理装置。
- 前記アドレス設定レジスタの各々は、メモリ領域の開始アドレスが設定される開始アドレスレジスタと、メモリ領域のサイズが設定される領域サイズレジスタと、を含む、請求項1に記載の情報処理装置。
- メモリ領域が設定されるアドレス設定レジスタと、
前記アドレス設定レジスタに対応して設けられトラップタイプが設定されるトラップタイプ設定レジスタと、
前記アドレス設定レジスタの各々に設定されたメモリ領域へのアクセス要求に応じて、対応するトラップタイプ設定レジスタに設定されたトラップタイプのトラップを生成するトラップ機構と、
を備える情報処理装置において、不当な書込みによるメモリの破壊を防止するメモリ保護方法であって、
禁止領域サイズ設定手段が、使用者からの入力に応じて、予めアクセス禁止領域サイズを設定するステップと、
メモリ割当て手段が、アプリケーションからのメモリ割当て要求に応じて、該アプリケーションに対しメモリ領域をアクセス可能領域として割当てるとともに、該アクセス可能領域の直後に該アクセス禁止領域サイズを有するアクセス禁止領域を設け、該アクセス禁止領域を第一のアドレス設定レジスタに設定し、かつ、第一のトラップタイプを対応する第一のトラップタイプ設定レジスタに設定するメモリ割当てステップと、
不当アクセス処理手段が、該第一のトラップタイプのトラップが発生した場合に、該アプリケーションのメモリイメージを生成して該アプリケーションを異常終了させるステップと、
を具備する、情報処理装置のメモリ保護方法。 - 前記メモリ割当てステップは、アプリケーションにメモリ領域をアクセス可能領域として割当てる際、更に、該アクセス可能領域を第二のアドレス設定レジスタに設定し、かつ、第二のトラップタイプを対応する第二のトラップタイプ設定レジスタに設定し、
該方法は、メモリアクセスログ採取手段が、該第二のトラップタイプのトラップが発生した場合にメモリアクセスのログを採取するステップ、を更に具備する、
請求項5に記載の情報処理装置のメモリ保護方法。 - メモリ領域が設定されるアドレス設定レジスタと、
前記アドレス設定レジスタに対応して設けられトラップタイプが設定されるトラップタイプ設定レジスタと、
前記アドレス設定レジスタの各々に設定されたメモリ領域へのアクセス要求に応じて、対応するトラップタイプ設定レジスタに設定されたトラップタイプのトラップを生成するトラップ機構と、
を備える情報処理装置に、不当な書込みによるメモリの破壊を防止するメモリ保護方法を実行させるプログラムであって、
使用者からの入力に応じて、予めアクセス禁止領域サイズを設定するステップと、
アプリケーションからのメモリ割当て要求に応じて、該アプリケーションに対しメモリ領域をアクセス可能領域として割当てるとともに、該アクセス可能領域の直後に該アクセス禁止領域サイズを有するアクセス禁止領域を設け、該アクセス禁止領域を第一のアドレス設定レジスタに設定し、かつ、第一のトラップタイプを対応する第一のトラップタイプ設定レジスタに設定するメモリ割当てステップと、
該第一のトラップタイプのトラップが発生した場合に、該アプリケーションのメモリイメージを生成して該アプリケーションを異常終了させるステップと、
を前記情報処理装置に実行させるプログラム。 - 前記メモリ割当てステップは、アプリケーションにメモリ領域をアクセス可能領域として割当てる際、更に、該アクセス可能領域を第二のアドレス設定レジスタに設定し、かつ、第二のトラップタイプを対応する第二のトラップタイプ設定レジスタに設定し、
該プログラムは、該第二のトラップタイプのトラップが発生した場合にメモリアクセスのログを採取するステップ、を更に前記情報処理装置に実行させる、
請求項7に記載のプログラム。
Priority Applications (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/JP2008/067100 WO2010032330A1 (ja) | 2008-09-22 | 2008-09-22 | 情報処理装置及びそのメモリ保護方法 |
JP2010529561A JP5392263B2 (ja) | 2008-09-22 | 2008-09-22 | 情報処理装置及びそのメモリ保護方法 |
US13/069,083 US20110173412A1 (en) | 2008-09-22 | 2011-03-22 | Data processing device and memory protection method of same |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/JP2008/067100 WO2010032330A1 (ja) | 2008-09-22 | 2008-09-22 | 情報処理装置及びそのメモリ保護方法 |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US13/069,083 Continuation US20110173412A1 (en) | 2008-09-22 | 2011-03-22 | Data processing device and memory protection method of same |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2010032330A1 true WO2010032330A1 (ja) | 2010-03-25 |
Family
ID=42039183
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/JP2008/067100 WO2010032330A1 (ja) | 2008-09-22 | 2008-09-22 | 情報処理装置及びそのメモリ保護方法 |
Country Status (3)
Country | Link |
---|---|
US (1) | US20110173412A1 (ja) |
JP (1) | JP5392263B2 (ja) |
WO (1) | WO2010032330A1 (ja) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2018092486A (ja) * | 2016-12-06 | 2018-06-14 | 日立オートモティブシステムズ株式会社 | 自動車用電子制御装置及びdmaコントローラの異常検知方法 |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8607210B2 (en) * | 2010-11-30 | 2013-12-10 | Micron Technology, Inc. | Code patching for non-volatile memory |
JP5914145B2 (ja) * | 2012-05-01 | 2016-05-11 | ルネサスエレクトロニクス株式会社 | メモリ保護回路、処理装置、およびメモリ保護方法 |
US9026720B2 (en) | 2013-02-07 | 2015-05-05 | Apple Inc. | Non-volatile memory monitoring |
US9529809B2 (en) * | 2013-10-17 | 2016-12-27 | International Business Machines Corporation | Managing log data using a circular fixed size file |
KR20190074691A (ko) * | 2017-12-20 | 2019-06-28 | 에스케이하이닉스 주식회사 | 반도체 장치 및 이를 포함하는 반도체 시스템 |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH03147028A (ja) * | 1989-11-01 | 1991-06-24 | Hitachi Ltd | メモリアクセス監視回路付マイクロコンピュータシステム |
JPH07191881A (ja) * | 1993-12-27 | 1995-07-28 | Nec Corp | 実時間メモリ監視方式 |
JP2002049531A (ja) * | 2000-08-03 | 2002-02-15 | Hitachi Ltd | メモリ領域境界検出方法及びコンピュータシステム |
JP2002055851A (ja) * | 2000-08-10 | 2002-02-20 | Himacs Ltd | コンピュータシステムにおける不正なメモリアクセスを検出する監視方法及びそのプログラム並びにその記録媒体 |
JP2003256237A (ja) * | 2002-02-27 | 2003-09-10 | Toshiba Corp | 割り込み発生装置、割り込み発生方法および割り込み発生プログラム |
JP2005338892A (ja) * | 2004-05-24 | 2005-12-08 | Toshiba Corp | メモリ異常使用検知装置 |
JP2006018705A (ja) * | 2004-07-05 | 2006-01-19 | Fujitsu Ltd | メモリアクセストレースシステムおよびメモリアクセストレース方法 |
JP2008041036A (ja) * | 2006-08-10 | 2008-02-21 | Sony Corp | メモリアクセス監視装置およびその方法 |
Family Cites Families (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5088036A (en) * | 1989-01-17 | 1992-02-11 | Digital Equipment Corporation | Real time, concurrent garbage collection system and method |
US5197130A (en) * | 1989-12-29 | 1993-03-23 | Supercomputer Systems Limited Partnership | Cluster architecture for a highly parallel scalar/vector multiprocessor system |
JP3260711B2 (ja) * | 1998-11-27 | 2002-02-25 | 甲府日本電気株式会社 | メモリパトロール方法と制御回路 |
US6934832B1 (en) * | 2000-01-18 | 2005-08-23 | Ati International Srl | Exception mechanism for a computer |
US20020065646A1 (en) * | 2000-09-11 | 2002-05-30 | Waldie Arthur H. | Embedded debug system using an auxiliary instruction queue |
JP2004013556A (ja) * | 2002-06-07 | 2004-01-15 | Matsushita Electric Ind Co Ltd | プロセッサ装置、コンパイル装置及びその方法 |
EP3001321B1 (en) * | 2004-02-05 | 2018-07-11 | BlackBerry Limited | Memory controller interface |
US7711937B1 (en) * | 2005-08-17 | 2010-05-04 | Oracle America, Inc. | Trap-based mechanism for tracking accesses of logical components |
US8108840B2 (en) * | 2006-01-12 | 2012-01-31 | International Business Machines Corporation | Method for enhancing debugger performance of hardware assisted breakpoints |
JP2008146542A (ja) * | 2006-12-13 | 2008-06-26 | Fujitsu Ltd | マルチプロセッサシステム、プロセッサ装置及び例外処理方法 |
-
2008
- 2008-09-22 WO PCT/JP2008/067100 patent/WO2010032330A1/ja active Application Filing
- 2008-09-22 JP JP2010529561A patent/JP5392263B2/ja active Active
-
2011
- 2011-03-22 US US13/069,083 patent/US20110173412A1/en not_active Abandoned
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH03147028A (ja) * | 1989-11-01 | 1991-06-24 | Hitachi Ltd | メモリアクセス監視回路付マイクロコンピュータシステム |
JPH07191881A (ja) * | 1993-12-27 | 1995-07-28 | Nec Corp | 実時間メモリ監視方式 |
JP2002049531A (ja) * | 2000-08-03 | 2002-02-15 | Hitachi Ltd | メモリ領域境界検出方法及びコンピュータシステム |
JP2002055851A (ja) * | 2000-08-10 | 2002-02-20 | Himacs Ltd | コンピュータシステムにおける不正なメモリアクセスを検出する監視方法及びそのプログラム並びにその記録媒体 |
JP2003256237A (ja) * | 2002-02-27 | 2003-09-10 | Toshiba Corp | 割り込み発生装置、割り込み発生方法および割り込み発生プログラム |
JP2005338892A (ja) * | 2004-05-24 | 2005-12-08 | Toshiba Corp | メモリ異常使用検知装置 |
JP2006018705A (ja) * | 2004-07-05 | 2006-01-19 | Fujitsu Ltd | メモリアクセストレースシステムおよびメモリアクセストレース方法 |
JP2008041036A (ja) * | 2006-08-10 | 2008-02-21 | Sony Corp | メモリアクセス監視装置およびその方法 |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2018092486A (ja) * | 2016-12-06 | 2018-06-14 | 日立オートモティブシステムズ株式会社 | 自動車用電子制御装置及びdmaコントローラの異常検知方法 |
Also Published As
Publication number | Publication date |
---|---|
US20110173412A1 (en) | 2011-07-14 |
JPWO2010032330A1 (ja) | 2012-02-02 |
JP5392263B2 (ja) | 2014-01-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7845006B2 (en) | Mitigating malicious exploitation of a vulnerability in a software application by selectively trapping execution along a code path | |
JP6129702B2 (ja) | 情報処理装置、情報処理システム、プログラム | |
US20050086517A1 (en) | Page granular curtained memory via mapping control | |
JP5392263B2 (ja) | 情報処理装置及びそのメモリ保護方法 | |
US11544223B2 (en) | Write operation verification method and apparatus | |
US20170364679A1 (en) | Instrumented versions of executable files | |
US20060218387A1 (en) | System and method for backup and recovery of data stored in a hard disk of a computer | |
US11226755B1 (en) | Core dump in a storage device | |
JP5716824B2 (ja) | マルチコアプロセッサシステム | |
CN108197041B (zh) | 一种确定子进程的父进程的方法、设备及其存储介质 | |
WO2015198600A1 (ja) | 解析装置、解析方法、および、解析プログラムが記録された記憶媒体 | |
US10339082B2 (en) | Technologies for stable secure channel identifier mapping for static and dynamic devices | |
JP2009169868A (ja) | 記憶領域アクセス装置及び記憶領域のアクセス方法 | |
JP7139926B2 (ja) | 電子デバイス、異常検知方法およびプログラム | |
US20080244335A1 (en) | Protecting memory operations involving zero byte allocations | |
JP2017208058A (ja) | 情報処理装置 | |
JP5920509B2 (ja) | コントローラの制御プログラム、およびコントローラの制御方法 | |
US8042176B2 (en) | Computer readable medium on which is stored a program for preventing the unauthorized use of program data | |
JP2002055851A (ja) | コンピュータシステムにおける不正なメモリアクセスを検出する監視方法及びそのプログラム並びにその記録媒体 | |
JP2012185547A (ja) | 改ざん検出装置、監視システム、改ざん検出方法、およびプログラム | |
JP2007034341A (ja) | コンピュータシステム及びそれに用いるプログラム実行環境実現方法並びにそのプログラム | |
JP7431776B2 (ja) | 情報処理装置、情報処理方法、およびプログラム | |
JP2009271597A (ja) | プロセッサ | |
JP4611659B2 (ja) | 不正アクセス検出装置、不正アクセス検出方法、プログラム | |
JP6364847B2 (ja) | 主記憶アクセス制御装置、主記憶アクセス制御システム、主記憶アクセス制御方法、及び、主記憶アクセス制御プログラム |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 08876985 Country of ref document: EP Kind code of ref document: A1 |
|
WWE | Wipo information: entry into national phase |
Ref document number: 2010529561 Country of ref document: JP |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 08876985 Country of ref document: EP Kind code of ref document: A1 |