EP3392791A1 - Method for executing a program intended for being interpreted by a virtual machine protected against fault-injection attacks - Google Patents

Method for executing a program intended for being interpreted by a virtual machine protected against fault-injection attacks Download PDF

Info

Publication number
EP3392791A1
EP3392791A1 EP18167875.6A EP18167875A EP3392791A1 EP 3392791 A1 EP3392791 A1 EP 3392791A1 EP 18167875 A EP18167875 A EP 18167875A EP 3392791 A1 EP3392791 A1 EP 3392791A1
Authority
EP
European Patent Office
Prior art keywords
program
virtual machine
instruction
code
interpreted
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
EP18167875.6A
Other languages
German (de)
French (fr)
Other versions
EP3392791B1 (en
Inventor
Ahmadou SERE
Karim Madjid AMMOUCHE
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Idemia Identity and Security France SAS
Original Assignee
Idemia Identity and Security France SAS
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 Idemia Identity and Security France SAS filed Critical Idemia Identity and Security France SAS
Publication of EP3392791A1 publication Critical patent/EP3392791A1/en
Application granted granted Critical
Publication of EP3392791B1 publication Critical patent/EP3392791B1/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • 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/53Monitoring 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 executing in a restricted environment, e.g. sandbox or secure virtual machine
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • 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/55Detecting local intrusion or implementing counter-measures
    • G06F21/56Computer malware detection or handling, e.g. anti-virus arrangements
    • G06F21/566Dynamic detection, i.e. detection performed at run-time, e.g. emulation, suspicious activities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/3005Arrangements for executing specific machine instructions to perform operations for flow control
    • G06F9/30058Conditional branch instructions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • 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
    • G06F12/1416Protection against unauthorised use of memory or access to memory by checking the object accessibility, e.g. type of access defined by the memory independently of subject rights
    • G06F12/1425Protection against unauthorised use of memory or access to memory by checking the object accessibility, e.g. type of access defined by the memory independently of subject rights the protection being physical, e.g. cell, word, block
    • G06F12/1441Protection against unauthorised use of memory or access to memory by checking the object accessibility, e.g. type of access defined by the memory independently of subject rights the protection being physical, e.g. cell, word, block for a range
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45587Isolation or security of virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/15Use in a specific computing environment
    • G06F2212/151Emulated environment, e.g. virtual machine
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/03Indexing scheme relating to G06F21/50, monitoring users, programs or devices to maintain the integrity of platforms
    • G06F2221/034Test or assess a computer or a system

Definitions

  • the present invention relates to a method of executing a program intended to be interpreted by a virtual machine.
  • the present application is advantageously used in electronic devices such as smart cards.
  • a fault injection attack consists in disturbing the physical environment of an electronic device, so as to modify data stored by the device.
  • Such disturbances can be produced in different ways: variation of a supply voltage, variation of a clock frequency of the device, emission of electromagnetic or laser radiation, etc.
  • This data may for example be code instructions of a program intended to be executed by a processor of such an electronic device.
  • the injection of fault amounts to inject malicious code.
  • Some programs are more particularly intended to be interpreted by a virtual machine, which is itself a program executed by a processor.
  • the processor is able to interpret machine code.
  • a virtual machine has the function of interpreting, using machine code, code instructions of the highest level.
  • An object of the invention is to prevent a virtual machine from interpreting malicious code, without having to change the format of program code instructions intended to be interpreted by such a virtual machine.
  • the method according to the first aspect of the invention may further comprise the following features taken alone or in combination when technically possible.
  • the presence check is implemented for each reference code instruction determined to be to be interpreted during program execution. This has the effect of ensuring a very high level of security.
  • the method includes verifying at least one condition that may or may not be satisfied by the reference code instruction; the presence check is then implemented only if the condition is fulfilled. This makes it possible to reduce the additional consumption of material resources by implementing the steps of the method compared with the previous embodiment.
  • code instructions are particularly critical in terms of security. It is therefore particularly advisable to limit the implementation of the presence check to such code instructions.
  • the presence control step can be implemented or not depending on a result of a random draw. This makes it possible to make this presence control unpredictable; an attacker therefore has more difficulty understanding and circumventing the security measures provided by the method according to the first aspect of the invention.
  • the interpretation rights data may be an integral part of the program and may include location data adapted to locate the portion of the program within the program. In this way, these interpretation rights data can be used directly from several installation platforms of the program.
  • the method may include reporting an error when the reference code instruction is not in the program portion.
  • the presence control step can be implemented by the virtual machine, the virtual machine being itself executed by at least one processor.
  • the presence control step is implemented by a circuit different from this processor (or each of these processors when there are several). Thus, part of the additional workload required by the method according to the first aspect is delegated to this circuit; therefore, the or each processor can run the virtual machine without being slowed down significantly.
  • a virtual machine comprising program code instructions for executing the steps of the method according to the first aspect of the invention, when this method is executed by at least one processor.
  • the first program portion can be stored in memory. adjacent to the third program portion. This makes it possible to reduce the fragmentation of the non-volatile memory.
  • an installer comprising program code instructions for performing the steps of the method according to the fourth aspect of the invention, when this method is executed by at least one processor.
  • the interpretation rights data of the program according to the seventh aspect of the invention may comprise location data adapted to locate the portion of the program within the program, and an integrity datum relating to the location data of the portion of the program. program.
  • the computer program product according to the seventh aspect of the invention can be a Java Card applet.
  • the portion of the program indicated in the interpretation rights data can be a component of the "method_component" type applet.
  • interpretation rights data used in one or other of the various aspects of the invention may include location data adapted for locate the portion of the program within the program, and the location data of the portion include a start address of the program portion and / or an end address of the program portion.
  • an electronic device 1 comprises at least one processor 2 and at least one memory 4.
  • the or each processor 2 is adapted to directly interpret program code instructions belonging to a set of predetermined code instructions.
  • the memory 4 comprises at least one volatile memory 6, for example of the RAM type.
  • the volatile memory 6 has the function of temporarily storing data, for example data calculated by the processor 2. The content of the volatile memory 6 is erased when the electronic device 1 is turned off.
  • the memory 4 further comprises at least one non-volatile memory 8 (NVM in English), for example of the hard disk, SSD, flash, EEPROM, etc. type.
  • the non-volatile memory 8 has the function of storing data in a persistent manner, in the sense that a de-energizing of the electronic device 1 does not erase the contents of the non-volatile memory 8.
  • the electronic device 1 also comprises a communication interface 10 with a third device, external to the electronic device 1.
  • This communication interface 10 may comprise a wireless communication circuit, for example an NFC chip, so as to establish a communication channel. radio communication between the electronic device and the third-party device, and / or include at least one port intended to be in physical contact with at least one port of the third-party device, so that data-carrying electrical signals can be transferred between the ports put in physical contact.
  • the electronic device may also comprise a control circuit 12 distinct from the processor, the function of which will be described later.
  • the electronic device 1 is for example a smart card, such as a SIM card.
  • the third-party device may be for example a user terminal, such as a smartphone.
  • the virtual machine M is a program coded using machine code, and therefore capable of being executed by at least one processor 2.
  • the virtual machine M has the function of interpreting, using machine code, high-level code instructions belonging to a set of instructions different from the set of machine code instructions.
  • code instruction implicitly designates a high level code instruction intended to be interpreted by the virtual machine M, while “machine code” designates one or more code instructions directly interpretable by the or each processor.
  • non-volatile memory 8 is also able to store at least one program P, said target program P, intended to be interpreted by the virtual machine M.
  • the installer IN is itself a program that can be executed by at least one processor 2.
  • a target program P intended to be interpreted by the virtual machine M can be generated from source code by means of the following steps.
  • the source code is written in the Java programming language, which is an object-oriented programming language.
  • the source code includes at least one source file suffixed in ".java".
  • a known Java compiler in itself generates on the basis of each source file a corresponding class file, suffixed in ".class".
  • a converter also known in itself generates on the basis of the class files at least one applet P interpretable by the virtual machine M.
  • the P applet includes an applet file suffixed in ".cap” (the suffix meaning “converted applet”) whose content conforms to Chapter 6 of the "Java Card 2.1.1 Virtual Machine Specification" specification.
  • the first program portion P1 is typically contained in a method_component structure detailed in part 6.9 of said specification.
  • the first program portion P1 can be this structure or the methods [] table contained in this structure.
  • the first portion P1 comprises at least one set of code instructions defining a method of the program, typically several sets of code instructions defining respective methods of the program.
  • a method can itself include one or more basic blocks.
  • a base block consists of a series of one-piece code instructions to be executed consecutively.
  • the converter generates in the applet file at least a second portion of P2 program not comprising any code instruction interpretable by the virtual machine M, but other types of data, for example constants intended to be read the virtual machine M during the execution of the applet.
  • the converter also generates data DR interpretation rights.
  • This interpretation rights data is configured to indicate to the virtual machine M that only code instructions contained in the first portion P1 program are allowed to be interpreted by the virtual machine M using machine code to run the program.
  • the interpretation rights data include location data adapted to locate the first portion P1 within the program.
  • These location data comprise, for example, a start address of the first portion P1 of the program, as well as an end address of the first portion P1 of the program (this end address can be replaced by a size of the first portion P1 of the program). program).
  • the end address may be the address of the last code instruction in the first portion P1 of the program or be the address that immediately follows the address of the latter code instruction. In the following, it will be assumed that the end address is the address of the last code instruction in the first portion P1.
  • the start and end addresses may be addresses relating to a reference address of the program. In other words, they are representative of a difference between this reference address and the beginning or the end of the first portion P1 within the program.
  • the start and end addresses can be absolute addresses in the non-volatile memory 8.
  • the DR interpretation rights data furthermore comprise an integrity datum relating to the location data.
  • the converter applies a predetermined integrity function F to the location data, such as a hash function, a function generating a longitudinal redundancy check (LRC) code. , a function generating a cyclic redundancy code ("cyclic redundancy check" or CRC in English), etc.
  • a predetermined integrity function F such as a hash function, a function generating a longitudinal redundancy check (LRC) code.
  • LRC longitudinal redundancy check
  • CRC cyclic redundancy check
  • the interpretation rights data DR are stored in the program P at a location that can be located by the installer IN or at the virtual machine M.
  • the DR interpretation rights data are for example included in an applet file and include an identifier specific to these data allowing the virtual machine M or the installer IN to distinguish these data rights of interpretation from other data content in the applet file.
  • the interpretation rights data are stored in a dedicated file.
  • the generation of the target program P is typically implemented by a device different from the electronic device, for example a desktop computer or a server.
  • Table 1 above illustrates an example of a method of a target program P.
  • the left column of Table 1 shows the source code of a foo method in Java.
  • the corresponding code instructions generated by the compiler and the converter found in an applet file are represented (in hexadecimal) with their respective addresses in the right column of Table 1.
  • Each Java Card code instruction is called "Opcode" whose value and bit size are specified in the above-mentioned Java Card Specification.
  • the middle column of Table 1 shows the mnemonics corresponding to these code instructions.
  • the first code statement that defines the foo method has a hexadecimal value opcode equal to 1C (in this example, this instruction is at the absolute address 0x8000).
  • This opcode is called "sload 0" and loads, when it is interpreted by the virtual machine M, the content of a first local variable at the top of an execution stack managed by the virtual machine M (in this example, this variable is the x parameter of the foo method).
  • the interpretation rights data thus comprise a start address equal to 0x8000, an end address equal to 0x800F (address of the last sreturn code instruction having the hexadecimal value 78).
  • the device 1 receives, via its communication interface 10, the target program P intended to be installed.
  • the target program P is for example downloaded from an application server by the third party device and transferred to the electronic device 1 via this communication interface 10.
  • the target program P is stored temporarily in the volatile memory 6 of the electronic device 1.
  • the program is then stored in the non-volatile memory 8 of the electronic device 1 in a conventional manner.
  • the target program P is then ready to be executed in the electronic device 1.
  • the interpretation rights data can be generated by the IN installer and not the compiler or the converter.
  • the IN installer uses its knowledge of the .cap format to detect within the program received via the communication interface the first program portion P1 (the component method_component).
  • the installer IN determines the start address and the end address of this first portion P1 and calculates, if necessary, the integrity data relating to these addresses.
  • the processor 2 starts the execution of the virtual machine M, for example when the electronic device 1 is powered up.
  • the virtual machine M receives an order to launch the target program P (step 100).
  • the execution of the target program P begins when an execution order of this program is received within the electronic device 1.
  • the virtual machine M opens an applet file of the target program P and locate there the first portion P1 program containing the code instructions of the program to interpret.
  • the virtual machine M has a code pointer ("Program Counter” in English, or PC) that will index the bytecode and a stack ("stack" in English). This stack is addressed through a stack pointer ("Stack Pointer” in English or SP).
  • the virtual machine M allocates an area of the volatile memory 6 reserved for the method, this area being called a frame.
  • the frame has a size corresponding to the number of words useful for storing context information, method arguments and the number of stack locations needed to execute all code instructions (opcodes) making part of the method.
  • the virtual machine M depiles the elements necessary for the execution of this opcode by relying on its arguments and stack the corresponding result in the stack.
  • the virtual machine M then updates the PC, before moving on to the interpretation of the next instruction.
  • the virtual machine M determines a reference code instruction to be interpreted using machine code (step 102).
  • This determination 102 comprises a reading of an address in the PC code pointer: at this address is the reference code instruction to be interpreted.
  • the virtual machine M also locates the DR interpretation rights data of the target program P and reads their content (step 106). The virtual machine M reads in particular the location data.
  • the virtual machine M checks whether or not the reference code instruction is present in the first portion P1 of the target program P (step 110).
  • the presence check comprises on the one hand a comparison between the code pointer (i.e. the address of the reference code instruction in the code pointer) and the start address read. in the location data.
  • the presence check also comprises a comparison between the code pointer and the end address read in the location data.
  • the reference code instruction is not present in the first portion P1 of the program.
  • the reference code instruction is not interpreted by the virtual machine M using machine code; the virtual machine M rather signals an error (step 114).
  • This signaling typically includes the lifting of a security exception by the virtual machine M.
  • the virtual machine M preferentially stops the execution of the program.
  • the reference code instruction is interpreted by the virtual machine M using machine code (step 112).
  • This interpretation step 112 is known to those skilled in the art.
  • the virtual machine M then updates the PC code pointer and determines a next code instruction to be executed, repeating step 102.
  • the presence control step 110 may be for several code instructions determined to be to be interpreted during the execution of the program by the virtual machine M.
  • the manner in which this presence control step 110 is repeated can make the object of several variants.
  • the presence control step 110 is repeated for each code instruction determined to be to be interpreted during an implementation of step 102, that is to say on the basis of each new address loaded in the code pointer during this execution.
  • the presence control step 110 is implemented for a reference instruction only if this reference instruction fulfills at least one predetermined condition (this condition being verified during a step 104). This makes it possible to reduce the additional computation load consumed by the presence control step.
  • This condition may be the result of a random draw implemented for the reference code instruction.
  • the presence control step is implemented or not, randomly.
  • the presence control step 110 can be implemented by the virtual machine M. However, such a presence control step consumes processor resources 2, and this is particularly important when the presence control 110 is implemented. for each reference code instruction determined to be to be interpreted by the virtual machine M, according to the first variant proposed above. To unload the processor 2, the presence control step 110 is advantageously delegated to the control circuit 12. For example, the virtual machine M reads once the location data of the first portion P1 from the non-volatile memory 8 and transmits the start and end addresses to the control circuit 12 at the start of the target program P, before the implementation of the presence check step 17. Later, the control circuit 12 implements the presence check 110 compares the code pointer with the addresses that the virtual machine M provided to him at the launch of the target program P.
  • the DR interpretation rights data comprise an integrity datum relating to these location data
  • this integrity datum is also read by the virtual machine M in step 106.
  • the virtual machine M controls the integrity of the location data using the integrity data (step 108).
  • the integrity check 108 comprises the application of the predetermined function F to the read location data, so as to generate a second integrity datum, then a comparison between the integrity data read and the second integrity data generated. . If the two integrity data compared are different, then the location data is considered unhealthy. It is possible in particular that the electronic device 1 has undergone an attack having had the effect of corrupting the location data stored in the electronic device. In this case step 110 is implemented. If the two integrity data compared are equal, then the location data is intact. The process then proceeds to step 110.
  • the integrity check step 108 may be implemented before the interpretation 112 of each reference code instruction determined to be to be interpreted in the step 102. Alternatively, the integrity check step 108 is implemented only when the presence check step 110 is performed for a reference code instruction.
  • the target program P installed in the electronic device has DR interpretation rights data of its own, and may even be an integral part. If several target programs are installed in the device 1, each installed target program has its own data DR.
  • the DR interpretation rights data are not part of a target program P but rather are shared between several target programs installed in the electronic device 1. This allows to limit the additional memory consumed by the DR interpretation right data.
  • the DR interpretation rights data indicate to the virtual machine M that only code instructions contained in a predetermined zone Z of the non-volatile memory 8 are allowed to be interpreted with the aid of machine code by the virtual machine M.
  • the interpretation rights data comprise location data adapted to locate the predetermined zone Z in the non-volatile memory 8.
  • These location data comprise, for example, a start address A of the predetermined zone Z in the non-volatile memory 8, as well as an end address B of this predetermined zone Z (this end address can be replaced by a size of the predetermined area).
  • the DR interpretation rights data may also include an integrity datum relative to the predetermined area of the nonvolatile memory 8, calculated in a manner similar to the first embodiment.
  • the interpretation rights data DR are stored in the non-volatile memory 8 before the installation of any target program P.
  • the installer IN breaks down the target program P in its first portion P1 and the remaining portion P2.
  • the installer IN reads the interpretation rights data from the volatile memory 6 to determine where is in the predetermined zone Z.
  • the installer IN controls the storage of the first portion P1 program in the predetermined zone Z of the non-volatile memory 8.
  • the installer IN also controls the storage of the remaining portion of the program in an area of the non-volatile memory different from the predetermined area.
  • the IN installer updates the interpretation rights data.
  • This update includes an update of the health value for the zone.
  • the zone indicated in the location data is extended by so to cover the first portion P1. This extension typically results in an increase in the value of the end address of the location data.
  • the electronic device receives via its communication interface a second target program P to be installed, the second target program P 'also being intended to be interpreted by the virtual machine M.
  • a first portion P1 'containing code instructions of the second target program P' is stored in the predetermined zone Z, and a remaining portion P2 of the second program is stored elsewhere in the virtual memory.
  • the first reference portion P1 is stored adjacent to the first portion P1 of the first target program P already present in the predetermined area of the nonvolatile memory 8. This makes it possible to limit the fragmentation of the memory.
  • the zone Z indicated in the location data is extended so as to cover the first two portions P1 and P1 '. This extension typically results in an increase in the value of the end address B of the location data.
  • the steps of the execution method are similar to those of the first embodiment, except that the location rights data are not read by the virtual machine M from a .cap file.

