JPH0442340A - Improper access preventing/detecting method for work memory - Google Patents

Improper access preventing/detecting method for work memory

Info

Publication number
JPH0442340A
JPH0442340A JP14910490A JP14910490A JPH0442340A JP H0442340 A JPH0442340 A JP H0442340A JP 14910490 A JP14910490 A JP 14910490A JP 14910490 A JP14910490 A JP 14910490A JP H0442340 A JPH0442340 A JP H0442340A
Authority
JP
Japan
Prior art keywords
memory
page
area
address
acquired
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.)
Pending
Application number
JP14910490A
Other languages
Japanese (ja)
Inventor
Kenichi Ishikawa
健一 石川
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.)
Fuji Electric Co Ltd
Fuji Facom Corp
Original Assignee
Fuji Electric Co Ltd
Fuji Facom 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 Fuji Electric Co Ltd, Fuji Facom Corp filed Critical Fuji Electric Co Ltd
Priority to JP14910490A priority Critical patent/JPH0442340A/en
Publication of JPH0442340A publication Critical patent/JPH0442340A/en
Pending legal-status Critical Current

Links

Landscapes

  • Storage Device Security (AREA)

Abstract

PURPOSE:To facilitate the check for the factor of breakage of a work memory by detecting an improper access given to a memory which is acquired and assigned with a memory assignment function in a step serving as a check mechanism using a memory return function. CONSTITUTION:A work memory is acquired for each page via a memory assignment function and the prescribed pattern data are previously stored in the areas except a requested area in a page of the acquired memory. At the same time, the address of the memory page, the data showing the position of a requested memory area, and the value of a program counter of the requester side are set and registered. Then a warning of an improper memory access is outputted together with the set and registered data if the address of the memory page to be returned via a memory return function is not coincident with the registered memory page address or the pattern data stored previously in the memory page has a change. Thus it is possible to know an area where the improper memory access is carried out to cause the breakage of the work memory.

Description

【発明の詳細な説明】[Detailed description of the invention] 【産業上の利用分野】[Industrial application field]

本発明はいわゆる作業用メモリ(即ちプログラムがその
処理のために一時的に使用するメモリで、その使用が終
われば他のプログラムがそのメモリを利用できるような
共同利用可能のメモリ)への他のプログラムの不当なア
クセスを防ぐ方法、および自プログラムが、自身の使用
できるメモリ領域外へ不当なアクセスをした場合にもこ
れを容易に検出する方法に関する。
The present invention provides a method for storing so-called working memory (i.e., memory that is temporarily used by a program for its processing, and that can be shared by other programs after its use is finished). The present invention relates to a method for preventing illegal access by a program, and a method for easily detecting when a program has illegally accessed a memory area outside its own usable memory area.

【従来の技術】[Conventional technology]

従来は、プログラムで割当てた作業用メモリに対するア
クセス権のチエツクは、この作業用メモリの割当がハー
ドウェア的に区分される単位(ページ単位という。この
ページ単位の容量は例えば64KBである。)で行われ
た場合には、このチエツクが行われ、割当てられたペー
ジ以外のページへ不当なアクセスが行われようとしたと
きには事前に警告が発せられるようになっているが、こ
のページ内のらKB、10KBといった一部の領域が作
業用メモリに割当てられた場合には、例えばこの割当て
を受けたプログラムがこのページ内の割当領域外を不当
にアクセスしてもそのチエツクは行われない。
Conventionally, access rights to working memory allocated by a program are checked in units in which the working memory allocation is divided in terms of hardware (referred to as page units. The capacity of this page unit is, for example, 64 KB). If this happens, this check will be performed, and a warning will be issued in advance if an attempt is made to illegally access a page other than the allocated page, but if there is a KB within this page. , 10 KB, etc., is allocated to the working memory, and even if a program that has received this allocation illegally accesses outside the allocated area within this page, the check will not be performed.

【発明が解決しようとする課題】[Problem to be solved by the invention]

