WO2022176164A1 - プログラム処理装置、プログラム処理方法、及び、プログラム - Google Patents

プログラム処理装置、プログラム処理方法、及び、プログラム Download PDF

Info

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
Application number
PCT/JP2021/006409
Other languages
English (en)
French (fr)
Inventor
翔永 梨本
Original Assignee
三菱電機株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 三菱電機株式会社 filed Critical 三菱電機株式会社
Priority to JP2021544438A priority Critical patent/JP7031070B1/ja
Priority to PCT/JP2021/006409 priority patent/WO2022176164A1/ja
Priority to CN202180093574.6A priority patent/CN116868176A/zh
Publication of WO2022176164A1 publication Critical patent/WO2022176164A1/ja
Priority to US18/214,020 priority patent/US20230334149A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/52Monitoring 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/54Monitoring 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/14Protection against unauthorised use of memory or access to memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/12Protecting executable software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/12Protecting executable software
    • G06F21/14Protecting executable software against software analysis or reverse engineering, e.g. by obfuscation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/52Monitoring 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/78Protecting 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/79Protecting 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

プログラム処理装置(100)は、ストレージに記憶した設定値を複写したセーブ値を用いてエントリーアドレスをマスクした偽エントリーアドレスを生成し前記アプリケーションプログラムが使用しているエントリーアドレスを前記偽エントリーアドレスに置換するエントリーアドレスマスク部(110)と、前記アプリケーションプログラムの実行中に、前記偽エントリーアドレスがロードされたかどうかを判定するメモリ監視部(111)と、前記偽エントリーアドレスがロードされた場合、前記ストレージから前記設定値をロードして前記設定値を用いて前記偽エントリーアドレスをアンマスクした新エントリーアドレスを生成して前記偽エントリーアドレスを前記新エントリーアドレスに置換するエントリーアドレスアンマスク部(112)とを備えた。

Description

プログラム処理装置、プログラム処理方法、及び、プログラム
 本開示は、プログラム処理装置、プログラム処理方法、及び、プログラムに関する。
 Trusted Execution Environment(TEE)はプロセッサの有するメモリ保護機構を使用してアプリケーション間のアクセス制御を行うセキュアな実行環境である。例えば、セキュリティにクリティカルなアプリケーションをセキュアな実行環境上で実行することで、ライブラリ又はアプリケーションに脆弱性が見つかったとしても、その影響がセキュリティにクリティカルなアプリケーションに伝搬することを防ぐことができる。
 TEEはソフトウェアによる攻撃を防ぐ仕組みであるものの、組込み機器のように物理アクセスが可能な機器でのTEE環境については、物理攻撃の危険性が指摘されている。非特許文献1では、故障注入攻撃と呼ばれる物理的な攻撃方法によりメモリ保護機構のアクセス権限の設定を無効化することにより、本来は許可されないメモリアクセスが可能になることが示されている。
Nashimoto, Shoei, et al. "Bypassing Isolated Execution on RISC-V with Fault Injection." Cryptology ePrint Archive, Report 2020/1193,2020(posted 30-Sep-2020)
 本開示は、本来は許可されないメモリアクセスを防止することを目的とする。
 本開示のプログラム処理装置は、
 設定値を複写したセーブ値と、前記設定値を記憶するストレージと、エントリーアドレスとを対応付けたコンフィグレーションデータを記憶した記憶部と、
 アプリケーションプログラムの実行前に、前記セーブ値を用いて前記コンフィグレーションデータの前記エントリーアドレスをマスクした偽エントリーアドレスを生成し前記アプリケーションプログラムが使用しているエントリーアドレスを前記偽エントリーアドレスに置換するマスク処理を実行するエントリーアドレスマスク部と、
 前記アプリケーションプログラムの実行中に、前記偽エントリーアドレスがロードされたかどうかを判定するメモリ監視部と、
 前記偽エントリーアドレスがロードされたと前記メモリ監視部が判定した場合、前記ストレージから前記設定値をロードして前記設定値を用いて前記偽エントリーアドレスをアンマスクした新エントリーアドレスを生成して前記偽エントリーアドレスを前記新エントリーアドレスに置換するアンマスク処理を実行するエントリーアドレスアンマスク部と
を備えた。
 本開示によれば、セーブ値を用いてアプリケーションプログラムが使用するエントリーアドレスをマスクし、アプリケーションプログラムがエントリーアドレスを使用する時に設定値を用いてエントリーアドレスのマスクを解除してからエントリーアドレスを使用する。このため、セーブ値と設定値が一致していなければ、エントリーアドレスへのアクセスができない。
実施の形態1におけるプログラム処理装置100の構成例を示す図。 実施の形態1におけるコンフィグレーションデータ121とアプリケーションプログラム120とストレージ105とを示す図。 実施の形態1におけるプログラム処理装置100の動作例を示すフローチャート。 実施の形態1におけるステップS140の動作例を示すフローチャート。 実施の形態1におけるコンフィグレーションデータ121と処理例を示す図。 実施の形態2におけるプログラム処理装置200の構成例を示す図。 実施の形態2におけるプログラム処理装置200の動作例を示すフローチャート。 実施の形態2におけるステップS240の動作例を示すフローチャート。 実施の形態2におけるコンフィグレーションデータ121と処理例を示す図。 実施の形態2におけるアンマスク処理の削除例を示す図。 実施の形態2におけるアンマスク処理の削除例を示す図。 実施の形態3におけるエントリーアドレスと処理例を示す図。
 以下の実施の形態の説明及び図面において、同一の符号を付したものは同一の部分又は相当する部分を示す。
 実施の形態1.