Abstract

La présente invention concerne notamment un procédé d'exécution d'un programme (P) destiné à être interprété par une machine virtuelle (M), le procédé comprenant des étapes de détermination (102) d'une instruction de code de référence à interpréter au cours de l'exécution du programme et d'interprétation (112), par la machine virtuelle, de l'instruction de code de référence à l'aide de code machine. Ce procédé comprend par ailleurs une lecture (106) de données de droits d'interprétation (DR) indiquant une portion du programme (P1) contenant des instructions de code interprétables par la machine virtuelle, et, sur la base des données lues, un contrôle de présence (110) de l'instruction de code de référence dans la portion (P1) du programme (P), l'interprétation de l'instruction de code de référence étant mise en oeuvre par la machine virtuelle (M) seulement si l'instruction de code de référence est contenue dans la portion (P1) du programme (P).The present invention relates in particular to a method for executing a program (P) intended to be interpreted by a virtual machine (M), the method comprising steps for determining (102) a reference code instruction to be interpreted at during the execution of the program and interpreting (112), by the virtual machine, the reference code instruction using machine code. The method further includes reading (106) interpretive rights (DR) data indicating a portion of the program (P1) containing code instructions interpretable by the virtual machine, and, based on the read data, a control of presence (110) of the reference code instruction in the portion (P1) of the program (P), the interpretation of the reference code instruction being implemented by the virtual machine (M) only if the reference code instruction is contained in the portion (P1) of the program (P).

Description

DOMAINE DE L'INVENTIONFIELD OF THE INVENTION

La présente invention concerne un procédé d'exécution d'un programme destiné à être interprété par une machine virtuelle.The present invention relates to a method of executing a program intended to be interpreted by a virtual machine.

La présente application trouve avantageusement application dans des dispositifs électroniques tels que des cartes à puce.The present application is advantageously used in electronic devices such as smart cards.

ETAT DE LA TECHNIQUESTATE OF THE ART

De façon connue, une attaque par injection de faute consiste à perturber l'environnement physique d'un dispositif électronique, de sorte à modifier des données mémorisées par le dispositif. De telles perturbations peuvent être produites de différentes manières : variation d'une tension d'alimentation, variation d'une fréquence d'horloge du dispositif, émission de rayonnement électromagnétique ou laser, etc.In a known manner, a fault injection attack consists in disturbing the physical environment of an electronic device, so as to modify data stored by the device. Such disturbances can be produced in different ways: variation of a supply voltage, variation of a clock frequency of the device, emission of electromagnetic or laser radiation, etc.

Ces données peuvent par exemple être des instructions de code d'un programme destiné à être exécuté par un processeur d'un tel dispositif électronique. Dans ce cas, l'injection de faute revient à injecter du code malicieux.This data may for example be code instructions of a program intended to be executed by a processor of such an electronic device. In this case, the injection of fault amounts to inject malicious code.

Certains programmes sont plus particulièrement destinés à être interprétés par une machine virtuelle, qui est elle-même un programme exécuté par un processeur.Some programs are more particularly intended to be interpreted by a virtual machine, which is itself a program executed by a processor.

Le processeur est apte à interpréter du code machine. De façon connue, une machine virtuelle a pour fonction d'interpréter à l'aide de code machine des instructions de code de plus haut niveau.The processor is able to interpret machine code. In known manner, a virtual machine has the function of interpreting, using machine code, code instructions of the highest level.

On connaît du document US 20110258397 un procédé permettant de protéger des objets manipulés par une machine virtuelle contre des attaques par injection de faute. Toutefois, ce procédé ne permet pas d'empêcher l'interprétation par une machine virtuelle de code malicieux.Document is known US 20110258397 a method for protecting objects manipulated by a virtual machine against fault injection attacks. However, this method does not prevent the interpretation by a virtual machine of malicious code.

Le document US 8,893,275 décrit par ailleurs un procédé dans lequel il est vérifié que des instructions de code peuvent être interprétées ou non en du code machine par une machine virtuelle. Pour cela, il est proposé de faire appel, dans un programme destiné à être interprété par une machine virtuelle, à des instructions spéciales comprenant des sécurités additionnelles. Par exemple, au lieu de faire appel à l'instruction invokespecial définie dans la norme Java Card, on fait appel en vertu de ce principe à une instruction invokespecial_bis qui met en oeuvre des tests de sécurité. Ce procédé a cependant pour inconvénient majeur de devoir modifier en profondeur le format des instructions de code du programme.The document US 8,893,275 further described a method in which it is verified that code instructions may or may not be interpreted as machine code by a virtual machine. For this, it is proposed to use, in a program intended to be interpreted by a virtual machine, special instructions including additional security. For example, instead of using the invokespecial instruction defined in the Java Card standard, an instruction is invoked under this principle. invokespecial_bis that implements security tests. However, this method has the major disadvantage of having to change in depth the format of the code instructions of the program.

RESUME DE L'INVENTIONSUMMARY OF THE INVENTION

Un but de l'invention est d'éviter qu'une machine virtuelle n'interprète du code malicieux, sans pour autant devoir modifier le format des instructions de code de programmes destinés à être interprétés par une telle machine virtuelle.An object of the invention is to prevent a virtual machine from interpreting malicious code, without having to change the format of program code instructions intended to be interpreted by such a virtual machine.

Il est ainsi proposé, selon un premier aspect de l'invention, un procédé d'exécution d'un programme destiné à être interprété par une machine virtuelle, le procédé comprenant des étapes de :

  • détermination d'une instruction de code de référence à interpréter au cours de l'exécution du programme,
  • lecture de données de droits d'interprétation indiquant une portion du programme contenant des instructions de code interprétables par la machine virtuelle,
  • sur la base des données lues, contrôle de présence de l'instruction de code de référence dans la portion du programme,
  • interprétation, par la machine virtuelle, de l'instruction de code de référence à l'aide de code machine, seulement si l'instruction de code de référence est contenue dans la portion du programme.
It is thus proposed, according to a first aspect of the invention, a method of executing a program intended to be interpreted by a virtual machine, the method comprising steps of:
  • determining a reference code instruction to be interpreted during program execution,
  • read interpretation rights data indicating a portion of the program containing code instructions interpretable by the virtual machine,
  • based on the read data, presence control of the reference code instruction in the portion of the program,
  • interpreting, by the virtual machine, the reference code instruction using machine code, only if the reference code instruction is contained in the portion of the program.

Le procédé selon le premier aspect de l'invention peut en outre comprendre les caractéristiques suivantes prises seules ou en combinaison lorsque cela est techniquement possible.The method according to the first aspect of the invention may further comprise the following features taken alone or in combination when technically possible.

Dans un mode de réalisation, le contrôle de présence est mis en oeuvre pour chaque instruction de code de référence déterminée comme étant à interpréter au cours de l'exécution du programme. Ceci a pour effet d'assurer un très haut niveau de sécurité.In one embodiment, the presence check is implemented for each reference code instruction determined to be to be interpreted during program execution. This has the effect of ensuring a very high level of security.

Dans un autre mode de réalisation, le procédé comprend la vérification d'au moins une condition susceptible d'être remplie ou non par l'instruction de code de référence ; le contrôle de présence est alors mis en oeuvre seulement si la condition est remplie. Ceci permet de réduire la consommation additionnelle de ressources matérielles par la mise en oeuvre des étapes du procédé comparativement au mode de réalisation précédent.In another embodiment, the method includes verifying at least one condition that may or may not be satisfied by the reference code instruction; the presence check is then implemented only if the condition is fulfilled. This makes it possible to reduce the additional consumption of material resources by implementing the steps of the method compared with the previous embodiment.

La condition peut notamment être remplie lorsque :

  • l'instruction de code de référence est une instruction de saut depuis un premier bloc de base de programme vers un autre bloc de base de programme, telle qu'une instruction de branchement, une instruction d'invocation de méthode, ou une instruction de retour de méthode, ou
  • l'instruction de code de référence est une instruction d'écriture dans une mémoire non volatile, ou
  • le programme étant exécuté dans un dispositif électronique, l'instruction de code de référence participe à une communication de données entre le dispositif électronique et un autre dispositif.
In particular, the condition can be met when:
  • the reference code instruction is a jump instruction from a first program base block to another program base block, such as a branch instruction, a method invocation instruction, or a return instruction method, or
  • the reference code instruction is a write instruction in a non-volatile memory, or
  • the program being executed in an electronic device, the reference code instruction participates in a data communication between the electronic device and another device.

Ces types d'instruction de code sont particulièrement critiques en termes de sécurité. Il est donc particulièrement judicieux de limiter la mise en oeuvre du contrôle de présence à de telles instructions de code.These types of code instructions are particularly critical in terms of security. It is therefore particularly advisable to limit the implementation of the presence check to such code instructions.

