WO2022176164A1 - プログラム処理装置、プログラム処理方法、及び、プログラム - Google Patents
プログラム処理装置、プログラム処理方法、及び、プログラム Download PDFInfo
- Publication number
- WO2022176164A1 WO2022176164A1 PCT/JP2021/006409 JP2021006409W WO2022176164A1 WO 2022176164 A1 WO2022176164 A1 WO 2022176164A1 JP 2021006409 W JP2021006409 W JP 2021006409W WO 2022176164 A1 WO2022176164 A1 WO 2022176164A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- entry address
- program
- address
- false
- value
- Prior art date
Links
- 230000015654 memory Effects 0.000 claims abstract description 139
- 238000012544 monitoring process Methods 0.000 claims abstract description 34
- 238000012545 processing Methods 0.000 claims description 95
- 238000000034 method Methods 0.000 claims description 76
- 230000008569 process Effects 0.000 claims description 72
- 230000007704 transition Effects 0.000 claims description 52
- 230000000873 masking effect Effects 0.000 claims description 42
- 230000007246 mechanism Effects 0.000 claims description 31
- 230000006870 function Effects 0.000 claims description 17
- 230000003362 replicative effect Effects 0.000 abstract 1
- 238000002347 injection Methods 0.000 description 11
- 239000007924 injection Substances 0.000 description 11
- 102100023882 Endoribonuclease ZC3H12A Human genes 0.000 description 8
- 101710112715 Endoribonuclease ZC3H12A Proteins 0.000 description 8
- 238000010586 diagram Methods 0.000 description 5
- 238000012795 verification Methods 0.000 description 5
- 238000004891 communication Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 3
- 230000009471 action Effects 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 2
- 238000012217 deletion Methods 0.000 description 2
- 230000037430 deletion Effects 0.000 description 2
- 230000001012 protector Effects 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 238000012790 confirmation Methods 0.000 description 1
- 125000004122 cyclic group Chemical group 0.000 description 1
- 238000002955 isolation Methods 0.000 description 1
- 230000009191 jumping Effects 0.000 description 1
- 238000007562 laser obscuration time method Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000001902 propagating effect Effects 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/50—Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
- G06F21/52—Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow
- G06F21/54—Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow by adding security routines or objects to programs
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/14—Protection against unauthorised use of memory or access to memory
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/10—Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
- G06F21/12—Protecting executable software
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/10—Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
- G06F21/12—Protecting executable software
- G06F21/14—Protecting executable software against software analysis or reverse engineering, e.g. by obfuscation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/50—Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
- G06F21/52—Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/70—Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
- G06F21/78—Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure storage of data
- G06F21/79—Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure storage of data in semiconductor storage media, e.g. directly-addressable memories
Definitions
- the present disclosure relates to a program processing device, a program processing method, and a program.
- the Trusted Execution Environment is a secure execution environment that uses the processor's memory protection mechanism to control access between applications. For example, by running a security-critical application in a secure execution environment, even if a vulnerability is found in a library or application, it is possible to prevent the impact from propagating to the security-critical application.
- Non-Patent Document 1 discloses that by invalidating the setting of the access authority of the memory protection mechanism by a physical attack method called a fault injection attack, it becomes possible to access memory that is not permitted.
- the purpose of this disclosure is to prevent unauthorized memory access.
- the program processing device of the present disclosure includes: a storage unit that stores configuration data that associates a saved value obtained by copying a setting value, a storage that stores the setting value, and an entry address; A masking process of generating a false entry address by masking the entry address of the configuration data using the save value and replacing the entry address used by the application program with the false entry address before executing the application program.
- an entry address mask unit that performs a memory monitoring unit that determines whether the false entry address has been loaded during execution of the application program; When the memory monitoring unit determines that the false entry address has been loaded, the setting value is loaded from the storage, the setting value is used to generate a new entry address by unmasking the false entry address, and the false entry address is generated.
- an entry address unmasking unit for executing an unmasking process of replacing an address with the new entry address.
- the save value is used to mask the entry address used by the application program, and when the application program uses the entry address, the setting value is used to unmask the entry address before using the entry address. . Therefore, if the saved value and the set value do not match, the entry address cannot be accessed.
- FIG. 1 is a diagram showing a configuration example of a program processing device 100 according to Embodiment 1;
- FIG. 2 shows configuration data 121, an application program 120, and a storage 105 according to Embodiment 1.
- FIG. 4 is a flowchart showing an operation example of the program processing device 100 according to Embodiment 1;
- 4 is a flowchart showing an operation example of step S140 in Embodiment 1;
- 4A and 4B show configuration data 121 and a processing example according to the first embodiment;
- FIG. FIG. 10 is a diagram showing a configuration example of a program processing device 200 according to Embodiment 2;
- Embodiment 1 *** Configuration description *** The configuration of the program processing device 100 will be described based on FIG.
- the program processing device 100 is a computer comprising a processor 101 , a main memory 102 , a storage device 103 , an input/output interface 104 and a storage 105 . These pieces of hardware are connected to each other via signal lines.
- the processor 101 is an IC that performs arithmetic processing and controls other hardware.
- the processor 101 has operation registers, loads instructions and data into the operation registers, and executes data processing according to the instructions.
- processor 101 is a CPU or FPGA.
- IC is an abbreviation for Integrated Circuit.
- CPU is an abbreviation for Central Processing Unit.
- FPGA is an abbreviation for Field Programmable Gated Array.
- the main memory 102 is at least one of a volatile memory device and a non-volatile memory device.
- volatile memory is RAM.
- non-volatile storage devices are ROM, HDD or flash memory.
- RAM is an abbreviation for Random Access Memory.
- ROM is an abbreviation for Read Only Memory.
- HDD is an abbreviation for Hard Disk Drive.
- an address refers to a memory address of the main memory 102 .
- the storage device 103 is a nonvolatile storage device that stores data. Specific examples of non-volatile storage devices are ROM, HDD or flash memory.
- the input/output interface 104 is an interface for input/output.
- input/output interface 104 is a serial communication interface or a debug interface.
- serial communication interfaces are SPI, UART or I2C.
- debug interfaces are JTAG or JWD.
- SPI is an abbreviation for Serial Peripheral Interface.
- UART is an abbreviation for Universal Asynchronous Receiver Transmitter.
- I2C is an abbreviation for Inter-Integrated Circuit.
- JTAG is an abbreviation for Joint Test Action Group.
- SWD is an abbreviation for Serial Wire Debug.
- Storage 105 is a storage device.
- a specific example of storage 105 is memory or a register.
- Storage 105 stores data accessed by processor 101 .
- the storage 105 may be a part of the main memory 102, a part of the storage device 103, a register of the processor 101, or an independent storage device.
- the processor 101 comprises elements such as an entry address masking section 110 , a memory monitoring section 111 and an entry address unmasking section 112 .
- the entry address masking unit 110 and the entry address unmasking unit 112 are realized by software.
- the memory monitoring unit 111 is implemented by hardware such as a memory monitoring unit built into the processor.
- the memory monitoring unit 111 is a memory management unit that converts logical addresses handled by software and physical addresses handled by hardware, or a memory protection unit that prevents illegal memory accesses by programs.
- the storage device 103 contains an application program 120 operated by the processor 101, a countermeasure program 122 for executing the entry address mask unit 110 and the entry address unmask unit 112, and configuration data 121 for operating the countermeasure program 122. is stored.
- the storage device 103 stores an operating system, network drivers, and storage drivers. As shown in FIG. 1, main memory 102 is loaded with software and data stored in storage device 103 .
- the application program 120 is a program whose security is strengthened by the countermeasure program 122 .
- the application program 120 is a protected program to be protected.
- the application program 120 of the first embodiment is an execution module 130 in executable form.
- the execution module 130 is written in binary code and written in machine language that the processor 101 can interpret.
- FIG. 1 shows the state immediately before the processor 101 loads the execution module 130 into the main memory 102 and executes the execution module 130 .
- the countermeasure program 122 is a program that strengthens the security of the application program 120 .
- the countermeasure program 122 is a program that implements the functions of the entry address mask section 110 and the entry address unmask section 112 .
- the storage 105 stores setting values.
- a setting value is a value associated with an entry address used by the application program 120 .
- the entry address is the entry point used by the application program.
- the entry address is the execution start address of a module having a given function. It is called the entry address because it is the top address at which execution of the module entered in the memory area starts.
- the entry address is the memory address of the transition destination in the transition instruction used by the application program 120 .
- a module may be a subroutine or function used within the program by the application program 120, or may be another application program.
- the setting value is a value corresponding to the entry address.
- the setting value may be an attribute value of the module starting with the entry address, a processed value obtained by processing the module starting with the entry address, or a random value unrelated to the module starting with the entry address.
- a specific example of the setting value is a value describing the authority to transition to the entry address. Even if the application program 120 has transition instructions at multiple locations, if the memory address of the transition destination is the same, the transition destination becomes one entry address, and the set value becomes one corresponding to one entry address. . If the application program 120 has transition instructions at multiple locations and the memory addresses of the transition destinations are different, the transition destinations will be multiple entry addresses, and the set values will be multiple corresponding to the multiple entry addresses.
- the program processing device 100 of the first embodiment masks the entry address when the application program 120 is activated, and unmasks the entry address when transitioning.
- the entry address mask unit 110 performs mask processing using a pair of a save value obtained by copying a setting value and an entry address.
- the entry address mask unit 110 masks the entry address used by the application program 120 using the save value.
- the memory monitoring unit 111 monitors accesses to masked entry addresses. When the memory monitoring unit 111 determines that the masked entry address is accessed, the entry address unmasking unit 112 uses the set value to unmask the loaded masked entry address to restore the original entry address. Take out.
- the configuration data 121 in FIG. 2 is data used by the countermeasure program 122 to strengthen the security of the application program 120 .
- the configuration data 121 is 1. save value and 2. Storage of setting values (storage identifier); 3. This table associates entry addresses used by the application program 120 .
- a saved value is a value obtained by copying a set value. Since the set values stored in the storage 105 are saved in the configuration data 121, they are called saved values. Since the setting value and the entry address correspond, the save value and the entry address also correspond.
- a save value and a setting value are values corresponding to an entry address.
- the save value and the set value are data to be protected from being tampered with, and are data to be protected. The meaning of each item in the configuration data 121 of FIG.
- a “pair” is a pair of a save value and an entry address corresponding to the save value.
- a “saved value” is a value obtained by copying a setting value stored in the storage 105 . Immediately after copying, the set value and the saved value are the same value, but if the set value is tampered with, the set value and the saved value become different values.
- the save value (setting value) may be one like Pair1, or may be two or more like Pair2.
- a “setpoint storage” is a memory or register that stores a setpoint. In FIG.
- the register name "Reg1" of the register storing the setting value and the memory address "900" of the memory storing the setting value are stored as identifiers.
- the "entry address” is the execution start address of a module having a predetermined function, and in FIG. 2 stores the memory addresses "500” and "659" of the transition destination in the transition instruction.
- Application program 120 Although the execution module 130 of the application program 120 in FIG. 2 is described in binary code, it is represented in text form in FIG. 2 to facilitate the explanation.
- the value "500” is stored in the variable X at the memory address 100
- the value "500” of the variable X is loaded by the load instruction of the memory address 110
- the jump instruction of the memory address 120 loads the value "500” of the variable X. Jumping to memory address 500.
- the processor 101 executes an application program 120 and a countermeasure program 122 while executing an operating system, network driver, and storage driver.
- the application program 120 , countermeasure program 122 , operating system, network driver, and storage driver stored in the storage device 103 are read into the main memory 102 and executed by the processor 101 .
- Configuration data 121 is read into the main memory 102 and accessed by the processor 101 . Part or all of the application program 120, the configuration data 121, and the countermeasure program 122 may be incorporated into the operating system.
- Data, information, signal values, and variable values used, processed, or output by the application program 120 and the countermeasure program 122 are stored in the main memory 102, the storage device 103, or the register or cache memory in the processor 101. be.
- each section of the entry address mask section 110 and the entry address unmask section 112 may be read as “processing", “procedure” or “step”. Also, the “processing” of each process of the entry address masking unit 110 and the entry address unmasking unit 112 may be read as “program”, “program product” or “computer-readable storage medium recording the program”.
- the application program 120 and the countermeasure program 122 cause the computer to execute each process, each procedure, or each process, where the above "part” is read as “process", "procedure", or “step”.
- the program processing method is a method performed by the program processing device 100 executing a program.
- the application program 120 and the countermeasure program 122 may be stored and provided in a computer-readable recording medium. Also, the application program 120 and the countermeasure program 122 may be provided as program products.
- the program processing device 100 may be realized by a processing circuit such as a logic IC (Integrated Circuit), GA (Gate Array), ASIC (Application Specific Integrated Circuit), and FPGA (Field-Programmable Gate Array).
- a processing circuit such as a logic IC (Integrated Circuit), GA (Gate Array), ASIC (Application Specific Integrated Circuit), and FPGA (Field-Programmable Gate Array).
- processors In addition, the upper concept of processors, memories, combinations of processors and memories, and processing circuits is called processing circuitry. That is, the processor, the memory, the combination of the processor and the memory, and the processing circuit are each examples of processing circuitry.
- the program processing device 100 Before executing the application program 120, the program processing device 100 generates a false entry address by masking the entry address used by the application program 120 using the save value, and replaces the entry address with the false entry address. When a false entry address is loaded during execution of the application program 120, the program processing device 100 loads the setting value from the storage 105 and generates a new entry address by unmasking the false entry address using the setting value. replaces the false entry address with the new entry address.
- step S110 the countermeasure program 122 is read from the storage device 103 into the main memory 102 and executed.
- the countermeasure program 122 reads the application program 120 and the configuration data 121 from the storage device 103 to the main memory 102 .
- the execution module 130 of the application program 120 is read into the main memory 102 and the application program 120 becomes executable by the processor 101 .
- step S120 the entry address mask unit 110 selects one pair from the configuration data 121.
- step S130 the entry address mask unit 110 checks whether all pairs of configuration data have been processed. When all pairs of configuration data 121 have been processed, the entry address mask unit 110 notifies the processor 101 of the end of processing, and starts step S150. Otherwise, execute step S140.
- step S140 the entry address masking unit 110 performs entry address masking using pairs.
- step S141 the entry address mask unit 110 masks paired entry addresses using the save value, and calculates the masked entry addresses.
- the masked entry address is hereinafter referred to as a false entry address.
- the entry address mask unit 110 applies a hash function to the save value, and then applies an XOR operation to the obtained hash value and entry address.
- (+)Hash(data[n]) Equation (1) here, Addr[mask] is the fake entry address (masked entry address); Addr[raw] is the original entry address given as a pair, Hash() is a hash function; (+) is an XOR (eXclusive OR) operation; data is the save value given as a pair, data[i] (i 0...n) is the i-th saved value, Hash(data[i]) represents the hash value of the i-th save value.
- FIG. 5 shows configuration data 121 revised by the entry address mask unit 110 .
- the configuration data 121 in FIG. 5 is obtained by adding a false entry address to the configuration data 121 in FIG. Since Pair1 has one save value, expression (1) is as follows.
- Addr[mask] Addr[raw](+)Hash(data[0]) In FIG. 5, it is assumed that the number of false entry addresses is 256.
- FIG. 756 500 (+) Hash (1000) Since Pair2 has two save values, expression (1) is as follows.
- Addr[mask] Addr[raw](+)Hash(data[0])(+)Hash(data[1])
- FIG. 560 659 (+) Hash (6012) (+) Hash (6013)
- the hash function may be a cryptographic hash function such as md5 or SHA256.
- the hash function may be a non-cryptographic hash function such as CRC32 or xxHash.
- the hash function may be a universal hash function such as the Toeplitz hash.
- md5 is an abbreviation for Message Digest algorithm 5.
- sha256 is an abbreviation for Secure Hash Algorithm.
- CRC is an abbreviation for Cyclic Redundancy Checksum.
- the entry address mask unit 110 stores the configuration data 121 in FIG.
- the configuration data 121 is referenced by the memory monitoring unit 111 and the entry address unmasking unit 112 .
- step S142 the entry address mask unit 110 searches for jump instructions from the application program 120 to paired entry addresses. Specifically, the processor 101 searches the execution module 130 of the application program 120 for a process of loading the value of the entry address into the register and a jump instruction that exists after that process. The entry address mask unit 110 ignores jump instructions to addresses other than entry addresses. In the case of the execution module 130 of FIG. 5( a ), the entry address mask unit 110 detects a load instruction at memory address 110 and a jump instruction at memory address 120 .
- step S143 the entry address mask unit 110 verifies whether all jump instructions to the entry address have been searched. When all jump instructions to the entry address have been searched, the process ends. Otherwise, step S144 is executed.
- step S144 the entry address mask unit 110 replaces the data (entry address) loaded by the entry address load instruction with the false entry address calculated in step S141. Specifically, the data stored at the memory address of the load source is replaced with the false entry address. In the case of the execution module 130 of (a) of FIG. 5, the entry address mask unit 110 replaces the value "500" stored in the variable X of the memory address 100 with the value "756" of the false entry address (see FIG. 5). (b)).
- step S150 the processor 101 starts executing the application program 120 with the entry address masked.
- the memory monitoring unit 11 starts monitoring the application program 120 .
- the processor 101 executes the application program 120 of FIG. 5(b).
- the memory monitoring unit 111 starts monitoring the application program 120 in FIG. 5(b).
- step S ⁇ b>150 the memory monitoring unit 111 refers to the false entry address of the configuration data 121 during execution of the application program 120 and checks whether the false entry address has been loaded into the operation register of the processor 101 . If the false entry address is loaded into the operation register, step S170 is executed. Otherwise, the processor 101 continues execution of the application program 120 by returning to step S150.
- the memory monitoring unit 111 detects that the false entry address value "756" is loaded when executing the memory address 110, and detects the jump instruction of the memory address 120. do.
- the memory monitoring unit 111 interrupts the execution of the application program 120 without executing the jump instruction. Note that the execution of special processing according to certain conditions can be realized by the memory monitoring unit 111 causing an exception or an interrupt. The exception or interrupt can cause the processor 101 to interrupt the processing of the program being executed and execute the processing of step S170.
- step S170 the processor 101 activates the entry address unmasking unit 112.
- FIG. The entry address unmasking unit 112 refers to the “setting value storage” stored in the configuration data 121 and loads the setting values from the storage 105 .
- the entry address unmask unit 112 responds to the false entry address value "756". Access the storage "Reg1" and load the set value "1000".
- step S180 the entry address unmask unit 112 unmasks the false entry address loaded in step S160 using the setting value loaded in step S170.
- the unmasked entry address will be referred to as a new entry address.
- the original entry address can be restored by applying the XOR operation in a manner opposite to that of equation (1).
- Addr[raw] Addr[mask](+) Hash(data[0])(+) . . . (+)Hash(data[n]) Equation (2)
- the entry address unmask unit 112 replaces the false entry address loaded in step S160 with the new entry address ((c) in FIG. 5).
- the entry address unmask unit 112 notifies the processor 101 of the end of processing, and ends the processing. If the entry address unmasking unit 112 can restore the original entry address, the application program 120 jumps to the original entry address.
- (x) shall mean the value of the variable X.
- the entry address unmask unit 112 executes an instruction "LOAD (NP)" to load the new entry address NP.
- (NP) means the value of variable NP.
- the original entry address 500 the new entry address 500 is established.
- the application program 120 jumps to the entry address "500".
- step S180 After the unmasking process in step S180, the process returns to step S150 and the processor 101 continues to execute the program. If the false entry address is correctly unmasked by the processing of steps S170 and S180, it is possible to transition to the correct entry address with the following jump instruction. If the transition to the entry address is successful, it can be guaranteed that the correct setting value is stored in the storage 105 . On the other hand, if the setting value of the storage 105 is tampered with by an unauthorized attack, the false entry address cannot be correctly unmasked and the entry address cannot be correctly restored. Therefore, the subsequent jump instruction will result in an abnormal transition, and the unauthorized attack will not succeed.
- the processing of the entry address mask unit 110 is the processing of step S140.
- the processing of the memory monitoring unit 111 is the processing of step S160.
- the processing of the entry address unmasking unit is the processing of steps S170 and S180.
- the processing of the application program 120 is the processing of step S150.
- the processing of the countermeasure program 122 is all the processing of FIG. 3 except steps S150 and S160.
- the save value is used to mask the entry address used by the application program 120 . Then, when the application program 120 uses the entry address, it uses the entry address after unmasking the entry address according to the set value. Therefore, if the saved value and the set value do not match, the entry address cannot be correctly accessed.
- the program processing device 100 of Embodiment 1 masks the entry address, there is no problem even if the setting value set in the storage 105 is read by an attacker. Also, since the fake entry address is a value masked by a hash value, there is no problem even if the fake entry address is read by an attacker.
- TEE Trusted Execution Environment
- TEE provides a secure execution environment for applications with hardware as well as software support.
- TEE is provided by processors with resource isolation mechanisms based on memory access monitoring.
- access control between applications is performed using a memory protection mechanism (such as a mechanism called Physical Memory Protection) that the processor has.
- the memory protection mechanism verifies access rights on every memory access.
- the memory protection mechanism sets access rights for other applications when executing a transition to another application program.
- the memory protection mechanism verifies access rights each time an application program begins execution.
- the memory protection mechanism controls memory access based on access rights.
- the program processing device 100 executes the application program 120 stored in the storage device 103 after applying countermeasures against fault injection attacks.
- a fault injection attack is an attack that causes an error in processor processing and skips the setting of the access authority of the memory protection mechanism when the processor processing transitions to the transition destination.
- the entry address is the entry address of the application program running on the TEE.
- the entry address is an execution start address of a plurality of application programs running on the processor.
- the setting value is a value indicating the access authority of the memory protection mechanism set for each application program.
- the setting value is a value indicating the access authority that the memory protection mechanism sets for the memory area. Access rights are defined by a memory area and attributes for that memory area.
- a memory region is a range of memory indicated by a memory address.
- An attribute is a value that indicates which action, execution, reading, or writing, can be performed on data in a memory area.
- a storage is a register or memory referenced by a memory protector and a register or memory used by a memory protector. Specifically, storage is a special register or special memory that the memory protection mechanism has.
- the entry address mask unit 110 masks the execution start address of the application program based on the value (save value) indicating the access authority used to monitor the memory access of the application program to generate a false entry address. do. Then, the execution start address of the application program is replaced with the false entry address.
- the memory monitoring unit 111 refers to the false entry address of the configuration data 121 during execution of the application program 120, and checks whether the false entry address has been loaded. Then, it checks whether there is a transition to another application program.
- Unmask processing The entry address unmask unit 112 unmasks the false entry address based on the value (set value) indicating the access authority stored in the storage when starting transition execution to another application program, and creates a new entry. Generate an address. The entry address unmask unit 112 sets the new entry address as the execution start address of another application program.
- the entry address is the execution start address of the application program
- the setting value is the value indicating the access authority of the memory protection mechanism set for each application program.
- the memory protection mechanism checks access rights to the application program each time the application program starts executing.
- the program processing apparatus 100 of Embodiment 1 provides a mechanism that prevents execution from being started from the correct entry address when the access authority is tampered with. Therefore, if the access authority of the memory protection mechanism is tampered with, the execution of the application program cannot be started from the execution start address.
- the program processing device 100 of the first embodiment guarantees that the access authority of the memory protection mechanism is correctly set even under an attack environment where arbitrary processing can be skipped due to a fault injection attack.
- the program processing device 100 according to the first embodiment can guarantee confirmation of the access authority of the memory protection mechanism and prohibit illegal execution of the application program.
- the value of the access authority of the memory protection mechanism has not been tampered with when the application program is executed under the TEE. Therefore, an attack in which an application program refers to the execution start address of another application program (memory address where another application program is located) cannot be established. Further, according to the first embodiment, it is possible to prevent a fault injection attack on the memory protection mechanism.
- the program processing device 100 is a signal processing device that processes an application program that uses entry addresses and setting values corresponding to the entry addresses.
- the program processing device has a storage unit that stores configuration data that associates a save value obtained by copying a setting value, an identifier of a storage that stores the setting value, and an entry address.
- the entry address masking unit 110 performs the following masking process before executing the application program 120 . 1.
- a false entry address is generated by masking the entry address of the configuration data 121 using the save value of the configuration data 121 . 2.
- Memory monitoring unit 111 determines whether a false entry address has been loaded during execution of application program 120 .
- the entry address unmasking unit 112 executes the following unmasking process when the memory monitoring unit 111 determines that a false entry address has been loaded. 1. A setting value is loaded from the storage 105 and a new entry address is generated by unmasking the false entry address using the setting value. 2. Replace the bogus entry address with the new entry address.
- the application program 120 is executed by applying a countermeasure consisting of mask processing and unmask processing to the application program 120 based on the configuration data 121 .
- a countermeasure consisting of mask processing and unmask processing
- the masking process may apply an encryption process using a private key
- the unmasking process may apply a decryption process using a private key.
- the calculation formula for the false entry address shown in step S141 may be the following formula (3).
- Addr[mask] Addr[raw](+)Enc(data[0],key)(+). . . (+)Enc(data[n], key) Equation (3)
- Enc( ) and key represent encryption processing and secret key, respectively.
- Enc(data[0], key) is obtained by encrypting data[0] with the private key key.
- the encryption process may use ciphers such as AES and RSA.
- step S180 When expression (3) is substituted for expression (1) in the entry address masking process, the unmasking process shown in step S180 must be replaced as follows.
- Addr[raw] Addr[mask](+)Enc(data[0],key)(+). . . (+)Enc(data[n], key) Equation (4)
- AES is an abbreviation for Advanced Encryption Standard.
- RSA® is an abbreviation for Rivest-Shamir-Adleman cryptosystem.
- the formula for calculating the masked entry address shown in step S141 may be the following formula (5).
- Addr[mask] Enc(...Enc(Enc(Addr[raw], data[0]), data[1])..., data[n]) Equation (5)
- Enc(Addr[raw], data[0]) is Addr[raw] encrypted with key data[0].
- Enc (Enc (Addr[raw], data[0]), data[1]) is Addr[raw] encrypted with key data[0] and further encrypted with key data[1].
- Expression (5) is a process of giving the original entry address as the data for the encryption process and giving the save value as the key. Further, the encryption result thus obtained is used as data, and the data is repeatedly encrypted using the save value as a key.
- expression (5) is substituted for expression (1) in the entry address masking process, the unmasking process shown in step S180 must be replaced as follows.
- the cipher used in the entry address masking and unmasking processes realized by equations (5) and (6) must be a common key cipher.
- a block cipher such as AES or KCiper-2 or a stream cipher may be used.
- the transition instruction need not be a jump instruction, and may be a GOTO instruction, a CALL instruction, a RETURN instruction, a function execution instruction, or a subroutine execution instruction.
- the application program 120 and the configuration data 121 may be externally supplied via the input/output interface 104 instead of the storage device 103 .
- the entry address mask unit 110 may set the transition destination memory address found by the search result of the load instruction and the jump instruction.
- the program processing device 100 of Embodiment 1 may be used for secure boot protection.
- secure boot after checking the hash value of the boot code, the process transitions to the boot code startup process. In a fault injection attack, this hash value check process is skipped and booted with an unauthorized boot code.
- the setting value and the save value may be set as boot code hash values, and the entry address may be set as the boot code execution start address.
- the program processing device 100 of Embodiment 1 may be used for protection of authentication check processing.
- the authentication check process the password is received from the user, the password is verified, and if the password is correct, the process shifts to post-authentication process.
- a fault injection attack skips password verification and fraudulently causes post-authentication processing to be performed.
- the program processing device 100 of the first embodiment is applied to protection of the authentication check process, the set value and the save value should be the values of the password verification result, and the entry address should be the execution start address of the post-authentication process.
- the program processing device 100 of the first embodiment if the value of the password verification result as the save value and the value of the password verification result as the set value do not match, transition is made to the correct execution start address after password authentication. I can't.
- Embodiment 2 points different from the first embodiment will be described.
- the program processing device 200 of the second embodiment acquires the program code 140 of the application program 120 from the input/output interface 104 .
- the program processing device 200 generates an application program 120 that implements all the operations of the program processing device 100 only by software. Specifically, the program processing device 200 applies countermeasures against fault injection attacks to the program code 140 to generate a countermeasured execution module.
- the configuration of the program processing device 200 is a computer comprising a processor 101 , a main memory 102 and an input/output interface 104 . These pieces of hardware are connected to each other via signal lines.
- the input/output interface 104 is an interface for input/output.
- input/output interface 104 is a serial communication interface or a network interface.
- serial communication interfaces are SPI, UART or I2C.
- a specific example of the network interface is Ethernet (registered trademark).
- the processor 101 includes elements such as a transition identifying unit 210 , an entry address masking unit 211 , an unmask processing adding unit 212 and a code generating unit 213 .
- the transition identifying unit 210 , the entry address masking unit 211 , the unmask processing adding unit 212 and the code generating unit 213 are implemented as software stored in the main memory 102 .
- the input/output interface 104 receives the program code 140 of the application program 120 and the configuration data 121 shown in the first embodiment from the outside. Further, the input/output interface 104 transmits the corrected execution module generated by the program processing device 200 to the outside.
- the countermeasure program 122 is a program that strengthens the security of the application program 120 .
- the countermeasure program 122 is a program that implements the functions of the transition identifying unit 210 , the entry address masking unit 211 , the unmask processing adding unit 212 , and the code generating unit 213 .
- the countermeasure program 122 is an editor that edits the program code 140, and the program code 140 is data that the countermeasure program 122 edits.
- FIG. 6 shows a state in which the countermeasure program 122 has loaded the program code 140 into the main memory 102 as data for editing.
- step S ⁇ b>210 the processor 101 receives the program code 140 and the configuration data 121 of the application program 120 via the input/output interface 104 and reads them into the main memory 102 .
- the configuration data 121 are assumed to be the same as those shown in FIG.
- step S220 the entry address mask unit 211 selects one pair of configuration data 121.
- step S230 the entry address mask unit 211 checks whether all pairs have been processed. If all pairs have been processed, step S250 is executed. Otherwise, execute step S240.
- step S240 the entry address masking unit 211 performs entry address masking processing on the program code 140, and the entry address masking unit 211 adds entry address unmasking processing.
- step S240 the processing of step S240 will be described. Most of the processing in step S240 is the same as the mask processing (FIG. 4) of the first embodiment. Specifically, steps S241, S242, S243, and S244 correspond to steps S141, S142, S143, and S144, respectively. However, there is a difference that the object to which the countermeasure is applied is the execution module 130 immediately before the start of execution in the first embodiment, and the program code 140 in the second embodiment.
- step S241 the entry address masking unit 211 calculates a masked entry address using the saved value according to Equation (1).
- the masked entry address is hereinafter referred to as a false entry address.
- FIG. 9 shows configuration data 121 revised by the entry address mask unit 110 .
- the configuration data 121 in FIG. 9 are the same as those shown in FIG.
- step S242 the transition identifying unit 210 searches for a jump instruction from the program code 140 to the entry address. Specifically, the transition identifying unit 210 searches the program code 140 for a process of loading the value of the entry address into the register and a jump instruction that exists after that process.
- the value "500” is stored in the variable X on the first line
- the value "500” of the variable X is loaded on the second line
- the jump instruction on the third line Assume that a jump is made to memory address 200 .
- the entry address mask unit 211 detects the jump instruction on the third line.
- step S243 the entry address mask unit 211 verifies whether all jump instructions to the entry address have been searched. When all jump instructions to the entry address have been searched, the process ends. Otherwise, step S244 is executed.
- step S244 the entry address masking unit 211 replaces the entry address loaded by the load instruction found by the transition identifying unit 210 with the false entry address calculated in step S241. Specifically, the data set in the variable of the program code 140 is replaced with the false entry address.
- the entry address mask unit 211 replaces the value "500" set in the variable X with the value "756" of the false entry address ((b) in FIG. 9). ).
- Step S245 which is different from the first embodiment, will be described.
- the unmasking process addition unit 212 adds to the program code 140 an unmasking process of unmasking the false entry address using the set value immediately before the jump instruction to the entry address specified in step S242.
- the unmask processing code according to equation (2) is written in the same language as the program code 140 and added to the program code 140 .
- the entry address masking process is a process based on formula (1), and may be a process based on either formula (3) or formula (5).
- the unmasking process adding unit 212 adds the unmasking process code shown in formula (4) or formula (6). Unmasking by the unmasking code must correspond to masking.
- step S250 the code generator 213 organizes the plurality of unmask processing codes added in step S245 and deletes unnecessary unmask processing codes. For example, if the application program 120 transitions to the same application program at multiple locations, the unmask processing code will be the same code, and the same unmask processing code will be redundant and unnecessary processing. Therefore, the unmask processing is deleted for the duplication in which the application program 120 transitions to the same application program.
- the false entry address "756" of Pair1 is the false entry address of another application program P1 to which the application program 120 transitions. It is assumed that the application program 120 has a description to transition to the application program P1 at two places.
- the setting value "1000" of the application program P1 is stored in Reg1.
- the two unmasking codes in FIG. 10 would be the same.
- the code generator 213 puts together the two unmask processing codes into one common routine FUNC, and adds a CALL instruction for executing the common routine FUNC before the jump instruction.
- the unmask processing code will be the same code, and the same unmask processing code will be redundant and unnecessary processing. Therefore, the unmask process is deleted by the duplication of the "setting value storage" specified by the configuration data.
- the fault injection attack shown in Non-Patent Document 1 aims at resetting the access authority stored in the special register of the memory protection mechanism.
- the fault injection attack causes an error in the calculation processing of the processor 101 to skip resetting the access authority to the special register of the memory protection mechanism when the application program is switched.
- the application program 120 of Embodiment 2 is applied to the TEE, the set value is the access authority value for each application program, and the access authority value is stored in a special register of the memory protection mechanism. Since this special register is common to multiple applications, the storage location of the access privilege value is the same.
- step S250 is to eliminate this redundant unmask processing code.
- the special register possessed by the memory protection mechanism is the storage "Reg1".
- the false entry address "756" of Pair1 is the false entry address of another application program P1 to which the application program 120 transits.
- the false entry address "600" of Pair2 is the false entry address of another application program P2 to which the application program 120 transits.
- the application program 120 has a description that transitions to the application program P1 and the application program P2.
- the access authority value is stored in the special register "Reg1" of the memory protection mechanism, so the two unmask processing codes for Pair1 and Pair2 are be the same.
- the code generator 213 puts together the two unmask processing codes into one common routine FUNC, and adds a CALL instruction for executing the common routine FUNC before the jump instruction.
- step S260 the code generation unit 213 sets the program code 140 subjected to the countermeasure as the execution module 130, and transmits the execution module 130 to the outside via the input/output interface 104.
- the execution module 130 is a program in which entry addresses are replaced with false entry addresses.
- the execution module 130 is a program that causes the computer to execute the following processes before accessing the false entry address. 1. A process of loading a setting value from the storage and generating a new entry address by unmasking the false entry address using the setting value;2. Processing to replace fake entry address with new entry address
- the processing of the transition specifying unit 210 is step S242.
- the processing of the entry address mask unit 211 is step S210, step S2220, step S230, step S241 and step S244.
- the processing of the unmask processing adding unit 212 is step S245.
- the processing of the code generator 213 is step S250 and step S260.
- the program processing device 200 is a program code generation device that masks entry addresses when generating a program and embeds an unmask processing code in the program code.
- the program processing device 200 has a storage unit that stores configuration data 121 that associates save values obtained by copying setting values, storage storing the setting values, and entry addresses used by the program code 140 .
- the transition identifying unit 210 identifies transition instructions for transitioning to entry addresses from the program code 140 .
- the entry address mask unit 211 executes the following masking process. 1. A false entry address is generated by masking the entry address of the configuration data 121 using the save value. 2. Replace the entry address used by the program code 140 with a false entry address.
- the unmask processing addition unit 212 adds the following unmask processing code immediately before the transition instruction identified by the transition identification unit 210. 1. A code that loads a setting value from the storage 105 and generates a new entry address by unmasking the false entry address using the setting value. 2. Unmasking code that performs unmasking using the new entry address.
- the program processing device 200 applies the countermeasure to the application program 120 based on the configuration data 121 and generates a countermeasure-completed code.
- the monitoring unit 111 becomes unnecessary. Also, the redundant unmasking code has been removed from the fixed code.
- the program code 140 handled by the program processing device 200 may be any program code to which the unmasking process adding unit 212 can add an unmasking process code.
- the program code 140 may be executable module code, source code, script code, intermediate code, HTML (hypertext markup language) text, or other code.
- Embodiment 3 points different from Embodiments 1 and 2 will be described.
- the configuration data 121 of FIG. 12 shall be used.
- the configuration data 121 in FIG. 12 are the same as the configuration data 121 in FIG.
- ⁇ Mask processing In the case of the execution module 130 in FIG. Assume that the comparison instruction at address 120 compares the value of variable X with the value "333".
- the entry address mask unit 110 refers to the entry address of the configuration data 121 and detects a load instruction that refers to the entry address "500". Since the load instruction for memory address 110 loads the value “333” for memory address 500 , entry address mask unit 110 detects the load instruction for memory address 110 .
- the entry address mask unit 110 replaces the value "500” stored in the memory address 100 with the value "756" of the false entry address ((b) of FIG. 12).
- the processor 101 executes the application program 120 shown in FIG. 12(b).
- the memory monitoring unit 111 starts monitoring the application program 120 in FIG. 12(b).
- the memory monitoring unit 111 refers to the false entry address of the configuration data 121 during execution of the application program 120 and checks whether the false entry address has been loaded into the operation register of the processor 101 . In the case of the application program 120 of FIG. 12(b), the memory monitoring unit 111 detects that the false entry address value "756" has been loaded during the execution of the memory address 110, and interrupts the execution of the application program 120. .
- the entry address unmasking unit 112 accesses Reg1 corresponding to the fake entry address value "756" to set the value "1000". ” to load.
- the entry address unmask unit 112 executes the instruction “LOAD (500)” to load the value of the new entry address 500.
- the application program 120 can compare the value ⁇ 333 ⁇ of the entry address "500" and the value of the variable X.
- the entry address handled by the program processing device 100 may be the reference destination memory address instead of the transition destination memory address.
- the entry address handled by the program processing device 200 may also be a reference destination memory address instead of a transition destination memory address.
- Embodiment 3 by using the reference memory address as the entry address, it is possible to prevent unauthorized access to the data stored at the reference memory address.
- program processing device 101 processor, 102 main memory, 103 storage device, 104 input/output interface, 105 storage, 110 entry address masking unit, 111 memory monitoring unit, 112 entry address unmasking unit, 120 application program, 121 configuration data , 122 countermeasure program, 130 execution module, 140 program code, 200 program processing device, 210 transition identification unit, 211 entry address mask unit, 212 unmask processing addition unit, 213 code generation unit.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Computer Hardware Design (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Technology Law (AREA)
- Storage Device Security (AREA)
Abstract
Description
設定値を複写したセーブ値と、前記設定値を記憶するストレージと、エントリーアドレスとを対応付けたコンフィグレーションデータを記憶した記憶部と、
アプリケーションプログラムの実行前に、前記セーブ値を用いて前記コンフィグレーションデータの前記エントリーアドレスをマスクした偽エントリーアドレスを生成し前記アプリケーションプログラムが使用しているエントリーアドレスを前記偽エントリーアドレスに置換するマスク処理を実行するエントリーアドレスマスク部と、
前記アプリケーションプログラムの実行中に、前記偽エントリーアドレスがロードされたかどうかを判定するメモリ監視部と、
前記偽エントリーアドレスがロードされたと前記メモリ監視部が判定した場合、前記ストレージから前記設定値をロードして前記設定値を用いて前記偽エントリーアドレスをアンマスクした新エントリーアドレスを生成して前記偽エントリーアドレスを前記新エントリーアドレスに置換するアンマスク処理を実行するエントリーアドレスアンマスク部と
を備えた。
***構成の説明***
図1に基づいて、プログラム処理装置100の構成を説明する。
プログラム処理装置100は、プロセッサ101と、主記憶メモリ102と、記憶装置103と、入出力インタフェース104と、ストレージ105とを備えるコンピュータである。これらのハードウェアは信号線を介して互いに接続されている。
プロセッサ101は、演算レジスタを有し、演算レジスタに命令とデータとをロードして命令に従ったデータ処理を実行する。
例えば、プロセッサ101は、CPUあるいはFPGAである。
ICは、Integrated Circuitの略称である。
CPUは、Central Processing Unitの略称である。
FPGAは、Field Programable Gated Arrayの略称である。
RAMは、Random Access Memoryの略称である。
ROMは、Read Only Memoryの略称である。
HDDは、Hard Disk Driveの略称である。
以下、アドレスとは、主記憶メモリ102のメモリアドレスをいう。
SPIは、Serial Peripheral Interfaceの略称である。
UARTは、Universal Asynchronous Receiver Transmitterの略称である。
I2Cは、Inter-Integrated Circuitの略称である。
JTAGは、Joint Test Action Groupの略称である。
SWDは、Serial Wire Debugの略称である。
ストレージ105の具体例は、メモリ、又は、レジスタである。
ストレージ105は、プロセッサ101によりアクセスされるデータを記憶する。
ストレージ105は、主記憶メモリ102の一部でも構わないし、記憶装置103の一部でも構わないし、プロセッサ101のレジスタでもよいし、独立した記憶デバイスでもよい。
エントリーアドレスマスク部110とエントリーアドレスアンマスク部112とはソフトウェアで実現される。
メモリ監視部111は、プロセッサに内蔵されるメモリ監視ユニットのようなハードウェアにより実現される。例えば、メモリ監視部111は、ソフトウェアが扱う論理アドレスとハードウェアが扱う物理アドレスとを変換するメモリ管理ユニットあるいはプログラムの不正なメモリアクセスを防止するためのメモリ保護ユニットである。
図1に示すように、主記憶メモリ102には、記憶装置103に記憶されたソフトウェアとデータが読み込まれる。
アプリケーションプログラム120は、保護の対象となる保護対象プログラムである。
実行モジュール130は、バイナリコードで記載されており、プロセッサ101が解釈できるマシンランゲージで記載されている。
図1は、プロセッサ101が、実行モジュール130を主記憶メモリ102に読み込み、実行モジュール130を実行する直前の状態を示している。
対策プログラム122は、エントリーアドレスマスク部110とエントリーアドレスアンマスク部112の機能を実現するプログラムである。
エントリーアドレスは、所定の機能を有するモジュールの実行開始アドレスである。メモリ領域にエントリーされているモジュールの実行開始の先頭のアドレスなのでエントリーアドレスという。具体的には、エントリーアドレスは、アプリケーションプログラム120が使用している遷移命令における遷移先のメモリアドレスである。
モジュールとは、アプリケーションプログラム120がプログラム内で使用しているサブルーチン又は関数でもよいし、別なアプリケーションプログラムでもよい。
設定値は、エントリーアドレスで始まるモジュールの属性値でもよいし、エントリーアドレスで始まるモジュールを加工した加工値でもよいし、エントリーアドレスで始まるモジュールとは関係のない乱数値であってもよい。
設定値の具体例は、エントリーアドレスに遷移する権限を記載した値である。
アプリケーションプログラム120が複数個所において遷移命令を有していても遷移先のメモリアドレスが同じであれば、遷移先は1つのエントリーアドレスになり、設定値は1つのエントリーアドレスに対応して1つとなる。アプリケーションプログラム120が複数個所において遷移命令を有しており遷移先のメモリアドレスが異なれば、遷移先は複数のエントリーアドレスとなり、設定値は複数のエントリーアドレスに対応して複数になる。
エントリーアドレスマスク部110は、設定値を複写したセーブ値とエントリーアドレスとのペアを利用してマスク処理をする。エントリーアドレスマスク部110は、セーブ値を用いてアプリケーションプログラム120が使用しているエントリーアドレスをマスクする。
メモリ監視部111は、マスクされたエントリーアドレスへのアクセスを監視する。
エントリーアドレスアンマスク部112は、メモリ監視部111がマスクされたエントリーアドレスへのアクセスがあったと判断した場合に、設定値を用いて、ロードしたマスクされたエントリーアドレスをアンマスクして元のエントリーアドレスを取り出す。
図2のコンフィグレーションデータ121は、対策プログラム122がアプリケーションプログラム120のセキュリティを強化するために使用するデータである。
コンフィグレーションデータ121は、
1.セーブ値と、
2.設定値のストレージ(ストレージの識別子)と、
3.アプリケーションプログラム120が使用しているエントリーアドレスと
を対応付けているテーブルである。
セーブ値とは、設定値を複写した値である。ストレージ105に記憶された設定値をコンフィグレーションデータ121にセーブしているのでセーブ値という。設定値とエントリーアドレスとは対応しているのでセーブ値とエントリーアドレスとも対応している。
セーブ値と設定値とは、エントリーアドレスに対応した値である。セーブ値と設定値は、改ざんを防ぐデータであり保護の対象となる保護対象データである。
図2のコンフィグレーションデータ121における各項目の意味は以下のとおりである。
「ペア」とは、セーブ値とそのセーブ値に対応するエントリーアドレスとの対をいう。図2では、Pair1とPair2との2つのペアが図示されている。
「セーブ値」とは、ストレージ105に記憶されている設定値を複写した値である。複写した直後は、設定値とセーブ値とは同じ値であるが、設定値が改ざんされれば、設定値とセーブ値とは異なる値になる。セーブ値(設定値)は、Pair1のように1個でもよいし、Pair2のように2個以上の複数の個数でもよい。
「設定値のストレージ」とは、設定値を記憶したメモリ又はレジスタである。図2では、設定値のストレージを識別するために、識別子として、設定値を記憶したレジスタのレジスタ名「Reg1」と、設定値を記憶したメモリのメモリアドレス「900」が記憶されている。
「エントリーアドレス」は、所定の機能を有するもモジュールの実行開始アドレスであり、図2では、遷移命令における遷移先のメモリアドレス「500」とメモリアドレス「659」とが記憶されている。
図2のアプリケーションプログラム120の実行モジュール130は、バイナリコードで記載されているが、説明をわかりやすくするために、図2では、テキスト形式で表現している。
図2の実行モジュール130は、メモリアドレス100で変数Xに値「500」が格納されており、メモリアドレス110のロード命令により変数Xの値「500」をロードし、メモリアドレス120のジャンプ命令によりメモリアドレス500にジャンプしている。
記憶装置103に記憶されているアプリケーションプログラム120、対策プログラム122、オペレーティングシステム、ネットワークドライバ及びストレージドライバは、主記憶メモリ102に読み込まれ、プロセッサ101によって実行される。
主記憶メモリ102には、コンフィグレーションデータ121が読み込まれ、プロセッサ101によりアクセスされる。
なお、アプリケーションプログラム120と、コンフィグレーションデータ121と、対策プログラム122との一部又は全部がオペレーティングシステムに組み込まれていてもよい。
アプリケーションプログラム120と、対策プログラム122とは、前記の各部の「部」を「処理」、「手順」あるいは「工程」に読み替えた各処理、各手順あるいは各工程を、コンピュータに実行させる。
また、プログラム処理方法は、プログラム処理装置100がプログラムを実行することにより行われる方法である。
アプリケーションプログラム120と、対策プログラム122とは、コンピュータ読取可能な記録媒体に格納されて提供されてもよい。また、アプリケーションプログラム120と、対策プログラム122とは、プログラムプロダクトとして提供されてもよい。
プログラム処理装置100は、アプリケーションプログラム120の実行前に、セーブ値を用いてアプリケーションプログラム120が使用しているエントリーアドレスをマスクした偽エントリーアドレスを生成して、エントリーアドレスを偽エントリーアドレスに置換する。
プログラム処理装置100は、アプリケーションプログラム120の実行中に、偽エントリーアドレスがロードされた場合、ストレージ105から設定値をロードして、設定値を用いて偽エントリーアドレスをアンマスクした新エントリーアドレスを生成して、偽エントリーアドレスを新エントリーアドレスに置換する。
図3に基づいて、プログラム処理装置100の動作を説明する。
動作開始前には、ストレージ105には、設定値が格納され、コンフィグレーションデータ121には、値が設定されているものとする。具体的には、設定値がセーブ値としてコンフィグレーションデータ121に複写されているものとする。また、ストレージ105の識別子と、設定値と対応付けられたエントリーアドレスとがコンフィグレーションデータ121に設定されているものとする。
対策プログラム122は、アプリケーションプログラム120とコンフィグレーションデータ121を記憶装置103から主記憶メモリ102へ読み込む。この時点で、アプリケーションプログラム120の実行モジュール130が主記憶メモリ102へ読み込まれてアプリケーションプログラム120がプロセッサ101により実行可能な状態になる。
図4に基づいて、ステップS140のエントリーアドレスのマスク処理を説明する。
ステップS141において、エントリーアドレスマスク部110は、セーブ値を用いてペアとなっているエントリーアドレスをマスクし、マスクしたエントリーアドレスを計算する。以下、マスクしたエントリーアドレスを偽エントリーアドレスという。
具体的には、エントリーアドレスマスク部110は、セーブ値にハッシュ関数を適用した後、得られたハッシュ値とエントリーアドレスに対してXOR演算を適用する。この処理は、次の式(1)で表すことができる。
Addr[mask]=Addr[raw](+)Hash(data[0])(+)...(+)Hash(data[n]) 式(1)
ここで、
Addr[mask]は、偽エントリーアドレス(マスクされたエントリーアドレス)、
Addr[raw]は、ペアとして与えられた元のエントリーアドレス、
Hash()は、ハッシュ関数、
(+)は、XOR(eXclusive OR)演算、
dataは、ペアとして与えられたセーブ値、
data[i](i=0...n)は、i番目のセーブ値、
Hash(data[i])は、i番目のセーブ値のハッシュ値を表す。
図5のコンフィグレーションデータ121は、図2のコンフィグレーションデータ121に偽エントリーアドレスを追加したものである。
Pair1は、セーブ値が1個なので、式(1)は以下のようになる。
Addr[mask]=Addr[raw](+)Hash(data[0])
図5では、偽エントリーアドレスが256になったものとしている。
756=500(+)Hash(1000)
Pair2は、セーブ値が2個なので、式(1)は以下のようになる。
Addr[mask]=Addr[raw](+)Hash(data[0])(+)Hash(data[1])
図5では、偽エントリーアドレスが560になったものとしている。
560=659(+)Hash(6012)(+)Hash(6013)
md5は、Message Digest algorithm 5の略称である。
sha256は、Secure Hash Algorithmの略称である。
CRCは、Cyclic Redundancy Checksumの略称である。
図5の(a)の実行モジュール130の場合、エントリーアドレスマスク部110は、メモリアドレス110のロード命令と、メモリアドレス120のジャンプ命令を検出する。
図5の(a)の実行モジュール130の場合、エントリーアドレスマスク部110は、メモリアドレス100の変数Xに格納される値「500」を、偽エントリーアドレスの値「756」で置換する(図5の(b))。
ステップS150において、プロセッサ101は、エントリーアドレスのマスク処理を施したアプリケーションプログラム120の実行を開始する。同時に、メモリ監視部11はアプリケーションプログラム120の監視を開始する。
図5の場合は、プロセッサ101は、図5の(b)のアプリケーションプログラム120を実行する。メモリ監視部111は図5の(b)のアプリケーションプログラム120の監視を開始する。
図5の(b)のアプリケーションプログラム120の場合、メモリ監視部111は、メモリアドレス110の実行時に偽エントリーアドレスの値「756」がロードされたことを検出し、メモリアドレス120のジャンプ命令を検出する。メモリ監視部111は、ジャンプ命令を実行せずアプリケーションプログラム120の実行を中断させる。
なお、このように、ある条件に応じて特別な処理を実行させるためには、メモリ監視部111が例外又は割込みを生じさせることで実現できる。例外又は割込みにより、プロセッサ101に実行しているプログラムの処理を中断させ、ステップS170の処理を実行させることができる。
ステップS170において、プロセッサ101は、エントリーアドレスアンマスク部112を起動する。エントリーアドレスアンマスク部112は、コンフィグレーションデータ121に記憶された「設定値のストレージ」を参照して、ストレージ105から設定値をロードする。
図5の(b)のアプリケーションプログラム120の場合、偽エントリーアドレスの値「756」がロードされたことが検出されると、エントリーアドレスアンマスク部112は、偽エントリーアドレスの値「756」に対応するストレージ「Reg1」をアクセスして、設定値「1000」をロードする。
Addr[raw]=Addr[mask](+)Hash(data[0])(+)...(+)Hash(data[n]) 式(2)
エントリーアドレスアンマスク部112は、処理を終了したことをプロセッサ101に知らせ、処理を終了する。
エントリーアドレスアンマスク部112が、元のエントリーアドレスを復元できた場合、アプリケーションプログラム120は、元のエントリーアドレスにジャンプする。
図5の(c)の場合、元のエントリーアドレス500=新エントリーアドレス500となる。アプリケーションプログラム120は、エントリーアドレス「500」にジャンプする。
ステップS170及びステップS180の処理により偽エントリーアドレスが正しくアンマスクされていれば、続くジャンプ命令で正しいエントリーアドレスに遷移することができる。エントリーアドレスへの遷移が成功した場合、ストレージ105に正しい設定値が記憶されていることを保証できる。
一方で、ストレージ105の設定値が不正な攻撃により改ざんされた場合、偽エントリーアドレスが正しくアンマスクできず、エントリーアドレスが正しく復元できない。そのため、続くジャンプ命令では異常な遷移となり、不正な攻撃は成功しない。
メモリ監視部111の処理は、ステップS160の処理である。
エントリーアドレスアンマスク部の処理は、ステップS170及びステップS180の処理である。
アプリケーションプログラム120の処理は、ステップS150の処理である。
対策プログラム122の処理は、ステップS150とステップS160を除く図3のすべての処理である。
また、偽エントリーアドレスはハッシュ値によりマスクされた値なので、偽エントリーアドレスが攻撃者に読まれても問題ない。
実施の形態1をTrusted Execution Environment(TEE)に適用する場合について説明する。
TEEは、ソフトウェアだけではなくハードウェアによるサポートによって、アプリケーションの安全な実行環境を実現する。
TEEは、メモリアクセス監視に基づく資源分離機構を有するプロセッサにより提供される。
TEEを提供するシステムでは、プロセッサの有するメモリ保護機構(Physical Memory Protectionと呼ばれる機構等)を使用してアプリケーション間のアクセス制御を行う。メモリ保護機構は、メモリアクセスのたびにアクセス権限を確認する。メモリ保護機構は、他のアプリケーションプログラムへの遷移実行時に、他のアプリケーションのアクセス権限を設定する。メモリ保護機構は、アプリケーションプログラムの実行開始のたびにアクセス権限を確認する。メモリ保護機構は、アクセス権限に基づいてメモリアクセス制御を行う。
プログラム処理装置100は、故障注入攻撃の対策を適用した上で、記憶装置103に記憶されたアプリケーションプログラム120を実行する。
故障注入攻撃は、プロセッサの処理に誤りを発生させ、プロセッサの処理が遷移先に遷移する際のメモリ保護機構のアクセス権限の設定をスキップする攻撃である。
設定値は、アプリケーションプログラムごとに設定されたメモリ保護機構のアクセス権限を示す値である。設定値は、メモリ保護機構がメモリ領域に対して設定するアクセス権限を示す値である。
アクセス権限は、メモリ領域とそのメモリ領域に対する属性とで定義される。
メモリ領域は、メモリアドレスにより示されるメモリの範囲である。
属性は、メモリ領域のデータに対して、実行・読み込み・書き込みのいずれの行為が可能かを示した値である。
ストレージは、メモリ保護機構が参照するレジスタあるいはメモリであり、メモリ保護機構が利用するレジスタあるいはメモリである。具体的には、ストレージは、メモリ保護機構が有する特殊なレジスタあるいは特殊なメモリである。
●マスク処理
エントリーアドレスマスク部110は、アプリケーションプログラムのメモリアクセスを監視するために使用するアクセス権限を示す値(セーブ値)をもとにアプリケーションプログラムの実行開始アドレスをマスクして偽エントリーアドレスを生成する。そして、アプリケーションプログラムの実行開始アドレスを偽エントリーアドレスで置換する。
●監視処理
メモリ監視部111は、アプリケーションプログラム120の実行中に、コンフィグレーションデータ121の偽エントリーアドレスを参照し、偽エントリーアドレスがロードされたかどうかをチェックする。そして、他のアプリケーションプログラムへの遷移があるか否かをチェックする。
●アンマスク処理
エントリーアドレスアンマスク部112は、他のアプリケーションプログラムへの遷移実行開始時に、ストレージに記憶されたアクセス権限を示す値(設定値)をもとに偽エントリーアドレスのマスクを解除して新エントリーアドレスを生成する。エントリーアドレスアンマスク部112は、新エントリーアドレスを他のアプリケーションプログラムの実行開始アドレスとする。
実施の形態1のプログラム処理装置100は、アクセス権限が改ざんされた場合、正しいエントリーアドレスから実行を開始できない仕組みを提供している。したがって、メモリ保護機構のアクセス権限が改ざんされた場合、アプリケーションプログラムの実行開始アドレスから実行を開始することができないことになる。
実施の形態1のプログラム処理装置100は、故障注入攻撃により任意の処理がスキップされ得る攻撃環境下であっても、メモリ保護機構のアクセス権限が正しく設定されることを保証するものである。実施の形態1のプログラム処理装置100は、メモリ保護機構のアクセス権限の確認を保証し、アプリケーションプログラムの不正な実行を禁止することができる。
また、実施の形態1によれば、メモリ保護機構への故障注入攻撃を防ぐことができる。
プログラム処理装置100は、エントリーアドレスと、エントリーアドレスに対応した設定値とを使用するアプリケーションプログラムを処理する信号処理装置である。
プログラム処理装置は、設定値を複写したセーブ値と、設定値を記憶するストレージの識別子と、エントリーアドレスとを対応付けたコンフィグレーションデータを記憶した記憶部を有する。
エントリーアドレスマスク部110は、アプリケーションプログラム120の実行前に、以下のマスク処理を実行する。
1.コンフィグレーションデータ121のセーブ値を用いてコンフィグレーションデータ121のエントリーアドレスをマスクした偽エントリーアドレスを生成する。
2.アプリケーションプログラム120が使用するエントリーアドレスを偽エントリーアドレスに置換する。
メモリ監視部111は、アプリケーションプログラム120の実行中に、偽エントリーアドレスがロードされたかどうかを判定する。
エントリーアドレスアンマスク部112は、偽エントリーアドレスがロードされたとメモリ監視部111が判定した場合、以下のアンマスク処理を実行する。
1.ストレージ105から設定値をロードして設定値を用いて偽エントリーアドレスをアンマスクした新エントリーアドレスを生成する。
2.偽エントリーアドレスを新エントリーアドレスに置換する。
実施の形態1のプログラム処理装置100によれば、コンフィグレーションデータ121に基づいてアプリケーションプログラム120にマスク処理とアンマスク処理とからなる対策を適用してアプリケーションプログラム120を実行する。その結果、セーブ値と設定値が一致していなければ、エントリーアドレスへの正しい遷移ができない。これにより、エントリーアドレスへの遷移が成功した場合、ストレージに正しい設定値が記憶されていることを保証できる。
マスク処理は、秘密鍵を使用した暗号化処理を適用し、アンマスク処理は、秘密鍵を使用した復号処理を適用してもよい。
例えば、エントリーアドレスのマスク処理において、ステップS141に示す偽エントリーアドレスの計算式は以下のような式(3)であってもよい。
Addr[mask]=Addr[raw](+)Enc(data[0],key)(+)...(+)Enc(data[n],key) 式(3)
ここで、Enc()とkeyは、それぞれ暗号化処理と秘密鍵とを表す。Enc(data[0],key)は、data[0]を秘密鍵keyで暗号化したものである。暗号化処理は、AESやRSA(登録商標)のような暗号を使用してもよい。
エントリーアドレスのマスク処理を式(1)の代わりに式(3)に置き換えた場合、ステップS180に示すアンマスク処理を次のように置き換える必要がある。
Addr[raw]=Addr[mask](+)Enc(data[0],key)(+)...(+)Enc(data[n],key) 式(4)
AESは、Advanced Encryption Standardの略称である。
RSA(登録商標)は、Rivest-Shamir-Adleman cryptosystemの略称である。
マスク処理は、エントリーアドレスをデータとし、セーブ値を秘密鍵として、エントリーアドレスを暗号化して偽エントリーアドレスを生成し、アンマスク処理は、偽エントリーアドレスをデータとし、設定値を秘密鍵とし、新エントリーアドレスを復号してもよい。
例えば、エントリーアドレスのマスク処理において、ステップS141に示すマスクしたエントリーアドレスの計算式は以下のような式(5)であってもよい。
Addr[mask]=Enc(...Enc(Enc(Addr[raw],data[0]),data[1])...,data[n]) 式(5)
Enc(Addr[raw],data[0])は、Addr[raw]を鍵data[0]で暗号化したものである。
Enc(Enc(Addr[raw],data[0]),data[1])は、Addr[raw]を鍵data[0]で暗号化したものをさらに鍵data[1]で暗号化したものである。
式(5)は、暗号化処理のデータとして元のエントリーアドレスを与え、鍵としてセーブ値を与える処理である。さらに、そうして得られた暗号化結果をデータとして、繰りかえしセーブ値を鍵として暗号化を行う。
エントリーアドレスのマスク処理を式(1)の代わりに式(5)に置き換えた場合、ステップS180に示すアンマスク処理を次のように置き換える必要がある。
Addr[raw]=Dec(...Dec(Dec(Addr[mask],data[n]),data[n-1])...,data[0]) 式(6)
Dec(Addr[mask],data[n]は、Addr[mask]を鍵data[n]で復号したものである。
Dec(Dec(Addr[mask],data[n]),data[n-1])は、Addr[mask]を鍵data[n]で復号したものさらに、鍵data[n-1]で復号したものである。
ここで、Decは式(5)に示すEncと対となる復号処理である。暗号化処理とは逆順でdata[i]を与えていることに注意されたい。このような特徴から、式(5)と式(6)により実現されるエントリーアドレスのマスク処理及びアンマスク処理で使用する暗号は、共通鍵暗号でなくてはならない。例えば、AESやKCiper-2のようなブロック暗号又はストリーム暗号でもよい。
遷移命令は、ジャンプ命令でなくてもよく、GOTO命令、CALL命令、RETURN命令でもよいし、関数実行命令、サブルーチン実行命令でもよい。
アプリケーションプログラム120及びコンフィグレーションデータ121は、記憶装置103ではなく、入出力インタフェース104を経由して外部から供給されてもよい。
コンフィグレーションデータ121のエントリーアドレスには、エントリーアドレスマスク部110が、ロード命令とジャンプ命令との検索結果により判明した遷移先のメモリアドレスを設定してもよい。
実施の形態1のプログラム処理装置100を、セキュアブートの保護に使用してもよい。
セキュアブートでは、ブートコードのハッシュ値のチェック処理後にブートコードの起動処理に遷移する。故障注入攻撃では、このハッシュ値のチェック処理をスキップし、不正なブートコードで起動させる。
実施の形態1のプログラム処理装置100をセキュアブートの保護に適用する場合、設定値とセーブ値とをブートコードのハッシュ値とし、エントリーアドレスをブートコードの実行開始アドレスとすればよい。
設定値=セーブ値=ブートコードのハッシュ値
エントリーアドレス=ブートコードの実行開始アドレス
実施の形態1のプログラム処理装置100を、認証チェック処理の保護に使用してもよい。
認証チェック処理では、ユーザからパスワードを受信し、パスワード検証し、パスワードが正しい場合に認証後の処理に移行する。故障注入攻撃では、パスワード検証をスキップし、不正に認証後の処理を実行させる。
実施の形態1のプログラム処理装置100を認証チェック処理の保護に適用する場合、設定値とセーブ値とをパスワード検証結果の値とし、エントリーアドレスを認証後の処理の実行開始アドレスとすればよい。
設定値=セーブ値=パスワード検証結果の値
エントリーアドレス=認証後の処理の実行開始アドレス
実施の形態2では、実施の形態1と異なる点について説明する。
実施の形態2のプログラム処理装置200は、アプリケーションプログラム120のプログラムコード140を入出力インタフェース104から取得する。プログラム処理装置200は、プログラム処理装置100の動作をすべてソフトウェアだけで実現するアプリケーションプログラム120を生成する。具体的には、プログラム処理装置200は、プログラムコード140に対して故障注入攻撃対策を適用して対策済み実行モジュールを生成する。
図6に基づいて、プログラム処理装置200の構成を説明する。
プログラム処理装置200は、プロセッサ101と、主記憶メモリ102と、入出力インタフェース104とを備えるコンピュータである。これらのハードウェアは信号線を介して互いに接続されている。
対策プログラム122は、遷移特定部210とエントリーアドレスマスク部211とアンマスク処理追加部212とコード生成部213との機能を実現するプログラムである。
対策プログラム122は、プログラムコード140を編集するエディタであり、プログラムコード140は、対策プログラム122が編集するデータである。
図6は、対策プログラム122が、プログラムコード140を編集するデータとして、主記憶メモリ102に読み込んだ状態を示している。
図7に基づいて、プログラム処理装置200の動作を説明する。
ステップS210において、プロセッサ101は、入出力インタフェース104を経由して、アプリケーションプログラム120のプログラムコード140とコンフィグレーションデータ121を受信し、主記憶メモリ102に読み込む。
コンフィグレーションデータ121は、図2に示すものと同じものとする。
ステップS240の処理の多くは、実施の形態1のマスク処理(図4)と同じである。具体的には、ステップS241、ステップS242、ステップS243、ステップS244はそれぞれ、ステップS141,ステップS142,ステップS143、ステップS144に対応する。ただし、対策を適用する対象が、実施の形態1では実行開始直前の実行モジュール130であり、実施の形態2ではプログラムコード140であるという違いがある。
ステップS241において、エントリーアドレスマスク部211は、セーブ値を用いて式(1)により、マスクしたエントリーアドレスを計算する。以下、マスクしたエントリーアドレスを偽エントリーアドレスという。
図9は、エントリーアドレスマスク部110が改定したコンフィグレーションデータ121を示している。図9のコンフィグレーションデータ121は、図5に示すものと同じものである。
図9の(a)のプログラムコード140の場合、1行目で変数Xに値「500」が格納され、2行目で変数Xの値「500」をロードし、3行目のジャンプ命令でメモリアドレス200にジャンプしているものとする。エントリーアドレスマスク部211は、3行目のジャンプ命令を検出する。
ステップS245において、アンマスク処理追加部212は、ステップS242で特定したエントリーアドレスへのジャンプ命令の直前に設定値を用いて偽エントリーアドレスをアンマスクするアンマスク処理をプログラムコード140に追加する。具体的には、式(2)によるアンマスク処理コードを、プログラムコード140と同じ言語で記述して、プログラムコード140に追加する。
図9の(c)の場合、アンマスク処理追加部212は、ストレージ「Reg1」から設定値「1000」を変数Zにロードするロード命令「LOAD Reg1 to Z」と、式(2)に基づき新エントリーアドレスを計算する計算式「X=(x)(+)hash(Z)」とを追加する。したがって、アンマスク処理コードが実行されると元のエントリーアドレス=新エントリーアドレスとなる。
例えば、アプリケーションプログラム120が複数か所において同一のアプリケーションプログラムに遷移する場合、アンマスク処理コードは同じコードになり、同一のアンマスク処理コードは冗長であり不要な処理となる。したがって、アプリケーションプログラム120が同一のアプリケーションプログラムに遷移する重複分だけアンマスク処理を削除する。
実施の形態2のアプリケーションプログラム120をTEEに適用した場合、設定値はアプリケーションプログラムごとのアクセス権限の値であり、アクセス権限の値の格納先はメモリ保護機構が有する特殊レジスタである。この特殊レジスタは複数のアプリケーションに対して共通であるため、アクセス権限の値の格納先は同じである。したがって、アンマスク処理コードは他のアプリケーションプログラムに遷移する数だけプログラムコード140に追加されるものの、アンマスク処理コードは共通の特殊レジスタからアクセス権限の値をロードしてアンマスクするという同一コードになる。この冗長なアンマスク処理コードを除く処理がステップS250の効果である。
実行モジュール130は、偽エントリーアドレスをアクセスする前に、コンピュータに、以下の処理を実行させるプログラムである。
1.ストレージから設定値をロードして設定値を用いて偽エントリーアドレスをアンマスクした新エントリーアドレスを生成する処理
2.偽エントリーアドレスを新エントリーアドレスに置換する処理
エントリーアドレスマスク部211の処理は、ステップS210、ステップS2220、ステップS230、ステップS241及びステップS244である。
アンマスク処理追加部212の処理は、ステップS245である。
コード生成部213の処理は、ステップS250及びステップS260である。
実施の形態2のプログラム処理装置200は、プログラム生成時にエントリーアドレスのマスク処理をし、プログラムコードにアンマスク処理コードを埋め込むプログラムコード生成装置である。
プログラム処理装置200は、設定値を複写したセーブ値と、設定値を記憶したストレージと、プログラムコード140が使用しているエントリーアドレスとを対応付けたコンフィグレーションデータ121を記憶した記憶部を有する。
遷移特定部210は、プログラムコード140から、エントリーアドレスに遷移する遷移命令を特定する。
エントリーアドレスマスク部211は、以下のマスク処理を実行する。
1.セーブ値を用いてコンフィグレーションデータ121のエントリーアドレスをマスクした偽エントリーアドレスを生成する。
2.プログラムコード140が使用しているエントリーアドレスを偽エントリーアドレスに置換する。
アンマスク処理追加部212は、遷移特定部210により特定された遷移命令の直前に、以下のアンマスク処理コードを追加する。
1.ストレージ105から設定値をロードして設定値を用いて偽エントリーアドレスをアンマスクした新エントリーアドレスを生成するコード。
2.新エントリーアドレスを使用したアンマスク処理を実行するアンマスク処理コード。
プログラム処理装置200は、コンフィグレーションデータ121に基づいてアプリケーションプログラム120に対策を適用して対策済みコードを生成することにより、実施の形態1と同じ対策を、ソフトウェアのみで実現することができ、メモリ監視部111が不要となる。
また、冗長なアンマスク処理コードが対策済みコードから除かれている。
プログラム処理装置200が扱うプログラムコード140は、アンマスク処理追加部212が、アンマスク処理コードが追加できるプログラムコードであればよい。
プログラムコード140は、実行モジュールのコード、ソースコード、スクリプトコード、中間コード、HTML(ハイパーテキストマークアップランゲージ)テキスト、又は、その他のコードでもよい。
実施の形態3では、実施の形態1と2と異なる点について説明する。
実施の形態3では、エントリーアドレスが遷移先のメモリアドレスではなく、参照先のメモリアドレスである場合を説明する。
実施の形態3では、図12のコンフィグレーションデータ121が使用されるものとする。図12のコンフィグレーションデータ121は、図5のコンフィグレーションデータ121と同じである。
図12の(a)の実行モジュール130の場合、メモリアドレス500に値「333」が格納されており、メモリアドレス110のロード命令によりメモリアドレス500の値「333」をロードし、メモリアドレス120の比較命令により変数Xの値と値「333」とを比較しているものとする。エントリーアドレスマスク部110は、コンフィグレーションデータ121のエントリーアドレスを参照し、エントリーアドレス「500」を参照するロード命令を検出する。メモリアドレス110のロード命令がメモリアドレス500の値「333」をロードしているので、エントリーアドレスマスク部110は、メモリアドレス110のロード命令を検出する。
エントリーアドレスマスク部110は、メモリアドレス100に格納された値「500」を、偽エントリーアドレスの値「756」で置換する(図12の(b))。
プロセッサ101は、図12の(b)のアプリケーションプログラム120を実行する。メモリ監視部111は図12の(b)のアプリケーションプログラム120の監視を開始する。
図12の(b)のアプリケーションプログラム120の場合、メモリ監視部111は、メモリアドレス110の実行時に偽エントリーアドレスの値「756」がロードされたことを検出し、アプリケーションプログラム120の実行を中断させる。
偽エントリーアドレスの値「756」がロードされたことが検出されると、エントリーアドレスアンマスク部112は、偽エントリーアドレスの値「756」に対応するReg1をアクセスして、設定値「1000」をロードする。
図12の(c)の場合、元のエントリーアドレス500=新エントリーアドレス500となっている。アプリケーションプログラム120は、エントリーアドレス「500」の値{333}と変数Xの値とを比較することができる。
プログラム処理装置200が扱うエントリーアドレスも遷移先メモリアドレスではなく、参照先メモリアドレスでもよい。
Claims (11)
- 設定値を複写したセーブ値と、前記設定値を記憶するストレージと、エントリーアドレスとを対応付けたコンフィグレーションデータを記憶した記憶部と、
アプリケーションプログラムの実行前に、前記セーブ値を用いて前記コンフィグレーションデータの前記エントリーアドレスをマスクした偽エントリーアドレスを生成し前記アプリケーションプログラムが使用しているエントリーアドレスを前記偽エントリーアドレスに置換するマスク処理を実行するエントリーアドレスマスク部と、
前記アプリケーションプログラムの実行中に、前記偽エントリーアドレスがロードされたかどうかを判定するメモリ監視部と、
前記偽エントリーアドレスがロードされたと前記メモリ監視部が判定した場合、前記ストレージから前記設定値をロードして前記設定値を用いて前記偽エントリーアドレスをアンマスクした新エントリーアドレスを生成して前記偽エントリーアドレスを前記新エントリーアドレスに置換するアンマスク処理を実行するエントリーアドレスアンマスク部と
を備えたプログラム処理装置。 - 設定値を複写したセーブ値と、前記設定値を記憶するストレージと、エントリーアドレスとを対応付けたコンフィグレーションデータを記憶した記憶部と、
プログラムコードから、前記エントリーアドレスに遷移する遷移命令を特定する遷移特定部と、
前記セーブ値を用いて前記コンフィグレーションデータの前記エントリーアドレスをマスクした偽エントリーアドレスを生成し前記プログラムコードが使用しているエントリーアドレスを前記偽エントリーアドレスに置換するマスク処理を実行するエントリーアドレスマスク部と、
前記遷移特定部により特定された前記遷移命令の直前に、前記ストレージから前記設定値をロードして前記設定値を用いて前記偽エントリーアドレスをアンマスクした新エントリーアドレスを生成するアンマスク処理を実行するアンマスク処理コードを追加するアンマスク処理追加部と、
を備えたプログラム処理装置。 - 前記セーブ値は、メモリ保護機構がメモリに対して設定する設定値であり、
前記ストレージは、メモリ保護機構が利用するレジスタあるいはメモリである請求項1又は2に記載のプログラム処理装置。 - 前記エントリーアドレスは、Trusted Execution Environment(TEE)で動作するアプリケーションのエントリーアドレスである請求項1から3のいずれか1項に記載のプログラム処理装置。
- 前記マスク処理と前記アンマスク処理とは、暗号学的ハッシュ関数と、非暗号学的ハッシュ関数と、ユニバーサルハッシュ関数とのいずれかを適用する請求項1から4のいずれか1項に記載のプログラム処理装置。
- 前記マスク処理は、秘密鍵を使用した暗号化処理を適用し、
前記アンマスク処理は、秘密鍵を使用した復号処理を適用する請求項1から4のいずれか1項に記載のプログラム処理装置。 - 前記マスク処理は、前記エントリーアドレスをデータとし、前記セーブ値を秘密鍵として、前記エントリーアドレスを暗号化して前記偽エントリーアドレスを生成し、
前記アンマスク処理は、前記偽エントリーアドレスをデータとし、前記設定値を秘密鍵とし、前記新エントリーアドレスを復号する請求項1から4のいずれか1項に記載のプログラム処理装置。 - 前記アンマスク処理追加部により加えられた冗長なアンマスク処理を削除して、プログラムコードを生成するコード生成部を備えた請求項2に記載のプログラム処理装置。
- アプリケーションプログラムの実行前に、ストレージに記憶した設定値を複写したセーブ値を用いて前記アプリケーションプログラムが使用しているエントリーアドレスをマスクした偽エントリーアドレスを生成して、前記エントリーアドレスを前記偽エントリーアドレスに置換し、
前記アプリケーションプログラムの実行中に、前記偽エントリーアドレスがロードされた場合、前記ストレージから前記設定値をロードして、前記設定値を用いて前記偽エントリーアドレスをアンマスクした新エントリーアドレスを生成して、前記偽エントリーアドレスを前記新エントリーアドレスに置換するプログラム処理方法。 - コンピュータに、
アプリケーションプログラムの実行前に、ストレージに記憶した設定値を複写したセーブ値を用いて前記アプリケーションプログラムが使用しているエントリーアドレスをマスクした偽エントリーアドレスを生成して、前記エントリーアドレスを前記偽エントリーアドレスに置換するマスク処理と、
前記アプリケーションプログラムの実行中に、前記偽エントリーアドレスがロードされた場合、前記ストレージから前記設定値をロードして、前記設定値を用いて前記偽エントリーアドレスをアンマスクした新エントリーアドレスを生成して、前記偽エントリーアドレスを前記新エントリーアドレスに置換するアンマスク処理と
を実行させるプログラム。 - エントリーアドレスが偽エントリーアドレスに置換されたプログラムであって、コンピュータに、
ストレージから設定値をロードして設定値を用いて偽エントリーアドレスをアンマスクした新エントリーアドレスを生成する処理と
偽エントリーアドレスを新エントリーアドレスに置換する処理と
を、偽エントリーアドレスをアクセスする前に、実行させるプログラム。
Priority Applications (4)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2021544438A JP7031070B1 (ja) | 2021-02-19 | 2021-02-19 | プログラム処理装置、プログラム処理方法、及び、プログラム |
PCT/JP2021/006409 WO2022176164A1 (ja) | 2021-02-19 | 2021-02-19 | プログラム処理装置、プログラム処理方法、及び、プログラム |
CN202180093574.6A CN116868176A (zh) | 2021-02-19 | 2021-02-19 | 程序处理装置、程序处理方法和程序 |
US18/214,020 US20230334149A1 (en) | 2021-02-19 | 2023-06-26 | Program processing device and program processing method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/JP2021/006409 WO2022176164A1 (ja) | 2021-02-19 | 2021-02-19 | プログラム処理装置、プログラム処理方法、及び、プログラム |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US18/214,020 Continuation US20230334149A1 (en) | 2021-02-19 | 2023-06-26 | Program processing device and program processing method |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2022176164A1 true WO2022176164A1 (ja) | 2022-08-25 |
Family
ID=81215081
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/JP2021/006409 WO2022176164A1 (ja) | 2021-02-19 | 2021-02-19 | プログラム処理装置、プログラム処理方法、及び、プログラム |
Country Status (4)
Country | Link |
---|---|
US (1) | US20230334149A1 (ja) |
JP (1) | JP7031070B1 (ja) |
CN (1) | CN116868176A (ja) |
WO (1) | WO2022176164A1 (ja) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS513745A (ja) * | 1974-06-28 | 1976-01-13 | Tokyo Shibaura Electric Co | |
US20080256346A1 (en) * | 2007-04-13 | 2008-10-16 | Samsung Electronics Co., Ltd. | Central processing unit having branch instruction verification unit for secure program execution |
JP2009110113A (ja) * | 2007-10-26 | 2009-05-21 | Mitsubishi Electric Corp | プログラム変換装置及びプログラム及びプログラム変換方法 |
US20170140148A1 (en) * | 2015-11-12 | 2017-05-18 | Samsung Electronics Co., Ltd. | Method and apparatus for protecting kernel control-flow integrity using static binary instrumentation |
-
2021
- 2021-02-19 CN CN202180093574.6A patent/CN116868176A/zh active Pending
- 2021-02-19 JP JP2021544438A patent/JP7031070B1/ja active Active
- 2021-02-19 WO PCT/JP2021/006409 patent/WO2022176164A1/ja active Application Filing
-
2023
- 2023-06-26 US US18/214,020 patent/US20230334149A1/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS513745A (ja) * | 1974-06-28 | 1976-01-13 | Tokyo Shibaura Electric Co | |
US20080256346A1 (en) * | 2007-04-13 | 2008-10-16 | Samsung Electronics Co., Ltd. | Central processing unit having branch instruction verification unit for secure program execution |
JP2009110113A (ja) * | 2007-10-26 | 2009-05-21 | Mitsubishi Electric Corp | プログラム変換装置及びプログラム及びプログラム変換方法 |
US20170140148A1 (en) * | 2015-11-12 | 2017-05-18 | Samsung Electronics Co., Ltd. | Method and apparatus for protecting kernel control-flow integrity using static binary instrumentation |
Also Published As
Publication number | Publication date |
---|---|
JPWO2022176164A1 (ja) | 2022-08-25 |
JP7031070B1 (ja) | 2022-03-07 |
US20230334149A1 (en) | 2023-10-19 |
CN116868176A (zh) | 2023-10-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10303901B2 (en) | Secure processor and a program for a secure processor | |
US9230122B2 (en) | System and method for validating program execution at run-time using control flow signatures | |
US7930743B2 (en) | Information processing system, information processing method, information processing program, computer readable medium and computer data signal | |
KR100792287B1 (ko) | 자체 생성한 암호화키를 이용한 보안방법 및 이를 적용한보안장치 | |
US8555089B2 (en) | Program execution apparatus, control method, control program, and integrated circuit | |
US8225105B2 (en) | Method and apparatus for verifying integrity of computer system vital data components | |
CN111052115A (zh) | 取决于调用路径的认证 | |
KR101216995B1 (ko) | 인덱스 테이블 기반 코드 암호화 및 복호화 장치 및 그 방법 | |
CN102163268B (zh) | 在执行期间验证软件代码的完整性的方法和设备 | |
CN115048652A (zh) | 针对运行已验证软件的硬件的端到端安全性 | |
KR20040094724A (ko) | 멀티-토큰 실 및 실 해제 | |
AU2005201995A1 (en) | System and method for protected operating system boot using state validation | |
WO2008145602A1 (en) | Updateable secure kernel extensions | |
US20160055331A1 (en) | Detecting exploits against software applications | |
JP4791250B2 (ja) | マイクロコンピュータおよびそのソフトウェア改竄防止方法 | |
US20140359306A1 (en) | System, information processing apparatus, secure module, and verification method | |
CN112613037A (zh) | 一种代码校验方法及装置 | |
KR101954439B1 (ko) | 이중보안기능을 가지는 SoC 및 SoC의 이중보안방법 | |
WO2014178889A1 (en) | Vlsi tamper detection and resistance | |
KR20180059742A (ko) | 이중보안기능을 가지는 SoC 및 SoC의 이중보안방법 | |
WO2022176164A1 (ja) | プログラム処理装置、プログラム処理方法、及び、プログラム | |
WO2023001624A1 (en) | Securely executing software based on cryptographically verified instructions | |
CN114816549B (zh) | 一种保护bootloader及其环境变量的方法及系统 | |
CN111291389B (zh) | 一种计算机核心程序全生命周期的保护方法及系统 | |
EP2202661B1 (en) | Apparatus and method for protecting asset in computer system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
ENP | Entry into the national phase |
Ref document number: 2021544438 Country of ref document: JP Kind code of ref document: A |
|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 21926597 Country of ref document: EP Kind code of ref document: A1 |
|
WWE | Wipo information: entry into national phase |
Ref document number: 202180093574.6 Country of ref document: CN |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 21926597 Country of ref document: EP Kind code of ref document: A1 |