***構成の説明***
 図1に基づいて、プログラム処理装置100の構成を説明する。
 プログラム処理装置100は、プロセッサ101と、主記憶メモリ102と、記憶装置103と、入出力インタフェース104と、ストレージ105とを備えるコンピュータである。これらのハードウェアは信号線を介して互いに接続されている。
 プロセッサ101は、演算処理を行うICであり、他のハードウェアを制御する。
 プロセッサ101は、演算レジスタを有し、演算レジスタに命令とデータとをロードして命令に従ったデータ処理を実行する。
 例えば、プロセッサ101は、CPUあるいはFPGAである。
 ICは、Integrated Circuitの略称である。
 CPUは、Central Processing Unitの略称である。
 FPGAは、Field Programable Gated Arrayの略称である。
 主記憶メモリ102は、揮発性の記憶装置と不揮発性の記憶装置との少なくともいずれかである。揮発性の記憶装置の具体例は、RAMである。不揮発性の記憶装置の具体例は、ROM、HDD又はフラッシュメモリである。
 RAMは、Random Access Memoryの略称である。
 ROMは、Read Only Memoryの略称である。
 HDDは、Hard Disk Driveの略称である。
 以下、アドレスとは、主記憶メモリ102のメモリアドレスをいう。
 記憶装置103は、データを保管する不揮発性の記憶装置である。不揮発性の記憶装置の具体例は、ROM、HDD又はフラッシュメモリである。
 入出力インタフェース104は、入出力のためのインタフェースである。例えば、入出力インタフェース104は、シリアル通信インタフェースあるいはデバッグインタフェースである。シリアル通信インタフェースの具体例は、SPI、UART又はI2Cである。デバッグインタフェースの具体例は、JTAG又はJWDである。
 SPIは、Serial Peripheral Interfaceの略称である。
 UARTは、Universal Asynchronous Receiver Transmitterの略称である。
 I2Cは、Inter-Integrated Circuitの略称である。
 JTAGは、Joint Test Action Groupの略称である。
 SWDは、Serial Wire Debugの略称である。
 ストレージ105は、記憶装置である。
 ストレージ105の具体例は、メモリ、又は、レジスタである。
 ストレージ105は、プロセッサ101によりアクセスされるデータを記憶する。
 ストレージ105は、主記憶メモリ102の一部でも構わないし、記憶装置103の一部でも構わないし、プロセッサ101のレジスタでもよいし、独立した記憶デバイスでもよい。
 プロセッサ101は、エントリーアドレスマスク部110とメモリ監視部111とエントリーアドレスアンマスク部112といった要素を備える。
 エントリーアドレスマスク部110とエントリーアドレスアンマスク部112とはソフトウェアで実現される。
 メモリ監視部111は、プロセッサに内蔵されるメモリ監視ユニットのようなハードウェアにより実現される。例えば、メモリ監視部111は、ソフトウェアが扱う論理アドレスとハードウェアが扱う物理アドレスとを変換するメモリ管理ユニットあるいはプログラムの不正なメモリアクセスを防止するためのメモリ保護ユニットである。
 記憶装置103には、プロセッサ101によって動作するアプリケーションプログラム120と、エントリーアドレスマスク部110とエントリーアドレスアンマスク部112を実行するための対策プログラム122と、対策プログラム122を動作させるためのコンフィグレーションデータ121とが記憶されている。記憶装置103には、オペレーティングシステム、ネットワークドライバ及びストレージドライバが記憶されている。
 図1に示すように、主記憶メモリ102には、記憶装置103に記憶されたソフトウェアとデータが読み込まれる。
 アプリケーションプログラム120は、対策プログラム122によりセキュリティが強化されるプログラムである。
 アプリケーションプログラム120は、保護の対象となる保護対象プログラムである。
 実施の形態1のアプリケーションプログラム120は、エグゼキュータブルな形式の実行モジュール130である。
 実行モジュール130は、バイナリコードで記載されており、プロセッサ101が解釈できるマシンランゲージで記載されている。
 図1は、プロセッサ101が、実行モジュール130を主記憶メモリ102に読み込み、実行モジュール130を実行する直前の状態を示している。
 対策プログラム122は、アプリケーションプログラム120のセキュリティを強化するプログラムである。
 対策プログラム122は、エントリーアドレスマスク部110とエントリーアドレスアンマスク部112の機能を実現するプログラムである。
 ストレージ105は、設定値を記憶する。設定値とは、アプリケーションプログラム120が使用しているエントリーアドレスに対応付けられた値である。
 エントリーアドレスは、アプリケーションプログラムが使用しているエントリーポイントである。
 エントリーアドレスは、所定の機能を有するモジュールの実行開始アドレスである。メモリ領域にエントリーされているモジュールの実行開始の先頭のアドレスなのでエントリーアドレスという。具体的には、エントリーアドレスは、アプリケーションプログラム120が使用している遷移命令における遷移先のメモリアドレスである。
 モジュールとは、アプリケーションプログラム120がプログラム内で使用しているサブルーチン又は関数でもよいし、別なアプリケーションプログラムでもよい。
 設定値は、エントリーアドレスに対応した値である。
 設定値は、エントリーアドレスで始まるモジュールの属性値でもよいし、エントリーアドレスで始まるモジュールを加工した加工値でもよいし、エントリーアドレスで始まるモジュールとは関係のない乱数値であってもよい。
 設定値の具体例は、エントリーアドレスに遷移する権限を記載した値である。
 アプリケーションプログラム120が複数個所において遷移命令を有していても遷移先のメモリアドレスが同じであれば、遷移先は1つのエントリーアドレスになり、設定値は1つのエントリーアドレスに対応して1つとなる。アプリケーションプログラム120が複数個所において遷移命令を有しており遷移先のメモリアドレスが異なれば、遷移先は複数のエントリーアドレスとなり、設定値は複数のエントリーアドレスに対応して複数になる。
 実施形態1のプログラム処理装置100は、アプリケーションプログラム120の起動時にエントリーアドレスにマスクをかけ、遷移時にエントリーアドレスのマスクを解除する。
 エントリーアドレスマスク部110は、設定値を複写したセーブ値とエントリーアドレスとのペアを利用してマスク処理をする。エントリーアドレスマスク部110は、セーブ値を用いてアプリケーションプログラム120が使用しているエントリーアドレスをマスクする。
 メモリ監視部111は、マスクされたエントリーアドレスへのアクセスを監視する。
 エントリーアドレスアンマスク部112は、メモリ監視部111がマスクされたエントリーアドレスへのアクセスがあったと判断した場合に、設定値を用いて、ロードしたマスクされたエントリーアドレスをアンマスクして元のエントリーアドレスを取り出す。
●コンフィグレーションデータ121
 図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」とが記憶されている。