L'étape de contrôle de présence peut être mise en oeuvre ou non en fonction d'un résultat d'un tirage aléatoire. Ceci permet de rendre imprévisible ce contrôle de présence ; un attaquant a donc alors plus de difficultés à comprendre et contourner les mesures de sécurité procurées par le procédé selon le premier aspect de l'invention.The presence control step can be implemented or not depending on a result of a random draw. This makes it possible to make this presence control unpredictable; an attacker therefore has more difficulty understanding and circumventing the security measures provided by the method according to the first aspect of the invention.

Le procédé selon le premier aspect peut en outre comprendre des étapes de :

  • lecture, dans les données de droits d'interprétation, de données de localisation adaptées pour localiser la portion du programme,
  • lecture, dans les données de droits d'interprétation, d'une donnée d'intégrité relative aux données de localisation,
  • contrôle d'intégrité des données de localisation sur la base de la donnée d'intégrité, l'instruction de code de référence étant interprétée seulement s'il est déterminé au cours du contrôle d'intégrité que les données de localisation sont intègres.
The method according to the first aspect may further comprise steps of:
  • reading, in the interpretation rights data, suitable location data for locating the portion of the program,
  • reading, in the interpretation rights data, an integrity datum relating to the location data,
  • location data integrity check based on the integrity data, the reference code instruction being interpreted only if it is determined during the integrity check that the location data is integrity.

Ces étapes permettent de détecter une éventuelle corruption par un attaquant des données de droits d'interprétation elles-mêmes en vue de contourner les mesures de sécurité procurées par le procédé.These steps make it possible to detect possible corruption by an attacker of the interpretation rights data themselves in order to circumvent the security measures provided by the method.

Les données de droits d'interprétation peuvent faire partie intégrante du programme et peuvent comprendre des données de localisation adaptées pour localiser la portion du programme au sein du programme. De la sorte, ces données de droits d'interprétation sont directement utilisables depuis plusieurs plateformes d'installation du programme.The interpretation rights data may be an integral part of the program and may include location data adapted to locate the portion of the program within the program. In this way, these interpretation rights data can be used directly from several installation platforms of the program.

Le procédé peut comprendre un signalement d'une erreur lorsque l'instruction de code de référence n'est pas dans la portion du programme.The method may include reporting an error when the reference code instruction is not in the program portion.

