JP4732921B2 - Program correctness verification device - Google Patents
Program correctness verification device Download PDFInfo
- Publication number
- JP4732921B2 JP4732921B2 JP2006048031A JP2006048031A JP4732921B2 JP 4732921 B2 JP4732921 B2 JP 4732921B2 JP 2006048031 A JP2006048031 A JP 2006048031A JP 2006048031 A JP2006048031 A JP 2006048031A JP 4732921 B2 JP4732921 B2 JP 4732921B2
- Authority
- JP
- Japan
- Prior art keywords
- program
- result
- memory
- data
- held
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Storage Device Security (AREA)
Description
本発明は、プログラム正当性検証装置に係り、特に、メモリに保持されたプログラムの正当性を検証するのに好適なプログラム正当性検証装置に関する。 The present invention relates to a program validity verification apparatus, and more particularly to a program validity verification apparatus suitable for verifying the validity of a program held in a memory.
従来から、OS等のプログラム本体を起動する前には、CPUが、ブートローダ等のプログラムを実行することによって、FlashROMやRAM等のメモリに展開されて保持された状態のプログラム本体(すなわちプログラム本体イメージ)が破損しているか否かを検証するプログラム本体イメージの正当性の検証を行っていた。 Conventionally, before starting a program main body such as an OS, the CPU executes a program such as a boot loader so that the program main body is expanded and held in a memory such as FlashROM or RAM (that is, a program main body image). ) Was verified for the validity of the program image.
このプログラム本体イメージの正当性の検証には、いわゆるチェックサムが用いられ、CPUは、プログラム本体イメージのチェックサムを計算し、この計算結果を予め記憶された正しいチェックサムと照合するようになっていた。 A so-called checksum is used to verify the validity of the program body image, and the CPU calculates a checksum of the program body image and compares the calculation result with a correct checksum stored in advance. It was.
この照合の結果、CPUは、チェックサムの計算結果と、予め記憶された正しいチェックサムとが一致する場合には、プログラム本体イメージが破損のない正当なものであるとみなし、一致しない場合には、プログラム本体イメージが正当でない(破損している)とみなすようになっていた。 As a result of this collation, when the checksum calculation result matches the correct checksum stored in advance, the CPU regards the program body image as a legitimate one that is not damaged. The program body image was considered invalid (damaged).
そして、CPUは、プログラム本体イメージが正当である場合には、プログラム本体を実行し、プログラム本体イメージが正当でない(破損している)場合には、プログラム本体を、2次記憶メモリ等から復元するようになっていた。 The CPU executes the program body when the program body image is valid, and restores the program body from the secondary storage memory or the like when the program body image is not valid (damaged). It was like that.
しかしながら、近年は、プログラムの複雑化にともなうプログラム本体イメージの巨大化により、チェックサムの計算によるプログラム本体イメージの正当性の検証に長い時間がかかり、これによって、プログラム本体の実行が遅延されるといった問題が生じていた。 However, in recent years, due to the enormous size of the program body image as the program becomes more complicated, it takes a long time to verify the validity of the program body image by calculating the checksum, which delays the execution of the program body. There was a problem.
例えば、従来は、プログラム本体イメージは破損していないにもかかわらず、チェックサムの計算に要する時間によって、チェックサムの計算の開始からプログラム本体の実行までに数秒程度の時間がかかってしまうことがあった。 For example, in the past, although the image of the program body has not been damaged, it may take several seconds from the start of the checksum calculation to the execution of the program body depending on the time required for the checksum calculation. there were.
そこで、本発明は、このような問題点に鑑みなされたものであり、プログラムの正当性の検証を迅速に行うことによって正当なプログラムをすみやかに実行することができ、ひいては、システムの起動時間を短縮することができるプログラム正当性検証装置を提供することを目的とするものである。 Therefore, the present invention has been made in view of such a problem, and it is possible to promptly execute a legitimate program by quickly verifying the legitimacy of the program, thereby reducing the startup time of the system. An object of the present invention is to provide a program validity verification device that can be shortened.
前述した目的を達成するため、本発明に係るプログラム正当性検証装置は、メモリに保持されたプログラムの正当性を検証するプログラム正当性検証装置であって、前記メモリに保持されたプログラムに対して所定の演算を行うグラフィックアクセラレータを備え、前記メモリに保持されたプログラムが正当な場合における前記所定の演算によって得られる結果を予め用意しておき、前記グラフィックアクセラレータによる前記メモリに保持されたプログラムに対する前記所定の演算の結果が、前記予め用意された結果と一致する場合に、前記メモリに保持されたプログラムが正当であるとみなすように形成されていることを特徴としている。そして、このような構成によれば、グラフィックアクセラレータにより、メモリに保持されたプログラムに対して、このプログラムを画像として扱った所定の演算を行い、この所定の演算の結果が予め用意された結果(正当なプログラムに対応する結果)と一致するか否かに基づいて、メモリに保持されたプログラムの正当性を迅速に検証することが可能となる。 In order to achieve the above object, a program correctness verification apparatus according to the present invention is a program correctness verification apparatus for verifying the correctness of a program held in a memory, and for the program held in the memory A graphic accelerator for performing a predetermined calculation; a result obtained by the predetermined calculation when the program held in the memory is valid; prepared in advance; and the program for the program held in the memory by the graphic accelerator It is characterized in that the program stored in the memory is regarded as valid when the result of a predetermined calculation matches the result prepared in advance. According to such a configuration, the graphic accelerator performs a predetermined operation in which the program is handled as an image with respect to the program held in the memory, and the result of the predetermined operation is prepared in advance ( It is possible to quickly verify the validity of the program held in the memory based on whether or not the result matches the result of the legitimate program.
また、本発明に係るプログラム正当性検証装置は、前記所定の演算が、排他的論理和(XOR)を含むことを特徴としている。そして、このような構成によれば、演算が簡便かつプログラムの破損の検出に好適な演算結果を得ることができる排他的論理和を用いることによって、メモリに保持されたプログラムの正当性をより迅速かつ適切に検証することが可能となる。 The program validity verification apparatus according to the present invention is characterized in that the predetermined operation includes an exclusive OR (XOR). According to such a configuration, the validity of the program held in the memory can be more quickly achieved by using exclusive OR that is easy to calculate and can obtain a calculation result suitable for detecting program breakage. And it becomes possible to verify appropriately.
さらに、本発明に係るプログラム正当性検証装置は、前記所定の演算が、ラスタ演算(raster operation)とされていることを特徴としている。そして、このような構成によれば、メモリに保持されたプログラムの正当性を、ラスタ演算を用いてさらに高速に検証することが可能となる。 Furthermore, the program correctness verification apparatus according to the present invention is characterized in that the predetermined calculation is a raster operation. According to such a configuration, it is possible to verify the validity of the program held in the memory at a higher speed using the raster operation.
さらにまた、本発明に係るプログラム正当性検証装置は、前記所定の演算に用いられる設定された初期値を有するデータが格納されたワークメモリを用意するように形成され、前記グラフィックアクセラレータが、前記メモリに保持されたプログラムにおける1ブロック分のプログラムと、前記ワークメモリに格納された前記データの全部または一部を読み込み、読み込まれた前記1ブロック分のプログラムと前記データの全部または一部を用いて論理演算を行い、この論理演算の結果を前記ワークメモリに格納して前記ワークメモリに格納された前記データを更新するといった一連の処理を、前記メモリに保持されたプログラムにおけるすべてのブロックに至るまで順次繰り返すことによって、前記所定の演算を行うように形成され、前記一連の処理の繰り返しによって前記ワークメモリに最終的に格納された前記データが、前記所定の演算の結果とされていることを特徴としている。そして、このような構成によれば、一般的なグラフィックアクセラレータが備えているソースデータとデスティネーションデータとの論理演算を行う機能を活用して、メモリに保持されたプログラムをソースデータとし、ワークメモリに格納されたデータをデスティネーションデータとした論理演算を含む一連の処理(換言すれば、ワークメモリへの描画)を繰り返すことによって所定の演算を行うことが可能となる。この所定の演算の結果は、ワークメモリに最終的に格納されたデータ(換言すれば、ワークメモリへの最終描画結果)として取得することができる。そして、このようにして取得された所定の演算の結果と、予め用意された結果との一致の有無に基づいて、メモリに保持されたプログラムの正当性をより正確に検証することが可能となる。 Furthermore, the program correctness verification apparatus according to the present invention is formed so as to prepare a work memory storing data having a set initial value used for the predetermined calculation, and the graphic accelerator includes the memory A program for one block in the program held in the memory and all or part of the data stored in the work memory are read, and the program for one block and all or part of the data read are used. A series of processes such as performing a logical operation, storing the result of the logical operation in the work memory, and updating the data stored in the work memory is performed up to all blocks in the program held in the memory. It is formed so as to perform the predetermined calculation by repeating sequentially, The data by repeating the processing of the communication is ultimately stored in the work memory is characterized by being the result of said predetermined operation. According to such a configuration, a program held in the memory is used as the source data by utilizing a function of performing a logical operation between the source data and the destination data provided in a general graphic accelerator, and the work memory It is possible to perform a predetermined operation by repeating a series of processing (in other words, drawing to a work memory) including a logical operation using the data stored in the destination data as destination data. The result of the predetermined calculation can be acquired as data finally stored in the work memory (in other words, the final drawing result in the work memory). Then, it is possible to more accurately verify the validity of the program held in the memory based on whether or not the result of the predetermined calculation acquired in this way matches the result prepared in advance. .
また、本発明に係るプログラム正当性検証装置は、前記所定の演算の結果と、前記予め用意された結果とが、それぞれ、複数個の画素データによって形成され、前記グラフィックアクセラレータが、前記所定の演算の結果と前記予め用意された結果との排他的論理和を、双方の結果における互いに対応する画素データの組ごとに計算するように形成され、この排他的論理和の計算結果が、すべての画素データの組において0に相当する結果となる場合に、前記所定の演算の結果が前記予め用意された結果と一致すると判定して、前記メモリに保持されたプログラムが正当であるとみなすように形成されていることを特徴としている。そして、このような構成によれば、グラフィックアクセラレータにより、所定の演算の結果と予め用意された結果との排他的論理和を計算することで、メモリに保持されたプログラムの正当性を容易に検証することが可能となる。 In the program validity verification apparatus according to the present invention, the result of the predetermined calculation and the result prepared in advance are each formed by a plurality of pixel data, and the graphic accelerator is configured to perform the predetermined calculation. And the result prepared in advance are calculated for each set of pixel data corresponding to each other in both results, and the calculation result of this exclusive OR is calculated for all pixels. When a result corresponding to 0 is obtained in a data set, it is determined that the result of the predetermined calculation matches the result prepared in advance, and the program stored in the memory is regarded as valid. It is characterized by being. According to such a configuration, the graphic accelerator can easily verify the validity of the program held in the memory by calculating the exclusive OR of the result of the predetermined operation and the result prepared in advance. It becomes possible to do.
さらに、本発明に係るプログラム正当性検証装置は、前記所定の演算の結果と、前記予め用意された結果とが、それぞれ、複数個の画素データによって形成され、前記予め用意された結果におけるすべての画素データが、0に相当するデータとされ、前記ワークメモリに格納された前記データの前記初期値が、前記予め用意された結果に対応する値とされ、前記メモリに保持されたプログラムに対する前記所定の演算の結果におけるすべての画素データが0に相当するデータとなる場合に、前記所定の演算の結果が前記予め用意された結果と一致すると判定して、前記メモリに保持されたプログラムが正当であるとみなすように形成されていることを特徴としている。そして、このような構成によれば、グラフィックアクセラレータによる所定の演算の結果におけるすべての画素データが0に相当するデータとなるか否かに基づいて、メモリに保持されたプログラムの正当性をさらに迅速に検証することが可能となる。 Furthermore, in the program validity verification apparatus according to the present invention, the result of the predetermined calculation and the result prepared in advance are each formed by a plurality of pixel data, and all the results in the result prepared in advance are included. Pixel data is data corresponding to 0, the initial value of the data stored in the work memory is a value corresponding to the previously prepared result, and the predetermined value for the program held in the memory When all the pixel data in the result of the calculation is data corresponding to 0, it is determined that the result of the predetermined calculation matches the result prepared in advance, and the program held in the memory is valid. It is characterized by being formed to be considered to be. According to such a configuration, the validity of the program held in the memory can be further quickly determined based on whether or not all pixel data in the result of the predetermined calculation by the graphic accelerator becomes data corresponding to 0. Can be verified.
本発明に係るプログラム正当性検証装置によれば、グラフィックアクセラレータの演算機能を用いてメモリに保持されたプログラムの正当性の検証を迅速に行うことによって、正当なプログラムをすみやかに実行することができ、ひいては、システムの起動時間を短縮することができる。 According to the program correctness verification apparatus according to the present invention, it is possible to promptly execute a legitimate program by quickly verifying the correctness of the program held in the memory using the arithmetic function of the graphic accelerator. As a result, the startup time of the system can be shortened.
さらに、本発明によれば、グラフィックアクセラレータの演算機能を用いてメモリに保持されたプログラムの正当性の検証を行うことによって、CPUの負担を軽減してCPUに空き時間を確保することができるので、メモリに保持されたプログラムの正当性の検証が行われている最中においても、既に正当であるとみなされたプログラムをCPUによってすみやかに実行することができる。 Furthermore, according to the present invention, the validity of the program held in the memory is verified by using the arithmetic function of the graphic accelerator, thereby reducing the burden on the CPU and ensuring the CPU free time. Even while the validity of the program held in the memory is being verified, the program that has already been considered valid can be executed immediately by the CPU.
以下、本発明に係るプログラム正当性検証装置の実施形態について、図1乃至図3を参照して説明する。 Hereinafter, an embodiment of a program validity verification apparatus according to the present invention will be described with reference to FIGS. 1 to 3.
図1は、本実施形態におけるプログラム正当性検証装置1のハードウェア構成を示したものであり、この図1に示すように、本実施形態におけるプログラム正当性検証装置1は、FlashROMやRAM等のメモリ2と、CPU3と、グラフィックアクセラレータ4とを有している。
FIG. 1 shows a hardware configuration of a program
メモリ2には、ハードディスクドライブ等の図示しない記憶装置から読み込まれたプログラムとしてのOS等のプログラム本体が、プログラム本体イメージとして保持されている。なお、プログラム本体を記憶装置から読み込んでメモリ2に保持する処理は、ブートローダ等のプログラム本体以外のプログラムによって行われるようになっている。
The
グラフィックアクセラレータ4は、メモリ2に保持されたプログラム本体イメージに対して、このプログラム本体イメージを画像として扱った所定の演算を行い、演算結果(以下、所定演算結果と称する)をメモリ2に格納するようになっている。
The
また、メモリ2には、予め用意された結果として、メモリ2に保持されたプログラム本体イメージが正当な場合(破損がない場合)における前記所定の演算によって得られる結果(以下、正当結果と称する)が格納されている。
In addition, as a result prepared in advance in the
CPU3は、所定演算結果が正当結果と一致する場合に、メモリ2に保持されたプログラム本体イメージが正当であるとみなすようになっている。
The
具体的には、図2に示すように、グラフィックアクセラレータ4は、前記所定の演算の際に、プログラム本体イメージ5を、複数個のブロックに分割された1ブロック分のプログラム本体イメージ5a〜5eの集合として認識するようになっている。なお、図2におけるプログラム本体イメージ5は、第1番目の1ブロック分のプログラム本体イメージ5aから第5番目の1ブロック分のプログラム本体イメージ5eまでの5個の1ブロック分のプログラム本体イメージ5a〜5eによって構成されている。また、図2に示すように、プログラム本体イメージ5は、2進数の場合には、0または1の値によって表現することができる。
Specifically, as shown in FIG. 2, the
グラフィックアクセラレータ4は、このようなプログラム本体イメージ5を前記所定の演算の際に画像として扱い、1ブロック分のプログラム本体イメージ5a〜5eを、複数個の画素データの集合として捉えるようになっている。
The
例えば、1ブロック分のプログラム本体イメージ5a〜5eを、64行×64列(512Byte)のデータと仮定し、グラフィックアクセラレータ4が、1Bitで1画素を表すと仮定した場合には、1ブロック分のプログラム本体イメージ5a〜5eは、4096個分の画素データからなる白黒(2値)画像として捉えることができる。
For example, if it is assumed that the program body images 5a to 5e for one block are data of 64 rows × 64 columns (512 bytes) and the
この場合、1ブロック分のプログラム本体イメージ5a〜5eにおける「1」の値をとるデータは、白黒画像における白色の画素データとして捉えられ、1ブロック分のプログラム本体イメージ5a〜5eにおける「0」の値をとるデータは、黒色の画素データとして捉えられる。 In this case, data having a value of “1” in the program main body images 5a to 5e for one block is regarded as white pixel data in the black and white image, and “0” in the program main body images 5a to 5e for one block. Data that takes a value is taken as black pixel data.
また、図2に示すように、メモリ2内には、CPU3によってワークメモリ7が用意されており、このワークメモリ7には、前記所定の演算に用いられる所定の初期値が設定されたデータが格納されている。
As shown in FIG. 2, a work memory 7 is prepared in the
このワークメモリ7に格納されたデータ(以下、ワークメモリ内データ8と称する)は、複数個の画素データによって形成されている。 Data stored in the work memory 7 (hereinafter referred to as work memory data 8) is formed by a plurality of pixel data.
本実施形態において、ワークメモリ内データ8の初期値は、ワークメモリ内データ8におけるすべての画素データが、1画素を1Bitで表現する場合における「0」に相当する黒色のデータとなるような値(以下、初期値0と称する)とされている。
In this embodiment, the initial value of the
したがって、図2に示すように、初期値0のワークメモリ内データ8は、全面黒色の画像として表現される。
Therefore, as shown in FIG. 2, the
また、本実施形態において、ワークメモリ内データ8は、1ブロック分のプログラム本体イメージ5a〜5eとデータのサイズが同一とされており、ワークメモリ内データ8の画素データの個数は、1ブロック分のプログラム本体イメージにおける画素データの個数と同行同列の同数とされている。
In this embodiment, the
さらに、図2に示すように、メモリ2内の領域には、前述した正当結果9が予め格納されており、この正当結果9は、ワークメモリ内データ8と同行同列の同数の画素データによって形成されている。
Further, as shown in FIG. 2, the above-described valid result 9 is stored in advance in the area in the
グラフィックアクセラレータ4は、前記所定の演算を開始すると、図2における(1)の番号が付された矢印に示すように、メモリ2から、第1番目の1ブロック分のプログラム本体イメージ5aを読み込むようになっている。
When the
また、このとき、グラフィックアクセラレータ4は、図2における(2)の番号が付された矢印に示すように、ワークメモリ7から、初期値0が設定されたワークメモリ内データ8を読み込むようになっている。
At this time, the
そして、グラフィックアクセラレータ4は、図2における(3)の番号に示すように、読み込まれた1ブロック分のプログラム本体イメージ5aと、ワークメモリ内データ8との間で、互いに対応する同行同列に位置する画素データの組ごとに、論理演算としての排他的論理和(XOR)を計算するようになっている。
The
例えば、1ブロック分のプログラム本体イメージ5aにおける第m行第n列目の画素データは、ワークメモリ内データ8における第m行第n列目の画素データとの間で排他的論理和が計算されるようになっている。
For example, an exclusive OR is calculated between the pixel data of the m-th row and the n-th column in the program main body image 5a for one block and the pixel data of the m-th row and the n-th column in the
ここで、排他的論理和は、1Bitのデータで考えると、演算に係る2つのデータの値が互いに等しい場合(「0」同士または「1」同士の場合)には0となり、互いに異なる場合(一方が「0」、他方が「1」の場合)には1となる。したがって、例えば、1ブロック分のプログラム本体イメージ5aにおける第m行第n列目の画素データが、「1」に相当する白色のデータで、ワークメモリ内データ8における第m行第n列目の画素データが、「0」に相当する黒色のデータの場合には、排他的論理和は「1」に相当する白色のデータとなる。
Here, when the exclusive OR is considered with 1-bit data, when the values of the two data related to the calculation are equal to each other (in the case of “0” or “1”), they are 0 and are different from each other ( 1 when one is “0” and the other is “1”. Therefore, for example, the pixel data of the m-th row and the n-th column in the program body image 5a for one block is white data corresponding to “1”, and the m-th row and the n-th column in the
なお、この排他的論理和は、1つの画素データが1Bitで表現される場合には、ラスタ演算となる。 This exclusive OR is a raster operation when one pixel data is expressed by 1 bit.
そして、グラフィックアクセラレータ4は、図2における(4)の番号が付された矢印に示すように、前記画素データの組ごとの排他的論理和の結果を、ワークメモリ7におけるワークメモリ内データ8を読み込んだ位置と同じ位置に格納(上書き)するようになっている。
Then, as shown by the arrow numbered (4) in FIG. 2, the
例えば、第m行第n列目の画素データの組を用いた排他的論理和の結果は、ワークメモリ7における第m行第n列目の画素の位置に格納されることになる。 For example, the result of the exclusive OR using the pixel data set of the m-th row and the n-th column is stored at the pixel position of the m-th row and the n-th column in the work memory 7.
これにより、図2に示すように、ワークメモリ内データ8が更新され、第1回目の排他的論理和の結果が、ワークメモリ7内に白黒画像として描画されることになる。
As a result, as shown in FIG. 2, the
次に、グラフィックアクセラレータ4は、図2における(5)の番号が付された矢印に示すように、メモリ2から第2番目の1ブロック分のプログラム本体イメージ5bを読み込むようになっている。
Next, the
そして、グラフィックアクセラレータ4は、この第2番目の1ブロック分のプログラム本体イメージ5bに対しても、第1番目のときと同様に、ワークメモリ内データ8との排他的論理和を互いに対応する同行同列に位置する画素データの組ごとに計算し、その結果をワークメモリ7に格納するようになっている。
Then, the
このような一連の処理が、第5番目(最後)のプログラム本体イメージ5eに至るまで順次繰り返し行われることによって、前記所定演算結果として、ワークメモリ7に最終的に格納されたワークメモリ内データ8(最終描画結果)が取得されるようになっている。
Such a series of processing is sequentially repeated until reaching the fifth (last) program body image 5e, whereby the
そして、CPU3は、図2における(6)の番号が付された矢印に示すように、ワークメモリ7に格納された所定演算結果と、正当結果9とを比較し、双方の結果が一致する場合には、メモリ2に格納されたプログラム本体イメージ5が破損のない正当なものであるとみなすようになっている。
Then, the
このように、本実施形態においては、グラフィックアクセラレータ4により、メモリ2に保持されたプログラム本体イメージ5に対して、このプログラム本体イメージ5を画像として扱った所定の演算を行い、所定演算結果が正当結果9と一致するか否かに基づいて、メモリ2に保持されたプログラム本体イメージの正当性を迅速に検証することが可能となる。
As described above, in this embodiment, the
また、前述した排他的論理和は、演算が簡便である上に、所定演算結果が「0」に相当する黒色のデータに偏りやすい論理積(AND)や、所定演算結果が「1」に相当する白色のデータに偏りやすい論理和(OR)の場合に比べて、黒色のデータと白色のデータとが混在する白黒画像を得やすい演算であるため、プログラム本体イメージ5の破損を検出しやすい。したがって、このような排他的論理和を含む前記所定の演算を行うことによって、メモリ2に保持されたプログラム本体イメージ5の正当性をより迅速かつ適切に検証することが可能となる。
In addition, the above-described exclusive OR is not only easy to calculate, but also has a logical product (AND) that tends to be biased to black data corresponding to a predetermined calculation result of “0”, and a predetermined calculation result of “1”. Compared to the case of logical sum (OR) that tends to be biased to white data, it is easy to obtain a black and white image in which black data and white data are mixed. Therefore, the validity of the
さらに、一般的なグラフィックアクセラレータ4が備えているソースデータとデスティネーションデータとの論理演算を行う機能を活用して、メモリ2に保持されたプログラム本体イメージ5をソースデータとし、ワークメモリ内データ8をデスティネーションデータとした排他的論理和を簡便に実行することが可能となる。
Further, by utilizing a function of performing logical operation between source data and destination data provided in a general
より好ましい実施形態としては、CPU3により、グラフィックアクセラレータ4に、所定演算結果と正当結果9との排他的論理和を互いに対応する同行同列に位置する画素データの組ごとに計算させるようにする。
In a more preferred embodiment, the
そして、この排他的論理和の結果が、すべての画素データの組において「0」に相当する黒色のデータとなる場合に、CPU3により、所定演算結果が正当結果9と一致すると判定し、メモリ2に格納されたプログラム本体イメージ5が正当であるとみなすようにする。
When the result of the exclusive OR becomes black data corresponding to “0” in all sets of pixel data, the
このようにすれば、メモリ2に格納されたプログラム本体イメージ5の正当性をさらに簡便に検証することが可能となる。
In this way, the validity of the
次に、本実施形態の作用について図3を参照して説明する。 Next, the operation of the present embodiment will be described with reference to FIG.
なお、初期状態において、メモリ2には、プログラム本体イメージ5がハードディスクドライブ等から読み込まれて保持されているものとする。
In the initial state, it is assumed that the
そして、初期状態から、メモリ2に保持されたプログラム本体イメージ5の正当性の検証処理を開始すると、CPU3は、図3のステップ1(ST1)において、ブートローダ等を用いて初期値0のワークメモリ内データ8が格納されたワークメモリ7を用意する。そして、メモリ2に格納されたプログラム本体イメージ5をソースデータとし、ワークメモリ内データ8をデスティネーションデータとして、グラフィックアクセラレータ4をセットアップする。
When the verification process of the validity of the program
次いで、ステップ2(ST2)において、グラフィックアクセラレータ4は、メモリ2から読み込む1ブロック分のプログラム本体イメージ5a〜5eのブロック番号jを1に設定してステップ3(ST3)に進む。
Next, in step 2 (ST2), the
次いで、ステップ3(ST3)において、グラフィックアクセラレータ4は、メモリ2から、第j番目(ST3の直後においては第1番目)の1ブロック分のプログラム本体イメージ5a〜5eを読み込む。
Next, in step 3 (ST3), the
次いで、ステップ4(ST4)において、グラフィックアクセラレータ4は、ワークメモリ7からワークメモリ内データ8を読み込む。このステップ4(ST4)の処理は、ステップ3(ST3)と同時に行うようにしてもよい。
Next, in step 4 (ST4), the
次いで、ステップ5(ST5)において、グラフィックアクセラレータ4は、ステップ3(ST3)において読み込んだ1ブロック分のプログラム本体イメージ5a〜5eと、ステップ4(ST4)において読み込んだワークメモリ内データ8との排他的論理和(XOR)を、互いに対応する画素データの組ごとに計算する。
Next, in step 5 (ST5), the
次いで、ステップ6(ST6)において、グラフィックアクセラレータ4は、ステップ5(ST5)における排他的論理和の計算結果をワークメモリ7に格納する。
Next, in step 6 (ST6), the
次いで、ステップ7(ST7)において、グラフィックアクセラレータ4は、ステップ5(ST5)における排他的論理和が行われた1ブロック分のプログラム本体イメージ5a〜5eのブロック番号jが、最後のブロックの番号(j=5)であるか否かを判定し、j=5の場合には、ステップ8(ST8)に進み、そうでない場合(j<5の場合)には、ステップ9(ST9)に進む。
Next, in step 7 (ST7), the
ステップ8(ST8)に進む場合は、ステップ6までの処理によって前記所定の演算が完了したことになる。 When the process proceeds to step 8 (ST8), the predetermined calculation is completed by the process up to step 6.
一方、ステップ9(ST9)に進む場合には、未だに前記所定の演算が完了していないことになる。この場合は、ステップ9(ST9)において、jの値を1つ増やしてステップ3(ST3)に戻り、j=5となるまで、ステップ3(ST3)〜ステップ7(ST7)およびステップ9(ST9)の処理を繰り返す。 On the other hand, when proceeding to step 9 (ST9), the predetermined calculation has not yet been completed. In this case, in step 9 (ST9), the value of j is incremented by one and the process returns to step 3 (ST3). Until j = 5, step 3 (ST3) to step 7 (ST7) and step 9 (ST9) are performed. ) Is repeated.
次いで、ステップ8(ST8)において、CPU3は、ステップ6(ST6)によって取得された所定演算結果が、メモリ2に保持された正当結果9と一致するか否かを判定し、一致する場合には、ステップ10(ST10)に進み、一致しない場合には、ステップ11(ST11)に進む。
Next, in step 8 (ST8), the
ステップ10(ST10)において、CPU3は、メモリ2に保持されたプログラム本体イメージ5が正当であると判定して正当性の検証処理を終了する。
In step 10 (ST10), the
一方、ステップ11(ST11)において、CPU3は、メモリ2に保持されたプログラム本体イメージ5が正当でない(破損がある)と判定して正当性の検証処理を終了する。
On the other hand, in step 11 (ST11), the
以上述べたように、本実施形態によれば、グラフィックアクセラレータ4の演算機能を用いてメモリ2に保持されたプログラム本体イメージ5の検証を迅速に行うことができる結果、正当なプログラムをすみやかに実行することができ、ひいては、システムの起動時間を短縮することができる。
As described above, according to the present embodiment, the program
さらに、発明によれば、グラフィックアクセラレータ4の演算機能を用いてメモリ2に保持されたプログラム本体イメージ5の正当性の検証を行うことにより、CPU3の負担を軽減してCPU3に空き時間を確保することができるので、メモリ2に保持されたプログラム本体イメージ5の正当性の検証が行われている最中においても、既に正当であるとみなされたプログラム本体イメージ5をCPU3によってすみやかに実行することができる。
Furthermore, according to the invention, the validity of the program
なお、本発明は、前述した実施の形態に限定されるものではなく、必要に応じて種々の変更が可能である。 In addition, this invention is not limited to embodiment mentioned above, A various change is possible as needed.
例えば、前述した実施形態においては、前記所定の演算の際に、初期値0のワークメモリ内データ8を用いたが、本発明は、このような構成に限定されるものではない。例えば、正当結果9におけるすべての画素データを0に相当する黒色のデータとし、ワークメモリ内データ8の初期値を、これに対応する値にしてもよい。
For example, in the above-described embodiment, the
このようにすれば、所定演算結果におけるすべての画素データが0に相当する黒色のデータとなるか否かに基づいて、メモリ2に保持されたプログラム本体イメージ5が正当であるか否かを判定することができるため、前述した実施形態のように所定演算結果と正当結果9との排他的論理和を計算する場合よりも演算回数を削減することができる。この結果、メモリ2に保持されたプログラム本体イメージ5の正当性の検証をさらに迅速に行うことが可能となる。
In this way, whether or not the
また、前述した実施形態においては、1ブロック分のプログラム本体イメージ5a〜5eとワークメモリ内データ8とのサイズが同一であるが、ワークメモリ内データ8のサイズを1ブロック分のプログラム本体イメージ5a〜5eのサイズよりも大きくしてもよい。この場合、前述した排他的論理和の計算は、1ブロック分のプログラム本体イメージ5a〜5eと、ワークメモリ内データ8の一部(1ブロック分のプログラム本体イメージ5a〜5eと同一サイズ分のデータ)との間で行い、その排他的論理和の結果を上書きすることによって、ワークメモリ内データ8の一部を更新するようにすればよい。なお、この場合、ワークメモリ内データ8におけるどの位置にある一部のデータを排他的論理和に用いるのか、また、ワークメモリ内データ8におけるどの位置にあるデータを排他的論理和の結果によって更新するのかについては、コンセプトに応じて種々変更することができる。
In the above-described embodiment, the size of the program main body images 5a to 5e for one block and the
このようにすれば、ワークメモリ内データ8のデータ量を多くすることができるので、プログラム本体イメージ5の破損をさらに容易に検出することが可能となる。
In this way, since the data amount of the
さらに、前述した実施形態においては、1画素が1Bitで表現されているが、1画素が、8Bitや16Bit等の複数のBit数で表現されたものであってもよい。この場合には、前記所定の演算の際に、プログラム本体イメージ5における8Bitまたは16Bit分のデータが、1画素として捉えられることになる。
Furthermore, in the embodiment described above, one pixel is expressed by 1 bit, but one pixel may be expressed by a plurality of numbers of bits such as 8 bits and 16 bits. In this case, 8 bits or 16 bits of data in the program
さらにまた、本発明を車載用ナビゲーションシステムに適用すれば、車載用ナビゲーションシステムをすみやかに起動することができる。 Furthermore, if the present invention is applied to an in-vehicle navigation system, the in-vehicle navigation system can be started quickly.
1 プログラム正当性検証装置
2 メモリ
3 CPU
4 グラフィックアクセラレータ4
5 プログラム本体イメージ
7 ワークメモリ7
8 ワークメモリ内データ
9 正当結果
1 Program
4
5 Program body image 7 Work memory 7
8 Work memory data 9 Valid result
Claims (5)
前記メモリに保持されたプログラムに対して所定の演算を行うグラフィックアクセラレータを備え、前記メモリに保持されたプログラムが正当な場合における前記所定の演算によって得られる結果を予め用意しておき、前記グラフィックアクセラレータによる前記メモリに保持されたプログラムに対する前記所定の演算の結果が、前記予め用意された結果と一致する場合に、前記メモリに保持されたプログラムが正当であるとみなすように形成され、
前記所定の演算に用いられる設定された初期値を有するデータが格納されたワークメモリを用意するように形成され、
前記グラフィックアクセラレータが、前記メモリに保持されたプログラムにおける1ブロック分のプログラムと、前記ワークメモリに格納された前記データの全部または一部を読み込み、読み込まれた前記1ブロック分のプログラムと前記データの全部または一部を用いて論理演算を行い、この論理演算の結果を前記ワークメモリに格納して前記ワークメモリに格納された前記データを更新するといった一連の処理を、前記メモリに保持されたプログラムにおけるすべてのブロックに至るまで順次繰り返すことによって、前記所定の演算を行うように形成され、
前記一連の処理の繰り返しによって前記ワークメモリに最終的に格納された前記データが、前記所定の演算の結果とされていること
を特徴とするプログラム正当性検証装置。 A program validity verification device for verifying the validity of a program held in a memory,
A graphic accelerator for performing a predetermined operation on the program held in the memory; a result obtained by the predetermined operation when the program held in the memory is valid; When the result of the predetermined operation on the program held in the memory according to is coincident with the result prepared in advance, the program held in the memory is regarded as valid ,
It is formed so as to prepare a work memory storing data having a set initial value used for the predetermined calculation,
The graphic accelerator reads a program for one block in the program held in the memory and all or part of the data stored in the work memory, and reads the program for the one block and the data stored in the data. A program held in the memory for performing a series of processes such as performing a logical operation using all or a part, storing the result of the logical operation in the work memory, and updating the data stored in the work memory Is formed so as to perform the predetermined calculation by sequentially repeating until reaching all the blocks in
The program correctness verification apparatus , wherein the data finally stored in the work memory by repeating the series of processes is a result of the predetermined calculation .
前記グラフィックアクセラレータが、前記所定の演算の結果と前記予め用意された結果との排他的論理和を、双方の結果における互いに対応する画素データの組ごとに計算するように形成され、
この排他的論理和の計算結果が、すべての画素データの組において0に相当する結果となる場合に、前記所定の演算の結果が前記予め用意された結果と一致すると判定して、前記メモリに保持されたプログラムが正当であるとみなすように形成されていることを特徴とする請求項1乃至請求項3のいずれか1項に記載のプログラム正当性検証装置。 The result of the predetermined calculation and the result prepared in advance are each formed by a plurality of pixel data,
The graphic accelerator is configured to calculate an exclusive OR of the result of the predetermined operation and the result prepared in advance for each set of pixel data corresponding to each other in both results;
When the calculation result of the exclusive OR is a result corresponding to 0 in all the pixel data sets, it is determined that the result of the predetermined operation matches the result prepared in advance, and the memory stores 4. The program validity verification apparatus according to claim 1 , wherein the program validity verification apparatus is formed so that the stored program is regarded as valid.
前記予め用意された結果におけるすべての画素データが、0に相当するデータとされ、
前記ワークメモリに格納された前記データの前記初期値が、前記予め用意された結果に対応する値とされ、
前記メモリに保持されたプログラムに対する前記所定の演算の結果におけるすべての画素データが0に相当するデータとなる場合に、前記所定の演算の結果が前記予め用意された結果と一致すると判定して、前記メモリに保持されたプログラムが正当であるとみなすように形成されていることを特徴とする請求項1乃至請求項3のいずれか1項に記載のプログラム正当性検証装置。 The result of the predetermined calculation and the result prepared in advance are each formed by a plurality of pixel data,
All pixel data in the result prepared in advance is data corresponding to 0,
The initial value of the data stored in the work memory is a value corresponding to the result prepared in advance;
When all the pixel data in the result of the predetermined calculation for the program stored in the memory is data corresponding to 0, it is determined that the result of the predetermined calculation matches the result prepared in advance, 4. The program validity verification apparatus according to claim 1 , wherein the program validity verification apparatus is formed so that a program held in the memory is regarded as valid.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2006048031A JP4732921B2 (en) | 2006-02-24 | 2006-02-24 | Program correctness verification device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2006048031A JP4732921B2 (en) | 2006-02-24 | 2006-02-24 | Program correctness verification device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2007226610A JP2007226610A (en) | 2007-09-06 |
| JP4732921B2 true JP4732921B2 (en) | 2011-07-27 |
Family
ID=38548364
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2006048031A Expired - Fee Related JP4732921B2 (en) | 2006-02-24 | 2006-02-24 | Program correctness verification device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP4732921B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP6949416B2 (en) * | 2017-07-13 | 2021-10-13 | 株式会社デンソー | Electronic control device, program tampering detection method |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2500858B2 (en) * | 1986-04-11 | 1996-05-29 | インターナショナル・ビジネス・マシーンズ・コーポレーション | Display system having extended raster operation circuit |
| JP2002236600A (en) * | 2001-02-08 | 2002-08-23 | Nagano Fujitsu Component Kk | Arithmetic unit and its runaway detecting method |
| JP4553660B2 (en) * | 2004-08-12 | 2010-09-29 | 株式会社エヌ・ティ・ティ・ドコモ | Program execution device |
-
2006
- 2006-02-24 JP JP2006048031A patent/JP4732921B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2007226610A (en) | 2007-09-06 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP4160625B1 (en) | Error detection control system | |
| CN109634645B (en) | Firmware upgrading method and terminal | |
| US10832639B2 (en) | Method of and apparatus for generating a signature representative of the content of an array of data | |
| CN105740088B (en) | Flash memory data error correction method and device | |
| US20150324590A1 (en) | Method for protecting data | |
| CN109753788B (en) | Integrity checking method and computer readable storage medium during kernel operation | |
| CN111934861A (en) | Data validity verification method and system in diagnosis flashing process | |
| US11960608B2 (en) | Fast secure booting method and system | |
| JP4732921B2 (en) | Program correctness verification device | |
| US7373525B2 (en) | Data processing method and data checking method | |
| CN108196975B (en) | Data verification method and device based on multiple checksums and storage medium | |
| CN114266758A (en) | Panel brightness correction method, device and computer readable storage medium | |
| JP2005532728A (en) | Protecting electronic circuits from error-based attacks | |
| US12481495B2 (en) | Firmware update method of a flash bootloader in a micro controller unit for a vehicle | |
| JP2000089622A5 (en) | ||
| CN118067614B (en) | Defect detection method, device and equipment for automobile parts and storage medium | |
| CN101501585A (en) | Method for programming a controller in a motor vehicle | |
| JP2018160208A (en) | On-vehicle controller and program update software | |
| CN114201334A (en) | System comprising a camera module connected to an electronic device | |
| US20190347385A1 (en) | Security methods and systems by code mutation | |
| US10242183B2 (en) | Method of executing a program by a processor and electronic entity comprising such a processor | |
| CN111420406A (en) | Method and system for preventing external game cheating through memory zero clearing | |
| EP3336797B1 (en) | Single-molecule image correction method, device and system, and computer-readable storage medium | |
| CN114153474B (en) | Program update method and update system | |
| US20040098605A1 (en) | Prospective execution of function based on partial correlation of digital signature |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20080417 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20110202 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20110208 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20110401 |
|
| TRDD | Decision of grant or rejection written | ||
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20110419 |
|
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20110421 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140428 Year of fee payment: 3 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 4732921 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| LAPS | Cancellation because of no payment of annual fees |