●アプリケーションプログラム120
 図2のアプリケーションプログラム120の実行モジュール130は、バイナリコードで記載されているが、説明をわかりやすくするために、図2では、テキスト形式で表現している。
 図2の実行モジュール130は、メモリアドレス100で変数Xに値「500」が格納されており、メモリアドレス110のロード命令により変数Xの値「500」をロードし、メモリアドレス120のジャンプ命令によりメモリアドレス500にジャンプしている。
 プロセッサ101は、オペレーティングシステム、ネットワークドライバ及びストレージドライバを実行しながら、アプリケーションプログラム120と、対策プログラム122とを実行する。
 記憶装置103に記憶されているアプリケーションプログラム120、対策プログラム122、オペレーティングシステム、ネットワークドライバ及びストレージドライバは、主記憶メモリ102に読み込まれ、プロセッサ101によって実行される。
 主記憶メモリ102には、コンフィグレーションデータ121が読み込まれ、プロセッサ101によりアクセスされる。
 なお、アプリケーションプログラム120と、コンフィグレーションデータ121と、対策プログラム122との一部又は全部がオペレーティングシステムに組み込まれていてもよい。
 アプリケーションプログラム120と、対策プログラム122とにより利用、処理又は出力されるデータ、情報、信号値及び変数値は、主記憶メモリ102、記憶装置103、又は、プロセッサ101内のレジスタあるいはキャッシュメモリに記憶される。
 エントリーアドレスマスク部110とエントリーアドレスアンマスク部112の各部の「部」を「処理」、「手順」あるいは「工程」に読み替えてもよい。また、エントリーアドレスマスク部110とエントリーアドレスアンマスク部112の各処理の「処理」を「プログラム」、「プログラムプロダクト」又は「プログラムを記録したコンピュータ読取可能な記憶媒体」に読み替えてもよい。
 アプリケーションプログラム120と、対策プログラム122とは、前記の各部の「部」を「処理」、「手順」あるいは「工程」に読み替えた各処理、各手順あるいは各工程を、コンピュータに実行させる。
 また、プログラム処理方法は、プログラム処理装置100がプログラムを実行することにより行われる方法である。
 アプリケーションプログラム120と、対策プログラム122とは、コンピュータ読取可能な記録媒体に格納されて提供されてもよい。また、アプリケーションプログラム120と、対策プログラム122とは、プログラムプロダクトとして提供されてもよい。
 また、プログラム処理装置100は、ロジックIC(Integrated Circuit)、GA(Gate Array)、ASIC(Application Specific Integrated Circuit)、FPGA(Field-Programmable Gate Array)といった処理回路により実現されてもよい。
 また、プロセッサと、メモリと、プロセッサとメモリの組合せと、処理回路との上位概念を、プロセッシングサーキットリという。つまり、プロセッサと、メモリと、プロセッサとメモリの組合せと、処理回路とは、それぞれプロセッシングサーキットリの具体例である。
***プログラム処理方法の概要説明***
 プログラム処理装置100は、アプリケーションプログラム120の実行前に、セーブ値を用いてアプリケーションプログラム120が使用しているエントリーアドレスをマスクした偽エントリーアドレスを生成して、エントリーアドレスを偽エントリーアドレスに置換する。
 プログラム処理装置100は、アプリケーションプログラム120の実行中に、偽エントリーアドレスがロードされた場合、ストレージ105から設定値をロードして、設定値を用いて偽エントリーアドレスをアンマスクした新エントリーアドレスを生成して、偽エントリーアドレスを新エントリーアドレスに置換する。
***動作の詳細説明***
 図3に基づいて、プログラム処理装置100の動作を説明する。
 動作開始前には、ストレージ105には、設定値が格納され、コンフィグレーションデータ121には、値が設定されているものとする。具体的には、設定値がセーブ値としてコンフィグレーションデータ121に複写されているものとする。また、ストレージ105の識別子と、設定値と対応付けられたエントリーアドレスとがコンフィグレーションデータ121に設定されているものとする。
 ステップS110において、対策プログラム122は、記憶装置103から主記憶メモリ102へ読み込まれて、実行される。
 対策プログラム122は、アプリケーションプログラム120とコンフィグレーションデータ121を記憶装置103から主記憶メモリ102へ読み込む。この時点で、アプリケーションプログラム120の実行モジュール130が主記憶メモリ102へ読み込まれてアプリケーションプログラム120がプロセッサ101により実行可能な状態になる。
 ステップS120において、エントリーアドレスマスク部110は、コンフィグレーションデータ121から、ペアを一つ選択する。
 ステップS130において、エントリーアドレスマスク部110は、すべてのコンフィグレーションデータのペアを処理し終えたかを確認する。すべてのコンフィグレーションデータ121のペアを処理し終えた場合、エントリーアドレスマスク部110は、処理を終了したことをプロセッサ101に知らせ、ステップS150を開始させる。そうでない場合、ステップS140を実行する。
 ステップS140において、エントリーアドレスマスク部110は、ペアを用いてエントリーアドレスのマスク処理を実行する。
●マスク処理
 図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は、エントリーアドレスマスク部110が改定したコンフィグレーションデータ121を示している。
 図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又はSHA256のような暗号学的ハッシュ関数であってもよい。ハッシュ関数は、CRC32又はxxHashのような非暗号学的ハッシュ関数であってもよい。ハッシュ関数は、Toeplitzハッシュのようなユニバーサルハッシュ関数であってもよい。
 md5は、Message Digest algorithm 5の略称である。
 sha256は、Secure Hash Algorithmの略称である。
 CRCは、Cyclic Redundancy Checksumの略称である。
 エントリーアドレスマスク部110は、図5のコンフィグレーションデータ121を主記憶メモリ102に記憶する。コンフィグレーションデータ121は、メモリ監視部111とエントリーアドレスアンマスク部112とによって参照される。
 ステップS142において、エントリーアドレスマスク部110は、アプリケーションプログラム120からペアとなっているエントリーアドレスへのジャンプ命令を探索する。具体的には、プロセッサ101は、アプリケーションプログラム120の実行モジュール130から、エントリーアドレスの値をレジスタにロードする処理及びその処理後に存在するジャンプ命令を探す。エントリーアドレスマスク部110は、エントリーアドレス以外へジャンプ命令は無視する。
 図5の(a)の実行モジュール130の場合、エントリーアドレスマスク部110は、メモリアドレス110のロード命令と、メモリアドレス120のジャンプ命令を検出する。
 ステップS143において、エントリーアドレスマスク部110は、エントリーアドレスへのジャンプ命令をすべて探索し終えたかを検証する。エントリーアドレスへのジャンプ命令をすべて探索し終えた場合、終了する。そうでない場合、ステップS144を実行する。
 ステップS144において、エントリーアドレスマスク部110は、エントリーアドレスのロード命令によりロードされるデータ(エントリーアドレス)をステップS141で計算した偽エントリーアドレスで置換する。具体的には、ロード元のメモリアドレスに格納されたデータを、偽エントリーアドレスで置換する。
 図5の(a)の実行モジュール130の場合、エントリーアドレスマスク部110は、メモリアドレス100の変数Xに格納される値「500」を、偽エントリーアドレスの値「756」で置換する(図5の(b))。