L'étape de contrôle de présence peut être mise en oeuvre par la machine virtuelle, la machine virtuelle étant elle-même exécutée par au moins un processeur. Alternativement, l'étape de contrôle de présence est mise en oeuvre par un circuit différent de ce processeur (ou chacun de ces processeurs lorsqu'il y en a plusieurs). Ainsi, une partie de la charge de travail additionnelle requise par le procédé selon le premier aspect est déléguée à ce circuit ; par conséquent, le ou chaque processeur peut exécuter la machine virtuelle sans être ralenti de façon importante.The presence control step can be implemented by the virtual machine, the virtual machine being itself executed by at least one processor. Alternatively, the presence control step is implemented by a circuit different from this processor (or each of these processors when there are several). Thus, part of the additional workload required by the method according to the first aspect is delegated to this circuit; therefore, the or each processor can run the virtual machine without being slowed down significantly.

Il est également proposé, selon un deuxième aspect de l'invention, une machine virtuelle comprenant des instructions de code de programme pour l'exécution des étapes du procédé selon le premier aspect de l'invention, lorsque ce procédé est exécuté par au moins un processeur.It is also proposed, according to a second aspect of the invention, a virtual machine comprising program code instructions for executing the steps of the method according to the first aspect of the invention, when this method is executed by at least one processor.

Il est également proposé, selon un troisième aspect de l'invention, un dispositif électronique, tel qu'une carte à puce, comprenant :

  • au moins un processeur configuré pour exécuter une machine virtuelle selon le deuxième aspect de l'invention,
  • au moins un programme destiné à être interprété par la machine virtuelle.
It is also proposed, according to a third aspect of the invention, an electronic device, such as a smart card, comprising:
  • at least one processor configured to execute a virtual machine according to the second aspect of the invention,
  • at least one program intended to be interpreted by the virtual machine.

Il est également proposé, selon un quatrième aspect de l'invention, un procédé d'installation d'un programme destiné à être interprété par une machine virtuelle dans une mémoire non volatile, le procédé comprenant des étapes de :

  • décomposition du programme en une première portion comprenant des instructions de code interprétable par la machine virtuelle et une portion restante,
  • lecture de données de droits d'interprétation indiquant à la machine virtuelle que seules des instructions de code contenues dans une zone prédéterminée de la mémoire non volatile sont autorisées à être interprétées à l'aide de code machine par la machine virtuelle,
  • mémorisation de la première portion de programme dans la zone prédéterminée de la mémoire non volatile,
  • mémorisation de la portion restante du programme dans une zone différente de la zone prédéterminée.
It is also proposed, according to a fourth aspect of the invention, a method for installing a program intended to be interpreted by a virtual machine in a non-volatile memory, the method comprising steps of:
  • decomposing the program into a first portion comprising code instructions interpretable by the virtual machine and a remaining portion,
  • reading interpretation rights data indicating to the virtual machine that only code instructions contained in a predetermined area of the non-volatile memory are allowed to be interpreted using machine code by the virtual machine,
  • storing the first program portion in the predetermined area of the non-volatile memory,
  • storing the remaining portion of the program in a different area of the predetermined area.

Si une portion d'un autre programme contenant des instructions de code interprétables par la machine virtuelle, dite troisième portion de programme, est déjà présente dans la mémoire non volatile, alors la première portion de programme peut être mémorisée de manière adjacente à la troisième portion de programme. Ceci permet de réduire la fragmentation de la mémoire non volatile.If a portion of another program containing code instructions interpretable by the virtual machine, said third program portion, is already present in the non-volatile memory, then the first program portion can be stored in memory. adjacent to the third program portion. This makes it possible to reduce the fragmentation of the non-volatile memory.

Il est également proposé, selon un cinquième aspect de l'invention, un installeur comprenant des instructions de code de programme pour l'exécution des étapes du procédé selon le quatrième aspect de l'invention, lorsque ce procédé est exécuté par au moins un processeur.It is also proposed, according to a fifth aspect of the invention, an installer comprising program code instructions for performing the steps of the method according to the fourth aspect of the invention, when this method is executed by at least one processor. .

Il est également proposé, selon un sixième aspect de l'invention, un procédé de génération d'un programme destiné à être interprété par une machine virtuelle, comprenant des étapes de

  • génération d'une portion de programme contenant des instructions de code interprétables par la machine virtuelle,
  • génération de données de droits d'interprétation configurées pour indiquer à la machine virtuelle que seules les instructions de code contenues dans la portion de programme sont autorisées à être interprétées par la machine virtuelle à l'aide de code machine pour exécuter le programme.
It is also proposed, according to a sixth aspect of the invention, a method of generating a program intended to be interpreted by a virtual machine, comprising steps of
  • generating a program portion containing code instructions interpretable by the virtual machine,
  • generating interpretation rights data configured to indicate to the virtual machine that only the code instructions contained in the program portion are allowed to be interpreted by the virtual machine using machine code to execute the program.

Il est également proposé, selon un septième aspect de l'invention, un produit programme d'ordinateur destiné à être interprété par une machine virtuelle, comprenant :

  • une portion de programme contenant des instructions de code interprétables par la machine virtuelle,
  • des données de droits d'interprétation configurées pour indiquer à la machine virtuelle que seules les instructions de code contenues dans la portion du programme sont autorisées à être interprétées par la machine virtuelle à l'aide de code machine pour exécuter le programme.
It is also proposed, according to a seventh aspect of the invention, a computer program product intended to be interpreted by a virtual machine, comprising:
  • a program portion containing code instructions interpretable by the virtual machine,
  • interpretive rights data configured to indicate to the virtual machine that only the code instructions contained in the portion of the program are allowed to be interpreted by the virtual machine using machine code to execute the program.

Les données de droits d'interprétation du programme selon le septième aspect de l'invention peuvent comprendre des données de localisation adaptées pour localiser la portion du programme au sein du programme, et une donnée d'intégrité relative aux données de localisation de la portion de programme.The interpretation rights data of the program according to the seventh aspect of the invention may comprise location data adapted to locate the portion of the program within the program, and an integrity datum relating to the location data of the portion of the program. program.

En particulier, le produit programme d'ordinateur selon le septième aspect de l'invention peut être une applet Java Card. Dans ce cas, la portion du programme indiquée dans les données de droits d'interprétation peut être un composant de l'applet de type « method_component ».In particular, the computer program product according to the seventh aspect of the invention can be a Java Card applet. In this case, the portion of the program indicated in the interpretation rights data can be a component of the "method_component" type applet.

En outre, les données de droits d'interprétation utilisées dans l'un ou l'autre des différents aspects de l'invention peut comprendre des données de localisation adaptées pour localiser la portion du programme au sein du programme, et les données de localisation de la portion comprendre une adresse de début de la portion de programme et/ou une adresse de fin de la portion de programme.In addition, the interpretation rights data used in one or other of the various aspects of the invention may include location data adapted for locate the portion of the program within the program, and the location data of the portion include a start address of the program portion and / or an end address of the program portion.

DESCRIPTION DES FIGURES ANNEXEESDESCRIPTION OF THE APPENDIXES

D'autres caractéristiques, buts et avantages de l'invention ressortiront de la description qui suit, qui est purement illustrative et non limitative, et qui doit être lue en regard des dessins annexés sur lesquels :

  • La figure 1 représente schématiquement un dispositif électronique selon un mode de réalisation de l'invention.
  • La figure 2, représente schématiquement une mémoire du dispositif schématiquement représenté en figure 1 contenant plusieurs programmes.
  • La figure 3 est un organigramme d'étapes du procédé d'exécution d'un programme selon un mode de réalisation de l'invention.
  • Les figures 4, 5 et 6 représentent le contenu d'une mémoire du dispositif à des instants différents, au cours de la mise en oeuvre d'un procédé d'installation d'un programme dans cette mémoire.
Sur l'ensemble des figures, les éléments similaires portent des références identiques.Other features, objects and advantages of the invention will emerge from the description which follows, which is purely illustrative and nonlimiting, and which should be read with reference to the appended drawings in which:
  • The figure 1 schematically represents an electronic device according to one embodiment of the invention.
  • The figure 2 , schematically represents a memory of the device schematically represented in figure 1 containing several programs.
  • The figure 3 is a flowchart of steps of the method of executing a program according to an embodiment of the invention.
  • The Figures 4, 5 and 6 represent the contents of a memory of the device at different times, during the implementation of a method of installing a program in this memory.
In all the figures, similar elements bear identical references.

DESCRIPTION DETAILLEE DE L'INVENTIONDETAILED DESCRIPTION OF THE INVENTION Dispositif électronique protégé contre des attaques par injection de fauteElectronic device protected against fault injection attacks

En référence à la figure 1 , un dispositif électronique 1 comprend au moins un processeur 2 et au moins une mémoire 4.With reference to the figure 1 an electronic device 1 comprises at least one processor 2 and at least one memory 4.

Le ou chaque processeur 2 est adapté pour interpréter directement des instructions de code de programme appartenant à un jeu d'instructions de code prédéterminées.The or each processor 2 is adapted to directly interpret program code instructions belonging to a set of predetermined code instructions.

La mémoire 4 comprend au moins une mémoire volatile 6, par exemple de type RAM. La mémoire volatile 6 a pour fonction de mémoriser temporairement des données, par exemple des données calculées par le processeur 2. Le contenu de la mémoire volatile 6 est effacé lors d'une mise hors tension du dispositif électronique 1.The memory 4 comprises at least one volatile memory 6, for example of the RAM type. The volatile memory 6 has the function of temporarily storing data, for example data calculated by the processor 2. The content of the volatile memory 6 is erased when the electronic device 1 is turned off.

La mémoire 4 comprend en outre au moins une mémoire non volatile 8 (NVM en anglais), par exemple de type disque dur, SSD, flash, EEPROM, etc. La mémoire non volatile 8 a pour fonction de mémoriser des données de manière persistante, au sens où une mise hors tension du dispositif électronique 1 n'efface pas le contenu de la mémoire non volatile 8.The memory 4 further comprises at least one non-volatile memory 8 (NVM in English), for example of the hard disk, SSD, flash, EEPROM, etc. type. The non-volatile memory 8 has the function of storing data in a persistent manner, in the sense that a de-energizing of the electronic device 1 does not erase the contents of the non-volatile memory 8.

Le dispositif électronique 1 comprend par ailleurs une interface de communication 10 avec un dispositif tiers, extérieur au dispositif électronique 1. Cette interface de communication 10 peut comprendre un circuit de communication sans fil, par exemple une puce NFC, de sorte à établir un canal de communication radio entre le dispositif électronique et le dispositif tiers, et/ou comprendre au moins un port destiné à être mis en contact physique avec au moins un port du dispositif tiers, de sorte que des signaux électriques porteurs de données puissent être transférés entre les ports mis en contact physique.The electronic device 1 also comprises a communication interface 10 with a third device, external to the electronic device 1. This communication interface 10 may comprise a wireless communication circuit, for example an NFC chip, so as to establish a communication channel. radio communication between the electronic device and the third-party device, and / or include at least one port intended to be in physical contact with at least one port of the third-party device, so that data-carrying electrical signals can be transferred between the ports put in physical contact.

Le dispositif électronique peut également comprendre un circuit de contrôle 12 distinct du processeur, et dont la fonction sera décrite plus loin.The electronic device may also comprise a control circuit 12 distinct from the processor, the function of which will be described later.

Le dispositif électronique 1 est par exemple une carte à puce, telle qu'une carte SIM. Le dispositif tiers peut être par exemple un terminal utilisateur, tel qu'un smartphone.The electronic device 1 is for example a smart card, such as a SIM card. The third-party device may be for example a user terminal, such as a smartphone.

En référence à la figure 2 , est mémorisée dans la mémoire non volatile 8 une machine virtuelle M.With reference to the figure 2 , is stored in the non-volatile memory 8 a virtual machine M.

La machine virtuelle M est un programme codé à l'aide de code machine, et donc susceptible d'être exécuté par au moins un processeur 2.The virtual machine M is a program coded using machine code, and therefore capable of being executed by at least one processor 2.

La machine virtuelle M a comme fonction d'interpréter à l'aide de code machine des instructions de code de haut niveau appartenant à un jeu d'instructions différent du jeu d'instructions de code machine.The virtual machine M has the function of interpreting, using machine code, high-level code instructions belonging to a set of instructions different from the set of machine code instructions.

Dans la suite du présent document, le terme « instruction de code » désigne implicitement une instruction de code de haut niveau destinée à être interprétée par la machine virtuelle M, tandis que « code machine » désigne une ou plusieurs instructions de code directement interprétables par le ou chaque processeur.In the remainder of this document, the term "code instruction" implicitly designates a high level code instruction intended to be interpreted by the virtual machine M, while "machine code" designates one or more code instructions directly interpretable by the or each processor.

On verra dans la suite que la mémoire non volatile 8 est également apte à mémoriser au moins un programme P, dit programme cible P, destiné à être interprété par la machine virtuelle M.It will be seen in the following that the non-volatile memory 8 is also able to store at least one program P, said target program P, intended to be interpreted by the virtual machine M.

Dans la suite, on prendra l'exemple non limitatif d'une machine virtuelle M Java Card. Elle est alors configurée pour interpréter du « bytecode » d'une applet ayant été préalablement générée à partir d'un code source dans le langage de programmation Java, qui est un langage de programmation orienté objet.In the following, we will take the non-limiting example of a virtual machine Java Card M. It is then configured to interpret the "bytecode" of an applet that has been previously generated from a source code in the Java programming language, which is an object-oriented programming language.

Est par ailleurs mémorisé dans la mémoire non volatile 8 un installeur IN de programmes interprétables par la machine virtuelle M.Is also stored in the nonvolatile memory 8 an IN installer programs interpretable by the virtual machine M.

L'installeur IN est lui-même un programme susceptible d'être exécuté par au moins un processeur 2.The installer IN is itself a program that can be executed by at least one processor 2.

Génération d'un programme cible P destiné à être interprété par une machine virtuelle MGeneration of a target program P intended to be interpreted by a virtual machine M

Un programme cible P destiné à être interprété par la machine virtuelle M peut être généré à partir de code source au moyen des étapes suivantes.A target program P intended to be interpreted by the virtual machine M can be generated from source code by means of the following steps.

Le code source est écrit dans le langage de programmation Java, qui est un langage de programmation orienté objet.The source code is written in the Java programming language, which is an object-oriented programming language.

Le code source comprend au moins un fichier source suffixé en « .java ».The source code includes at least one source file suffixed in ".java".

Un compilateur Java connu en lui-même génère sur la base de chaque fichier source un fichier de classe correspondant, suffixé en « .class ».A known Java compiler in itself generates on the basis of each source file a corresponding class file, suffixed in ".class".

Un convertisseur également connu en lui-même génère sur la base des fichiers de classes au moins une applet P interprétable par la machine virtuelle M.A converter also known in itself generates on the basis of the class files at least one applet P interpretable by the virtual machine M.

L'applet P comprend un fichier d'applet suffixé en « .cap » (ce suffixe signifiant « converted applet ») dont le contenu est conforme à au chapitre 6 de la spécification « Java Card 2.1.1 Virtual Machine Specification ».The P applet includes an applet file suffixed in ".cap" (the suffix meaning "converted applet") whose content conforms to Chapter 6 of the "Java Card 2.1.1 Virtual Machine Specification" specification.

Est généré par le convertisseur dans le fichier d'applet une première portion P1 de programme comprenant des instructions de code interprétables par la machine virtuelle M.Is generated by the converter in the applet file a first portion P1 program comprising code instructions interpretable by the virtual machine M.

La première portion P1 de programme est typiquement contenue dans une structure method_component détaillée dans la partie 6.9 de ladite spécification. La première portion P1 de programme peut être cette structure ou bien la table methods [ ] contenue dans cette structure.The first program portion P1 is typically contained in a method_component structure detailed in part 6.9 of said specification. The first program portion P1 can be this structure or the methods [] table contained in this structure.

La première portion P1 comprend au moins un ensemble d'instructions de codes définissant une méthode du programme, typiquement plusieurs ensembles d'instructions de code définissant des méthode respectives du programme.The first portion P1 comprises at least one set of code instructions defining a method of the program, typically several sets of code instructions defining respective methods of the program.

Une méthode peut elle-même comprendre un ou plusieurs blocs de base (« basic block » en anglais). Un bloc de base est constitué d'une suite d'instructions de codes d'un seul tenant, destinées à être exécutées consécutivement.A method can itself include one or more basic blocks. A base block consists of a series of one-piece code instructions to be executed consecutively.

Par ailleurs, le convertisseur génère dans le fichier d'applet au moins une deuxième portion de programme P2 ne comprenant pas d'instruction de code interprétable par la machine virtuelle M, mais d'autres types de données, par exemple des constantes destinées à être lues la machine virtuelle M au cours de l'exécution de l'applet.Furthermore, the converter generates in the applet file at least a second portion of P2 program not comprising any code instruction interpretable by the virtual machine M, but other types of data, for example constants intended to be read the virtual machine M during the execution of the applet.

De façon non conventionnelle, le convertisseur génère par ailleurs des données de droits d'interprétation DR. Ces données de droits d'interprétation sont configurées pour indiquer à la machine virtuelle M que seules des instructions de code contenues dans la première portion P1 de programme sont autorisées à être interprétées par la machine virtuelle M à l'aide de code machine pour exécuter le programme.Unconventionally, the converter also generates data DR interpretation rights. This interpretation rights data is configured to indicate to the virtual machine M that only code instructions contained in the first portion P1 program are allowed to be interpreted by the virtual machine M using machine code to run the program.

Les données de droits d'interprétation comprennent des données de localisation adaptées pour localiser la première portion P1 au sein du programme.The interpretation rights data include location data adapted to locate the first portion P1 within the program.

Ces données de localisation comprennent par exemple une adresse de début de la première portion P1 du programme, ainsi qu'une adresse de fin de la première portion P1 du programme (cette adresse de fin pouvant être remplacée par une taille de la première portion P1 du programme).These location data comprise, for example, a start address of the first portion P1 of the program, as well as an end address of the first portion P1 of the program (this end address can be replaced by a size of the first portion P1 of the program). program).

L'adresse de fin peut être l'adresse de la dernière instruction de code se trouvant dans la première portion P1 du programme ou bien être l'adresse qui suit immédiatement l'adresse de cette dernière instruction de code. Dans la suite, on supposera que l'adresse de fin est l'adresse de la dernière instruction de code se trouvant dans la première portion P1.The end address may be the address of the last code instruction in the first portion P1 of the program or be the address that immediately follows the address of the latter code instruction. In the following, it will be assumed that the end address is the address of the last code instruction in the first portion P1.

Les adresses de début et de fin peuvent être des adresses relatives à une adresse de référence du programme. Autrement dit, elles sont représentatives d'un écart entre cette adresse de référence et le début ou la fin de la première portion P1 au sein du programme. Alternativement, les adresses de début et de fin peuvent être des adresses absolues dans la mémoire non volatile 8.The start and end addresses may be addresses relating to a reference address of the program. In other words, they are representative of a difference between this reference address and the beginning or the end of the first portion P1 within the program. Alternatively, the start and end addresses can be absolute addresses in the non-volatile memory 8.

Les données de droits d'interprétation DR comprennent par ailleurs une donnée d'intégrité relative aux données de localisation.The DR interpretation rights data furthermore comprise an integrity datum relating to the location data.

Pour générer cette donnée d'intégrité, le convertisseur applique une fonction d'intégrité F prédéterminée aux données de localisation, telle qu'une fonction de hachage, une fonction générant un code de redondance longitudinal (« longitudinal redundancy check » ou LRC en anglais), une fonction générant un code de redondance cyclique (« cyclic redundancy check » ou CRC en anglais), etc.To generate this integrity data, the converter applies a predetermined integrity function F to the location data, such as a hash function, a function generating a longitudinal redundancy check (LRC) code. , a function generating a cyclic redundancy code ("cyclic redundancy check" or CRC in English), etc.

Les données de droits d'interprétation DR sont mémorisées au sein du programme P à un emplacement localisable par l'installeur IN ou à la machine virtuelle M.The interpretation rights data DR are stored in the program P at a location that can be located by the installer IN or at the virtual machine M.

Les données de droits d'interprétation DR sont par exemple incluses dans un fichier d'applet et comprennent un identifiant propre à ces données permettant à la machine virtuelle M ou l'installeur IN de distinguer ces données de droits d'interprétation des autres données contenu dans le fichier d'applet. En variante, les données de droits d'interprétation sont mémorisées dans un fichier dédié.The DR interpretation rights data are for example included in an applet file and include an identifier specific to these data allowing the virtual machine M or the installer IN to distinguish these data rights of interpretation from other data content in the applet file. Alternatively, the interpretation rights data are stored in a dedicated file.

La génération du programme cible P est typiquement mis en oeuvre par un dispositif différent du dispositif électronique, par exemple un ordinateur de bureau ou un serveur.The generation of the target program P is typically implemented by a device different from the electronic device, for example a desktop computer or a server.

Le tableau 1 ci-dessus illustre un exemple de méthode d'un programme cible P. Tableau 1 - Exemple de méthode Java Code source Java Mnémonique Byte code Static short foo ( short x ) L0: sload_0 // x==Localvar #0 0x8000: 1C 0x8001: 61 05 { ifne L1 0x8003: 11 64 if( x==0 ) sspush 100 0x8005: 78 return 100; sreturn 0x8006: 1C else L1: sload_0 0x8007: 04 return foo(x-1 ) + sconst_1 0x8008: 43 20; ssub 0x8009: 8B 80 00 } invokevirtual<foo> 0x800C: 11 14 sspush 20 0x800E: 41 sadd 0x800F: 78 sreturn Table 1 above illustrates an example of a method of a target program P. Table 1 - Java Method Example Java source code Mnemonic Byte code Static short foo (short x) L0: sload_0 // x == Localvar # 0 0x8000: 1C 0x8001: 61 05 { ifne L1 0x8003: 11 64 if (x == 0) sspush 100 0x8005: 78 return 100; sreturn 0x8006: 1C else L1: sload_0 0x8007: 04 return foo (x-1) + sconst_1 0x8008: 43 20; s sub 0x8009: 8B 80 00 } invokevirtual <foo> 0x800C: 11 14 sspush 20 0x800E: 41 sadd 0x800F: 78 sreturn

La colonne de gauche du tableau 1 montre le code source d'une méthode foo en langage Java. Les instructions de code correspondantes générées par le compilateur et le convertisseur que l'on retrouve dans un fichier d'applet sont représentées (en hexadécimal) avec leurs adresses respectives dans la colonne de droite du tableau 1. Chaque instruction de code Java Card est appelée « opcode » dont la valeur et la taille en nombre de bits sont spécifiées dans la spécification Java Card susmentionnée. La colonne du milieu du tableau 1 montre les mnémoniques correspondant à ces instructions de code.The left column of Table 1 shows the source code of a foo method in Java. The corresponding code instructions generated by the compiler and the converter found in an applet file are represented (in hexadecimal) with their respective addresses in the right column of Table 1. Each Java Card code instruction is called "Opcode" whose value and bit size are specified in the above-mentioned Java Card Specification. The middle column of Table 1 shows the mnemonics corresponding to these code instructions.

Par exemple, la première instruction de code définissant la méthode foo a un opcode de valeur hexadécimale égale à 1C (dans cet exemple, cette instruction se trouvant à l'adresse absolue 0x8000). Cet opcode est appelé « sload 0 » et charge, lors de son interprétation par la machine virtuelle M, le contenu d'une première variable locale au sommet d'une pile d'exécution gérée par la machine virtuelle M (dans cet exemple, cette variable est le paramètre x de la méthode foo).For example, the first code statement that defines the foo method has a hexadecimal value opcode equal to 1C (in this example, this instruction is at the absolute address 0x8000). This opcode is called "sload 0" and loads, when it is interpreted by the virtual machine M, the content of a first local variable at the top of an execution stack managed by the virtual machine M (in this example, this variable is the x parameter of the foo method).

Dans la suite on supposera de manière fictive et par souci de simplicité que la première portion P1 du programme ne contient que les instructions de code de la méthode foo. Les données de droits d'interprétation comprennent donc une adresse de début égale à 0x8000, une adresse de fin égale à 0x800F (adresse de la dernière instruction de code sreturn ayant pour valeur hexadécimale 78).In the following it will be assumed fictitiously and for the sake of simplicity that the first portion P1 of the program contains only the code instructions of the method foo. The interpretation rights data thus comprise a start address equal to 0x8000, an end address equal to 0x800F (address of the last sreturn code instruction having the hexadecimal value 78).

Installation d'un programme cible P destiné à être interprété par une machine virtuelle M dans une mémoire d'un dispositif électroniqueInstallation of a target program P intended to be interpreted by a virtual machine M in a memory of an electronic device

Le dispositif 1 reçoit, via son interface de communication 10, le programme cible P destiné à être installé. Le programme cible P est par exemple téléchargé depuis un serveur d'applications par le dispositif tiers et transféré au dispositif électronique 1 via cette interface de communication 10.The device 1 receives, via its communication interface 10, the target program P intended to be installed. The target program P is for example downloaded from an application server by the third party device and transferred to the electronic device 1 via this communication interface 10.

Le programme cible P est mémorisé de façon temporaire dans la mémoire volatile 6 du dispositif électronique 1.The target program P is stored temporarily in the volatile memory 6 of the electronic device 1.

Le programme est ensuite mémorisé dans la mémoire non volatile 8 du dispositif électronique 1 de manière conventionnelle.The program is then stored in the non-volatile memory 8 of the electronic device 1 in a conventional manner.

Le programme cible P est alors prêt à être exécuté dans le dispositif électronique 1.The target program P is then ready to be executed in the electronic device 1.

Les données de droits d'interprétation peuvent être générées par l'installeur IN et non le compilateur ou le convertisseur. Pour cela, l'installeur IN utilise sa connaissance du format .cap pour détecter au sein du programme reçu via l'interface de communication la première portion P1 de programme (le composant method_component). L'installeur IN détermine l'adresse de début et l'adresse de fin de cette première portion P1 et calcule le cas échéant la donnée d'intégrité relative à ces adresses.The interpretation rights data can be generated by the IN installer and not the compiler or the converter. For this, the IN installer uses its knowledge of the .cap format to detect within the program received via the communication interface the first program portion P1 (the component method_component). The installer IN determines the start address and the end address of this first portion P1 and calculates, if necessary, the integrity data relating to these addresses.

Exécution de programme cible au moyen de la machine virtuelleTarget program execution using the virtual machine

Le processeur 2 démarre l'exécution de la machine virtuelle M, par exemple lors d'une mise sous tension du dispositif électronique 1.The processor 2 starts the execution of the virtual machine M, for example when the electronic device 1 is powered up.

Ultérieurement, la machine virtuelle M reçoit un ordre de lancement du programme cible P (étape 100). Dans le présent texte, on considère que l'exécution du programme cible P débute lorsqu'un ordre d'exécution de ce programme est reçu au sein du dispositif électronique 1.Subsequently, the virtual machine M receives an order to launch the target program P (step 100). In the present text, it is considered that the execution of the target program P begins when an execution order of this program is received within the electronic device 1.

La machine virtuelle M ouvre un fichier d'applet du programme cible P et y localiser la première portion P1 de programme contenant les instructions de code du programme à interpréter.The virtual machine M opens an applet file of the target program P and locate there the first portion P1 program containing the code instructions of the program to interpret.

La machine virtuelle M dispose d'un pointeur de code (« Program Counter » en anglais, ou PC) qui va indexer le bytecode et d'une pile (« stack » en anglais). Cette pile est adressée au travers d'un pointeur de pile (« Stack Pointer » en anglais ou SP).The virtual machine M has a code pointer ("Program Counter" in English, or PC) that will index the bytecode and a stack ("stack" in English). This stack is addressed through a stack pointer ("Stack Pointer" in English or SP).

Pour exécuter une méthode, la machine virtuelle M alloue une zone de la mémoire volatile 6 réservée à la méthode, cette zone étant appelée trame (« frame » en anglais). La trame à une taille correspondant au nombre de mots utiles au stockage d'informations de contexte, des arguments de la méthode et ainsi que le nombre d'emplacement de la pile nécessaire à l'exécution de toutes les instructions de code (opcodes) faisant partie de la méthode.To execute a method, the virtual machine M allocates an area of the volatile memory 6 reserved for the method, this area being called a frame. The frame has a size corresponding to the number of words useful for storing context information, method arguments and the number of stack locations needed to execute all code instructions (opcodes) making part of the method.

Ensuite, pour chaque opcode de la méthode, la machine virtuelle M dépile les éléments nécessaires à l'exécution de cet opcode en s'appuyant sur ses arguments et empiler le résultat correspondant dans la pile. La machine virtuelle M met ensuite à jour le PC, avant de passer à l'interprétation de l'instruction suivante.Then, for each opcode of the method, the virtual machine M depiles the elements necessary for the execution of this opcode by relying on its arguments and stack the corresponding result in the stack. The virtual machine M then updates the PC, before moving on to the interpretation of the next instruction.

Au cours de l'exécution du programme cible P, la machine virtuelle M détermine une instruction de code de référence à interpréter à l'aide de code machine (étape 102).During execution of the target program P, the virtual machine M determines a reference code instruction to be interpreted using machine code (step 102).

Cette détermination 102 comprend une lecture d'une adresse dans le pointeur de code PC : à cette adresse se trouve l'instruction de code de référence à interpréter.This determination 102 comprises a reading of an address in the PC code pointer: at this address is the reference code instruction to be interpreted.

La machine virtuelle M localise par ailleurs les données de droits d'interprétation DR du programme cible P et lit leur contenu (étape 106). La machine virtuelle M lit en particulier les données de localisation.The virtual machine M also locates the DR interpretation rights data of the target program P and reads their content (step 106). The virtual machine M reads in particular the location data.

Sur la base des données de droits d'interprétation DR lues, la machine virtuelle M contrôle la présence ou non de l'instruction de code de référence dans la première portion P1 du programme cible P (étape 110).On the basis of the DR interpretation rights data read, the virtual machine M checks whether or not the reference code instruction is present in the first portion P1 of the target program P (step 110).

Le contrôle de présence comprend d'une part une comparaison entre le pointeur de code (c'est-à-dire l'adresse de l'instruction de code de référence se trouvant dans le pointeur de code) et l'adresse de début lue dans les données de localisation. Le contrôle de présence comprend d'autre part une comparaison entre le pointeur de code et l'adresse de fin lue dans les données de localisation.The presence check comprises on the one hand a comparison between the code pointer (i.e. the address of the reference code instruction in the code pointer) and the start address read. in the location data. The presence check also comprises a comparison between the code pointer and the end address read in the location data.

L'instruction de code est présente dans la première portion P1 du programme cible P lorsque :

  • l'adresse de l'instruction de code de référence est supérieure ou égale à l'adresse de début, et
  • l'adresse de l'instruction de code de référence est inférieure ou égale à l'adresse de fin (ou strictement inférieure à l'adresse de fin dans le cas où l'adresse de fin est l'adresse qui suit immédiatement l'adresse de la dernière instruction de code de la première portion P1).
The code instruction is present in the first portion P1 of the target program P when:
  • the address of the reference code instruction is greater than or equal to the start address, and
  • the address of the reference code instruction is less than or equal to the end address (or strictly less than the end address in the case where the end address is the address that immediately follows the address of the last code instruction of the first portion P1).

Dans un premier cas, il est déterminé au cours du contrôle de présence que l'instruction de code de référence n'est pas présente dans la première portion P1 du programme. Dans ce premier cas, l'instruction de code de référence n'est pas interprétée par la machine virtuelle M à l'aide de code machine ; la machine virtuelle M signale plutôt une erreur (étape 114). Ce signalement comprend typiquement la levée d'une exception de sécurité par la machine virtuelle M.In a first case, it is determined during the presence check that the reference code instruction is not present in the first portion P1 of the program. In this first case, the reference code instruction is not interpreted by the virtual machine M using machine code; the virtual machine M rather signals an error (step 114). This signaling typically includes the lifting of a security exception by the virtual machine M.

Par ailleurs, dans ce premier cas, la machine virtuelle M stoppe préférentiellement l'exécution du programme.Moreover, in this first case, the virtual machine M preferentially stops the execution of the program.

Dans un deuxième cas, il est déterminé au cours du contrôle de présence 110 que l'instruction de code est bien présente dans la première portion P1 du programme. Dans ce deuxième cas, l'instruction de code de référence est interprétée par la machine virtuelle M à l'aide de code machine (étape 112). Cette étape 112 d'interprétation est connue de l'homme du métier. Pour une instruction de code lue dans un fichier d'applet, une ou plusieurs instructions de code machine correspondantes sont exécutées par le processeur 2.In a second case, it is determined during the presence check 110 that the code instruction is present in the first portion P1 of the program. In this second case, the reference code instruction is interpreted by the virtual machine M using machine code (step 112). This interpretation step 112 is known to those skilled in the art. For a code instruction read from an applet file, one or more corresponding machine code instructions are executed by the processor 2.

Toujours dans le deuxième cas, la machine virtuelle M met ensuite à jour le pointeur de code PC et détermine une instruction de code suivante à exécuter, en répétant l'étape 102.Still in the second case, the virtual machine M then updates the PC code pointer and determines a next code instruction to be executed, repeating step 102.

L'étape de contrôle de présence 110 peut être pour plusieurs instructions de code déterminées comme étant à interpréter au cours de l'exécution du programme par la machine virtuelle M. La manière dont cette étape de contrôle de présence 110 est répétée peut faire l'objet de plusieurs variantes.The presence control step 110 may be for several code instructions determined to be to be interpreted during the execution of the program by the virtual machine M. The manner in which this presence control step 110 is repeated can make the object of several variants.

Dans une première variante, l'étape 110 de contrôle de présence est répétée pour chaque instruction de code déterminée comme étant à interpréter au cours d'une mise en oeuvre de l'étape 102, c'est-à-dire sur la base de chaque nouvelle adresse chargée dans le pointeur de code au cours de cette exécution.In a first variant, the presence control step 110 is repeated for each code instruction determined to be to be interpreted during an implementation of step 102, that is to say on the basis of each new address loaded in the code pointer during this execution.

La méthode foo détaillée dans le tableau 1 est interprétée de la manière suivante par la machine virtuelle M dans cette première variante (les lignes en gras sont les traitements non conventionnels mis en oeuvre par la machine virtuelle M, tandis que les autres lignes sont des traitements classiques) :

  1. 1. La machine virtuelle M crée une trame pour la méthode foo.
  2. 2. La machine virtuelle M charge l'adresse 0x8000 dans le pc.
  3. 3. La machine virtuelle M vérifie que le PC est compris entre 0x8000 et 0x800F ; si oui, elle poursuit l'interprétation ; sinon, la machine virtuelle M lève une exception de sécurité
  4. 4. La machine virtuelle M exécute l'opcode sload_0 qui charge le contenu de la première variable locale au sommet de la pile, ici il s'agit du paramètre X de la méthode foo.
  5. 5. La machine virtuelle M incrémente le PC de 1, lequel prend alors la valeur 0x8001.
  6. 6. La machine virtuelle M vérifie que le PC est compris entre 0x8000 et 0x800F ; si oui, elle poursuit l'interprétation ; sinon, la machine virtuelle M lève une exception de sécurité
  7. 7. La machine virtuelle M exécute l'opcode ifne qui teste si la valeur se trouvant au sommet de la pile est égale à 0
  8. 8. Si oui, la machine virtuelle M incrémente le PC de 2 et
  9. 9. Si non, la machine virtuelle M ajoute au PC la valeur de l'argument de l'opcode ifne, ici 0x05, pour passer à 0x8006.
  10. 10. La machine virtuelle M vérifie que le PC est compris entre 0x8000 et 0x800F ; si oui, elle poursuit l'interprétation ; sinon, la machine virtuelle M lève une exception de sécurité
  11. 11. Cette opération se répète jusqu'à rencontrer un des opcode sreturn de la méthode.
  12. 12. La machine virtuelle M retourne ensuite à la méthode qui a appelé foo.
  13. 13. Etc.
The method foo detailed in Table 1 is interpreted as follows by the virtual machine M in this first variant (the bold lines are the treatments unconventional implemented by the virtual machine M, while the other lines are conventional treatments):
  1. 1. The virtual machine M creates a frame for the foo method.
  2. 2. The virtual machine M loads the address 0x8000 in the pc.
  3. 3. The virtual machine M checks that the PC is between 0x8000 and 0x800F; if so, she continues the interpretation; otherwise, the virtual machine M throws a security exception
  4. 4. The virtual machine M executes the sload_0 opcode which loads the content of the first local variable at the top of the stack, here it is the X parameter of the foo method.
  5. 5. The virtual machine M increments the PC by 1, which then takes the value 0x8001.
  6. 6. The virtual machine M checks that the PC is between 0x8000 and 0x800F; if so, she continues the interpretation; otherwise, the virtual machine M throws a security exception
  7. 7. The virtual machine M executes the ifne opcode which tests whether the value at the top of the stack equals 0
  8. 8. If yes, the virtual machine M increments the PC by 2 and
  9. 9. If no, virtual machine M adds to the PC the value of the ifne opcode argument, here 0x05, to pass to 0x8006.
  10. 10. The virtual machine M verifies that the PC is between 0x8000 and 0x800F; if so, she continues the interpretation; otherwise, the virtual machine M throws a security exception
  11. 11. This operation is repeated until you encounter one of the method sreturn opcode.
  12. 12. The virtual machine M then returns to the method that called foo.
  13. 13. Etc.

Dans une deuxième variante, l'étape 110 de contrôle de présence n'est mise en oeuvre pour une instruction de référence que si cette instruction de référence remplit au moins une condition prédéterminée (cette condition étant vérifiée au cours d'une étape 104). Ceci permet de réduire la charge de calcul additionnelle consommée par l'étape de contrôle de présence.In a second variant, the presence control step 110 is implemented for a reference instruction only if this reference instruction fulfills at least one predetermined condition (this condition being verified during a step 104). This makes it possible to reduce the additional computation load consumed by the presence control step.

Cette condition peut être le résultat d'un tirage aléatoire mis en oeuvre pour l'instruction de code de référence. Autrement dit, l'étape de contrôle de présence est mise en oeuvre ou non, de manière aléatoire.This condition may be the result of a random draw implemented for the reference code instruction. In other words, the presence control step is implemented or not, randomly.

Alternativement, ou à titre complémentaire, le contrôle de présence peut être mise en oeuvre lorsqu'au moins une des conditions suivantes est remplie :

  • l'instruction de code de référence est une instruction de saut depuis un premier bloc de base de programme vers un autre bloc de base de programme, telle qu'une instruction de branchement, une instruction d'invocation de méthode, ou une instruction de retour de méthode, ou
  • l'instruction de code de référence est une instruction d'écriture dans une mémoire non volatile 8, ou
  • le programme étant exécuté dans un dispositif électronique, l'instruction de code de référence participe à une communication de données avec un dispositif différent du dispositif électronique.
Alternatively, or in addition, the presence check can be implemented when at least one of the following conditions is fulfilled:
  • the reference code instruction is a jump instruction from a first program base block to another program base block, such as a branch instruction, a method invocation instruction, or a return instruction method, or
  • the reference code instruction is a write instruction in a non-volatile memory 8, or
  • the program being executed in an electronic device, the reference code instruction participates in a data communication with a device different from the electronic device.

Ces types d'instruction de code sont particulièrement critiques en termes de sécurité. Il est donc particulièrement avantageux de limiter l'étape de contrôle à ces types d'instruction de code.These types of code instructions are particularly critical in terms of security. It is therefore particularly advantageous to limit the control step to these types of code instructions.

L'étape de contrôle de présence 110 peut être mise en oeuvre par la machine virtuelle M. Toutefois, une telle étape de contrôle de présence consomme des ressources processeur 2, et ce de façon particulièrement importante lorsque le contrôle de présence 110 est mis en oeuvre pour chaque instruction de code de référence déterminée comme étant à interpréter par la machine virtuelle M, conformément à la première variante proposée ci-dessus. Pour décharger le processeur 2, l'étape de contrôle de présence 110 est avantageusement déléguée au circuit de contrôle 12. Par exemple, la machine virtuelle M lit une seule fois les données de localisation de la première portion P1 depuis la mémoire non volatile 8 et transmet les adresses de début et de fin au circuit de contrôle 12 au lancement du programme cible P, avant la mise en oeuvre de l'étape de contrôle de présence 17. Plus tard, le circuit de contrôle 12 met en oeuvre le contrôle de présence 110 en compare le pointeur de code avec les adresses que la machine virtuelle M lui a fournies au lancement du programme cible P.The presence control step 110 can be implemented by the virtual machine M. However, such a presence control step consumes processor resources 2, and this is particularly important when the presence control 110 is implemented. for each reference code instruction determined to be to be interpreted by the virtual machine M, according to the first variant proposed above. To unload the processor 2, the presence control step 110 is advantageously delegated to the control circuit 12. For example, the virtual machine M reads once the location data of the first portion P1 from the non-volatile memory 8 and transmits the start and end addresses to the control circuit 12 at the start of the target program P, before the implementation of the presence check step 17. Later, the control circuit 12 implements the presence check 110 compares the code pointer with the addresses that the virtual machine M provided to him at the launch of the target program P.

Par ailleurs, si les données de droits d'interprétation DR comprennent une donnée d'intégrité relative à ces données de localisation, cette donnée d'intégrité est également lue par la machine virtuelle M au cours de l'étape 106. La machine virtuelle M contrôle alors l'intégrité des données de localisation à l'aide de la donnée d'intégrité (étape 108).Moreover, if the DR interpretation rights data comprise an integrity datum relating to these location data, this integrity datum is also read by the virtual machine M in step 106. The virtual machine M then controls the integrity of the location data using the integrity data (step 108).

Le contrôle d'intégrité 108 comprend l'application de la fonction F prédéterminée aux données de localisation lues, de sorte à générer une deuxième donnée d'intégrité, puis une comparaison entre la donnée d'intégrité lue et la deuxième donnée d'intégrité générée. Si les deux données d'intégrité comparées sont différentes, alors les données de localisation sont considérées non intègres. Il est possible en particulier que le dispositif électronique 1 ait subi une attaque ayant eu pour effet de corrompre les données de localisation mémorisées dans le dispositif électronique. Dans ce cas l'étape 110 est mise en oeuvre. Si les deux données d'intégrité comparées sont égales, alors les données de localisation sont intègres. Le procédé passe alors à l'étape 110.The integrity check 108 comprises the application of the predetermined function F to the read location data, so as to generate a second integrity datum, then a comparison between the integrity data read and the second integrity data generated. . If the two integrity data compared are different, then the location data is considered unhealthy. It is possible in particular that the electronic device 1 has undergone an attack having had the effect of corrupting the location data stored in the electronic device. In this case step 110 is implemented. If the two integrity data compared are equal, then the location data is intact. The process then proceeds to step 110.

L'étape 108 de contrôle d'intégrité peut être mis en oeuvre avant l'interprétation 112 de chaque instruction de code de référence déterminée comme étant à interpréter au cours de l'étape 102. En variante, l'étape de contrôle d'intégrité108 est mise en oeuvre seulement lorsque l'étape de contrôle de présence 110 est mise en oeuvre pour une instruction de code de référence.The integrity check step 108 may be implemented before the interpretation 112 of each reference code instruction determined to be to be interpreted in the step 102. Alternatively, the integrity check step 108 is implemented only when the presence check step 110 is performed for a reference code instruction.

Autres modes de réalisationOther embodiments

Dans le mode de réalisation décrit précédemment, le programme cible P installé dans le dispositif électronique dispose de données de droits d'interprétation DR qui lui sont propres, et pouvant même en faire partie intégrante. Si plusieurs programmes cibles sont installés dans le dispositif 1, chaque programme cible installé dispose de ses propres données DR.In the embodiment described above, the target program P installed in the electronic device has DR interpretation rights data of its own, and may even be an integral part. If several target programs are installed in the device 1, each installed target program has its own data DR.

Dans un deuxième mode de réalisation, qui va être à présent décrit, les données de droits d'interprétation DR ne font pas partie intégrante d'un programme cible P mais sont plutôt partagées entre plusieurs programmes cibles installés dans le dispositif électronique 1. Ceci permet de limiter la mémoire additionnelle consommée par les données de droit d'interprétation DR.In a second embodiment, which will now be described, the DR interpretation rights data are not part of a target program P but rather are shared between several target programs installed in the electronic device 1. This allows to limit the additional memory consumed by the DR interpretation right data.

En référence à la figure 4 relative à ce deuxième mode de réalisation, les données de droits d'interprétation DR indiquent à la machine virtuelle M que seules des instructions de code contenues dans une zone prédéterminée Z de la mémoire non volatile 8 sont autorisées à être interprétées à l'aide de code machine par la machine virtuelle M.With reference to the figure 4 relative to this second embodiment, the DR interpretation rights data indicate to the virtual machine M that only code instructions contained in a predetermined zone Z of the non-volatile memory 8 are allowed to be interpreted with the aid of machine code by the virtual machine M.

Les données de droits d'interprétation comprennent des données de localisation adaptées pour localiser la zone prédéterminée Z dans la mémoire non volatile 8.The interpretation rights data comprise location data adapted to locate the predetermined zone Z in the non-volatile memory 8.

Ces données de localisation comprennent par exemple une adresse de début A de la zone prédéterminée Z dans la mémoire non volatile 8, ainsi qu'une adresse de fin B de cette zone prédéterminée Z (cette adresse de fin pouvant être remplacée par une taille de la zone prédéterminée).These location data comprise, for example, a start address A of the predetermined zone Z in the non-volatile memory 8, as well as an end address B of this predetermined zone Z (this end address can be replaced by a size of the predetermined area).

Les données de droits d'interprétation DR peuvent également comprendre une donnée d'intégrité relative aux à la zone prédéterminée de la mémoire non volatile 8, calculée d'une manière similaire au premier mode de réalisation.The DR interpretation rights data may also include an integrity datum relative to the predetermined area of the nonvolatile memory 8, calculated in a manner similar to the first embodiment.

Les données de droits d'interprétation DR sont mémorisées dans la mémoire non volatile 8 avant l'installation d'un quelconque programme cible P.The interpretation rights data DR are stored in the non-volatile memory 8 before the installation of any target program P.

On suppose dans un premier temps que la zone prédéterminée de la mémoire non volatile 8 est vide, comme cela est représenté sur la figure 4, et qu'aucun programme cible P n'a encore été installé dans le dispositif électronique.It is assumed in a first step that the predetermined zone of the nonvolatile memory 8 is empty, as shown in FIG. figure 4 , and no target program P has yet been installed in the electronic device.

L'installeur IN décompose le programme cible P en sa première portion P1 et la portion restante P2.The installer IN breaks down the target program P in its first portion P1 and the remaining portion P2.

L'installeur IN lit les données de droits d'interprétation depuis la mémoire volatile 6 pour déterminer où se trouve dans la zone prédéterminée Z.The installer IN reads the interpretation rights data from the volatile memory 6 to determine where is in the predetermined zone Z.

En référence à la figure 5 , l'installeur IN commande la mémorisation de la première portion P1 de programme dans la zone prédéterminée Z de la mémoire non volatile 8.With reference to the figure 5 , the installer IN controls the storage of the first portion P1 program in the predetermined zone Z of the non-volatile memory 8.

L'installeur IN commande par ailleurs la mémorisation de la portion restante du programme dans une zone de la mémoire non-volatile différente de la zone prédéterminée.The installer IN also controls the storage of the remaining portion of the program in an area of the non-volatile memory different from the predetermined area.

Ensuite, l'installeur IN met à jour les données de droits d'interprétation.Then, the IN installer updates the interpretation rights data.

Cette mise à jour comprend une mise à jour de la valeur d'intégrité relative à la zone.This update includes an update of the health value for the zone.

Si la première portion P1 du programme cible P n'est pas totalement incluse dans la zone prédéterminée (par exemple par ce que sa taille est plus grande que la taille de la zone prédéterminée), la zone indiquée dans les données de localisation est étendue de sorte à couvrir la première portion P1. Cette extension se traduit typiquement par une augmentation de la valeur de l'adresse de fin des données de localisation.If the first portion P1 of the target program P is not totally included in the predetermined zone (for example because its size is larger than the size of the predetermined zone), the zone indicated in the location data is extended by so to cover the first portion P1. This extension typically results in an increase in the value of the end address of the location data.

Ultérieurement, le dispositif électronique reçoit via son interface de communication un deuxième programme cible P à installer, le deuxième programme cible P' étant également destiné à être interprété par la machine virtuelle M.Subsequently, the electronic device receives via its communication interface a second target program P to be installed, the second target program P 'also being intended to be interpreted by the virtual machine M.

Les étapes de décomposition et de mémorisation sont répétées : une première portion P1' contenant des instructions de code du deuxième programme cible P' est mémorisée dans la zone prédéterminée Z, et une portion restante P2 du deuxième programme est mémorisée ailleurs dans la mémoire virtuelle.The decomposition and storage steps are repeated: a first portion P1 'containing code instructions of the second target program P' is stored in the predetermined zone Z, and a remaining portion P2 of the second program is stored elsewhere in the virtual memory.

La première portion P1 de référence est mémorisée de façon adjacente à la première portion P1 du premier programme cible P déjà présente dans la zone prédéterminée de la mémoire non volatile 8. Ceci permet de limiter la fragmentation de la mémoire.The first reference portion P1 is stored adjacent to the first portion P1 of the first target program P already present in the predetermined area of the nonvolatile memory 8. This makes it possible to limit the fragmentation of the memory.

Si la première portion P1 du programme cible P n'est pas totalement incluse dans la zone prédéterminée (parce que la taille cumulée de la première portion P1 du premier programme cible P et de la première portion P1 du deuxième programme cible P est plus grande que la taille de la zone prédéterminée), la zone Z indiquée dans les données de localisation est étendue de sorte à couvrir les deux premières portions P1 et P1'. Cette extension se traduit typiquement par une augmentation de la valeur de l'adresse de fin B des données de localisation.If the first portion P1 of the target program P is not totally included in the predetermined area (because the cumulative size of the first portion P1 of the first target program P and the first portion P1 of the second target program P is greater than the size of the predetermined zone), the zone Z indicated in the location data is extended so as to cover the first two portions P1 and P1 '. This extension typically results in an increase in the value of the end address B of the location data.

Les étapes du procédé d'exécution sont similaires à celles du premier mode de réalisation, à ceci près que les données de droits de localisation ne sont pas lues par la machine virtuelle M depuis un fichier .cap.The steps of the execution method are similar to those of the first embodiment, except that the location rights data are not read by the virtual machine M from a .cap file.

Claims (15)

Procédé d'exécution d'un programme (P) destiné à être interprété par une machine virtuelle (M), le procédé comprenant des étapes de : • détermination (102) d'une instruction de code de référence à interpréter au cours de l'exécution du programme, • interprétation (112), par la machine virtuelle, de l'instruction de code de référence à l'aide de code machine, le procédé étant caractérisé en ce qu'il comprend des étapes de • lecture (106) de données de droits d'interprétation (DR) indiquant une portion du programme (P1) contenant des instructions de code interprétables par la machine virtuelle, • sur la base des données lues, contrôle de présence (110) de l'instruction de code de référence dans la portion (P1) du programme (P), l'interprétation de l'instruction de code de référence étant mise en oeuvre par la machine virtuelle (M) seulement si l'instruction de code de référence est contenue dans la portion (P1) du programme (P). A method of executing a program (P) to be interpreted by a virtual machine (M), the method comprising steps of: Determining (102) a reference code instruction to be interpreted during program execution, • interpretation (112) by the virtual machine of the reference code instruction using machine code, the method being characterized in that it comprises steps of Reading (106) interpretation rights data (DR) indicating a portion of the program (P1) containing code instructions interpretable by the virtual machine, Based on the read data, presence control (110) of the reference code instruction in the portion (P1) of the program (P), the interpretation of the reference code instruction being implemented by the virtual machine (M) only if the reference code instruction is contained in the portion (P1) of the program (P). Procédé selon la revendication 1, dans lequel le contrôle de présence (110) est mis en oeuvre pour chaque instruction de code de référence déterminée (102) comme étant à interpréter au cours de l'exécution du programme.The method of claim 1, wherein the presence check (110) is implemented for each determined reference code instruction (102) as to be interpreted during program execution. Procédé selon la revendication 1, comprenant une vérification (104) d'au moins une condition susceptible d'être remplie ou non par l'instruction de code de référence, dans lequel le contrôle de présence (110) est mis en oeuvre seulement si la condition est remplie.A method according to claim 1, comprising checking (104) at least one condition that may or may not be satisfied by the reference code instruction, wherein the presence check (110) is implemented only if the condition is fulfilled. Procédé selon la revendication 3, dans lequel la condition est remplie lorsque : • l'instruction de code de référence est une instruction de saut depuis un premier bloc de base de programme vers un autre bloc de base de programme, telle qu'une instruction de branchement, une instruction d'invocation de méthode, ou une instruction de retour de méthode, ou • l'instruction de code de référence est une instruction d'écriture dans une mémoire non volatile (8), ou • le programme étant exécuté dans un dispositif électronique (1), l'instruction de code de référence participe à une communication de données entre le dispositif électronique (1) et un autre dispositif. The method of claim 3, wherein the condition is met when: The reference code instruction is a jump instruction from a first program base block to another program base block, such as a branch instruction, a method invocation instruction, or a program instruction instruction. return of method, or The reference code instruction is a write instruction in a non-volatile memory (8), or When the program is executed in an electronic device (1), the reference code instruction participates in a data communication between the electronic device (1) and another device. Procédé selon la revendication 1, dans lequel l'étape de contrôle de présence (110) est mise en oeuvre ou non en fonction d'un résultat d'un tirage aléatoire.The method of claim 1, wherein the presence checking step (110) is performed or not based on a result of a random draw. Procédé selon l'une des revendications précédentes, comprenant des étapes de : • lecture, dans les données de droits d'interprétation (DR), de données de localisation adaptées pour localiser la portion du programme, • lecture, dans les données de droits d'interprétation (DR), d'une donnée d'intégrité relative aux données de localisation, • contrôle d'intégrité (108) des données de localisation sur la base de la donnée d'intégrité, l'instruction de code de référence étant interprétée (112) seulement s'il est déterminé au cours du contrôle d'intégrité que les données de localisation sont intègres. Method according to one of the preceding claims, comprising steps of: • Reading, in the interpretation rights data (DR), suitable location data to locate the portion of the program, Reading, in the interpretation rights data (DR), an integrity datum relating to the location data, Integrity check (108) of the location data based on the integrity data, the reference code instruction being interpreted (112) only if it is determined during the integrity check that the data localization are intact. Procédé selon l'une des revendications 1 à 6, dans lequel la machine virtuelle (M) est exécutée par au moins un processeur (2), et dans lequel l'étape de contrôle de présence (110) est mise en oeuvre par un circuit (12) différent de chaque processeur (2).Method according to one of claims 1 to 6, wherein the virtual machine (M) is executed by at least one processor (2), and wherein the presence control step (110) is implemented by a circuit (12) different from each processor (2). Machine virtuelle (M) comprenant des instructions de code de programme pour l'exécution des étapes du procédé selon l'une des revendications 1 à 7, lorsque ce procédé est exécuté par au moins un processeur (2).Virtual machine (M) comprising program code instructions for executing the steps of the method according to one of claims 1 to 7, when this method is executed by at least one processor (2). Dispositif électronique (1), tel qu'une carte à puce, comprenant : • au moins un processeur (2) configuré pour exécuter une machine virtuelle (M) selon la revendication précédente, • au moins un programme (P) destiné à être interprété par la machine virtuelle (M). An electronic device (1), such as a smart card, comprising: At least one processor (2) configured to execute a virtual machine (M) according to the preceding claim, At least one program (P) intended to be interpreted by the virtual machine (M). Procédé d'installation d'un programme (P) destiné à être interprété par une machine virtuelle (M) dans une mémoire non volatile (8), le procédé comprenant des étapes de : • décomposition du programme (P) en une première portion (P1) comprenant des instructions de code interprétable par la machine virtuelle et une portion restante (P2), • lecture de données de droits d'interprétation (DR) indiquant à la machine virtuelle que seules des instructions de code contenues dans une zone prédéterminée (Z) de la mémoire non volatile (8) sont autorisées à être interprétées à l'aide de code machine par la machine virtuelle (M), • mémorisation de la première portion (P1) de programme dans la zone prédéterminée (Z) de la mémoire non volatile (8), • mémorisation de la portion restante (P2) du programme dans une zone différente de la zone prédéterminée (Z). A method of installing a program (P) to be interpreted by a virtual machine (M) in a non-volatile memory (8), the method comprising steps of: Decomposing the program (P) in a first portion (P1) comprising instructions for code interpretable by the virtual machine and a remaining portion (P2), Reading interpretation rights (DR) data indicating to the virtual machine that only code instructions contained in a predetermined zone (Z) of the nonvolatile memory (8) are allowed to be interpreted using code machine by the virtual machine (M), Storing the first portion (P1) of the program in the predetermined zone (Z) of the non-volatile memory (8), Memorizing the remaining portion (P2) of the program in a zone different from the predetermined zone (Z). Installeur (IN) comprenant des instructions de code de programme pour l'exécution des étapes du procédé selon la revendication 10, lorsque ce procédé est exécuté par au moins un processeur (2).Installer (IN) comprising program code instructions for executing the steps of the method according to claim 10, when this method is executed by at least one processor (2). Procédé de génération d'un programme (P) destiné à être interprété par une machine virtuelle (M), comprenant des étapes de • génération d'une portion (P1) de programme contenant des instructions de code interprétables par la machine virtuelle (M), • génération de données de droits d'interprétation configurées pour indiquer à la machine virtuelle (M) que seules les instructions de code contenues dans la portion (P1) de programme sont autorisées à être interprétées par la machine virtuelle à l'aide de code machine pour exécuter le programme (P). A method of generating a program (P) for interpretation by a virtual machine (M), comprising steps of Generating a portion (P1) of program containing code instructions interpretable by the virtual machine (M), Generating interpretation rights data configured to indicate to the virtual machine (M) that only the code instructions contained in the program portion (P1) are allowed to be interpreted by the virtual machine using machine code to execute the program (P). Produit programme d'ordinateur (P) destiné à être interprété par une machine virtuelle (M), comprenant : • une portion (P1) de programme contenant des instructions de code interprétables par la machine virtuelle (M), • des données de droits d'interprétation (DR) configurées pour indiquer à la machine virtuelle (M) que seules les instructions de code contenues dans la portion (P1) du programme sont autorisées à être interprétées par la machine virtuelle (M) à l'aide de code machine pour exécuter le programme (P). Computer program product (P) intended to be interpreted by a virtual machine (M), comprising: A portion (P1) of program containing code instructions interpretable by the virtual machine (M), • interpretation rights data (DR) configured to indicate to the virtual machine (M) that only the code instructions contained in the portion (P1) of the program are allowed to be interpreted by the virtual machine (M) to the machine code help to execute the program (P). Produit programme d'ordinateur (P) selon la revendication 13, dans lequel les données de droits d'interprétation (DR) comprennent : • des données de localisation adaptées pour localiser la portion du programme au sein du programme, et • une donnée d'intégrité relative aux données de localisation de la portion de programme. The computer program product (P) of claim 13, wherein the interpretation rights (DR) data comprises: • appropriate location data to locate the portion of the program within the program, and An integrity datum relating to the location data of the program portion. Produit programme d'ordinateur (P) selon l'une des revendications 13 à 14, de type applet Java Card, dans lequel la portion du programme est un composant de l'applet qui est de type « method_component ».Computer program product (P) according to one of Claims 13 to 14, of the Java Card applet type, in which the portion of the program is a component of the applet which is of type "method_component".
EP18167875.6A 2017-04-20 2018-04-18 Method for executing a program intended for being interpreted by a virtual machine protected against fault-injection attacks Active EP3392791B1 (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
FR1753434A FR3065553B1 (en) 2017-04-20 2017-04-20 METHOD OF EXECUTING A PROGRAM TO BE INTERPRETED BY A VIRTUAL MACHINE PROTECTED AGAINST FAULT INJECTION ATTACKS

Publications (2)

Publication Number Publication Date
EP3392791A1 true EP3392791A1 (en) 2018-10-24
EP3392791B1 EP3392791B1 (en) 2019-10-23

Family

ID=59746003

Family Applications (1)

Application Number Title Priority Date Filing Date
EP18167875.6A Active EP3392791B1 (en) 2017-04-20 2018-04-18 Method for executing a program intended for being interpreted by a virtual machine protected against fault-injection attacks

Country Status (3)

Country Link
US (1) US11030306B2 (en)
EP (1) EP3392791B1 (en)
FR (1) FR3065553B1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR3095054A1 (en) * 2019-04-11 2020-10-16 Idemia Identity & Security France Managing a memory in an electronic device
CN112765008A (en) * 2019-11-01 2021-05-07 腾讯科技(深圳)有限公司 Functional application testing method, device, equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060112241A1 (en) * 2004-11-24 2006-05-25 Yoav Weiss System, method and apparatus of securing an operating system
US20110202739A1 (en) * 2010-02-16 2011-08-18 Arm Limited Restricting memory areas for an instruction read in dependence upon a hardware mode and a security flag

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6922782B1 (en) * 2000-06-15 2005-07-26 International Business Machines Corporation Apparatus and method for ensuring data integrity of unauthenticated code
JP4889638B2 (en) * 2005-07-14 2012-03-07 パナソニック株式会社 Verification method, verification program, recording medium, information processing apparatus, integrated circuit
EP2202664A1 (en) * 2008-12-23 2010-06-30 Gemalto SA Method of protection of data during the execution of a software code in an electronic device
EP2354993A1 (en) * 2009-12-30 2011-08-10 Gemalto SA JCVM bytecode execution protection against fault attacks
US8966623B2 (en) * 2010-03-08 2015-02-24 Vmware, Inc. Managing execution of a running-page in a virtual machine
FR2967275B1 (en) * 2010-11-10 2012-12-28 Oberthur Technologies METHOD, COMPUTER PROGRAM AND DEVICE FOR SECURING INTERMEDIATE PROGRAMMING CODE FOR ITS EXECUTION BY A VIRTUAL MACHINE
US8595510B2 (en) * 2011-06-22 2013-11-26 Media Patents, S.L. Methods, apparatus and systems to improve security in computer systems
US20140053272A1 (en) * 2012-08-20 2014-02-20 Sandor Lukacs Multilevel Introspection of Nested Virtual Machines
CN103345602B (en) * 2013-06-14 2015-08-19 腾讯科技(深圳)有限公司 A kind of client-side code integrality detection, device and system
US10198572B2 (en) * 2013-09-17 2019-02-05 Microsoft Technology Licensing, Llc Virtual machine manager facilitated selective code integrity enforcement
US9436495B2 (en) * 2015-01-23 2016-09-06 Red Hat Israel, Ltd. Protection against interrupts in virtual machine functions
US10127064B2 (en) * 2015-02-24 2018-11-13 Red Hat Israel, Ltd. Read-only VM function chaining for secure hypervisor access

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060112241A1 (en) * 2004-11-24 2006-05-25 Yoav Weiss System, method and apparatus of securing an operating system
US20110202739A1 (en) * 2010-02-16 2011-08-18 Arm Limited Restricting memory areas for an instruction read in dependence upon a hardware mode and a security flag

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR3095054A1 (en) * 2019-04-11 2020-10-16 Idemia Identity & Security France Managing a memory in an electronic device
CN112765008A (en) * 2019-11-01 2021-05-07 腾讯科技(深圳)有限公司 Functional application testing method, device, equipment and storage medium

Also Published As

Publication number Publication date
US20180307830A1 (en) 2018-10-25
FR3065553B1 (en) 2019-04-26
FR3065553A1 (en) 2018-10-26
EP3392791B1 (en) 2019-10-23
US11030306B2 (en) 2021-06-08

Similar Documents

Publication Publication Date Title
US9432400B2 (en) Method and system for protecting against unknown malicious activities by detecting a heap spray attack on an electronic device
EP1702268B1 (en) Method for controlling program execution integrity by verifying execution trace prints
JP6746156B2 (en) Software repackaging prevention method and apparatus
US20120198554A1 (en) Obfuscated Malware Detection
EP3392791B1 (en) Method for executing a program intended for being interpreted by a virtual machine protected against fault-injection attacks
CN109255235B (en) Mobile application third-party library isolation method based on user state sandbox
EP2453356B1 (en) Method, computer program and device for securing byte code to be run by a virtual machine
CN109933986B (en) Malicious code detection method and device
EP3382588B1 (en) Method for protecting an electronic device against fault-injection attacks during the execution of a program
EP3470999B1 (en) Securing conditional branching instructions in a computer program written in intermediate code
KR101052735B1 (en) Method for detecting presence of memory operation and device using same
EP2860660A1 (en) System and method for securely loading data in a cache memory associated with a secure processor
EP3422232B1 (en) Method for protecting an electronic device running a program against fault-injection attacks
FR3068152B1 (en) METHOD FOR PROTECTING AN ELECTRONIC DEVICE EXECUTING A PROGRAM AGAINST FAULT INJECTION ATTACKS
FR2910658A1 (en) Electronic system e.g. subscriber identification module card, for portable mobile phone, has physical address allocating module for allocating addresses in memory by variant according to behavioral factors of system
KR102226218B1 (en) Apparatus and method for extracting feature information to identify an application created by cross-platform development framework
EP4307143A1 (en) Method and circuit for verifying the integrity of software
EP4123492A1 (en) Sharing of a function of an application defined in object oriented language
FR3074317B1 (en) METHOD FOR ACCESSING A FLASH TYPE NON-VOLATILE MEMORY ZONE OF A SECURE ELEMENT, SUCH AS A CHIP CARD
EP3203405B1 (en) Method for executing instructions of object-oriented applications by an interpreter
FR3059119A1 (en) METHOD FOR PROTECTING AN ELECTRONIC DEVICE EXECUTING A PROGRAM AGAINST FAULT INJECTION AND TYPE CONFUSION ATTACKS.
CN116414483A (en) Interface calling method, device, computer equipment and storage medium
FR3095054A1 (en) Managing a memory in an electronic device
FR2994755A1 (en) Computer program installation method for computing device of e.g. smart card, involves modifying file by replacement of first representation element by second representation element representing operations, and storing modified file
CN117034278A (en) Vulnerability detection method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PUAI Public reference made under article 153(3) epc to a published international application that has entered the european phase

Free format text: ORIGINAL CODE: 0009012

STAA Information on the status of an ep patent application or granted ep patent

Free format text: STATUS: THE APPLICATION HAS BEEN PUBLISHED

AK Designated contracting states

Kind code of ref document: A1

Designated state(s): AL AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HR HU IE IS IT LI LT LU LV MC MK MT NL NO PL PT RO RS SE SI SK SM TR

AX Request for extension of the european patent

Extension state: BA ME

RAP1 Party data changed (applicant data changed or rights of an application transferred)

Owner name: IDEMIA IDENTITY & SECURITY FRANCE

STAA Information on the status of an ep patent application or granted ep patent

Free format text: STATUS: REQUEST FOR EXAMINATION WAS MADE

17P Request for examination filed

Effective date: 20190322

RBV Designated contracting states (corrected)

Designated state(s): AL AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HR HU IE IS IT LI LT LU LV MC MK MT NL NO PL PT RO RS SE SI SK SM TR

GRAP Despatch of communication of intention to grant a patent

Free format text: ORIGINAL CODE: EPIDOSNIGR1

STAA Information on the status of an ep patent application or granted ep patent

Free format text: STATUS: GRANT OF PATENT IS INTENDED

RIC1 Information provided on ipc code assigned before grant

Ipc: G06F 21/52 20130101AFI20190617BHEP

Ipc: G06F 21/56 20130101ALI20190617BHEP

Ipc: G06F 12/14 20060101ALI20190617BHEP

Ipc: G06F 16/23 20190101ALI20190617BHEP

Ipc: G06F 9/30 20180101ALI20190617BHEP

Ipc: G06F 21/53 20130101ALI20190617BHEP

Ipc: G06F 9/455 20180101ALI20190617BHEP

Ipc: G06F 8/61 20180101ALI20190617BHEP

INTG Intention to grant announced

Effective date: 20190704

GRAS Grant fee paid

Free format text: ORIGINAL CODE: EPIDOSNIGR3

GRAA (expected) grant

Free format text: ORIGINAL CODE: 0009210

STAA Information on the status of an ep patent application or granted ep patent

Free format text: STATUS: THE PATENT HAS BEEN GRANTED

AK Designated contracting states

Kind code of ref document: B1

Designated state(s): AL AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HR HU IE IS IT LI LT LU LV MC MK MT NL NO PL PT RO RS SE SI SK SM TR

REG Reference to a national code

Ref country code: GB

Ref legal event code: FG4D

Free format text: NOT ENGLISH

REG Reference to a national code

Ref country code: CH

Ref legal event code: EP

REG Reference to a national code

Ref country code: IE

Ref legal event code: FG4D

Free format text: LANGUAGE OF EP DOCUMENT: FRENCH

REG Reference to a national code

Ref country code: DE

Ref legal event code: R096

Ref document number: 602018000951

Country of ref document: DE

REG Reference to a national code

Ref country code: AT

Ref legal event code: REF

Ref document number: 1194491

Country of ref document: AT

Kind code of ref document: T

Effective date: 20191115

REG Reference to a national code

Ref country code: NL

Ref legal event code: MP

Effective date: 20191023

REG Reference to a national code

Ref country code: LT

Ref legal event code: MG4D

PG25 Lapsed in a contracting state [announced via postgrant information from national office to epo]

Ref country code: LT

Free format text: LAPSE BECAUSE OF FAILURE TO SUBMIT A TRANSLATION OF THE DESCRIPTION OR TO PAY THE FEE WITHIN THE PRESCRIBED TIME-LIMIT

Effective date: 20191023

Ref country code: NL

Free format text: LAPSE BECAUSE OF FAILURE TO SUBMIT A TRANSLATION OF THE DESCRIPTION OR TO PAY THE FEE WITHIN THE PRESCRIBED TIME-LIMIT

Effective date: 20191023

Ref country code: GR

Free format text: LAPSE BECAUSE OF FAILURE TO SUBMIT A TRANSLATION OF THE DESCRIPTION OR TO PAY THE FEE WITHIN THE PRESCRIBED TIME-LIMIT

Effective date: 20200124

Ref country code: PL

Free format text: LAPSE BECAUSE OF FAILURE TO SUBMIT A TRANSLATION OF THE DESCRIPTION OR TO PAY THE FEE WITHIN THE PRESCRIBED TIME-LIMIT

Effective date: 20191023

Ref country code: NO

Free format text: LAPSE BECAUSE OF FAILURE TO SUBMIT A TRANSLATION OF THE DESCRIPTION OR TO PAY THE FEE WITHIN THE PRESCRIBED TIME-LIMIT

Effective date: 20200123

Ref country code: FI

Free format text: LAPSE BECAUSE OF FAILURE TO SUBMIT A TRANSLATION OF THE DESCRIPTION OR TO PAY THE FEE WITHIN THE PRESCRIBED TIME-LIMIT

Effective date: 20191023

Ref country code: BG

Free format text: LAPSE BECAUSE OF FAILURE TO SUBMIT A TRANSLATION OF THE DESCRIPTION OR TO PAY THE FEE WITHIN THE PRESCRIBED TIME-LIMIT

Effective date: 20200123

Ref country code: LV

Free format text: LAPSE BECAUSE OF FAILURE TO SUBMIT A TRANSLATION OF THE DESCRIPTION OR TO PAY THE FEE WITHIN THE PRESCRIBED TIME-LIMIT

Effective date: 20191023

Ref country code: SE

Free format text: LAPSE BECAUSE OF FAILURE TO SUBMIT A TRANSLATION OF THE DESCRIPTION OR TO PAY THE FEE WITHIN THE PRESCRIBED TIME-LIMIT

Effective date: 20191023

Ref country code: PT

Free format text: LAPSE BECAUSE OF FAILURE TO SUBMIT A TRANSLATION OF THE DESCRIPTION OR TO PAY THE FEE WITHIN THE PRESCRIBED TIME-LIMIT

Effective date: 20200224

PG25 Lapsed in a contracting state [announced via postgrant information from national office to epo]

Ref country code: HR

Free format text: LAPSE BECAUSE OF FAILURE TO SUBMIT A TRANSLATION OF THE DESCRIPTION OR TO PAY THE FEE WITHIN THE PRESCRIBED TIME-LIMIT

Effective date: 20191023

Ref country code: IS

Free format text: LAPSE BECAUSE OF FAILURE TO SUBMIT A TRANSLATION OF THE DESCRIPTION OR TO PAY THE FEE WITHIN THE PRESCRIBED TIME-LIMIT

Effective date: 20200224

Ref country code: RS

Free format text: LAPSE BECAUSE OF FAILURE TO SUBMIT A TRANSLATION OF THE DESCRIPTION OR TO PAY THE FEE WITHIN THE PRESCRIBED TIME-LIMIT

Effective date: 20191023

PG25 Lapsed in a contracting state [announced via postgrant information from national office to epo]

Ref country code: AL

Free format text: LAPSE BECAUSE OF FAILURE TO SUBMIT A TRANSLATION OF THE DESCRIPTION OR TO PAY THE FEE WITHIN THE PRESCRIBED TIME-LIMIT

Effective date: 20191023

REG Reference to a national code

Ref country code: DE

Ref legal event code: R097

Ref document number: 602018000951

Country of ref document: DE

PG2D Information on lapse in contracting state deleted

Ref country code: IS

PG25 Lapsed in a contracting state [announced via postgrant information from national office to epo]

Ref country code: EE

Free format text: LAPSE BECAUSE OF FAILURE TO SUBMIT A TRANSLATION OF THE DESCRIPTION OR TO PAY THE FEE WITHIN THE PRESCRIBED TIME-LIMIT

Effective date: 20191023

Ref country code: DK

Free format text: LAPSE BECAUSE OF FAILURE TO SUBMIT A TRANSLATION OF THE DESCRIPTION OR TO PAY THE FEE WITHIN THE PRESCRIBED TIME-LIMIT

Effective date: 20191023

Ref country code: CZ

Free format text: LAPSE BECAUSE OF FAILURE TO SUBMIT A TRANSLATION OF THE DESCRIPTION OR TO PAY THE FEE WITHIN THE PRESCRIBED TIME-LIMIT

Effective date: 20191023

Ref country code: ES

Free format text: LAPSE BECAUSE OF FAILURE TO SUBMIT A TRANSLATION OF THE DESCRIPTION OR TO PAY THE FEE WITHIN THE PRESCRIBED TIME-LIMIT

Effective date: 20191023

Ref country code: RO

Free format text: LAPSE BECAUSE OF FAILURE TO SUBMIT A TRANSLATION OF THE DESCRIPTION OR TO PAY THE FEE WITHIN THE PRESCRIBED TIME-LIMIT

Effective date: 20191023

Ref country code: IS

Free format text: LAPSE BECAUSE OF FAILURE TO SUBMIT A TRANSLATION OF THE DESCRIPTION OR TO PAY THE FEE WITHIN THE PRESCRIBED TIME-LIMIT

Effective date: 20200223

REG Reference to a national code

Ref country code: AT

Ref legal event code: MK05

Ref document number: 1194491

Country of ref document: AT

Kind code of ref document: T

Effective date: 20191023

PLBE No opposition filed within time limit

Free format text: ORIGINAL CODE: 0009261

STAA Information on the status of an ep patent application or granted ep patent

Free format text: STATUS: NO OPPOSITION FILED WITHIN TIME LIMIT

PG25 Lapsed in a contracting state [announced via postgrant information from national office to epo]

Ref country code: SK

Free format text: LAPSE BECAUSE OF FAILURE TO SUBMIT A TRANSLATION OF THE DESCRIPTION OR TO PAY THE FEE WITHIN THE PRESCRIBED TIME-LIMIT

Effective date: 20191023

Ref country code: IT

Free format text: LAPSE BECAUSE OF FAILURE TO SUBMIT A TRANSLATION OF THE DESCRIPTION OR TO PAY THE FEE WITHIN THE PRESCRIBED TIME-LIMIT

Effective date: 20191023

Ref country code: SM

Free format text: LAPSE BECAUSE OF FAILURE TO SUBMIT A TRANSLATION OF THE DESCRIPTION OR TO PAY THE FEE WITHIN THE PRESCRIBED TIME-LIMIT

Effective date: 20191023

26N No opposition filed

Effective date: 20200724

PG25 Lapsed in a contracting state [announced via postgrant information from national office to epo]

Ref country code: SI

Free format text: LAPSE BECAUSE OF FAILURE TO SUBMIT A TRANSLATION OF THE DESCRIPTION OR TO PAY THE FEE WITHIN THE PRESCRIBED TIME-LIMIT

Effective date: 20191023

Ref country code: MC

Free format text: LAPSE BECAUSE OF FAILURE TO SUBMIT A TRANSLATION OF THE DESCRIPTION OR TO PAY THE FEE WITHIN THE PRESCRIBED TIME-LIMIT

Effective date: 20191023

Ref country code: AT

Free format text: LAPSE BECAUSE OF FAILURE TO SUBMIT A TRANSLATION OF THE DESCRIPTION OR TO PAY THE FEE WITHIN THE PRESCRIBED TIME-LIMIT

Effective date: 20191023

PG25 Lapsed in a contracting state [announced via postgrant information from national office to epo]

Ref country code: LU

Free format text: LAPSE BECAUSE OF NON-PAYMENT OF DUE FEES

Effective date: 20200418

REG Reference to a national code

Ref country code: BE

Ref legal event code: MM

Effective date: 20200430

PG25 Lapsed in a contracting state [announced via postgrant information from national office to epo]

Ref country code: BE

Free format text: LAPSE BECAUSE OF NON-PAYMENT OF DUE FEES

Effective date: 20200430

PG25 Lapsed in a contracting state [announced via postgrant information from national office to epo]

Ref country code: IE

Free format text: LAPSE BECAUSE OF NON-PAYMENT OF DUE FEES

Effective date: 20200418

PG25 Lapsed in a contracting state [announced via postgrant information from national office to epo]

Ref country code: CH

Free format text: LAPSE BECAUSE OF NON-PAYMENT OF DUE FEES

Effective date: 20210430

Ref country code: LI

Free format text: LAPSE BECAUSE OF NON-PAYMENT OF DUE FEES

Effective date: 20210430

PG25 Lapsed in a contracting state [announced via postgrant information from national office to epo]

Ref country code: TR

Free format text: LAPSE BECAUSE OF FAILURE TO SUBMIT A TRANSLATION OF THE DESCRIPTION OR TO PAY THE FEE WITHIN THE PRESCRIBED TIME-LIMIT

Effective date: 20191023

Ref country code: MT

Free format text: LAPSE BECAUSE OF FAILURE TO SUBMIT A TRANSLATION OF THE DESCRIPTION OR TO PAY THE FEE WITHIN THE PRESCRIBED TIME-LIMIT

Effective date: 20191023

Ref country code: CY

Free format text: LAPSE BECAUSE OF FAILURE TO SUBMIT A TRANSLATION OF THE DESCRIPTION OR TO PAY THE FEE WITHIN THE PRESCRIBED TIME-LIMIT

Effective date: 20191023

PG25 Lapsed in a contracting state [announced via postgrant information from national office to epo]

Ref country code: MK

Free format text: LAPSE BECAUSE OF FAILURE TO SUBMIT A TRANSLATION OF THE DESCRIPTION OR TO PAY THE FEE WITHIN THE PRESCRIBED TIME-LIMIT

Effective date: 20191023

GBPC Gb: european patent ceased through non-payment of renewal fee

Effective date: 20220418

PG25 Lapsed in a contracting state [announced via postgrant information from national office to epo]

Ref country code: GB

Free format text: LAPSE BECAUSE OF NON-PAYMENT OF DUE FEES

Effective date: 20220418

PGFP Annual fee paid to national office [announced via postgrant information from national office to epo]

Ref country code: FR

Payment date: 20230321

Year of fee payment: 6

P01 Opt-out of the competence of the unified patent court (upc) registered

Effective date: 20230428

PGFP Annual fee paid to national office [announced via postgrant information from national office to epo]

Ref country code: DE

Payment date: 20230321

Year of fee payment: 6