従ってプログラムが、割当てられていない作業用メモリ
に対する不当なアクセスを行う場合があり、このような
アクセスを行うと、他プログラムのメモリ領域を破壊し
てしまい、他プログラムが誤動作し、誤動作の原因調査
のためにはプログラムの動作を全てチエツクしなければ
ならなかった。 そこで本発明はこのようなメモリ破壊を生ずるような作
業用メモリのアクセスを極力防止すると共に、仮に不当
なアクセスが行われたとしても作業用メモリ破壊原因の
調査を容易に行うことができるような作業用メモリの不
当アクセス防止および検出方法を提供することを課題と
する。
Therefore, a program may make illegal access to unallocated working memory, and when such access is made, the memory area of other programs is destroyed, causing other programs to malfunction, and it is necessary to investigate the cause of the malfunction. In order to do this, I had to check all the operations of the program. Therefore, the present invention prevents as much as possible access to the working memory that would cause such memory corruption, and also makes it possible to easily investigate the cause of the working memory corruption even if an illegal access is made. An object of the present invention is to provide a method for preventing and detecting unauthorized access to working memory.

【課題を解決するための手段】[Means to solve the problem]

前記の課題を解決するために本発明の方法は、作業用メ
モリの要求時、(メモリ割当関数100を介し)ページ
単位でこの作業用メモリを獲得し、この獲得したメモリ
ページ内の前記要求の領域を除く領域には所定のパター
ンデータを予め格納し、かつ少なくともこのメモリペー
ジのアドレス、要求したメモリ領域の位置を示すデータ
、要求元のプログラムカウンタの値を設定登録し、作業
用メモリの返却時、(メモリ返却関数200を介し)返
却対象のメモリページのアドレスが前記登録されたメモ
リページのアドレスに一致しないか、または当該メモリ
ページにおいて予め格納された前記パターンデータに変
化があるときは、不当メモリアクセスがあった旨の警告
を当該の前記設定登録データと共に出力するように鬼す
るものとする。
In order to solve the above problem, the method of the present invention, when a working memory is requested, acquires this working memory in page units (via the memory allocation function 100), and allocates the requested memory within the acquired memory page. Predetermined pattern data is stored in advance in the area other than the area, and at least the address of this memory page, data indicating the location of the requested memory area, and the value of the request source's program counter are set and registered, and the working memory is returned. When the address of the memory page to be returned (via the memory return function 200) does not match the address of the registered memory page, or when there is a change in the pattern data previously stored in the memory page, A warning to the effect that an illegal memory access has occurred is output together with the relevant setting registration data.

【作 用】[For use]

作業用メモリの要求時、その要求領域が小さく例えば5
KBであったとしても、ハードウェア的に区分されるペ
ージ単位の領域を獲得したうえ、その要求に応じたメモ
リ領域を割当てることで、プログラム間の不当アクセス
を防ぐ。さらにこの割当てられたページ中の当該プログ
ラムが要求した領域の残りの全領域には予め所定のパタ
ーンデータを埋め込んで置き、仮にこの領域に不当なア
クセスが行われた場合にも、その検出を容易にしたもの
である。
When requesting working memory, the required area is small, for example 5
Even if the size is KB, by acquiring an area in units of pages that are partitioned by hardware, and then allocating a memory area according to the request, illegal access between programs is prevented. Furthermore, predetermined pattern data is embedded in advance in all remaining areas of the area requested by the program in this allocated page, so that even if this area is accessed illegally, it can be easily detected. This is what I did.

【実施例】【Example】