●監視処理
 ステップS150において、プロセッサ101は、エントリーアドレスのマスク処理を施したアプリケーションプログラム120の実行を開始する。同時に、メモリ監視部11はアプリケーションプログラム120の監視を開始する。
 図5の場合は、プロセッサ101は、図5の(b)のアプリケーションプログラム120を実行する。メモリ監視部111は図5の(b)のアプリケーションプログラム120の監視を開始する。
 ステップS150において、メモリ監視部111は、アプリケーションプログラム120の実行中に、コンフィグレーションデータ121の偽エントリーアドレスを参照し、偽エントリーアドレスがプロセッサ101の演算レジスタにロードされたかどうかをチェックする。偽エントリーアドレスが演算レジスタにロードされた場合、ステップS170を実行する。そうでない場合、ステップS150に戻ってプロセッサ101がアプリケーションプログラム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」をロードする。
 ステップS180において、エントリーアドレスアンマスク部112は、ステップS160でロードした偽エントリーアドレスをステップS170でロードした設定値を用いてアンマスクする。以下、アンマスクしたエントリーアドレスを新エントリーアドレスという。具体的には、次の式(2)で示すように、式(1)と逆の方法でXOR演算を適用することで、元のエントリーアドレスを復元できる。
 Addr[raw]=Addr[mask](+)Hash(data[0])(+)...(+)Hash(data[n]) 式(2)
 エントリーアドレスアンマスク部112は、ステップS160でロードした偽エントリーアドレスを新エントリーアドレスに置換する(図5の(c))。
 エントリーアドレスアンマスク部112は、処理を終了したことをプロセッサ101に知らせ、処理を終了する。
 エントリーアドレスアンマスク部112が、元のエントリーアドレスを復元できた場合、アプリケーションプログラム120は、元のエントリーアドレスにジャンプする。
 図5の(c)の場合、エントリーアドレスアンマスク部112は、式(2)に基づき新エントリーアドレスNP=(x)(+)hash(1000)を計算する。ここで、(x)は、変数Xの値を意味するものとする。エントリーアドレスアンマスク部112は、新エントリーアドレスNPをロードする命令「LOAD (NP)」を実行する。ここで、(NP)は、変数NPの値を意味するものとする。
 図5の(c)の場合、元のエントリーアドレス500=新エントリーアドレス500となる。アプリケーションプログラム120は、エントリーアドレス「500」にジャンプする。
 ステップS180におけるアンマスク処理後は、ステップS150に戻ってプロセッサ101がプログラムを引き続き実行する。
 ステップS170及びステップS180の処理により偽エントリーアドレスが正しくアンマスクされていれば、続くジャンプ命令で正しいエントリーアドレスに遷移することができる。エントリーアドレスへの遷移が成功した場合、ストレージ105に正しい設定値が記憶されていることを保証できる。
 一方で、ストレージ105の設定値が不正な攻撃により改ざんされた場合、偽エントリーアドレスが正しくアンマスクできず、エントリーアドレスが正しく復元できない。そのため、続くジャンプ命令では異常な遷移となり、不正な攻撃は成功しない。
 エントリーアドレスマスク部110の処理は、ステップS140の処理である。
 メモリ監視部111の処理は、ステップS160の処理である。
 エントリーアドレスアンマスク部の処理は、ステップS170及びステップS180の処理である。
 アプリケーションプログラム120の処理は、ステップS150の処理である。
 対策プログラム122の処理は、ステップS150とステップS160を除く図3のすべての処理である。
 実施の形態1では、セーブ値を用いてアプリケーションプログラム120が使用するエントリーアドレスをマスクする。そして、アプリケーションプログラム120がエントリーアドレスを使用する時に設定値によりエントリーアドレスのマスクを解除してからエントリーアドレスを使用する。このため、セーブ値と設定値が一致していなければ、エントリーアドレスへの正しいアクセスができない。
 実施の形態1のプログラム処理装置100は、エントリーアドレスをマスクしているので、ストレージ105に設定された設定値が攻撃者に読まれても問題ない。
 また、偽エントリーアドレスはハッシュ値によりマスクされた値なので、偽エントリーアドレスが攻撃者に読まれても問題ない。
***TEEへの適用***
 実施の形態1をTrusted Execution Environment(TEE)に適用する場合について説明する。
 TEEは、ソフトウェアだけではなくハードウェアによるサポートによって、アプリケーションの安全な実行環境を実現する。
 TEEは、メモリアクセス監視に基づく資源分離機構を有するプロセッサにより提供される。
 TEEを提供するシステムでは、プロセッサの有するメモリ保護機構(Physical Memory Protectionと呼ばれる機構等)を使用してアプリケーション間のアクセス制御を行う。メモリ保護機構は、メモリアクセスのたびにアクセス権限を確認する。メモリ保護機構は、他のアプリケーションプログラムへの遷移実行時に、他のアプリケーションのアクセス権限を設定する。メモリ保護機構は、アプリケーションプログラムの実行開始のたびにアクセス権限を確認する。メモリ保護機構は、アクセス権限に基づいてメモリアクセス制御を行う。
 実施の形態1をメモリ保護機構に適用する場合、以下のようになる。
 プログラム処理装置100は、故障注入攻撃の対策を適用した上で、記憶装置103に記憶されたアプリケーションプログラム120を実行する。
 故障注入攻撃は、プロセッサの処理に誤りを発生させ、プロセッサの処理が遷移先に遷移する際のメモリ保護機構のアクセス権限の設定をスキップする攻撃である。
 エントリーアドレスは、TEEで動作するアプリケーションプログラムのエントリーアドレスである。エントリーアドレスは、プロセッサで動作する複数のアプリケーションプログラムの実行開始アドレスである。
 設定値は、アプリケーションプログラムごとに設定されたメモリ保護機構のアクセス権限を示す値である。設定値は、メモリ保護機構がメモリ領域に対して設定するアクセス権限を示す値である。
 アクセス権限は、メモリ領域とそのメモリ領域に対する属性とで定義される。
 メモリ領域は、メモリアドレスにより示されるメモリの範囲である。
 属性は、メモリ領域のデータに対して、実行・読み込み・書き込みのいずれの行為が可能かを示した値である。
 ストレージは、メモリ保護機構が参照するレジスタあるいはメモリであり、メモリ保護機構が利用するレジスタあるいはメモリである。具体的には、ストレージは、メモリ保護機構が有する特殊なレジスタあるいは特殊なメモリである。
 実施の形態1をメモリ保護機構に適用した場合、以下のようになる。
