DATA PROCESSING DEVICE AND METHOD FOR MONITORING CORRECT OPERATION OF A DATA PROCESSING DEVICE
A method for monitoring the correct operations of a data processing device including changing a subsystem from an authorized state to an unauthorized state, executing the partial operating sequence, and resetting any subsystem state from the unauthorized state to the authorized state.
Latest INFINEON TECHNOLOGIES AG Patents:
- Phase shifter system and method
- Leadframe, encapsulated package with punched lead and sawn side flanks, and corresponding manufacturing method
- Apparatus and method for ascertaining a rotation angle
- Pointing device for detecting motion relative to a surface and method for detecting motion of a pointing device relative to a surface
- Angle sensor with diverse measurement paths and a safety path
This application claims priority to German Patent Application Serial No. 10 2006 035 662.4, filed Jul. 31, 2006, and which is incorporated herein by reference in its entirety.
BACKGROUNDData processing devices are controlled using programs which includes a sequence of instructions that can be executed in order to achieve a particular functionality. The high flexibility of data processing devices is based on the fact that, in programs, individual steps can be executed not only sequentially but also with branches in the sequence. For a data processing device to operate correctly, the correct program flow, that is the correct order in which the individual instructions are executed, is required. Unexpected changes in the sequence lead to incorrect results or even to operation of the data processing device being stopped. Such changes may be caused, for example, by faults in the hardware or in the programs. Furthermore, external attacks in which the correct operation of a data processing device is deliberately disrupted in order to gain an advantage are conceivable.
In order to avoid faults during the operation of a data processing device, hardware and software are verified, that is, they are checked for the correct method of operation. Unfortunately, some faults remain undiscovered during verification since not all possible situations can be covered. These include, in particular, limiting cases which occur when different parts of a program interact, in which case it is not possible to verify the individual parts together. Faults in the program flow may result in failure of the data processing device or in security gaps which can be exploited.
External attacks which influence the operation of a data processing device may be detected using suitable hardware measures. These include checkpoint registers, in which values are compared with expected values during operation, glitch sensors, which detect very brief voltage dips or increases in the current or clock supply, frequency sensors, which are used to detect changes in the clock frequency, in particular underfrequencies, or single-step operation, and light sensors, which can be used to detect manipulation of the chip during optical analysis. Hardware measures can be used only in specialized safety processors, the use of analog sensors frequently requiring redesign, in particular.
In an embodiment a method for monitoring the correct operation of a data processing device, the method having the steps of changing a subsystem from an authorized state to an unauthorized state before a partial operating sequence is executed, the unauthorized state not interfering with the execution of the partial operating sequence as long as the state of the subsystem is not being evaluated, executing the partial operating sequence, resetting the subsystem state from the unauthorized state to the authorized state after the partial operating sequence has been executed, and evaluating the subsystem state.
If the partial operating sequence is fully executed properly, the subsystem state is reset from the unauthorized state to the authorized state before evaluation. During evaluation, the subsystem state is then in an authorized state. If, in contrast, the partial operating sequence is disrupted and is not ended correctly, the subsystem is still in an unauthorized state. This unauthorized state is detected by evaluating the subsystem state and the necessary measures, for example adjusting the operation of the data processing device, are taken.
In an embodiment, the data processing device carries out the abovementioned steps during operation. If the evaluation of the subsystem state revealed an authorized state, the data processing device continues operation at a continuation point for the partial operating sequence.
Operation of the data processing device may include a plurality of partial operating sequences, the process being continued, after the subsystem state has been evaluated, only if the subsystem is in an authorized state. This ensures that the partial operating sequence has been fully executed correctly, and operation of the data processing device is continued only if no unexpected interruptions in the partial operating sequence have occurred.
In an embodiment, the subsystem state is described by a continuation point.
Depending on the continuation point, the subsystem state is in an authorized state or an unauthorized state.
In an embodiment, in the authorized state, the continuation point is the continuation point for the partial operating sequence.
In order to monitor the correct operation of the data processing device, the continuation point for the partial operating sequence is modified before the partial operating sequence is executed and, after the latter has been successfully executed, is reset again to the correct continuation point for the partial operating sequence. If the partial operating sequence is disrupted in any way, with the result that the continuation point is not reset from an unauthorized continuation point to the authorized continuation point for the partial operating sequence, the unauthorized continuation point is detected when evaluating the subsystem state.
In an embodiment, in the unauthorized state, the continuation point is an invalid continuation point which does not correspond to the continuation point for the partial operating sequence.
An invalid continuation point can be detected when evaluating the subsystem state, the continuation point being selected in such a manner that operation of the data processing device is ended or interrupted in a determinate manner.
In an embodiment, the invalid continuation point is reversibly determined from the continuation point for the partial operating sequence.
In order to change the subsystem from an authorized state to an unauthorized state before the partial operating sequence is executed, and in order to change the subsystem state from the unauthorized state to the authorized state after the partial operating sequence has been executed, it is necessary for the continuation point for the partial operating sequence to be able to be determined from the invalid continuation point.
In an embodiment, instructions for changing the subsystem state from an authorized state to an unauthorized state before the partial operating sequence to be monitored, instructions for resetting the subsystem state from the unauthorized state to the authorized state, and instructions for evaluating the subsystem state after the partial operating sequence to be monitored are inserted into a program which controls the partial operating sequence.
The method for monitoring the correct operation of the data processing device can be implemented by inserting the appropriate instructions into the program which controls the partial operating sequence.
In an embodiment, the instructions are automatically inserted into the program when compiling or interpreting the program.
As a result of the fact that the instructions which are needed to monitor the correct operation of the data processing device are automatically inserted into the program which controls the partial operating sequence, the method can be used for any desired data processing devices without great expenditure. In particular, the method is thus independent of the platform and application program.
In an embodiment, the continuation point is a return address of the program which controls the partial operating sequence.
As a result of the use of a return address to represent the subsystem state, there is no need to explicitly check the subsystem state since the return address is automatically evaluated during the partial operating sequence, with the result that the method can be implemented with very little overhead.
In an embodiment, the invalid continuation point is a return address which is generated by adding a constant or a random number from the return address of the program for controlling the partial operating sequence.
In this case, the constant or random number is selected in such a manner than an invalid return address which results in a fault during return is generated. In this case, the fault can be triggered, for example, by access to a nonexistent memory area.
In an embodiment, in order to reset the subsystem state from the unauthorized state to the authorized state after the partial operating sequence has been executed, addition of the constant or of the random number is reversed.
As a result of the addition being reversed, the correct return address of the program which controls the partial operating sequence is obtained again and does not cause a fault during evaluation, that is to say during return.
In an embodiment, the subsystem state is evaluated using a memory management unit or a memory protection unit.
If the subsystem state is denoted using a return address, a memory management unit or a memory protection unit can be used to detect whether the address is valid and authorized or invalid and unauthorized. In this case, it is advantageous that there is no need for an additional memory for storing the subsystem state and that memory management units or memory protection units are present in most hardware platforms of data processing devices.
In an embodiment, the unauthorized state triggers an alarm, an abort, a fault, an exception or a trap in the data processing device.
State monitoring mechanisms which are already present in the data processing device can thus be used to monitor correct operation without the need for additional hardware expenditure. State monitoring mechanisms are intended to mean all mechanisms in the data processing device which are suitable for triggering an alarm, an abort, a fault, an exception or a trap.
In an embodiment, the unauthorized state interrupts operation of the data processing device during evaluation.
If, for example, an attempt is made to execute an unauthorized branch in the data processing device, as a result of which the subsystem state cannot be reset from the unauthorized state to the authorized state, this is indicated by interrupting operation. This makes it possible to detect faults and attacks and to protect security-sensitive data.
There is also provided a data processing device which includes a processor, a subsystem which can assume an authorized state and an unauthorized state, a sequence controller, a modification device for modifying a continuation point, a continuation point memory for storing a continuation point, and an evaluation unit for evaluating a state of the subsystem. In this case, the sequence controller is designed in such a manner that it stores a continuation point for a partial operating sequence in the continuation point memory before the partial operating sequence is executed by the processor, uses the modification device to change the continuation point in such a manner that, when a state of the subsystem is being evaluated by the evaluation unit, an unauthorized state is detected, uses the modification device to reverse the change in the continuation point after the partial operating sequence has been executed by the processor and changes the subsystem state from the unauthorized state to the authorized state, and evaluates the state of the subsystem in the evaluation unit.
The sequence controller modifies the partial operating sequence in such a manner that the continuation point for the latter is first of all changed in such a manner that it would lead to an unauthorized state during evaluation. Given the correct sequence of the partial operating sequence, this change is reversed, with the result that no unauthorized state is detected during evaluation. If, in contrast, the partial operating sequence is not ended properly, the change in the continuation point is not reversed either, with the result that the subsystem remains in the invalid state.
In an embodiment, the continuation point is a return address of a program which controls the partial operating sequence.
The authorized state corresponds to the correct return address of the program, while the unauthorized state corresponds to an illegal return address.
In an embodiment, the evaluation unit is a memory management unit or a memory protection unit of the processor.
The memory management unit or memory protection unit is responsible for memory management. A valid or authorized return address results in the next instruction being executed after the partial operating sequence, while an illegal, invalid or unauthorized return address results in a fault message. This makes it possible to use the already existing hardware of the processor to implement an evaluation unit which can be used to monitor the operation of the data processing device.
In an embodiment, the sequence controller is implemented using the processor.
A separate processor is thus not needed for the sequence controller; the latter can be implemented using the already existing processor of the data processing device.
In an embodiment, the subsystem is implemented using the processor.
The subsystem can assume an authorized state and an unauthorized state and can be implemented as such using system registers in which system states are stored. System registers are used to store the states of alarms, aborts, faults, exceptions and traps which have been detected by the processor.
In an embodiment, the modification device and the continuation point memory are implemented using software which runs on the processor.
The modification device and the continuation point memory are implemented using software which is executed in the processor. The continuation point memory may be, for example, a variable whose value is modified using an appropriate programming instruction.
In one embodiment, the evaluation unit AE is part of the processor P. Particularly if the continuation point FS is denoted using a return address, the memory management unit or the memory protection unit of the processor P can be used for this purpose. An unauthorized return address is detected as a fault by these units. In another design, the sequence controller AS is implemented, within the processor P, together with a corresponding program. In the same manner, the modification device M may also use registers of the processor P and the arithmetic unit of the latter to modify the continuation point FS. Furthermore, the subsystem T may be implemented using system states of the processor P. In this case, the states are detected by the hardware of the processor P and can access processor-internal fault detection mechanisms. Fault detection mechanisms of this type may be, for example, faults, traps, aborts or interrupts which change the normal operating sequence BA. It is particularly advantageous in these embodiments that there is no need for additional hardware for the modification device M, the subsystem T, the sequence controller AS and the evaluation device AE. Furthermore, system states of this type are available on virtually all hardware platforms and do not require any explicit checking by means of software, with the result that the operating sequence is encumbered only with very little overhead in order to monitor correct operation.
The left-hand side of
The right-hand side of
The constants C1 and C2 can be selected in such a manner that the resultant return addresses point to a nonexistent memory area. They may also point to a memory area which, although being present, does not contain any executable code. Furthermore, the constants C1 and C2 can be selected in such a manner that the return addresses refer to an area for which there are no access rights. Another possible way of selecting the constants C1 and C2 is for the modified return addresses RA to point, beyond the boundaries of a memory area, to another memory area if such a change in memory areas can be detected by the processor. They may also be selected in such a manner that the modified return address RA points, for example, to the middle of an instruction having a length of four bytes and thus triggers a fault. If, in contrast, the modification constants C1 and C2 are selected to be zero, the correct operation of the data processing device cannot be monitored. The constants for different subroutines must also be selected to be different so that unintentional resetting by another subroutine is precluded.
The invention can be used to monitor the operation of a data processing device without the need for hardware measures, for example sensors. Since mechanisms which exist in any hardware architecture are used to detect unauthorized states, it is possible to dispense with storing additional states. Since there is no need for any testing instructions either, very little programming complexity, which can also be automated, results. Monitoring without specialized hardware and without being restricted to specific applications or hardware platforms is thus possible.
Claims
1. A method for monitoring correct operation of a data processing device, comprising:
- changing a subsystem from an authorized state to an unauthorized state before a partial operating sequence is executed, the unauthorized state not interfering with the execution of the partial operating sequence as long as the state of the subsystem is not being evaluated;
- executing the partial operating sequence;
- resetting the subsystem state from the unauthorized state to the authorized state after the partial operating sequence has been executed; and
- evaluating the subsystem state.
2. The method as claimed in claim 1, wherein the data processing device executes as if the evaluation of the subsystem state revealed an authorized state, and continues operation at a continuation point for the partial operating sequence.
3. The method as claimed in claim 1, wherein the subsystem state is described by a continuation point.
4. The method as claimed in claim 3, wherein in the authorized state, the continuation point is the continuation point for the partial operating sequence.
5. The method as claimed in claim 3, wherein in the unauthorized state, the continuation point is an unauthorized continuation point which does not correspond with the continuation point for the partial operating sequence.
6. The method as claimed in claim 5, wherein the unauthorized continuation point is reversibly determined from the continuation point for the partial operating sequence.
7. A method for monitoring a correct operation of a data processing device, the method comprising:
- inserting instructions for changing a subsystem state from an authorized state to an unauthorized state before a partial operating sequence to be monitored;
- inserting instructions for resetting the subsystem state from the unauthorized state to the authorized state;
- inserting instructions for evaluating the subsystem state after the partial operating sequence to be monitored into a program which controls the partial operating sequence; and
- executing the partial operating sequence.
8. The method as claimed in claim 7, wherein the instructions are automatically inserted into the program when compiling or interpreting the program.
9. The method as claimed in claim 7, wherein the continuation point is a return address of the program which controls the partial operating sequence.
10. The method as claimed in claim 7, wherein an unauthorized continuation point is a return address which is generated by adding a constant or a random number from the return address of the program in order to control the partial operating sequence.
11. The method as claimed in claim 10, wherein in order to reset the subsystem state from the unauthorized state to the authorized state after the partial operating sequence has been executed, the method further comprises adding of the constant or of the random number is reversed.
12. The method as claimed in claim 11, wherein the subsystem state is evaluated using a memory management unit or a memory protection unit.
13. The method as claimed in claim 12, wherein the unauthorized state triggers an alarm, an abort, a fault, an exception, or a trap in the data processing device.
14. The method as claimed in claim 13, wherein the unauthorized state interrupts operation of the data processing device during evaluation.
15. A data processing device comprising:
- a processor;
- a subsystem which can assume an authorized state and an unauthorized state;
- a sequence controller;
- a modification device for modifying a continuation point;
- a continuation point memory for storing the continuation point; and
- an evaluation unit for evaluating a state of the subsystem,
- wherein the sequence controller: stores a continuation point for a partial operating sequence in the continuation point memory before the partial operating sequence is executed by the processor, uses the modification device to change the continuation point such that, when a state of the subsystem is being evaluated by the evaluation unit, an unauthorized state is detected, uses the modification device to reverse the change in the continuation point after the partial operating sequence has been executed by the processor and to change the subsystem state from the unauthorized state to the authorized state, and evaluates the state of the subsystem in the evaluation unit.
16. The data processing device as claimed in claim 15, wherein the continuation point is a return address of a program which controls the partial operating sequence.
17. The data processing device as claimed in claim 15, wherein the evaluation unit is a memory management unit or a memory protection unit of the processor.
18. The data processing device as claimed in claim 15, wherein the sequence controller is implemented using the processor.
19. The data processing device as claimed in claim 15, wherein the subsystem is implemented using the processor.
20. The data processing device as claimed in claim 15, wherein the modification device and the continuation point memory are implemented using software which runs on the processor.
21. A data processing device comprising:
- a processor;
- a subsystem which can assume an authorized state and an unauthorized state;
- a modification means for modifying a continuation point;
- an evaluation unit for evaluating a state of the subsystem; and
- a sequence controlling means for storing a continuation point for a partial operating sequence in a continuation point memory before the partial operating sequence is executed by the processor, for using the modification means to change the continuation point such that, when a state of the subsystem is being evaluated by the evaluation unit, an unauthorized state is detected, for using the modification means to reverse the change in the continuation point after the partial operating sequence has been executed by the processor and to change the subsystem state from the unauthorized state to the authorized state, and for evaluating the state of the subsystem in the evaluation unit.
22. A data processing device comprising:
- means for changing a subsystem from an authorized state to an unauthorized state before a partial operating sequence is executed, the unauthorized state not interfering with the execution of the partial operating sequence as long as the state of the subsystem is not being evaluated;
- means for executing the partial operating sequence;
- means for resetting the subsystem state from the unauthorized state to the authorized state after the partial operating sequence has been executed; and
- means for evaluating the subsystem state.
Type: Application
Filed: Dec 11, 2006
Publication Date: May 15, 2008
Applicant: INFINEON TECHNOLOGIES AG (Munich)
Inventors: ROBIN BOCH (Munich), Gerd Dirscherl (Munich), Stefan Erdmenger (Augsburg), Udo Kriebel (Diedorf)
Application Number: 11/609,253
International Classification: G06F 9/46 (20060101);