第一図は本発明の実施例としての処理手順を示すフロー
チ・ヤードで、同図(A)はプログラムがその処理中、
作業用メモリを要求する際に呼出すサブルーチンとして
のメモリ割当関数100の手順を示し、同図(B)はプ
ログラムが作業用メモリの使用を終ったときに呼出すサ
ブルーチンとしてのメモリ返却関数200の手順を示す
。また以下符号101〜103は同図(A)中の、また
符号201〜205は同図(B)中のそれぞれのステッ
プを示す。 第1図(A)のメモリ割当関数100では、まず呼出し
元のプログラムから要求されたサイズのメモリを、保護
され、たメモリ領域からページ単位(メモリ保護される
単位)に切り上げて獲得しく101) 、要求されたメ
モリサイズ、前記ステップ101で獲得したメモリの先
頭アドレス、本関数の呼出し元のプログラムカウンタの
値を、それぞれ別に設けられた管理テーブルに設定する
(102)。 さらに獲得したメモリ内で要求されなかったサイズ分の
メモリ領域を特定パターンデータで埋める(103)。 なお呼出し元のプログラムがページ単位の領域を全て要
求するようにすれば、この関数100は不要となるが、
既存のアプリケーションプログラムの実質的な内容を変
更しないで済ますためには、このような関数100が有
効となる。 次に第1図(B)のメモリ返却関数200では、呼出し
元のプログラムから返却を要求されたメモリアドレスが
前記の管理テーブル内に設定されているか否かを調べ(
201) 、設定されたものでないか(分岐N)、また
は前述のメモリ割当関数100のステップ103で初期
化した(つまり特定パターンデータで埋めた)領域が変
更されているか否かを調べ(202) 、変更されてい
れば(分岐N)、不当なアクセスがあったとみなして、
エラーを通知する(205)。他方、上述の条件に合致
しなければ(201,分岐Y→2025分岐Y)、不当
なアクセスは行われなかったものとみなし、メモリ割当
関数100で獲得した領域を返却しく203) 、管理
テーブルの対応するエントリの情報を空にする(204
)。 これにより、メモリ割当関数100で獲得9割当てを行
ったメモリに対する不当なアクセスは、オペレーティン
グシステムの備えるメモリ保護機構か、あるいはメモリ
返却関数200でのチエツク機構としてのステップ20
5により検出することが可能になる。
Figure 1 shows a flowchart showing the processing procedure as an embodiment of the present invention.
The procedure of the memory allocation function 100 as a subroutine called when requesting working memory is shown, and (B) of the same figure shows the procedure of the memory return function 200 as a subroutine called when the program finishes using the working memory. show. In addition, hereinafter, reference numerals 101 to 103 indicate steps in FIG. 10A, and 201 to 205 indicate steps in FIG. 1B. The memory allocation function 100 in FIG. 1(A) first acquires memory of the size requested by the calling program from the protected memory area by rounding it up to the page unit (memory protected unit) (101). , the requested memory size, the memory start address acquired in step 101, and the value of the program counter of the caller of this function are set in separate management tables (102). Furthermore, a memory area of an unrequired size in the acquired memory is filled with specific pattern data (103). Note that if the calling program requests all the area in page units, this function 100 becomes unnecessary.
Such a function 100 is effective in order to avoid changing the substantial contents of an existing application program. Next, the memory return function 200 in FIG. 1(B) checks whether the memory address requested to be returned by the calling program is set in the management table or not (
201), check whether the area has been set (branch N) or whether the area initialized (that is, filled with specific pattern data) in step 103 of the memory allocation function 100 described above has been changed (202) , if it has been changed (branch N), it is assumed that there has been an unauthorized access,
Notify the error (205). On the other hand, if the above conditions are not met (201, branch Y → 2025 branch Y), it is assumed that no illegal access has been made, and the area acquired by the memory allocation function 100 is returned.203), the management table is Empty the information of the corresponding entry (204
). As a result, illegal access to the memory acquired and allocated by the memory allocation function 100 can be prevented by the memory protection mechanism provided by the operating system or by the check mechanism in step 20 of the memory return function 200.
5 makes it possible to detect.

【発明の効果】【Effect of the invention】

本発明によれば、作業用メモリの要求時、メモリ割当関
数100を介しページ単位でこの作業用メモリを獲得し
、この獲得したメモリページ内の前記要求の領域を除く
領域には所定のパターンデータを予め格納し、かつ少な
くともこのメモリページのアドレス、要求したメモリ領
域の位置を示すデータ、要求元のプログラムカウンタの
値を設定登録し、 作業用メモリの返却時、メモリ返却関数200を介し返
却対象のメモリページのアドレスが前記登録されたメモ
リページのアドレスに一致しないか、または当該メモリ
ページにおいて予め格納された前記パターンデータに変
化があるときは、不当メモリアクセスがあった旨の警告
を当該の前記設定登録データと共に出力するようにした
ので、作業用メモリ破壊の原因となる不当なメモリアク
セスの実行箇所がわかるようになる。
According to the present invention, when a working memory is requested, this working memory is acquired in page units via the memory allocation function 100, and predetermined pattern data is stored in the acquired memory page in an area other than the requested area. is stored in advance, and at least the address of this memory page, data indicating the location of the requested memory area, and the value of the request source's program counter are set and registered, and when the working memory is returned, the return target is sent via the memory return function 200. If the address of the memory page does not match the address of the registered memory page, or if there is a change in the pattern data pre-stored in the memory page, a warning that there has been an illegal memory access is sent to the memory page. Since the information is output together with the setting registration data, it becomes possible to identify the location where illegal memory accesses are being made that cause the destruction of the working memory.