●マスク処理
 エントリーアドレスマスク部110は、アプリケーションプログラムのメモリアクセスを監視するために使用するアクセス権限を示す値(セーブ値)をもとにアプリケーションプログラムの実行開始アドレスをマスクして偽エントリーアドレスを生成する。そして、アプリケーションプログラムの実行開始アドレスを偽エントリーアドレスで置換する。
●監視処理
 メモリ監視部111は、アプリケーションプログラム120の実行中に、コンフィグレーションデータ121の偽エントリーアドレスを参照し、偽エントリーアドレスがロードされたかどうかをチェックする。そして、他のアプリケーションプログラムへの遷移があるか否かをチェックする。
●アンマスク処理
 エントリーアドレスアンマスク部112は、他のアプリケーションプログラムへの遷移実行開始時に、ストレージに記憶されたアクセス権限を示す値(設定値)をもとに偽エントリーアドレスのマスクを解除して新エントリーアドレスを生成する。エントリーアドレスアンマスク部112は、新エントリーアドレスを他のアプリケーションプログラムの実行開始アドレスとする。
 以上のように、エントリーアドレスはアプリケーションプログラムの実行開始アドレスであり、設定値はアプリケーションプログラムごとに設定されたメモリ保護機構のアクセス権限を示す値である。メモリ保護機構は、アプリケーションプログラムの実行開始のたびにアプリケーションプログラムに対するアクセス権限をチェックする。
 実施の形態1のプログラム処理装置100は、アクセス権限が改ざんされた場合、正しいエントリーアドレスから実行を開始できない仕組みを提供している。したがって、メモリ保護機構のアクセス権限が改ざんされた場合、アプリケーションプログラムの実行開始アドレスから実行を開始することができないことになる。
 実施の形態1のプログラム処理装置100は、故障注入攻撃により任意の処理がスキップされ得る攻撃環境下であっても、メモリ保護機構のアクセス権限が正しく設定されることを保証するものである。実施の形態1のプログラム処理装置100は、メモリ保護機構のアクセス権限の確認を保証し、アプリケーションプログラムの不正な実行を禁止することができる。
 実施の形態1によれば、TEEのもとでアプリケーションプログラムが実行された場合にメモリ保護機構のアクセス権限の値が改ざんされていないことを保証できる。したがって、アプリケーションプログラムから別のアプリケーションプログラムの実行開始アドレス(別のアプリケーションプログラムが配置されているメモリアドレス)を参照するような攻撃は成立しない。
 また、実施の形態1によれば、メモリ保護機構への故障注入攻撃を防ぐことができる。
***実施の形態1の特徴***
 プログラム処理装置100は、エントリーアドレスと、エントリーアドレスに対応した設定値とを使用するアプリケーションプログラムを処理する信号処理装置である。
 プログラム処理装置は、設定値を複写したセーブ値と、設定値を記憶するストレージの識別子と、エントリーアドレスとを対応付けたコンフィグレーションデータを記憶した記憶部を有する。
 エントリーアドレスマスク部110は、アプリケーションプログラム120の実行前に、以下のマスク処理を実行する。
1.コンフィグレーションデータ121のセーブ値を用いてコンフィグレーションデータ121のエントリーアドレスをマスクした偽エントリーアドレスを生成する。
2.アプリケーションプログラム120が使用するエントリーアドレスを偽エントリーアドレスに置換する。
 メモリ監視部111は、アプリケーションプログラム120の実行中に、偽エントリーアドレスがロードされたかどうかを判定する。
 エントリーアドレスアンマスク部112は、偽エントリーアドレスがロードされたとメモリ監視部111が判定した場合、以下のアンマスク処理を実行する。
1.ストレージ105から設定値をロードして設定値を用いて偽エントリーアドレスをアンマスクした新エントリーアドレスを生成する。
2.偽エントリーアドレスを新エントリーアドレスに置換する。
***実施の形態1の効果***
 実施の形態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を、認証チェック処理の保護に使用してもよい。
 認証チェック処理では、ユーザからパスワードを受信し、パスワード検証し、パスワードが正しい場合に認証後の処理に移行する。故障注入攻撃では、パスワード検証をスキップし、不正に認証後の処理を実行させる。
 実施の形態1のプログラム処理装置100を認証チェック処理の保護に適用する場合、設定値とセーブ値とをパスワード検証結果の値とし、エントリーアドレスを認証後の処理の実行開始アドレスとすればよい。
 設定値=セーブ値=パスワード検証結果の値
 エントリーアドレス=認証後の処理の実行開始アドレス
 実施の形態1のプログラム処理装置100によれば、セーブ値としてのパスワード検証結果の値と設定値としてのパスワード検証結果の値とが一致しなければ、パスワード認証後の正しい実行開始アドレスに遷移することができない。
 実施の形態2.
 実施の形態2では、実施の形態1と異なる点について説明する。
 実施の形態2のプログラム処理装置200は、アプリケーションプログラム120のプログラムコード140を入出力インタフェース104から取得する。プログラム処理装置200は、プログラム処理装置100の動作をすべてソフトウェアだけで実現するアプリケーションプログラム120を生成する。具体的には、プログラム処理装置200は、プログラムコード140に対して故障注入攻撃対策を適用して対策済み実行モジュールを生成する。
***構成の説明***
 図6に基づいて、プログラム処理装置200の構成を説明する。
 プログラム処理装置200は、プロセッサ101と、主記憶メモリ102と、入出力インタフェース104とを備えるコンピュータである。これらのハードウェアは信号線を介して互いに接続されている。
 入出力インタフェース104は、入出力のためのインタフェースである。例えば、入出力インタフェース104は、シリアル通信インタフェース又はネットワークインタフェースである。シリアル通信インタフェースの具体例は、SPI、UART又はI2Cである。ネットワークインタフェースの具体例は、Ethernet(登録商標)である。
 プロセッサ101は、遷移特定部210とエントリーアドレスマスク部211とアンマスク処理追加部212とコード生成部213といった要素を備える。遷移特定部210とエントリーアドレスマスク部211とアンマスク処理追加部212とコード生成部213とは主記憶メモリ102に記憶されるソフトウェアとして実現される。
 入出力インタフェース104は、外部よりアプリケーションプログラム120のプログラムコード140と実施の形態1で示したコンフィグレーションデータ121とを受信する。また、入出力インタフェース104は、プログラム処理装置200が生成した対策済み実行モジュールを外部に送信する。
 対策プログラム122は、アプリケーションプログラム120のセキュリティを強化するプログラムである。
 対策プログラム122は、遷移特定部210とエントリーアドレスマスク部211とアンマスク処理追加部212とコード生成部213との機能を実現するプログラムである。
 対策プログラム122は、プログラムコード140を編集するエディタであり、プログラムコード140は、対策プログラム122が編集するデータである。
 図6は、対策プログラム122が、プログラムコード140を編集するデータとして、主記憶メモリ102に読み込んだ状態を示している。
