Secure element and virtual machine
A virtual machine with a program counter and bytecode processing unit addresses memory changes from attacks or noise by re-executing instructions and implementing error handling, maintaining stable operation.
Patent Information
- Application Number
- JP2023023990
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-02-20
- Publication Date
- 2024-08-30
AI Technical Summary
Virtual machines in secure elements malfunction due to memory changes caused by fault exploitation attacks or disturbance noise, leading to user equipment shutdown.
Implement a virtual machine with a program counter and bytecode processing unit that checks for memory changes by comparing fetched and used bytecodes, and re-executes instructions if they differ, with error handling when re-executions exceed a threshold.
The virtual machine continues processing without malfunctioning by detecting and correcting memory changes due to attacks or noise, ensuring stable operation.
Smart Images

Figure 2024117906000001
Abstract
Description
[Technical field]
[0001] The present invention relates to a secure element equipped with a virtual machine, and more particularly to a technique for preventing malfunction of a secure element due to the influence of a fault exploitation attack or disturbance noise. [Background technology]
[0002] There are an increasing number of cases where a virtual machine (VM) such as Java (registered trademark) is implemented in a secure element that stores highly confidential information. As described in the background art of Patent Document 1, if the memory contents change due to a fault attack such as laser irradiation or disturbance noise, the virtual machine implemented in the secure element may malfunction. In Patent Document 2, when the virtual machine detects that the memory contents have changed due to a fault attack or disturbance noise, it stops the operation of the virtual machine, thereby preventing the secure element from malfunctioning. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] JP 2018-88147 A [Patent Document 2] JP 2009-288908 A Summary of the Invention [Problem to be solved by the invention]
[0004] However, when a change in memory contents due to a fault exploitation attack or external noise is detected, if the operation of the virtual machine implemented in the secure element is stopped to prevent the secure element from malfunctioning, the operation of the user device implementing the secure element may also be stopped.
[0005] Therefore, the invention disclosed in this application aims to enable a virtual machine to continue processing without malfunctioning even if the contents of the memory change due to a fault exploitation attack or disturbance noise. [Means for solving the problem]
[0006] A first invention for solving the above-mentioned problems is a secure element that implements a virtual machine. The virtual machine implemented in the secure element of the first invention comprises a program counter that indicates a memory address where a bytecode to be executed is stored, and a bytecode processing unit that executes the bytecode stored in the memory address indicated by the program counter. The bytecode processing unit fetches a bytecode by referring to the program counter, decodes the fetched bytecode, dispatches an instruction corresponding to the bytecode, and then, before executing the instruction, compares the bytecode used to dispatch the instruction with the bytecode fetched by referring to the program counter at this point in time, and if the two bytecodes are the same, executes the instruction corresponding to the bytecode, and if the two bytecodes are different, re-executes the process of executing the bytecode. In the first invention, before executing an instruction corresponding to a bytecode, the bytecode is fetched again, and the bytecode used for dispatching the instruction is compared with the fetched bytecode to determine whether the value of the program counter indicating the memory address of the bytecode to be executed has changed. Furthermore, if it is determined that the program counter has changed, the bytecode indicated by the program counter is executed again, so that processing can be continued without malfunctioning even if the value of the program counter changes due to a fault exploitation attack or disturbance noise.
[0007] If the two bytecodes continue to differ, a hardware failure may be assumed in addition to a fault exploitation attack or external noise. Therefore, it is preferable that the bytecode processing unit according to the first invention counts a first re-execution count for re-executing the process of executing the bytecode, and executes an error process when the first re-execution count exceeds a threshold.
[0008] A branch instruction, which determines whether or not to call a branch destination depending on whether a condition is satisfied, judges whether or not the condition corresponding to the branch instruction is satisfied in two pieces of data stored in a stack. If the value of the stack pointer that manages the stack changes due to a fault exploitation attack or disturbance noise during the execution of a branch instruction, the program counter after the execution of the branch instruction becomes invalid, causing a malfunction. Therefore, in the bytecode processing unit of the first invention, when the instruction corresponding to the bytecode is a branch instruction that determines whether or not to call a branch destination depending on whether a condition is satisfied, after executing the branch instruction, it is desirable to execute the branch instruction again, compare the value of the program counter when the branch instruction is executed for the first time with the value of the program counter after the branch instruction is executed for the second time, and re-execute the branch instruction if these two program counter values are different. In the case of the branch instruction as well, it is preferable that the bytecode processing unit counts a second re-execution count for re-executing the branch instruction, and executes an error process when the second re-execution count exceeds a threshold value.
[0009] A second invention for solving the above-mentioned problems is a virtual machine implemented in a secure element. The virtual machine includes a program counter that indicates a memory address where a bytecode to be executed is stored, and a bytecode processing unit that executes the bytecode stored in the memory address indicated by the program counter. The bytecode processing unit of the second invention fetches a bytecode by referring to the program counter, decodes the fetched bytecode and dispatches an instruction corresponding to the bytecode, and then, before executing the instruction, compares the bytecode used to dispatch the instruction with the bytecode fetched by referring to the program counter at this point in time, and if these two bytecodes are the same, executes the instruction corresponding to the bytecode, and if these two bytecodes are different, re-executes the process of executing the bytecode. Also in the second aspect of the invention, it is preferable that the bytecode processing unit counts a first re-execution number of times the process for executing the bytecode is re-executed, and executes an error process when the first re-execution number exceeds a threshold value. Furthermore, in the second invention, when the instruction corresponding to the bytecode is a branch instruction that determines whether or not to call a branch destination depending on whether a condition is satisfied, it is desirable for the bytecode processing unit to execute the branch instruction again after executing the branch instruction, compare the value of the program counter when the branch instruction is executed for the first time with the value of the program counter after the branch instruction is executed for the second time, and re-execute the branch instruction if these two program counter values are different. Furthermore, in the second aspect of the invention, it is preferable that the bytecode processing unit counts a second re-execution count for re-executing the branch instruction, and executes an error process when the second re-execution count exceeds a threshold value.
[0010] A third invention is an IC card incorporating a secure element. The secure element incorporated in the IC card according to the third invention includes a virtual machine. The virtual machine includes a program counter that indicates a memory address where a bytecode to be executed is stored, and a bytecode processing unit that executes the bytecode stored in the memory address indicated by the program counter. The bytecode processing unit fetches a bytecode by referring to the program counter, decodes the fetched bytecode, dispatches an instruction corresponding to the bytecode, and then, before executing the instruction, compares the bytecode used to dispatch the instruction with the bytecode fetched by referring to the program counter at this point in time, and if the two bytecodes are the same, executes the instruction corresponding to the bytecode, and if the two bytecodes are different, re-executes the process of executing the bytecode. Also in the third aspect of the invention, it is preferable that the bytecode processing unit counts a first re-execution number of times the process for executing the bytecode is re-executed, and executes an error process when the first re-execution number exceeds a threshold value. Furthermore, in the third invention, when the instruction corresponding to the bytecode is a branch instruction that determines whether or not to call a branch destination depending on whether a condition is satisfied, it is desirable for the bytecode processing unit to execute the branch instruction again after executing the branch instruction, compare the value of the program counter when the branch instruction is executed for the first time with the value of the program counter after the branch instruction is executed for the second time, and re-execute the branch instruction if these two program counter values are different. Furthermore, in the third aspect of the invention, it is preferable that the bytecode processing unit counts a second re-execution count for re-executing the branch instruction, and executes an error process when the second re-execution count exceeds a threshold value. Effect of the Invention
[0011] As described above, in the invention disclosed in this application, even if a program counter stored in the memory of a secure element implementing a virtual machine changes due to a fault attack or disturbance noise, the virtual machine can continue processing without malfunctioning. [Brief description of the drawings]
[0012] [Figure 1] FIG. 2 is a diagram showing hardware components related to a secure element. [Diagram 2]FIG. 2 is a diagram showing a software hierarchical structure related to a secure element. [Diagram 3] FIG. 1 explains how a virtual machine executes bytecode. [Figure 4] FIG. 2 explains how a virtual machine executes bytecode. [Diagram 5] A diagram showing an IC card equipped with a secure element. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0013] From here, an embodiment of the invention disclosed in this application will be described. This embodiment is intended to facilitate understanding of the invention disclosed in this application, and the invention disclosed in this application is not limited to this embodiment. Furthermore, unless otherwise specified, the drawings are schematic diagrams drawn to facilitate understanding of the invention disclosed in this application.
[0014] Fig. 1 shows basic components of hardware related to a secure element 1. The secure element 1 is made of an integrated circuit. For example, in Fig. 1, the secure element 1 integrates a CPU 1a (Central Processing Unit), a ROM 1b (Read Only Memory), a RAM 1c (Random Access Memory), an NVM 1d (NVM: Non Volatile Memory), a cryptographic coprocessor 1e, and an I / F 1f (Interface). In the secure element 1 shown in Fig. 1, the ROM 1b, the RAM 1c, the NVM 1d, the cryptographic coprocessor 1e, and the I / F 1f are each connected to the CPU 1a via a bus 1g.
[0015] CPU1a is the central processing unit in the secure element 1. ROM1b is a non-volatile memory that cannot be electrically rewritten. ROM1 becomes a memory that can store computer programs and data only when the secure element 1 is manufactured. RAM1c is an electrically rewritable volatile memory. RAM1c becomes a memory in which a computer program implemented in the secure element 1 temporarily stores data. NVM1d is an electrically rewritable non-volatile memory. NVM1d becomes a memory into which computer programs and data can be loaded after the secure element 1 is manufactured. An EEPROM or a flash memory, etc. is used for NVM1d of the secure element 1.
[0016] The cryptographic coprocessor 1e is a processing device designed specifically for a specific cryptographic operation. Since the secure element 1 stores highly confidential information, it is common for the secure element 1 to be equipped with a cryptographic coprocessor 1e.
[0017] The I / F 1f is a circuit that communicates with an external device. An example of the I / F 1f of the secure element 1 is the Inter-Integrated Circuit (I2C).
[0018] 2 shows a software hierarchical structure related to the secure element 1. The software hierarchical structure of the secure element 1 includes, from the lowest layer, hardware 11a, (operating system 11c), virtual machine 10, and application 11c.
[0019] The basic components of the hardware 11a of the secure element 1 are shown in Fig. 1. The upper layer of the hardware 11a of the secure element 1 is a virtual machine 10. The main memory for storing the program code of the virtual machine 10 is a ROM 1b. A structure in which the virtual machine 10 is provided above the hardware 11a is also possible, or a structure in which an operating system 11c is provided above the hardware 11a and the virtual machine 10 is provided above the operating system 11c.
[0020] The application 11c is a computer program written using bytecodes. The main memory for storing the application 11c is the NVM 1d. The bytecode is one byte of data that represents an instruction. Depending on the instruction corresponding to the bytecode, the bytecode is followed by one or more bytes of operands that serve as parameters.
[0021] The virtual machine 10 is software with a function of interpreting and executing bytecode. The Java (registered trademark) Virtual Machine is well-known as a virtual machine 10 suitable for the secure element 1. Although not shown in FIG. 2, a runtime environment of the virtual machine 10 and an API (Application Programming Interface) of the virtual machine 10 are implemented in the secure element 1.
[0022] The virtual machine 10 includes a program counter 100 (hereinafter, abbreviated as "PC"; PC is an abbreviation for Program Counter) that indicates a memory address where a bytecode to be executed is stored, and a bytecode processing unit 101 that executes the bytecode stored in the memory address indicated by the PC 100. Furthermore, the virtual machine 10 includes instructions 102 corresponding to each bytecode supported by the virtual machine 10. Here, the instructions 102 are a program that executes processing corresponding to the instructions 102. In FIG. 2, the instructions 102 provided in the virtual machine 10 include a branch instruction 1020 that determines whether or not to call a branch destination depending on whether a condition is satisfied.
[0023] The PC100 is provided in the RAM1c of the secure element 1. The RAM1c of the secure element 1 is provided with a stack used by the virtual machine 10 and a stack pointer (hereinafter, referred to as "SP." SP is an abbreviation of Stack Pointer) used to manage the stack. Data (e.g., bytecode) stored in the NVM1d is unlikely to change due to a fault attack or disturbance noise, but data stored in the RAM1c is likely to change due to a fault attack or disturbance noise. If the PC100 stored in the RAM1c changes due to a fault attack or disturbance noise, the virtual machine 10 will malfunction. Therefore, in this embodiment, the bytecode processing unit 101 of the virtual machine 10 has a function of determining whether the PC100 stored in a memory such as the RAM1c has changed due to a fault attack or disturbance noise, and a function of continuing processing without malfunctioning even if the data stored in the memory such as the RAM1c changes due to a fault attack or disturbance noise.
[0024] When executing a bytecode, the bytecode processing unit 101 included in the virtual machine 10 executes a process of fetching the bytecode from a memory address indicated by the PC 100, a process of decoding the fetched bytecode and dispatching an instruction 102 corresponding to the bytecode, and a process of executing the dispatched instruction 102. Here, dispatching means, for example, allocating resources (such as an area of the RAM 1c) to the instruction 102.
[0025] When executing an instruction 102 corresponding to a bytecode, if the PC 100 provided in the RAM 1c changes due to a fault exploitation attack or external noise, a malfunction occurs. Therefore, in order to determine the validity of the PC 100, the bytecode processing unit 101 according to this embodiment compares the bytecode used to dispatch the instruction 102 with the bytecode fetched by referring to the PC 100 at this time before executing the instruction 102 corresponding to the bytecode.
[0026] When the bytecode processing unit 101 according to the present embodiment determines that the value of the PC 100 is valid, that is, when the bytecode used to dispatch the instruction 102 is the same as the bytecode fetched by referring to the PC 100 at this time, the bytecode processing unit 101 executes the dispatched instruction 102. When the bytecode processing unit 101 determines that the PC 100 is invalid, that is, when the bytecode used to dispatch the instruction 102 is different from the bytecode fetched by referring to the PC 100 at this time, the bytecode processing unit 101 re-executes the process of executing the bytecode so that the process can be continued without malfunction. When the PC 100 continues to be invalid, a failure of the hardware 11a (for example, a failure of the RAM 1c) can also be assumed. Therefore, in the present embodiment, the bytecode processing unit 101 counts the first re-execution number of times that the bytecode is re-executed, and when the first re-execution number exceeds a threshold, the bytecode processing unit 101 interrupts the process of executing the bytecode and executes a predetermined error process. The content of the error process may be arbitrary. The error process may be a process of responding with a response indicating the occurrence of an error and terminating the execution of the bytecode. Moreover, the error handling may be a process of invoking an exception handling that indicates a security violation, or a process of stopping the operation of the secure element 1.
[0027] A branch instruction 1020, which determines whether or not to call a branch destination depending on whether a condition is satisfied, judges whether or not a condition corresponding to the branch instruction 1020 is satisfied in two pieces of data stored in a stack. If the value of a stack pointer that manages the stack or the value of PC 100 changes due to a fault exploitation attack or disturbance noise while the branch instruction 1020 is being executed, the PC 100 after the branch instruction 1020 is executed will no longer be valid, causing a malfunction.
[0028] Therefore, the bytecode processing unit 101 according to this embodiment executes the branch instruction 1020, and then executes the branch instruction 1020 again, and compares the value of the PC100 when the branch instruction 1020 is executed for the first time with the value of the PC100 after the branch instruction 1020 is executed for the second time, to determine the validity of the value of the PC100 after the branch instruction 1020 is executed. When the bytecode processing unit 101 determines that the value of the PC100 after the branch instruction 1020 is invalid, that is, when the above comparison shows that the values of the PC100 are different, the bytecode processing unit 101 reexecutes the branch instruction 1020. Therefore, in this embodiment, the bytecode processing unit 101 counts the second reexecution number of times that the process of executing the branch instruction 1020 is reexecuted, and when the second reexecution number exceeds a threshold, the process of executing the branch instruction 1020 is interrupted, and the above-mentioned error processing is executed.
[0029] FIG. 3 is a first diagram for explaining the operation of the virtual machine 10 executing a bytecode, and FIG. 4 is a second diagram for explaining the operation of the virtual machine 10 executing a bytecode.
[0030] First, the procedure shown in Fig. 3 will be described. When executing a bytecode, the bytecode processing unit 101 of the virtual machine 10 fetches the bytecode stored in the memory address pointed to by the PC 100 at this time (step S1 in Fig. 3). In the explanation of Fig. 3 and Fig. 4, the bytecode fetched from the memory in step S1 is denoted as BC1.
[0031] Next, the bytecode processing unit 101 of the virtual machine 10 decodes the BC1 fetched from the memory and identifies the instruction 102 corresponding to the BC1 (step S2 in FIG. 3). When the virtual machine 10 identifies the instruction 102 according to the BC1, it dispatches the instruction 102 (step S3 in FIG. 3).
[0032] When the instruction 102 corresponding to BC1 is dispatched, before executing the instruction 102 corresponding to BC1, the bytecode processing unit 101 of the virtual machine 10 compares the bytecode fetched from the memory address indicated by the PC 100 at this time with the BC1 used to dispatch the instruction 102 as a process for determining the legitimacy of the PC 100 (step S4 in Figure 3).
[0033] A process when BC1 is invalid in step S4 of FIG. 3 will be described. When BC1 is invalid in step S4, that is, when the bytecode fetched from the memory address indicated by the PC 100 at this time point is different from BC1, the bytecode processing unit 101 increments the first re-execution count, which indicates the number of times the bytecode has been re-executed, by one (step S5 of FIG. 3). Next, the virtual machine 10 determines whether the first re-execution count exceeds a predetermined threshold (step S6 of FIG. 3). The predetermined threshold may be any value. For example, the threshold may be "100". When the first re-execution count does not exceed the predetermined threshold, the bytecode processing unit 101 of the virtual machine 10 returns the process to step S1 of FIG. 4 and re-executes the bytecode from the beginning. When the first re-execution count exceeds the predetermined threshold, the virtual machine 10 executes a predetermined error process (step S7 of FIG. 3), and the procedure shown in FIG. 3 and FIG. 4 ends.
[0034] The process when BC1 is valid in step S4 of Fig. 3 will be described. When BC1 is valid in step S4, that is, when the bytecode fetched from the memory address indicated by PC 100 at this point in time is the same as BC1, the first re-execution count is initialized (step S8 of Fig. 3). For example, the virtual machine 10 sets the first re-execution count to "0".
[0035] Next, the virtual machine 10 determines whether the instruction 102 corresponding to BC1 is a branch instruction 1020 (step S9 in FIG. 3). If the instruction 102 corresponding to BC1 is not a branch instruction 1020, the virtual machine 10 passes the PC 100 and SP to the dispatched instruction 102 and executes this instruction 102 (step S13 in FIG. 3). If an operand is required for the instruction 102 according to BC1, the instruction 102 reads the operand from memory and executes the process related to the instruction 102.
[0036] In step S9, if the instruction 102 corresponding to BC1 is a branch instruction 1020, the value of PC 100 at this point in time is saved as a saved PC value (step S10 in FIG. 3), and the value of SP at this point in time is saved as a saved SP value (step S11 in FIG. 3). Next, the virtual machine 10 sets a branch instruction flag indicating that the branch instruction 1020 is to be executed (step S12 in FIG. 3), and executes an instruction according to BC1 (here, the branch instruction 1020) (step S13 in FIG. 3).
[0037] From here, the procedure shown in Fig. 4 will be described. When the processing of the instruction 102 executed in step S13 of Fig. 3 ends, the bytecode processing unit 101 of the virtual machine 10 judges whether or not the branch instruction flag is set (step S14 of Fig. 4). If the branch instruction flag is not set, that is, if the BC1 fetched in step S1 of Fig. 3 is not the branch instruction 1020, the bytecode processing unit 101 of the virtual machine 10 ends the procedure shown in Figs. 3 and 4.
[0038] In step S14 of FIG. 4, if the branch instruction flag is set, that is, if the BC1 fetched in step S1 of FIG. 3 is the branch instruction 1020, the bytecode processing unit 101 of the virtual machine 10 executes a process of reading out the saved PC value saved in step S10 of FIG. 3 and the saved SP value saved in step S11 of FIG. 3 (step S15 of FIG. 4). Next, the bytecode processing unit 101 of the virtual machine 10 fetches the bytecode stored in the memory address indicated by the saved PC100 value read in step S15 of FIG. 4 (step S16 of FIG. 4). Here, this bytecode is referred to as BC2. Next, the virtual machine 10 decodes the BC2 fetched in step S16 of FIG. 4, delivers the saved PC value and the saved SP value, and executes the instruction 102 (here, the branch instruction 1020) according to BC2 (step S17 of FIG. 4). In the case of the branch instruction 1020, step S13 in Fig. 3 corresponds to the process of executing the first branch instruction 1020, and step S17 in Fig. 4 corresponds to the process of executing the second branch instruction 1020. Next, in order to determine the validity of the value of PC100 after executing the branch instruction 1020, the bytecode processing unit 101 of the virtual machine 10 compares the value of PC100 at this time with the saved PC value (step S18 in Fig. 4).
[0039] A process when the value of the PC 100 is invalid in step S18 of FIG. 4 will be described. In step S18, when the value of the PC 100 at this time point is not the same as the saved PC value, the bytecode processing unit 101 of the virtual machine 10 increments the second re-execution count indicating the number of times the branch instruction 1020 is re-executed by one (step S19 of FIG. 4). Next, the bytecode processing unit 101 of the virtual machine 10 determines whether the second re-execution count exceeds a predetermined threshold (step S20 of FIG. 4). If the second re-execution count does not exceed the predetermined threshold, the bytecode processing unit 101 of the virtual machine 10 returns the process to step S15 of FIG. 4 and re-executes the branch instruction 1020. The process may be returned to step S16 of FIG. 4. If the second re-execution count exceeds the predetermined threshold, the bytecode processing unit 101 of the virtual machine 10 executes a predetermined error process (step S21 of FIG. 4), and the procedure shown in FIG. 3 and FIG. 4 ends.
[0040] The process when the value of PC100 is valid in step S18 of Fig. 4 will be described. In step S18 of Fig. 4, when the value of PC100 at this point is the same as the saved PC value, the bytecode processing unit 101 of the virtual machine 10 initializes the second re-execution count (step S22 of Fig. 4). Next, the bytecode processing unit 101 of the virtual machine 10 clears the set branch instruction 1020 flag (step S23 of Fig. 4), and the procedure shown in Figs. 3 and 4 ends.
[0041] The secure element 1 equipped with the virtual machine 10 described above can be implemented not only in a mobile information terminal such as a smartphone, but also in a card medium. Figure 5 shows an IC card 2 equipped with the secure element 1. Figure 5(a) shows a contact type IC card 20 equipped with the secure element 1. Figure 5(b) shows a contactless type IC card 21 equipped with the secure element 1.
[0042] As shown in FIG. 5(a), the contact IC card 20 having the secure element 1 mounted thereon has a contact pad 200 having the secure element 1 mounted thereon on its surface. The secure element 1 is electrically connected to some (here, five) of the terminals 200a provided on the back surface of the contact pad 200. In the case of the contact IC card 20, the I / F 1f of the secure element 1 is a serial I / O circuit that controls the I / O terminal 200a (I / O: Input / Output). As shown in FIG. 5(b), the non-contact IC card 21 having the secure element 1 mounted thereon has the secure element 1 connected to both ends of the antenna 210. In the case of the non-contact IC card 21, the I / F 1f of the secure element 1 is an analog communication circuit that controls the voltage between the terminals of the antenna 210. [Explanation of symbols]
[0043] 1. Secure Element 10 Virtual Machines 100 Program Counter (PC) 101 Bytecode processing section 102 Instructions 1020 Branch Instruction 2. IC Card 20 Contact IC Cards 21 Contactless IC cards
Claims
1. A secure element implementing a virtual machine, The virtual machine includes: A program counter is provided for pointing to a memory address where a bytecode to be executed is stored, and a bytecode processing unit is provided for executing the bytecode stored in the memory address pointed to by the program counter, the bytecode processing unit fetches a bytecode by referring to the program counter, decodes the fetched bytecode, dispatches an instruction corresponding to the bytecode, and then, before executing the instruction, compares the bytecode used for dispatching the instruction with the bytecode fetched by referring to the program counter at this time, and if the two bytecodes are the same, executes the instruction corresponding to the bytecode, and if the two bytecodes are different, re-executes the process of executing the bytecode. A secure element characterized by:
2. The secure element according to claim 1 , characterized in that the bytecode processing unit counts a first re-execution number of times that a process for executing a bytecode is re-executed, and executes an error processing when the first re-execution number exceeds a threshold value.
3. when an instruction corresponding to the bytecode is a branch instruction which determines whether or not to call a branch destination depending on whether or not a condition is satisfied, the bytecode processing unit executes the branch instruction, and then executes the branch instruction again, compares a value of the program counter when the branch instruction is executed for the first time with a value of the program counter after the branch instruction is executed for the second time, and re-executes the branch instruction if these two program counter values are different; 3. A secure element as claimed in claim 1 or 2.
4. The secure element according to claim 3 , wherein the bytecode processing unit counts a second re-execution count for re-executing the branch instruction, and executes an error process when the second re-execution count exceeds a threshold value.
5. A virtual machine implemented in a secure element, A program counter is provided for pointing to a memory address where a bytecode to be executed is stored, and a bytecode processing unit is provided for executing the bytecode stored in the memory address pointed to by the program counter, the bytecode processing unit fetches a bytecode by referring to the program counter, decodes the fetched bytecode, dispatches an instruction corresponding to the bytecode, and then, before executing the instruction, compares the bytecode used for dispatching the instruction with the bytecode fetched by referring to the program counter at this time, and if the two bytecodes are the same, executes the instruction corresponding to the bytecode, and if the two bytecodes are different, re-executes the process of executing the bytecode. A virtual machine characterized by:
6. 6. The virtual machine according to claim 5, wherein the bytecode processing unit counts a first re-execution number of times that the process of executing the bytecode is re-executed, and executes an error process when the first re-execution number exceeds a threshold value.
7. when an instruction corresponding to the bytecode is a branch instruction which determines whether or not to call a branch destination depending on whether or not a condition is satisfied, the bytecode processing unit executes the branch instruction, and then executes the branch instruction again, compares a value of the program counter when the branch instruction is executed for the first time with a value of the program counter after the branch instruction is executed for the second time, and re-executes the branch instruction if these two program counter values are different; 7. The virtual machine according to claim 5 or 6.
8. 8. The virtual machine according to claim 7, wherein the bytecode processing unit counts a second re-execution count for re-executing the branch instruction, and executes an error process when the second re-execution count exceeds a threshold value.
9. An IC card incorporating a secure element, the secure element comprises a virtual machine; The virtual machine includes: A program counter is provided for pointing to a memory address where a bytecode to be executed is stored, and a bytecode processing unit is provided for executing the bytecode stored in the memory address pointed to by the program counter, the bytecode processing unit fetches a bytecode by referring to the program counter, decodes the fetched bytecode, dispatches an instruction corresponding to the bytecode, and then, before executing the instruction, compares the bytecode used for dispatching the instruction with the bytecode fetched by referring to the program counter at this time, and if the two bytecodes are the same, executes the instruction corresponding to the bytecode, and if the two bytecodes are different, re-executes the process of executing the bytecode.
1. An IC card comprising:
10. 10. The IC card according to claim 9, wherein the bytecode processing unit counts a first re-execution number of times that the process of executing the bytecode is re-executed, and executes an error process when the first re-execution number exceeds a threshold value.
11. when an instruction corresponding to the bytecode is a branch instruction which determines whether or not to call a branch destination depending on whether or not a condition is satisfied, the bytecode processing unit executes the branch instruction, and then executes the branch instruction again, compares a value of the program counter when the branch instruction is executed for the first time with a value of the program counter after the branch instruction is executed for the second time, and re-executes the branch instruction if these two program counter values are different; 11. The IC card according to claim 9 or 10.
12. 12. The IC card according to claim 11, wherein the bytecode processing unit counts a second re-execution count for re-executing the branch instruction, and executes an error process when the second re-execution count exceeds a threshold value.
Citation Information
Patent Citations
Method of detecting failure attack for alterating content of memory, security device, and computer program
JP2009288908A
Electronic information storage medium, IC card, method for confirming data abnormality, and program for confirming data abnormality
JP2018088147A