【図面の簡単な説明】[Brief explanation of drawings]

Claims (1)

【特許請求の範囲】 1)作業用メモリの要求時、ページ単位でこの作業用メ
モリを獲得し、この獲得したメモリページ内の前記要求
の領域を除く領域には所定のパターンデータを予め格納
し、かつ少なくともこのメモリページのアドレス、要求
したメモリ領域の位置を示すデータ、要求元のプログラ
ムカウンタの値を設定登録し、 作業用メモリの返却時、返却対象のメモリページのアド
レスが前記登録されたメモリページのアドレスに一致し
ないか、または当該メモリページにおいて予め格納され
た前記パターンデータに変化があるときは、不当メモリ
アクセスがあった旨の警告を当該の前記設定登録データ
と共に出力するようにしたことを特徴とする作業用メモ
リの不当アクセス防止および検出方法。
[Scope of Claims] 1) When a working memory is requested, this working memory is acquired in page units, and predetermined pattern data is stored in advance in an area other than the requested area within the acquired memory page. , and at least set and register the address of this memory page, data indicating the location of the requested memory area, and the value of the request source's program counter, and when returning the working memory, the address of the memory page to be returned is registered as described above. If the address of the memory page does not match, or if there is a change in the pattern data stored in advance in the memory page, a warning to the effect that there has been an illegal memory access is output together with the configuration registration data. A method for preventing and detecting unauthorized access to working memory, characterized by:
JP14910490A 1990-06-07 1990-06-07 Improper access preventing/detecting method for work memory Pending JPH0442340A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP14910490A JPH0442340A (en) 1990-06-07 1990-06-07 Improper access preventing/detecting method for work memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP14910490A JPH0442340A (en) 1990-06-07 1990-06-07 Improper access preventing/detecting method for work memory

Publications (1)

Publication Number Publication Date
JPH0442340A true JPH0442340A (en) 1992-02-12

Family

ID=15467786

Family Applications (1)

Application Number Title Priority Date Filing Date
JP14910490A Pending JPH0442340A (en) 1990-06-07 1990-06-07 Improper access preventing/detecting method for work memory

Country Status (1)

Country Link
JP (1) JPH0442340A (en)

Similar Documents

Publication Publication Date Title
US5564040A (en) Method and apparatus for providing a server function in a logically partitioned hardware machine
US5230069A (en) Apparatus and method for providing private and shared access to host address and data spaces by guest programs in a virtual machine computer system
KR960024987A (en) Cache Memory with Reduced Request Blocking
US20020152428A1 (en) Digital processing system including a DMA controller operating in the virtual address domain and a method for operating the same
US7412705B2 (en) Method for inter partition communication within a logical partitioned data processing system
KR102044075B1 (en) Memory error detection method
US6081876A (en) Memory error containment in network cache environment via restricted access
JPH0133857B2 (en)
JP2002149495A (en) Memory management system and its method, and recording medium with the method recorded thereon
EP0175398A2 (en) Data processing system comprising a memory access controller which is provided for combining descriptor bits of different descriptors associated with virtual addresses
JPH10289158A (en) Task management device
JPH0442340A (en) Improper access preventing/detecting method for work memory
CN116166609A (en) Dynamic management of memory firewalls
JPS61105656A (en) Information processing device
US7979634B2 (en) Apparatus and method for preventing double allocation, and medium for recording its allocation program
US7627869B2 (en) Hardware register access via task tag ID
US20040243751A1 (en) Method for resource access co-ordination in a data processing system, data processing system and computer program
JP2828252B2 (en) File access control method
CN112363796B (en) Virtual machine shared memory allocation method and device and electronic equipment
JP2533931B2 (en) Data contents protection method of dynamic allocation area
JPS62208149A (en) Secret protecting system
JPS62219046A (en) Storage protection system
JPS6250863B2 (en)
JPH02146632A (en) Destruction preventing system for sharing data area of electronic computer system
JPH0540692A (en) Duplicate area managing system