***動作の説明***
 図7に基づいて、プログラム処理装置200の動作を説明する。
 ステップS210において、プロセッサ101は、入出力インタフェース104を経由して、アプリケーションプログラム120のプログラムコード140とコンフィグレーションデータ121を受信し、主記憶メモリ102に読み込む。
 コンフィグレーションデータ121は、図2に示すものと同じものとする。
 ステップS220において、エントリーアドレスマスク部211は、コンフィグレーションデータ121のペアを一つ選択する。
 ステップS230において、エントリーアドレスマスク部211は、すべてのペアを処理し終えたかを確認する。すべてのペアを処理し終えた場合、ステップS250を実行する。そうでない場合、ステップS240を実行する。
 ステップS240において、エントリーアドレスマスク部211は、プログラムコード140に対してエントリーアドレスのマスク処理を実施し、エントリーアドレスマスク部211は、エントリーアドレスのアンマスク処理を追加する。
 図8に基づいて、ステップS240の処理を説明する。
 ステップS240の処理の多くは、実施の形態1のマスク処理(図4)と同じである。具体的には、ステップS241、ステップS242、ステップS243、ステップS244はそれぞれ、ステップS141,ステップS142,ステップS143、ステップS144に対応する。ただし、対策を適用する対象が、実施の形態1では実行開始直前の実行モジュール130であり、実施の形態2ではプログラムコード140であるという違いがある。
●マスク処理
 ステップS241において、エントリーアドレスマスク部211は、セーブ値を用いて式(1)により、マスクしたエントリーアドレスを計算する。以下、マスクしたエントリーアドレスを偽エントリーアドレスという。
 図9は、エントリーアドレスマスク部110が改定したコンフィグレーションデータ121を示している。図9のコンフィグレーションデータ121は、図5に示すものと同じものである。
 ステップS242において、遷移特定部210は、プログラムコード140からエントリーアドレスへのジャンプ命令を探索する。具体的には、遷移特定部210は、プログラムコード140から、エントリーアドレスの値をレジスタにロードする処理及びその処理後に存在するジャンプ命令を探す。
 図9の(a)のプログラムコード140の場合、1行目で変数Xに値「500」が格納され、2行目で変数Xの値「500」をロードし、3行目のジャンプ命令でメモリアドレス200にジャンプしているものとする。エントリーアドレスマスク部211は、3行目のジャンプ命令を検出する。
 ステップS243において、エントリーアドレスマスク部211は、エントリーアドレスへのジャンプ命令をすべて探索し終えたかを検証する。エントリーアドレスへのジャンプ命令をすべて探索し終えた場合、終了する。そうでない場合、ステップS244を実行する。
 ステップS244において、エントリーアドレスマスク部211は、遷移特定部210が探したロード命令によりロードされるエントリーアドレスをステップS241で計算した偽エントリーアドレスで置換する。具体的には、プログラムコード140の変数に設定されるデータを、偽エントリーアドレスで置換する。
 図9の(a)のプログラムコード140の場合、エントリーアドレスマスク部211は、変数Xに設定される値「500」を、偽エントリーアドレスの値「756」で置換する(図9の(b))。
 実施の形態1との違いであるステップS245について説明する。
 ステップS245において、アンマスク処理追加部212は、ステップS242で特定したエントリーアドレスへのジャンプ命令の直前に設定値を用いて偽エントリーアドレスをアンマスクするアンマスク処理をプログラムコード140に追加する。具体的には、式(2)によるアンマスク処理コードを、プログラムコード140と同じ言語で記述して、プログラムコード140に追加する。
 図9の(c)の場合、アンマスク処理追加部212は、ストレージ「Reg1」から設定値「1000」を変数Zにロードするロード命令「LOAD Reg1 to Z」と、式(2)に基づき新エントリーアドレスを計算する計算式「X=(x)(+)hash(Z)」とを追加する。したがって、アンマスク処理コードが実行されると元のエントリーアドレス=新エントリーアドレスとなる。
 エントリーアドレスのマスク処理は、式(1)による処理であり、式(3)あるいは式(5)のいずれかの処理であってもよい。
 エントリーアドレスマスク部211が、式(3)あるいは式(5)に示すマスク処理をした場合は、アンマスク処理追加部212は、式(4)あるいは式(6)に示すアンマスク処理コードを追加する。アンマスク処理コードによるアンマスク処理は、マスク処理に対応する処理でなくてはならない。
 ステップS250において、コード生成部213は、ステップS245で追加した複数のアンマスク処理コードを整理して不要なアンマスク処理コードを削除する。
 例えば、アプリケーションプログラム120が複数か所において同一のアプリケーションプログラムに遷移する場合、アンマスク処理コードは同じコードになり、同一のアンマスク処理コードは冗長であり不要な処理となる。したがって、アプリケーションプログラム120が同一のアプリケーションプログラムに遷移する重複分だけアンマスク処理を削除する。
 図10の場合、Pair1の偽エントリーアドレス「756」はアプリケーションプログラム120が遷移する他のアプリケーションプログラムP1の偽エントリーアドレスであるとものする。アプリケーションプログラム120には、2か所においてアプリケーションプログラムP1に遷移する記述があるものとする。アプリケーションプログラムP1の設定値「1000」はReg1に格納されている。図10の2つのアンマスク処理コードは同じになる。コード生成部213は、2つのアンマスク処理コードを1つの共通ルーチンFUNCにまとめ、ジャンプ命令の前に共通ルーチンFUNCを実行するCALL命令を追加する。
 また、コンフィグレーションデータ121に記憶された「設定値のストレージ」がすべて同じストレージであった場合、アンマスク処理コードは同じコードになり、同一のアンマスク処理コードは冗長であり不要な処理となる。したがって、コンフィグレーションデータで指定される「設定値のストレージ」の重複分だけアンマスク処理を削除する。
 非特許文献1で示す故障注入攻撃は、メモリ保護機構の特殊レジスタに記憶させたアクセス権限の再設定を狙う。あるいは、故障注入攻撃は、プロセッサ101の計算処理に誤りを発生させ、アプリケーションプログラムが切り替わる際のメモリ保護機構の特殊レジスタへのアクセス権限の再設定をスキップさせる。
 実施の形態2のアプリケーションプログラム120をTEEに適用した場合、設定値はアプリケーションプログラムごとのアクセス権限の値であり、アクセス権限の値の格納先はメモリ保護機構が有する特殊レジスタである。この特殊レジスタは複数のアプリケーションに対して共通であるため、アクセス権限の値の格納先は同じである。したがって、アンマスク処理コードは他のアプリケーションプログラムに遷移する数だけプログラムコード140に追加されるものの、アンマスク処理コードは共通の特殊レジスタからアクセス権限の値をロードしてアンマスクするという同一コードになる。この冗長なアンマスク処理コードを除く処理がステップS250の効果である。
 図11の場合、メモリ保護機構が有する特殊レジスタがストレージ「Reg1」であるものとする。Pair1の偽エントリーアドレス「756」はアプリケーションプログラム120が遷移する他のアプリケーションプログラムP1の偽エントリーアドレスであるとする。Pair2の偽エントリーアドレス「600」はアプリケーションプログラム120が遷移する他のアプリケーションプログラムP2の偽エントリーアドレスであるとする。アプリケーションプログラム120には、アプリケーションプログラムP1とアプリケーションプログラムP2に遷移する記述があるものとする。アプリケーションプログラムP1への遷移時とアプリケーションプログラムP2への遷移時に、アクセス権限の値はメモリ保護機構が有する特殊レジスタである「Reg1」に格納されているので、Pair1とPair2の2つのアンマスク処理コードは同じになる。コード生成部213は、2つのアンマスク処理コードを1つの共通ルーチンFUNCにまとめ、ジャンプ命令の前に共通ルーチンFUNCを実行するCALL命令を追加する。
 ステップS260において、コード生成部213は、対策を施したプログラムコード140を実行モジュール130とし、入出力インタフェース104を介して実行モジュール130を外部に送信する。
 実行モジュール130は、エントリーアドレスが偽エントリーアドレスに置換されたプログラムである。
 実行モジュール130は、偽エントリーアドレスをアクセスする前に、コンピュータに、以下の処理を実行させるプログラムである。
 1.ストレージから設定値をロードして設定値を用いて偽エントリーアドレスをアンマスクした新エントリーアドレスを生成する処理
 2.偽エントリーアドレスを新エントリーアドレスに置換する処理
 遷移特定部210の処理は、ステップS242である。
 エントリーアドレスマスク部211の処理は、ステップS210、ステップS2220、ステップS230、ステップS241及びステップS244である。
 アンマスク処理追加部212の処理は、ステップS245である。
 コード生成部213の処理は、ステップS250及びステップS260である。
***実施の形態2の特徴***
 実施の形態2のプログラム処理装置200は、プログラム生成時にエントリーアドレスのマスク処理をし、プログラムコードにアンマスク処理コードを埋め込むプログラムコード生成装置である。
 プログラム処理装置200は、設定値を複写したセーブ値と、設定値を記憶したストレージと、プログラムコード140が使用しているエントリーアドレスとを対応付けたコンフィグレーションデータ121を記憶した記憶部を有する。
 遷移特定部210は、プログラムコード140から、エントリーアドレスに遷移する遷移命令を特定する。
 エントリーアドレスマスク部211は、以下のマスク処理を実行する。
1.セーブ値を用いてコンフィグレーションデータ121のエントリーアドレスをマスクした偽エントリーアドレスを生成する。
2.プログラムコード140が使用しているエントリーアドレスを偽エントリーアドレスに置換する。
 アンマスク処理追加部212は、遷移特定部210により特定された遷移命令の直前に、以下のアンマスク処理コードを追加する。
1.ストレージ105から設定値をロードして設定値を用いて偽エントリーアドレスをアンマスクした新エントリーアドレスを生成するコード。
2.新エントリーアドレスを使用したアンマスク処理を実行するアンマスク処理コード。
***実施の形態2の効果***
 プログラム処理装置200は、コンフィグレーションデータ121に基づいてアプリケーションプログラム120に対策を適用して対策済みコードを生成することにより、実施の形態1と同じ対策を、ソフトウェアのみで実現することができ、メモリ監視部111が不要となる。
 また、冗長なアンマスク処理コードが対策済みコードから除かれている。
***他の実施例の説明***
 プログラム処理装置200が扱うプログラムコード140は、アンマスク処理追加部212が、アンマスク処理コードが追加できるプログラムコードであればよい。
 プログラムコード140は、実行モジュールのコード、ソースコード、スクリプトコード、中間コード、HTML(ハイパーテキストマークアップランゲージ)テキスト、又は、その他のコードでもよい。
 実施の形態3.
 実施の形態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の監視を開始する。
 メモリ監視部111は、アプリケーションプログラム120の実行中に、コンフィグレーションデータ121の偽エントリーアドレスを参照し、偽エントリーアドレスがプロセッサ101の演算レジスタにロードされたかどうかを確認する。
 図12の(b)のアプリケーションプログラム120の場合、メモリ監視部111は、メモリアドレス110の実行時に偽エントリーアドレスの値「756」がロードされたことを検出し、アプリケーションプログラム120の実行を中断させる。
●アンマスク処理
 偽エントリーアドレスの値「756」がロードされたことが検出されると、エントリーアドレスアンマスク部112は、偽エントリーアドレスの値「756」に対応するReg1をアクセスして、設定値「1000」をロードする。
 エントリーアドレスアンマスク部112は、新エントリーアドレス500=756(+)hash(1000)を計算する。エントリーアドレスアンマスク部112は、新エントリーアドレス500の値をロードする命令「LOAD (500)」を実行する。
 図12の(c)の場合、元のエントリーアドレス500=新エントリーアドレス500となっている。アプリケーションプログラム120は、エントリーアドレス「500」の値{333}と変数Xの値とを比較することができる。
 以上のように、プログラム処理装置100が扱うエントリーアドレスは遷移先メモリアドレスではなく、参照先メモリアドレスでもよい。
 プログラム処理装置200が扱うエントリーアドレスも遷移先メモリアドレスではなく、参照先メモリアドレスでもよい。
 実施の形態3によれば、エントリーアドレスを参照先メモリアドレスにすることにより、参照先メモリアドレスに記憶されたデータへの不正アクセスを防止することができる。
 以上、複数の実施の形態について説明したが、これらの実施の形態のうち、いくつかを組み合わせて実施しても構わない。あるいは、これらの実施の形態の一部を組み合わせて実施しても構わない。
 100 プログラム処理装置、101 プロセッサ、102 主記憶メモリ、103 記憶装置、104 入出力インタフェース、105 ストレージ、110 エントリーアドレスマスク部、111 メモリ監視部、112 エントリーアドレスアンマスク部、120 アプリケーションプログラム、121 コンフィグレーションデータ、122 対策プログラム、130 実行モジュール、140 プログラムコード、200 プログラム処理装置、210 遷移特定部、211 エントリーアドレスマスク部、212 アンマスク処理追加部、213 コード生成部。

Claims (11)

  1.  設定値を複写したセーブ値と、前記設定値を記憶するストレージと、エントリーアドレスとを対応付けたコンフィグレーションデータを記憶した記憶部と、
     アプリケーションプログラムの実行前に、前記セーブ値を用いて前記コンフィグレーションデータの前記エントリーアドレスをマスクした偽エントリーアドレスを生成し前記アプリケーションプログラムが使用しているエントリーアドレスを前記偽エントリーアドレスに置換するマスク処理を実行するエントリーアドレスマスク部と、
     前記アプリケーションプログラムの実行中に、前記偽エントリーアドレスがロードされたかどうかを判定するメモリ監視部と、
     前記偽エントリーアドレスがロードされたと前記メモリ監視部が判定した場合、前記ストレージから前記設定値をロードして前記設定値を用いて前記偽エントリーアドレスをアンマスクした新エントリーアドレスを生成して前記偽エントリーアドレスを前記新エントリーアドレスに置換するアンマスク処理を実行するエントリーアドレスアンマスク部と
    を備えたプログラム処理装置。
  2.  設定値を複写したセーブ値と、前記設定値を記憶するストレージと、エントリーアドレスとを対応付けたコンフィグレーションデータを記憶した記憶部と、
     プログラムコードから、前記エントリーアドレスに遷移する遷移命令を特定する遷移特定部と、
     前記セーブ値を用いて前記コンフィグレーションデータの前記エントリーアドレスをマスクした偽エントリーアドレスを生成し前記プログラムコードが使用しているエントリーアドレスを前記偽エントリーアドレスに置換するマスク処理を実行するエントリーアドレスマスク部と、
     前記遷移特定部により特定された前記遷移命令の直前に、前記ストレージから前記設定値をロードして前記設定値を用いて前記偽エントリーアドレスをアンマスクした新エントリーアドレスを生成するアンマスク処理を実行するアンマスク処理コードを追加するアンマスク処理追加部と、
    を備えたプログラム処理装置。
  3.  前記セーブ値は、メモリ保護機構がメモリに対して設定する設定値であり、
     前記ストレージは、メモリ保護機構が利用するレジスタあるいはメモリである請求項1又は2に記載のプログラム処理装置。
  4.  前記エントリーアドレスは、Trusted Execution Environment(TEE)で動作するアプリケーションのエントリーアドレスである請求項1から3のいずれか1項に記載のプログラム処理装置。
  5.  前記マスク処理と前記アンマスク処理とは、暗号学的ハッシュ関数と、非暗号学的ハッシュ関数と、ユニバーサルハッシュ関数とのいずれかを適用する請求項1から4のいずれか1項に記載のプログラム処理装置。
  6.  前記マスク処理は、秘密鍵を使用した暗号化処理を適用し、
     前記アンマスク処理は、秘密鍵を使用した復号処理を適用する請求項1から4のいずれか1項に記載のプログラム処理装置。
  7.  前記マスク処理は、前記エントリーアドレスをデータとし、前記セーブ値を秘密鍵として、前記エントリーアドレスを暗号化して前記偽エントリーアドレスを生成し、
     前記アンマスク処理は、前記偽エントリーアドレスをデータとし、前記設定値を秘密鍵とし、前記新エントリーアドレスを復号する請求項1から4のいずれか1項に記載のプログラム処理装置。
  8.  前記アンマスク処理追加部により加えられた冗長なアンマスク処理を削除して、プログラムコードを生成するコード生成部を備えた請求項2に記載のプログラム処理装置。
  9.  アプリケーションプログラムの実行前に、ストレージに記憶した設定値を複写したセーブ値を用いて前記アプリケーションプログラムが使用しているエントリーアドレスをマスクした偽エントリーアドレスを生成して、前記エントリーアドレスを前記偽エントリーアドレスに置換し、
     前記アプリケーションプログラムの実行中に、前記偽エントリーアドレスがロードされた場合、前記ストレージから前記設定値をロードして、前記設定値を用いて前記偽エントリーアドレスをアンマスクした新エントリーアドレスを生成して、前記偽エントリーアドレスを前記新エントリーアドレスに置換するプログラム処理方法。
  10.  コンピュータに、
     アプリケーションプログラムの実行前に、ストレージに記憶した設定値を複写したセーブ値を用いて前記アプリケーションプログラムが使用しているエントリーアドレスをマスクした偽エントリーアドレスを生成して、前記エントリーアドレスを前記偽エントリーアドレスに置換するマスク処理と、
     前記アプリケーションプログラムの実行中に、前記偽エントリーアドレスがロードされた場合、前記ストレージから前記設定値をロードして、前記設定値を用いて前記偽エントリーアドレスをアンマスクした新エントリーアドレスを生成して、前記偽エントリーアドレスを前記新エントリーアドレスに置換するアンマスク処理と
    を実行させるプログラム。
  11.  エントリーアドレスが偽エントリーアドレスに置換されたプログラムであって、コンピュータに、
     ストレージから設定値をロードして設定値を用いて偽エントリーアドレスをアンマスクした新エントリーアドレスを生成する処理と
     偽エントリーアドレスを新エントリーアドレスに置換する処理と
    を、偽エントリーアドレスをアクセスする前に、実行させるプログラム。
PCT/JP2021/006409 2021-02-19 2021-02-19 プログラム処理装置、プログラム処理方法、及び、プログラム WO2022176164A1 (ja)

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)

* Cited by examiner, † Cited by third party
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

Patent Citations (4)

* Cited by examiner, † Cited by third party
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