EP4078418A1 - Electronic system and methods for dynamic activation of countermeasures - Google Patents

Electronic system and methods for dynamic activation of countermeasures

Info

Publication number
EP4078418A1
EP4078418A1 EP20848856.9A EP20848856A EP4078418A1 EP 4078418 A1 EP4078418 A1 EP 4078418A1 EP 20848856 A EP20848856 A EP 20848856A EP 4078418 A1 EP4078418 A1 EP 4078418A1
Authority
EP
European Patent Office
Prior art keywords
function
security
hardware
execution
electronic system
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.)
Pending
Application number
EP20848856.9A
Other languages
German (de)
French (fr)
Inventor
Sylvain Charbonnier
Jean Roch Coulon
Vincent DUMAS
André Sintzoff
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.)
Thales DIS France SAS
Original Assignee
Thales DIS 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 Thales DIS France SAS filed Critical Thales DIS France SAS
Publication of EP4078418A1 publication Critical patent/EP4078418A1/en
Pending legal-status Critical Current

Links

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/55Detecting local intrusion or implementing counter-measures
    • G06F21/554Detecting local intrusion or implementing counter-measures involving event detection and direct action
    • 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/552Detecting local intrusion or implementing counter-measures involving long-term monitoring or reporting
    • 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 the field of securing the execution of software on an electronic device against attacks, and more particularly to a method for dynamically activating countermeasures.
  • Software execution on an electronic device can be the subject of various attacks, allowing an attacker to maliciously modify the execution of software code on the electronic device or to gain knowledge of sensitive data stored on the secure device. , such as secret cryptographic keys or banking information.
  • the present invention therefore relates to a method of configuring an electronic system for a secure execution of a code comprising a plurality of functions, said electronic system being configured to apply, during an execution of a code. a function, a security countermeasure configuration among a plurality of security countermeasure configurations, said method being executed by said electronic system comprising a hardware processor, security hardware registers configured to store start addresses of functions among said plurality of functions and associated security countermeasures configurations to be applied during an execution of said functions, a detection system configured to detect an attack on said electronic system during an execution of a function among said plurality of functions and including:
  • said electronic system further comprises a backup memory while the start address of said first function and said selected security countermeasure configuration, stored in said hardware security register, are copied from said register.
  • security equipment to said backup memory after said detection of an attack and, on startup of the electronic system, the starting addresses and the associated security countermeasures configurations, stored in said backup memory, are copied from said memory backup to said material security registers.
  • the present invention relates to a method for executing a code comprising a plurality of functions, by an electronic system configured for secure execution of said code according to the method according to the first aspect, and for application, during an execution of a function, of a configuration of security countermeasures among a plurality of configurations of security countermeasures and comprising a hardware processor and hardware security registers storing, for at least one function among said plurality of functions, a function start address and an associated configuration of security countermeasures, to be applied during an execution of said at least one function, said method being executed by said electronic system and comprising, when the code execution passes through 'a first function has a second function:
  • Such a method makes it possible to effectively protect parts of the code by activating, during their execution, the countermeasures necessary to protect them from the type of attacks which have already been detected during a previous execution of the code.
  • Applying said predefined configuration of security countermeasures may include disabling all activated countermeasures.
  • said electronic system comprises a secure processor state hardware register (psr_sec) storing a start address of a function in execution and a current configuration of a security countermeasure, as well as:
  • determining whether one of the hardware security registers stores a start address of the second function includes comparing the start address of the second function stored in said processor secure state hardware register (psr_sec) to the start of function addresses stored in the hardware safety registers (break (i) _sec),
  • - applying a security countermeasure configuration associated with the start address of the second function before executing said second function includes activating the required security countermeasures in the countermeasure configuration security associated with the start address of the second function and disabled in the current security countermeasure configuration.
  • the method according to the second aspect can comprise: when the execution of the code passes from a first function to a second function, saving the contents of the processor secure state hardware register storing the start address of the first function in running and updating the secure processor state hardware register with the start address of the second function, and at the end of the execution of the second function and when execution reverts to the first function, reloading the saved content.
  • the step of determining whether one of the security hardware registers stores a start address of the second function and / or the step of saving the content and reloading the saved content can be performed by a dedicated hardware circuit.
  • this invention relates to a computer program product directly loadable into the memory of at least one computer, comprising software code instructions for carrying out the steps of the methods according to the first and second aspects of the invention. when said product is run on the computer.
  • the present invention relates to an electronic system comprising a hardware processor, hardware security registers and a detection system, configured to perform the steps of the methods according to the first and the second aspect of the invention.
  • one or more embodiments include the following features, fully described and particularly emphasized in the claims.
  • Figure 1 is a schematic illustration of an electronic system according to the present invention.
  • Figure 2 is a schematic illustration of a method according to an embodiment of the present invention.
  • Figure 3 is an exemplary configuration of an electronic device according to the present invention.
  • Figures 4 and 5 are schematic illustrations of an example of secure execution of a code according to the present invention.
  • the invention relates to a method of configuring an electronic system 1 for secure execution of a code comprising a plurality of functions.
  • the electronic system is able to apply, during the execution of a function, a configuration of security countermeasures among a plurality of configurations of security countermeasures .
  • Each configuration of security countermeasures is defined by one or more countermeasures, the activation of which protects the electronic system against one or more types of attacks.
  • Such countermeasures may include timing desynchronization such as clock jitter, power smoothing, activation of an anti-code rerouting mechanism, and memory access redundancy.
  • Such an electronic system comprises, as shown in FIG. 1, a hardware processor 101 intended for the execution of the code to be protected and at least one memory 102, such as a non-volatile memory, a RAM memory and / or a ROM memory. in which the code is stored.
  • the electronic system can also include a backup memory 105 such as a non-volatile memory, a programmable read only memory, a hard disk, etc.
  • Such an electronic system can for example be a smart card or a tamper-proof computer.
  • the main idea of the invention is to activate countermeasures during the execution of functions which have undergone attacks during a previous execution. To do this, attacks are detected during the operation of the electronic system.
  • the electronic system comprises a detection system 103 configured to detect an attack on the electronic system during the execution of a function among the plurality of functions of the code to be protected.
  • countermeasures to be activated for the next executions of the function, are defined.
  • a security countermeasures configuration associated with the function that was running at the time of the attack is defined.
  • the electronic system includes hardware security registers 104 configured to store function start addresses among the plurality of functions of the code, and associated security countermeasure configurations. , to be applied when performing these functions.
  • such hardware security registers may be named break, _sec, where i represents an integer.
  • the electronic system checks, at the start of the execution of a function, whether its starting address is stored in any one of the registers. break safety equipment, _sec. If a start-of-function address is found, the associated configuration is applied by activating the required countermeasures, such that these countermeasures remain active throughout the execution of the associated function.
  • a first step S1 the detection system of the electronic system detects an attack on said electronic system during the execution of a first function. This step can be carried out continuously during the operation of the electronic system, until an attack is detected.
  • the electronic system selects, as a function of the attack detected in the first step, a security countermeasure configuration to be applied during an execution of the first function.
  • This security countermeasure configuration preferably includes one or more countermeasures against the attack detected in the first step, so that this countermeasure configuration, when applied, triggers the necessary countermeasures to protect the electronic system against further execution of the detected attack.
  • the electronic system stores, in a break hardware security register, _sec, the start address of the first function and the selected configuration of the security countermeasure to be applied during an execution of the first function.
  • a fourth step S4 when the execution code passes from a first function to a second function, the electronic system determines whether one of the hardware security registers break, _sec stores the start address of the second. function. This step can be performed by a dedicated hardware circuit. When one of the break hardware security registers, _sec stores the start address of the second function in a step S41, the electronic system applies the stored security countermeasure configuration before executing the second function. Thus, the execution of the second function is effectively protected by the countermeasures activated against the type of attacks it suffered during a previous execution.
  • the second function does not require special countermeasures to be activated.
  • the electronic system can apply a predefined security countermeasure configuration before executing the second function.
  • This predefined security countermeasure configuration may simply indicate that no countermeasure is required.
  • the application of the predefined configuration of security countermeasures may include deactivation of all activated countermeasures, in order to speed up the execution of the second function.
  • the fourth step described above can be executed repeatedly each time a new function is called, in order to adapt the configuration of the countermeasures to the next function to be executed.
  • the electronic system can at the same time carry out on the one hand the first three steps S1 to S3, in order to continuously detect new attacks and to adapt the configurations of security countermeasures stored in the hardware security registers; and on the other hand, performing the fourth step S4 at each change of function, in order to adapt the countermeasures applied to the function being executed.
  • the electronic system may include a backup memory 105, such as an NVM or a programmable read only memory and after detection of an attack during the execution of a first function, the start address of said first function and said selected security countermeasure configuration, stored in said hardware security register, are copied from said hardware security register to said backup memory.
  • a backup memory 105 such as an NVM or a programmable read only memory
  • the starting addresses and the associated security countermeasures configurations, stored in said backup memory are copied from said backup memory to said security hardware registers.
  • the electronic system may include a psr_sec processor secure state hardware register, configured to store the start address of the running function and the configuration. current security countermeasure applied.
  • a start address of the first function and the current configuration of the security countermeasure can be stored, at the start of the execution of a first function, in the register.
  • psr_sec processor secure state hardware configured to store the start address of the running function and the configuration.
  • the content of the processor secure state hardware register psr_sec relating to the first function can be saved, for example in RAM or in dedicated hardware registers, and the psr_sec processor secure state hardware register may be updated with the start address of the second function.
  • the fact of determining whether one of the break hardware security registers, _sec stores the start address of the second function can comprise the comparison of the start address of the second function stored in the hardware register.
  • This comparison step can be carried out by a dedicated hardware circuit, for example by hardware comparators between each hardware security register break, _sec and the hardware secure state processor register psr_sec.
  • a dedicated hardware circuit for example by hardware comparators between each hardware security register break, _sec and the hardware secure state processor register psr_sec.
  • second function can then include the activation of the security countermeasures, required in the security countermeasure configuration associated with the start address of the second function and disabled in the current security countermeasure configuration, applied when performing the first function.
  • the execution returns to the first function while the previous state of the processor secure state hardware register psr_sec, saved when passing from the execution to the second function, can be reloaded, for example from RAM or dedicated hardware registers. This step can be performed by a dedicated hardware circuit.
  • FIG. 3 An example of the configuration of the electronic system is represented in FIG. 3, which shows the operations carried out during the detection of an attack during the execution of a function B called by a function A.
  • Function A is executed from on board.
  • the processor secure state hardware register psr_sec stores the A function start address 0x200 and a safety countermeasure configuration 0x0, indicating that no countermeasure is required.
  • function B is called.
  • the psr_sec processor safety status hardware register is updated with the start address of function B 0x2000.
  • the detection of an attack triggers a security alarm which leads to writing the starting address of function B 0x2000 in one of the breakr_sec hardware security registers.
  • the electronic system determines that three countermeasures are necessary to prevent this attack and therefore associates, with the starting address of function B 0x2000, a configuration of security countermeasure 0x3 requiring the activation of these three countermeasures .
  • the contents of the breakr_sec security hardware registry can be copied to backup memory, so that it can be restored on restart.
  • FIGS. 4 and 5 an example of secure execution of a code according to the invention is given in FIGS. 4 and 5.
  • This example shows an initial state of the electronic system, in which a first function A is executed and calls a second function B. It is assumed that three hardware safety registers, breakr_sec, break2_sec and break / v_sec, store the start addresses of functions B (0x2000), D (0x4000) and F (0x6000) and the countermeasure configurations associated safety systems - which are not shown in FIG. 4 - but the start address of function A 0x200 is not stored in any of the hardware safety registers. As a result, function A is executed without the activation of any countermeasures.
  • the processor secure state hardware register psr_sec When executing function A, the processor secure state hardware register psr_sec stores the starting address (A @ or 0x200) of function A and the safety countermeasure configuration 0x0, indicating that no countermeasures are required in this configuration. Function B is then called. Function B's start address B @ 0x2000 is copied to the processor secure state hardware register psr_sec and this starting address is looked up in the safety hardware registers. The breakr_sec safety hardware register stores the start address B @ 0x2000 associated with the safety countermeasure configuration 0x3 requiring the activation of three countermeasures.
  • the processor secure state hardware register psr_sec After the execution of function B has started, the processor secure state hardware register psr_sec then stores the start address of function B @ 0x2000 and the associated safety countermeasure configuration 0x3.
  • Figures 4 and 5 also show what happens when the execution of function B is completed and the execution of function A resumes.
  • the processor secure state hardware register psr_sec still stores the start address of the B function @ 0x2000 and the associated safety countermeasure configuration 0x3.
  • the start of function address A 0x200 could not be found in the hardware safety registers.
  • the predefined safety configuration 0x0 is therefore applied, which deactivates the three countermeasures activated during the execution of function B, by a call to the deactivation function at address 0x1100.
  • the hardware safety status register of psr_sec processor again memorizes the start address of function A @ 0x200 and the associated safety countermeasure configuration 0x0.
  • the invention relates to a computer program product directly loadable into the memory of at least one computer, comprising software code instructions making it possible to execute, when said product is executed on the computer, the steps of the methods described above.
  • the method and the computer program according to the second and third aspects of the invention can be configured to execute or can include any other characteristic described above.
  • the electronic system and the method presented here therefore make it possible to effectively trigger the execution of additional countermeasures on specific parts of the code to be protected, almost without any imprint on this code and with a limited impact on the execution time, since 'no countermeasures are activated while performing functions for which no protection is required.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)

Abstract

The present invention relates to a method for configuring an electronic system for secured execution of a code comprising a plurality of functions, the electronic system being configured to apply, while executing a function, a security countermeasure configuration among a plurality of security countermeasure configurations. The method is executed by the electronic system comprising a hardware processor, hardware security registers configured to store start addresses of functions among the plurality of functions and associated security countermeasure configurations to be applied while executing the functions, a detection system configured to detect an attack on the electronic system while executing a function among the plurality of functions, and consists of: detecting (S1), by means of the detection system, an attack on the electronic system while executing a first function, selecting (S2), according to the detected attack, a security countermeasure configuration to be applied while executing the first function, storing (S3), in a hardware security register, the start address of the first function and the selected security countermeasure configuration to be applied while executing the first function.

Description

SYSTÈME ÉLECTRONIQUE ET PROCÉDÉS D'ACTIVATION DYNAMIQUE DE ELECTRONIC SYSTEM AND METHODS FOR DYNAMIC ACTIVATION OF
CONTRE-MESURES COUNTER-MEASURES
DOMAINE DE L'INVENTION FIELD OF THE INVENTION
La présente invention concerne le domaine de la sécurisation de l'exécution d'un logiciel sur un dispositif électronique contre des attaques, et plus particulièrement un procédé d'activation dynamique de contre-mesures. The present invention relates to the field of securing the execution of software on an electronic device against attacks, and more particularly to a method for dynamically activating countermeasures.
CONTEXTE DE L'INVENTION BACKGROUND OF THE INVENTION
L'exécution logicielle sur un appareil électronique peut faire l'objet de diverses attaques, permettant à un attaquant de modifier de manière malveillante l'exécution du code logiciel sur l'appareil électronique ou de prendre connaissance de données sensibles mémorisées sur l'appareil sécurisé, telles que des clés cryptographiques secrètes ou des informations bancaires. Software execution on an electronic device can be the subject of various attacks, allowing an attacker to maliciously modify the execution of software code on the electronic device or to gain knowledge of sensitive data stored on the secure device. , such as secret cryptographic keys or banking information.
Diverses contre-mesures ont été conçues, afin de prévenir de telles attaques ou d'y résister. Un inconvénient majeur de ces contre-mesures est généralement leur coût élevé, qui ralentit le code d'exécution sur un dispositif électronique protégé lorsque de telles contre-mesures sont activées. Various countermeasures have been devised to prevent or resist such attacks. A major drawback of these countermeasures is generally their high cost, which slows down execution code on a protected electronic device when such countermeasures are activated.
Afin d'éviter une activation permanente de multiples contre-mesures, chacune étant conçue contre un différent type d'attaques, à un coût très élevé, des procédés ont été proposés afin d'activer de telles contre-mesures uniquement lorsque des parties spécifiques de code, qui nécessitent un niveau élevé de protection, sont exécutées. De tels procédés nécessitent généralement de modifier manuellement le code logiciel à protéger, afin d'ajouter des commandes d'activation et de désactivation de chaque contre-mesure nécessaire, au début et à la fin de chaque partie de code à protéger par une contre-mesure. De tels procédés sont très lourds pour les concepteurs de codes. Ils peuvent également avoir un impact notable sur la taille du code. De plus, même si leur coût en temps d'exécution est inférieur à celui des procédés impliquant une activation permanente de la contre-mesure, ils induisent toujours un surcoût qui ne prend pas en compte l'environnement d'exécution du dispositif électronique protégé et qui restera le même, même si l'appareil n'est la cible d'aucune attaque. In order to avoid a permanent activation of multiple countermeasures, each designed against a different type of attack, at a very high cost, methods have been proposed to activate such countermeasures only when specific parts of the attack. code, which require a high level of protection, are executed. Such methods generally require manual modification of the software code to be protected, in order to add commands for activating and deactivating each necessary countermeasure, at the start and at the end of each part of code to be protected by a countermeasure. measured. Such methods are very cumbersome for code designers. They can also have a noticeable impact on the size of the code. Moreover, even if their cost in terms of execution time is lower than that of the methods involving a permanent activation of the countermeasure, they still induce an additional cost which does not take into account the execution environment of the protected electronic device and which will remain the same, even if the device is not the target of any attack.
Par conséquent, il existe un besoin de procédé sécurisé d'exécution logicielle sur un dispositif électronique, qui permette de ne protéger que les parties de code qui souffrent d'attaques, avec un impact sur le code et un temps d'exécution minimaux. Consequently, there is a need for a secure method of executing software on an electronic device, which makes it possible to protect only the parts of code which suffer from attacks, with a minimum impact on the code and a minimum execution time.
RÉSUMÉ DE L'INVENTION SUMMARY OF THE INVENTION
À cet effet et selon un premier aspect, la présente invention concerne donc un procédé de configuration d'un système électronique pour une exécution sécurisée d'un code comprenant une pluralité de fonctions, ledit système électronique étant configuré pour appliquer, pendant une exécution d'une fonction, une configuration de contre-mesure de sécurité parmi une pluralité de configurations de contre-mesure de sécurité, ledit procédé étant exécuté par ledit système électronique comprenant un processeur matériel, des registres matériels de sécurité configurés pour mémoriser des adresses de début de fonctions parmi ladite pluralité de fonctions et des configurations de contre-mesures de sécurité associées à appliquer pendant une exécution desdites fonctions, un système de détection configuré pour détecter une attaque sur ledit système électronique lors d'une exécution d'une fonction parmi ladite pluralité de fonctions et comprenant : To this end and according to a first aspect, the present invention therefore relates to a method of configuring an electronic system for a secure execution of a code comprising a plurality of functions, said electronic system being configured to apply, during an execution of a code. a function, a security countermeasure configuration among a plurality of security countermeasure configurations, said method being executed by said electronic system comprising a hardware processor, security hardware registers configured to store start addresses of functions among said plurality of functions and associated security countermeasures configurations to be applied during an execution of said functions, a detection system configured to detect an attack on said electronic system during an execution of a function among said plurality of functions and including:
- la détection, par ledit système de détection, d'une attaque sur ledit système électronique lors de l'exécution d'une première fonction, - the detection, by said detection system, of an attack on said electronic system during the execution of a first function,
- la sélection, en fonction de ladite attaque détectée, d'une configuration de contre-mesure de sécurité à appliquer lors d'une exécution de ladite première fonction, the selection, as a function of said detected attack, of a security countermeasure configuration to be applied during an execution of said first function,
- la mémorisation, dans un registre matériel de sécurité, d’une adresse de début de ladite première fonction et de ladite configuration de contre-mesure de sécurité sélectionnée, à appliquer pendant une exécution de ladite première fonction. - the storage, in a hardware security register, of a start address of said first function and of said countermeasure configuration of selected security, to be applied during an execution of said first function.
Ceci permet de mémoriser les fonctions à protéger, car elles ont déjà subi des attaques, et les contre-mesures à appliquer lors d'une future exécution de la fonction, afin de la protéger d'attaques similaires. This makes it possible to memorize the functions to be protected, because they have already been subjected to attacks, and the countermeasures to be applied during a future execution of the function, in order to protect it from similar attacks.
Selon un mode de réalisation, ledit système électronique comprend en outre une mémoire de sauvegarde tandis que l'adresse de début de ladite première fonction et ladite configuration de contre-mesure de sécurité sélectionnée, mémorisées dans ledit registre matériel de sécurité, sont copiées dudit registre matériel de sécurité à ladite mémoire de sauvegarde après ladite détection d'une attaque et, au démarrage du système électronique, les adresses de départ et les configurations de contre-mesures de sécurité associées, mémorisées dans ladite mémoire de sauvegarde, sont copiées de ladite mémoire de sauvegarde auxdits registres matériels de sécurité. According to one embodiment, said electronic system further comprises a backup memory while the start address of said first function and said selected security countermeasure configuration, stored in said hardware security register, are copied from said register. security equipment to said backup memory after said detection of an attack and, on startup of the electronic system, the starting addresses and the associated security countermeasures configurations, stored in said backup memory, are copied from said memory backup to said material security registers.
Ceci permet d'éviter toute perte des informations mémorisées dans les registres matériels de sécurité, du fait d'un arrêt ou d'une coupure de courant, et de les restaurer lors du redémarrage du système électronique. This makes it possible to avoid any loss of the information stored in the hardware safety registers, due to a shutdown or a power cut, and to restore them when the electronic system is restarted.
Selon un deuxième aspect, la présente invention concerne un procédé d'exécution d'un code comprenant une pluralité de fonctions, par un système électronique configuré pour une exécution sécurisée dudit code selon le procédé selon le premier aspect, et pour application, lors d'une exécution d'une fonction, d'une configuration de contre-mesures de sécurité parmi une pluralité de configurations de contre-mesures de sécurité et comprenant un processeur matériel et des registres matériels de sécurité mémorisant, pour au moins une fonction parmi ladite pluralité de fonctions, une adresse de début de fonction et une configuration associée de contre-mesures de sécurité, à appliquer pendant une exécution de ladite au moins une fonction, ledit procédé étant exécuté par ledit système électronique et comprenant, lorsque l'exécution de code passe d'une première fonction à une seconde fonction : According to a second aspect, the present invention relates to a method for executing a code comprising a plurality of functions, by an electronic system configured for secure execution of said code according to the method according to the first aspect, and for application, during an execution of a function, of a configuration of security countermeasures among a plurality of configurations of security countermeasures and comprising a hardware processor and hardware security registers storing, for at least one function among said plurality of functions, a function start address and an associated configuration of security countermeasures, to be applied during an execution of said at least one function, said method being executed by said electronic system and comprising, when the code execution passes through 'a first function has a second function:
- le fait de déterminer si l'un des registres matériels de sécurité mémorise l’adresse de début de la seconde fonction, - lorsque l'un des registres matériels de sécurité mémorise l’adresse de début de la seconde fonction et une configuration de contre-mesure de sécurité associée, l'application de ladite configuration de contre-mesure de sécurité mémorisée avant d'exécuter ladite seconde fonction, - determining whether one of the hardware security registers stores the start address of the second function, - when one of the hardware security registers stores the start address of the second function and an associated security countermeasure configuration, applying said stored security countermeasure configuration before executing said second function,
- lorsqu'aucun registre matériel de sécurité ne mémorise l’adresse de début de la seconde fonction, l'application d'une configuration de contre-mesure de sécurité prédéfinie avant d'exécuter ladite seconde fonction. - when no hardware security register stores the start address of the second function, applying a predefined security countermeasure configuration before executing said second function.
Un tel procédé permet de protéger efficacement des parties du code en activant, lors de leur exécution, les contre-mesures nécessaires pour les protéger du type d'attaques qui ont déjà été détectées lors d'une précédente exécution du code. Such a method makes it possible to effectively protect parts of the code by activating, during their execution, the countermeasures necessary to protect them from the type of attacks which have already been detected during a previous execution of the code.
L'application de ladite configuration prédéfinie de contre-mesures de sécurité peut comprendre la désactivation de toutes les contre-mesures activées. Applying said predefined configuration of security countermeasures may include disabling all activated countermeasures.
Lorsqu'une fonction ne nécessite aucune protection, ceci permet d'éviter toute augmentation du temps d'exécution qui serait provoquée par des contre-mesures activées inutilement. When a function does not require any protection, this avoids any increase in execution time that would be caused by unnecessarily activated countermeasures.
Selon un mode de réalisation, ledit système électronique comprend un registre matériel d'état sécurisé de processeur (psr_sec) mémorisant une adresse de début d'une fonction en cours d'exécution et une configuration courante de contre-mesure de sécurité, ainsi que : According to one embodiment, said electronic system comprises a secure processor state hardware register (psr_sec) storing a start address of a function in execution and a current configuration of a security countermeasure, as well as:
- le fait de déterminer si l'un des registres matériels de sécurité mémorise une adresse de début de la seconde fonction comprend la comparaison de l’adresse de début de la seconde fonction mémorisée dans ledit registre matériel d'état sécurisé de processeur (psr_sec) aux adresses de début de fonction mémorisées dans les registres matériels de sécurité (break(i)_sec), - determining whether one of the hardware security registers stores a start address of the second function includes comparing the start address of the second function stored in said processor secure state hardware register (psr_sec) to the start of function addresses stored in the hardware safety registers (break (i) _sec),
- l'application d'une configuration de contre-mesure de sécurité associée à l’adresse de début de la seconde fonction avant d'exécuter ladite seconde fonction comprend l'activation des contre-mesures de sécurité requises dans la configuration de contre-mesure de sécurité associée à l’adresse de début de la seconde fonction et inactivée dans la configuration courante de contre-mesure de sécurité. - applying a security countermeasure configuration associated with the start address of the second function before executing said second function includes activating the required security countermeasures in the countermeasure configuration security associated with the start address of the second function and disabled in the current security countermeasure configuration.
Le procédé selon le deuxième aspect peut comprendre : lorsque l'exécution du code passe d'une première fonction à une seconde fonction, la sauvegarde du contenu du registre matériel d'état sécurisé de processeur mémorisant l'adresse de début de la première fonction en cours d'exécution et la mise à jour du registre matériel d'état sécurisé de processeur avec l'adresse de début de la seconde fonction, et à la fin de l'exécution de la seconde fonction et lorsque l'exécution revient à la première fonction, le rechargement du contenu sauvegardé. The method according to the second aspect can comprise: when the execution of the code passes from a first function to a second function, saving the contents of the processor secure state hardware register storing the start address of the first function in running and updating the secure processor state hardware register with the start address of the second function, and at the end of the execution of the second function and when execution reverts to the first function, reloading the saved content.
L'étape consistant à déterminer si l'un des registres matériels de sécurité mémorise une adresse de début de la seconde fonction et/ou l'étape de sauvegarde du contenu et de rechargement du contenu sauvegardé peuvent être exécutées par un circuit matériel dédié. The step of determining whether one of the security hardware registers stores a start address of the second function and / or the step of saving the content and reloading the saved content can be performed by a dedicated hardware circuit.
Selon un troisième aspect, cette invention concerne un produit programme d’ordinateur directement chargeable dans la mémoire d’au moins un ordinateur, comprenant des instructions de code logiciel permettant d'exécuter les étapes des procédés selon les premier et deuxième aspects de l'invention lorsque ledit produit est exécuté sur l’ordinateur. According to a third aspect, this invention relates to a computer program product directly loadable into the memory of at least one computer, comprising software code instructions for carrying out the steps of the methods according to the first and second aspects of the invention. when said product is run on the computer.
Selon un quatrième aspect, la présente invention concerne un système électronique comprenant un processeur matériel, des registres matériels de sécurité et un système de détection, configuré pour exécuter les étapes des procédés selon le premier et le deuxième aspects de l'invention. According to a fourth aspect, the present invention relates to an electronic system comprising a hardware processor, hardware security registers and a detection system, configured to perform the steps of the methods according to the first and the second aspect of the invention.
Pour l'accomplissement des fins précédentes et apparentées, un ou plusieurs modes de réalisation comprennent les caractéristiques ci-après, entièrement décrites et particulièrement soulignées dans les revendications. BRÈVE DESCRIPTION DES DESSINS For the accomplishment of the foregoing and related purposes, one or more embodiments include the following features, fully described and particularly emphasized in the claims. BRIEF DESCRIPTION OF THE DRAWINGS
La description suivante et les dessins annexés présentent en détail certains aspects illustratifs et ne sont indicatifs que de quelques-unes des diverses manières dont les principes des modes de réalisation peuvent être employés. D'autres avantages et caractéristiques nouvelles apparaîtront à la lecture de la description détaillée suivante, prise conjointement avec les dessins, et les modes de réalisation décrits sont destinés à inclure tous ces aspects et leurs équivalents. The following description and the accompanying drawings detail certain illustrative aspects and are indicative of only a few of the various ways in which the principles of the embodiments may be employed. Other advantages and novel features will become apparent from the following detailed description, taken in conjunction with the drawings, and the embodiments described are intended to include all of these aspects and their equivalents.
• La figure 1 est une illustration schématique d'un système électronique selon la présente invention. • Figure 1 is a schematic illustration of an electronic system according to the present invention.
• La figure 2 est une illustration schématique d'un procédé selon un mode de réalisation de la présente invention. • Figure 2 is a schematic illustration of a method according to an embodiment of the present invention.
• La figure 3 est un exemple de configuration d'un dispositif électronique selon la présente invention. • Figure 3 is an exemplary configuration of an electronic device according to the present invention.
• Les figures 4 et 5 sont des illustrations schématiques d'un exemple d'exécution sécurisée d'un code selon la présente invention. • Figures 4 and 5 are schematic illustrations of an example of secure execution of a code according to the present invention.
DESCRIPTION DETAILLEE DES MODES DE RÉALISATION DE L'INVENTION DETAILED DESCRIPTION OF EMBODIMENTS OF THE INVENTION
Selon un premier aspect, l'invention concerne un procédé de configuration d'un système électronique 1 pour une exécution sécurisée d'un code comprenant une pluralité de fonctions. Afin de protéger l'exécution de ces fonctions contre des attaques, le système électronique est apte à appliquer, lors de l'exécution d'une fonction, une configuration de contre-mesures de sécurité parmi une pluralité de configurations de contre-mesures de sécurité. According to a first aspect, the invention relates to a method of configuring an electronic system 1 for secure execution of a code comprising a plurality of functions. In order to protect the execution of these functions against attacks, the electronic system is able to apply, during the execution of a function, a configuration of security countermeasures among a plurality of configurations of security countermeasures .
Chaque configuration de contre-mesures de sécurité est définie par une ou par plusieurs contre-mesures, dont l'activation protège le système électronique contre un ou contre plusieurs types d'attaques. De telles contre-mesures peuvent comprendre une désynchronisation temporelle telle que la jigue d'horloge, un lissage de puissance, l’activation d’un mécanisme anti-reroutage de code et une redondance d'accès à la mémoire. Un tel système électronique comprend, comme représenté sur la figure 1 , un processeur matériel 101 destiné à l'exécution du code à protéger et au moins une mémoire 102, telle qu'une mémoire non volatile, une mémoire RAM et/ou une mémoire ROM dans laquelle est mémorisé le code. Le système électronique peut également comprendre une mémoire de sauvegarde 105 telle qu'une mémoire non volatile, une mémoire morte programmable, un disque dur... Un tel système électronique peut par exemple être une carte à puce ou un ordinateur inviolable. Each configuration of security countermeasures is defined by one or more countermeasures, the activation of which protects the electronic system against one or more types of attacks. Such countermeasures may include timing desynchronization such as clock jitter, power smoothing, activation of an anti-code rerouting mechanism, and memory access redundancy. Such an electronic system comprises, as shown in FIG. 1, a hardware processor 101 intended for the execution of the code to be protected and at least one memory 102, such as a non-volatile memory, a RAM memory and / or a ROM memory. in which the code is stored. The electronic system can also include a backup memory 105 such as a non-volatile memory, a programmable read only memory, a hard disk, etc. Such an electronic system can for example be a smart card or a tamper-proof computer.
L'idée principale de l'invention est d'activer des contre-mesures lors de l'exécution de fonctions ayant subi des attaques lors d'une précédente exécution. Pour ce faire, des attaques sont détectées lors du fonctionnement du système électronique. À cet effet, le système électronique comprend un système de détection 103 configuré pour détecter une attaque sur le système électronique lors de l'exécution d'une fonction parmi la pluralité de fonctions du code à protéger. Lorsqu'une attaque est détectée, des contre-mesures, à activer pour les prochaines exécutions de la fonction, sont définies. Une configuration de contre-mesures de sécurité associée à la fonction qui était en cours d'exécution au moment de l'attaque est définie. Afin de mémoriser la configuration de contre-mesures de sécurité définie, le système électronique comprend des registres matériels de sécurité 104 configurés pour mémoriser des adresses de début de fonctions parmi la pluralité de fonctions du code, et des configurations de contre-mesure de sécurité associées, à appliquer lors d'une exécution de ces fonctions. Dans les paragraphes suivants et parmi les figures, de tels registres matériels de sécurité peuvent être nommés break, _sec, où i représente un nombre entier. The main idea of the invention is to activate countermeasures during the execution of functions which have undergone attacks during a previous execution. To do this, attacks are detected during the operation of the electronic system. To this end, the electronic system comprises a detection system 103 configured to detect an attack on the electronic system during the execution of a function among the plurality of functions of the code to be protected. When an attack is detected, countermeasures, to be activated for the next executions of the function, are defined. A security countermeasures configuration associated with the function that was running at the time of the attack is defined. In order to store the defined security countermeasures configuration, the electronic system includes hardware security registers 104 configured to store function start addresses among the plurality of functions of the code, and associated security countermeasure configurations. , to be applied when performing these functions. In the following paragraphs and among the figures, such hardware security registers may be named break, _sec, where i represents an integer.
Afin d'activer des contre-mesures appropriées lors de l'exécution de chaque fonction du code, le système électronique vérifie, au début de l'exécution d'une fonction, si son adresse de départ est mémorisée dans l'un quelconque des registres matériels de sécurité break, _sec. Si une adresse de début de fonction est trouvée, la configuration associée est appliquée par activation des contre-mesures requises, de sorte que ces contre-mesures restent actives tout au long de l'exécution de la fonction qui leur est associée. Les paragraphes suivants décrivent en détail les étapes, représentées sur la figure 2, du procédé de configuration du système électronique pour une exécution sécurisée d'un code selon l'invention. In order to activate appropriate countermeasures during the execution of each function of the code, the electronic system checks, at the start of the execution of a function, whether its starting address is stored in any one of the registers. break safety equipment, _sec. If a start-of-function address is found, the associated configuration is applied by activating the required countermeasures, such that these countermeasures remain active throughout the execution of the associated function. The following paragraphs describe in detail the steps, shown in FIG. 2, of the method for configuring the electronic system for secure execution of a code according to the invention.
Lors d'une première étape S1 , le système de détection du système électronique détecte une attaque sur ledit système électronique lors de l'exécution d'une première fonction. Cette étape peut être réalisée en continu pendant le fonctionnement du système électronique, jusqu'à la détection d'une attaque. During a first step S1, the detection system of the electronic system detects an attack on said electronic system during the execution of a first function. This step can be carried out continuously during the operation of the electronic system, until an attack is detected.
Lors d'une deuxième étape S2, le système électronique sélectionne, en fonction de l'attaque détectée à la première étape, une configuration de contre-mesure de sécurité à appliquer lors d'une exécution de la première fonction. Cette configuration de contre-mesure de sécurité comprend de préférence une ou plusieurs contre- mesures contre l'attaque détectée à la première étape, de sorte que cette configuration de contre-mesure, lorsqu'elle est appliquée, déclenche les contre-mesures nécessaires pour protéger le système électronique contre une autre exécution de l'attaque détectée. During a second step S2, the electronic system selects, as a function of the attack detected in the first step, a security countermeasure configuration to be applied during an execution of the first function. This security countermeasure configuration preferably includes one or more countermeasures against the attack detected in the first step, so that this countermeasure configuration, when applied, triggers the necessary countermeasures to protect the electronic system against further execution of the detected attack.
Lors d'une troisième étape S3, le système électronique mémorise, dans un registre matériel de sécurité break, _sec, l’adresse de début de la première fonction et la configuration sélectionnée de contre-mesure de sécurité à appliquer lors d'une exécution de la première fonction. During a third step S3, the electronic system stores, in a break hardware security register, _sec, the start address of the first function and the selected configuration of the security countermeasure to be applied during an execution of the first function.
Selon un deuxième aspect, les paragraphes suivants décrivent en détail les étapes, représentées à la figure 2, du procédé permettant d'exécuter en toute sécurité le code à protéger une fois que le système électronique a été configuré par application, au moins une fois, de la première, de la deuxième et de la troisième étape. According to a second aspect, the following paragraphs describe in detail the steps, shown in FIG. 2, of the method allowing the code to be protected to be executed in complete safety once the electronic system has been configured by application, at least once, of the first, second and third stages.
Lors d'une quatrième étape S4, lorsque le code d'exécution passe d'une première fonction à une seconde fonction, le système électronique détermine si l'un des registres matériels de sécurité break, _sec mémorise l’adresse de début de la seconde fonction. Cette étape peut être réalisée par un circuit matériel dédié. Lorsque l'un des registres matériels de sécurité break, _sec mémorise l’adresse de début de la seconde fonction lors d'une étape S41 , le système électronique applique la configuration de contre-mesure de sécurité mémorisée avant d'exécuter la seconde fonction. Ainsi, l'exécution de la seconde fonction est efficacement protégée par les contre-mesures activées contre le type d'attaques qu'elle a subies lors d'une exécution précédente. During a fourth step S4, when the execution code passes from a first function to a second function, the electronic system determines whether one of the hardware security registers break, _sec stores the start address of the second. function. This step can be performed by a dedicated hardware circuit. When one of the break hardware security registers, _sec stores the start address of the second function in a step S41, the electronic system applies the stored security countermeasure configuration before executing the second function. Thus, the execution of the second function is effectively protected by the countermeasures activated against the type of attacks it suffered during a previous execution.
Lorsqu'aucun registre matériel de sécurité ne mémorise l’adresse de début de la seconde fonction, la seconde fonction ne nécessite pas de contre-mesures particulières à activer. Dans ce cas, lors d'une étape S42, le système électronique peut appliquer une configuration de contre-mesure de sécurité prédéfinie avant d'exécuter la seconde fonction. When no hardware security register stores the start address of the second function, the second function does not require special countermeasures to be activated. In this case, during a step S42, the electronic system can apply a predefined security countermeasure configuration before executing the second function.
Cette configuration de contre-mesure de sécurité prédéfinie peut simplement indiquer qu'aucune contre-mesure n'est nécessaire. Dans ce cas, l'application de la configuration prédéfinie de contre-mesures de sécurité peut comprendre la désactivation de toutes les contre-mesures activées, afin d'accélérer l'exécution de la seconde fonction. This predefined security countermeasure configuration may simply indicate that no countermeasure is required. In this case, the application of the predefined configuration of security countermeasures may include deactivation of all activated countermeasures, in order to speed up the execution of the second function.
La quatrième étape décrite ci-dessus peut être exécutée de manière répétée à chaque appel d'une nouvelle fonction, afin d'adapter la configuration des contre- mesures à la fonction suivante à exécuter. The fourth step described above can be executed repeatedly each time a new function is called, in order to adapt the configuration of the countermeasures to the next function to be executed.
Le système électronique peut en même temps effectuer d'une part les trois premières étapes S1 à S3, afin de détecter en continu de nouvelles attaques et d'adapter les configurations de contre-mesures de sécurité mémorisées dans les registres matériels de sécurité ; et d'autre part, effectuer la quatrième étape S4 à chaque changement de fonction, afin d'adapter les contre-mesures appliquées à la fonction en cours d'exécution. The electronic system can at the same time carry out on the one hand the first three steps S1 to S3, in order to continuously detect new attacks and to adapt the configurations of security countermeasures stored in the hardware security registers; and on the other hand, performing the fourth step S4 at each change of function, in order to adapt the countermeasures applied to the function being executed.
Afin de mémoriser le contenu des registres matériels de sécurité break, _sec lorsque le système électronique est mis hors tension et de le restaurer au démarrage, le système électronique peut comprendre une mémoire de sauvegarde 105, telle qu'une NVM ou une mémoire morte programmable et après détection d'une attaque lors de l'exécution d'une première fonction, l'adresse de début de ladite première fonction et ladite configuration de contre-mesure de sécurité sélectionnée, mémorisée dans ledit registre matériel de sécurité, sont copiées dudit registre matériel de sécurité à ladite mémoire de sauvegarde. Au démarrage du système électronique, les adresses de départ et les configurations de contre-mesures de sécurité associées, mémorisées dans ladite mémoire de sauvegarde, sont copiées de ladite mémoire de sauvegarde auxdits registres matériels de sécurité. In order to memorize the contents of the break, _sec hardware safety registers when the electronic system is switched off and to restore it at start-up, the electronic system may include a backup memory 105, such as an NVM or a programmable read only memory and after detection of an attack during the execution of a first function, the start address of said first function and said selected security countermeasure configuration, stored in said hardware security register, are copied from said hardware security register to said backup memory. When the electronic system starts up, the starting addresses and the associated security countermeasures configurations, stored in said backup memory, are copied from said backup memory to said security hardware registers.
Afin de garder facilement une trace de l'état courant du système électronique, celui-ci peut comprendre un registre matériel d'état sécurisé de processeur psr_sec, configuré pour mémoriser l'adresse de début de la fonction en cours d'exécution et la configuration courante de contre-mesure de sécurité appliquée. Dans un tel cas, afin de maintenir ce registre à jour, une adresse de début de la première fonction et la configuration courante de contre-mesure de sécurité peuvent être mémorisées, au début de l'exécution d'une première fonction, dans le registre matériel d'état sécurisé de processeur psr_sec. In order to easily keep track of the current state of the electronic system, the electronic system may include a psr_sec processor secure state hardware register, configured to store the start address of the running function and the configuration. current security countermeasure applied. In such a case, in order to keep this register up to date, a start address of the first function and the current configuration of the security countermeasure can be stored, at the start of the execution of a first function, in the register. psr_sec processor secure state hardware.
Puis, lors la quatrième étape S4, lorsque l'exécution du code passe d'une première fonction à une seconde fonction, le contenu du registre matériel d'état sécurisé de processeur psr_sec relatif à la première fonction peut être sauvegardé, par exemple en RAM ou dans des registres matériels dédiés, et le registre matériel d'état sécurisé de processeur psr_sec peut être mis à jour avec l'adresse de début de la seconde fonction. Lors de cette quatrième étape S4, le fait de déterminer si l'un des registres matériels de sécurité break, _sec mémorise adresse de début de la seconde fonction peut comprendre la comparaison de l’adresse de début de la seconde fonction mémorisée dans le registre matériel d'état sécurisé de processeur psr_sec aux adresses de début de fonction mémorisées dans les registres matériels de sécurité break, _sec. Cette étape de comparaison peut être réalisée par un circuit matériel dédié, par exemple par des comparateurs matériels entre chaque registres matériels de sécurité break, _sec et le registre matériel d'état sécurisé de processeur psr_sec. Lorsque l'un des registres matériels de sécurité mémorise l’adresse de début de la seconde fonction, l'application d'une configuration de contre-mesure de sécurité associée à l’adresse de début de la seconde fonction avant l'exécution de ladite seconde fonction peut alors comprendre l'activation des contre-mesures de sécurité, requises dans la configuration de contre-mesure de sécurité associée à l’adresse de début de la seconde fonction et désactivées dans la configuration courante de contre- mesure de sécurité, appliquée lors de l'exécution de la première fonction. Then, during the fourth step S4, when the execution of the code passes from a first function to a second function, the content of the processor secure state hardware register psr_sec relating to the first function can be saved, for example in RAM or in dedicated hardware registers, and the psr_sec processor secure state hardware register may be updated with the start address of the second function. During this fourth step S4, the fact of determining whether one of the break hardware security registers, _sec stores the start address of the second function can comprise the comparison of the start address of the second function stored in the hardware register. psr_sec processor secure state at the start of function addresses stored in the break, _sec hardware safety registers. This comparison step can be carried out by a dedicated hardware circuit, for example by hardware comparators between each hardware security register break, _sec and the hardware secure state processor register psr_sec. When one of the hardware security registers stores the start address of the second function, the application of a security countermeasure configuration associated with the start address of the second function before the execution of said function. second function can then include the activation of the security countermeasures, required in the security countermeasure configuration associated with the start address of the second function and disabled in the current security countermeasure configuration, applied when performing the first function.
En fin d'exécution de la seconde fonction, l'exécution revient à la première fonction tandis que l'état précédent du registre matériel d'état sécurisé de processeur psr_sec, sauvegardé lors du passage de l'exécution à la seconde fonction, peut être rechargé, par exemple à partir de la RAM ou de registres matériels dédiés. Cette étape peut être réalisée par un circuit matériel dédié. At the end of the execution of the second function, the execution returns to the first function while the previous state of the processor secure state hardware register psr_sec, saved when passing from the execution to the second function, can be reloaded, for example from RAM or dedicated hardware registers. This step can be performed by a dedicated hardware circuit.
Un exemple de configuration du système électronique est représenté à la figure 3, qui montre les opérations effectuées lors de la détection d'une attaque lors de l'exécution d'une fonction B appelée par une fonction A. La fonction A est exécutée d'abord. À ce moment, le registre matériel d'état sécurisé de processeur psr_sec mémorise l'adresse de début de la fonction A 0x200 et une configuration de contre- mesure de sécurité 0x0, indiquant qu'aucune contre-mesure n'est requise. Ensuite, la fonction B est appelée. Le registre matériel d'état de sécurité de processeur psr_sec est mis à jour avec l'adresse de début de la fonction B 0x2000. La détection d'une attaque déclenche une alarme de sécurité qui conduit à écrire l'adresse de départ de la fonction B 0x2000 dans l'un des registres matériels de sécurité breakr_sec. Le système électronique détermine que trois contre-mesures sont nécessaires pour empêcher cette attaque et associe donc, à l'adresse de départ de la fonction B 0x2000, une configuration de contre-mesure de sécurité 0x3 nécessitant l'activation de ces trois contre-mesures. Le contenu du registre matériel de sécurité breakr_sec peut être copié dans la mémoire de sauvegarde, afin de pouvoir le restaurer au redémarrage. An example of the configuration of the electronic system is represented in FIG. 3, which shows the operations carried out during the detection of an attack during the execution of a function B called by a function A. Function A is executed from on board. At this time, the processor secure state hardware register psr_sec stores the A function start address 0x200 and a safety countermeasure configuration 0x0, indicating that no countermeasure is required. Then function B is called. The psr_sec processor safety status hardware register is updated with the start address of function B 0x2000. The detection of an attack triggers a security alarm which leads to writing the starting address of function B 0x2000 in one of the breakr_sec hardware security registers. The electronic system determines that three countermeasures are necessary to prevent this attack and therefore associates, with the starting address of function B 0x2000, a configuration of security countermeasure 0x3 requiring the activation of these three countermeasures . The contents of the breakr_sec security hardware registry can be copied to backup memory, so that it can be restored on restart.
Suite à cette configuration, un exemple d'exécution sécurisée d'un code selon l'invention est donné sur les figures 4 et 5. Cet exemple montre un état initial du système électronique, dans lequel une première fonction A est exécutée et appelle une seconde fonction B. On suppose que trois registres matériels de sécurité, breakr_sec, break2_sec et break/v_sec, mémorisent les adresses de début de fonctions B (0x2000), D (0x4000) et F (0x6000) et les configurations de contre- mesures de sécurité associées - qui ne sont pas représentées à la figure 4 - mais l'adresse de début de la fonction A 0x200 n'est mémorisée dans aucun des registres matériels de sécurité. En conséquence, la fonction A est exécutée sans l'activation d'aucune contre-mesure. Lors de l'exécution de la fonction A, le registre matériel d'état sécurisé de processeur psr_sec mémorise l'adresse de départ (A@ ou 0x200) de la fonction A et la configuration de contre-mesure de sécurité 0x0, indiquant qu'aucune contre-mesure n'est requise dans cette configuration. La fonction B est ensuite appelée. L'adresse de début B@ 0x2000 de la fonction B est copiée dans le registre matériel d'état sécurisé de processeur psr_sec et cette adresse de début est recherchée dans les registres matériels de sécurité. Le registre matériel de sécurité breakr_sec mémorise l'adresse de début B@ 0x2000 associée à la configuration de contre-mesure de sécurité 0x3 nécessitant l'activation de trois contre-mesures. Comme cette configuration de contre-mesure de sécurité 0x3 diffère de la précédente 0x0 appliquée à l'exécution de la fonction A, les trois contre-mesures, requises dans la configuration de contre-mesure de sécurité 0x3 et maintenues inactivées pendant l'exécution de la fonction A, sont activées par un appel à la fonction d'activation à l'adresse 0x1100. Après le démarrage de l'exécution de la fonction B, le registre matériel d'état sécurisé de processeur psr_sec mémorise alors l'adresse de début de la fonction B@ 0x2000 et la configuration de contre-mesure de sécurité associée 0x3. Following this configuration, an example of secure execution of a code according to the invention is given in FIGS. 4 and 5. This example shows an initial state of the electronic system, in which a first function A is executed and calls a second function B. It is assumed that three hardware safety registers, breakr_sec, break2_sec and break / v_sec, store the start addresses of functions B (0x2000), D (0x4000) and F (0x6000) and the countermeasure configurations associated safety systems - which are not shown in FIG. 4 - but the start address of function A 0x200 is not stored in any of the hardware safety registers. As a result, function A is executed without the activation of any countermeasures. When executing function A, the processor secure state hardware register psr_sec stores the starting address (A @ or 0x200) of function A and the safety countermeasure configuration 0x0, indicating that no countermeasures are required in this configuration. Function B is then called. Function B's start address B @ 0x2000 is copied to the processor secure state hardware register psr_sec and this starting address is looked up in the safety hardware registers. The breakr_sec safety hardware register stores the start address B @ 0x2000 associated with the safety countermeasure configuration 0x3 requiring the activation of three countermeasures. As this configuration of security countermeasure 0x3 differs from the previous 0x0 applied to the execution of function A, the three countermeasures, required in the configuration of security countermeasure 0x3 and kept inactive during the execution of function A, are activated by a call to the activation function at address 0x1100. After the execution of function B has started, the processor secure state hardware register psr_sec then stores the start address of function B @ 0x2000 and the associated safety countermeasure configuration 0x3.
Les figures 4 et 5 montrent également ce qui se passe lorsque l'exécution de la fonction B est terminée et que l'exécution de la fonction A reprend. À ce moment, le registre matériel d'état sécurisé de processeur psr_sec mémorise toujours l'adresse de début de la fonction B@ 0x2000 et la configuration de contre-mesure de sécurité associée 0x3. L'adresse de début de fonction A 0x200 est introuvable dans les registres matériels de sécurité. On applique donc la configuration prédéfinie de sécurité 0x0, qui désactive les trois contre-mesures activées lors de l'exécution de la fonction B, par un appel à la fonction de désactivation à l'adresse 0x1100. Après le démarrage de l'exécution de la fonction B, le registre matériel d'état de sécurité de processeur psr_sec mémorise à nouveau l'adresse de début de la fonction A@ 0x200 et la configuration de contre-mesure de sécurité associée 0x0. Figures 4 and 5 also show what happens when the execution of function B is completed and the execution of function A resumes. At this time, the processor secure state hardware register psr_sec still stores the start address of the B function @ 0x2000 and the associated safety countermeasure configuration 0x3. The start of function address A 0x200 could not be found in the hardware safety registers. The predefined safety configuration 0x0 is therefore applied, which deactivates the three countermeasures activated during the execution of function B, by a call to the deactivation function at address 0x1100. After starting the execution of function B, the hardware safety status register of psr_sec processor again memorizes the start address of function A @ 0x200 and the associated safety countermeasure configuration 0x0.
Selon un troisième aspect, l'invention concerne un produit programme d'ordinateur directement chargeable dans la mémoire d'au moins un ordinateur, comprenant des instructions de code logiciel permettant d'exécuter, lorsque ledit produit est exécuté sur l'ordinateur, les étapes des procédés décrits précédemment. According to a third aspect, the invention relates to a computer program product directly loadable into the memory of at least one computer, comprising software code instructions making it possible to execute, when said product is executed on the computer, the steps of the methods described above.
En plus de ces caractéristiques, le procédé et le programme d'ordinateur selon les deuxième et troisième aspects de l'invention peuvent être configurés pour exécuter ou peuvent comprendre toute autre caractéristique décrite précédemment. In addition to these characteristics, the method and the computer program according to the second and third aspects of the invention can be configured to execute or can include any other characteristic described above.
Le système électronique et le procédé présentés ici permettent donc de déclencher efficacement l'exécution de contre-mesures supplémentaires sur des parties spécifiques du code à protéger, quasiment sans aucune empreinte sur ce code et avec un impact limité sur le temps d'exécution, puisqu'aucune contre-mesure n'est activée pendant le l'exécution de fonctions pour lesquelles aucune protection n'est nécessaire. The electronic system and the method presented here therefore make it possible to effectively trigger the execution of additional countermeasures on specific parts of the code to be protected, almost without any imprint on this code and with a limited impact on the execution time, since 'no countermeasures are activated while performing functions for which no protection is required.

Claims

REVENDICATIONS
1. Procédé de configuration d'un système électronique (1 ) destiné à l'exécution sécurisée d'un code comprenant une pluralité de fonctions, ledit système électronique étant configuré pour appliquer, pendant l'exécution d'une fonction, une configuration de contre-mesure de sécurité parmi une pluralité de configurations de contre-mesure de sécurité, ledit procédé étant exécuté par ledit système électronique comprenant : un processeur matériel (101 ), des registres matériels de sécurité (104) configurés pour mémoriser des adresses de début de fonctions parmi ladite pluralité de fonctions et des configurations de contre-mesures de sécurité associées à appliquer pendant une exécution desdites fonctions, un système de détection (103) configuré pour détecter une attaque sur ledit système électronique lors d'une exécution d'une fonction parmi ladite pluralité de fonctions, et comprenant : 1. Method for configuring an electronic system (1) intended for the secure execution of a code comprising a plurality of functions, said electronic system being configured to apply, during the execution of a function, a counter configuration. - security measurement among a plurality of security countermeasure configurations, said method being executed by said electronic system comprising: a hardware processor (101), hardware security registers (104) configured to store start addresses of functions of said plurality of functions and associated security countermeasure configurations to be applied during execution of said functions, a detection system (103) configured to detect an attack on said electronic system during execution of one of said functions. plurality of functions, and comprising:
- la détection (S1 ), par ledit système de détection, d'une attaque sur ledit système électronique lors de l'exécution d'une première fonction, - the detection (S1), by said detection system, of an attack on said electronic system during the execution of a first function,
- la sélection (S2), en fonction de ladite attaque détectée, d'une configuration de contre-mesure de sécurité à appliquer lors d'une exécution de ladite première fonction, - the selection (S2), as a function of said detected attack, of a security countermeasure configuration to be applied during an execution of said first function,
- la mémorisation (S3), dans un registre matériel de sécurité, d’une adresse de début de ladite première fonction et de ladite configuration de contre-mesure de sécurité sélectionnée à appliquer pendant une exécution de ladite première fonction. - storing (S3), in a hardware security register, a start address of said first function and said selected security countermeasure configuration to be applied during an execution of said first function.
2. Procédé selon la revendication 1 , dans lequel, ledit système électronique comprenant en outre une mémoire de sauvegarde (105), l'adresse de début de ladite première fonction et ladite configuration de contre-mesure de sécurité sélectionnée mémorisée dans ledit registre matériel de sécurité sont copiées dudit registre matériel de sécurité à ladite mémoire de sauvegarde, après ladite détection d'une attaque, et, au démarrage du système électronique, les adresses de départ et les configurations de contre-mesures de sécurité associées mémorisées dans ladite mémoire de sauvegarde sont copiées de ladite mémoire de sauvegarde auxdits registres matériels de sécurité. The method of claim 1, wherein, said electronic system further comprising a backup memory (105), the start address of said first function and said selected security countermeasure configuration stored in said hardware register. security are copied from said security hardware register to said backup memory, after said detection of an attack, and, on startup of the electronic system, the starting addresses and associated security countermeasure configurations stored in said backup memory are copied from said backup memory to said security hardware registers.
3. Procédé d'exécution d'un code comprenant une pluralité de fonctions par un système électronique (1 ) configuré pour exécuter de manière sécurisée ledit code selon le procédé de l'une quelconque des revendications 1 à 2 et pour appliquer, pendant une exécution d'une fonction, une configuration de contre-mesure de sécurité parmi une pluralité de configurations de contre-mesures de sécurité et comprenant un processeur matériel (101 ) et des registres matériels de sécurité (104) mémorisant, pour au moins une fonction parmi ladite pluralité de fonctions, une adresse de début de fonction et une configuration de contre-mesure de sécurité associée à appliquer pendant une exécution de ladite au moins une fonction, ledit procédé étant exécuté par ledit système électronique et comprenant, lorsque l'exécution de code passe d'une première fonction à une seconde fonction : 3. A method of executing a code comprising a plurality of functions by an electronic system (1) configured to securely execute said code according to the method of any one of claims 1 to 2 and to apply, during an execution. of a function, a security countermeasure configuration among a plurality of security countermeasure configurations and comprising a hardware processor (101) and hardware security registers (104) storing, for at least one of said function plurality of functions, a function start address and an associated security countermeasure configuration to be applied during an execution of said at least one function, said method being executed by said electronic system and comprising, when the code execution passes from a first function to a second function:
- le fait de déterminer (S4) si l'un des registres matériels de sécurité mémorise l’adresse de début de la seconde fonction, - determining (S4) whether one of the hardware security registers stores the start address of the second function,
- lorsque l'un des registres matériels de sécurité mémorise l’adresse de début de la seconde fonction et une configuration de contre-mesure de sécurité associée, l'application (S41 ) de ladite configuration de contre-mesure de sécurité mémorisée avant d'exécuter ladite seconde fonction, - when one of the hardware security registers stores the start address of the second function and an associated security countermeasure configuration, the application (S41) of said memorized security countermeasure configuration before perform said second function,
- lorsqu'aucun registre matériel de sécurité ne mémorise l’adresse de début de la seconde fonction, l'application (S42) d'une configuration prédéfinie de contre- mesure de sécurité avant d'exécuter ladite seconde fonction. - When no hardware security register stores the start address of the second function, the application (S42) of a predefined security countermeasure configuration before executing said second function.
4. Procédé selon la revendication 3, dans lequel l'application de ladite configuration prédéfinie de contre-mesures de sécurité comprend la désactivation de toutes les contre-mesures activées. The method of claim 3, wherein applying said predefined configuration of security countermeasures comprises disabling all activated countermeasures.
5. Procédé selon la revendication 3, dans lequel ledit système électronique comprend un registre matériel d'état sécurisé de processeur (psr_sec) mémorisant une adresse de début d'une fonction en cours d'exécution et une configuration courante de contre- mesure de sécurité, et dans lequel : 5. The method of claim 3, wherein said electronic system comprises a processor secure state hardware register (psr_sec) storing a start address of a running function and a current security countermeasure configuration. , and in which:
- le fait de déterminer si l'un des registres matériels de sécurité mémorise une adresse de début de la seconde fonction comprend la comparaison de l’adresse de début de la seconde fonction mémorisée dans ledit registre matériel d'état sécurisé de processeur (psr_sec) aux adresses de début de fonction mémorisées dans les registres matériels de sécurité (break(i)_sec), - determining whether one of the security hardware registers stores a start address of the second function comprises comparing the start address of the second function stored in said hardware status register secure processor (psr_sec) at the start of function addresses stored in the hardware safety registers (break (i) _sec),
- l'application d'une configuration de contre-mesure de sécurité associée à l’adresse de début de la seconde fonction avant d'exécuter ladite seconde fonction comprend l'activation des contre-mesures de sécurité requises dans la configuration de contre-mesure de sécurité, associée à l’adresse de début de la seconde fonction et inactivée dans la configuration courante de contre- mesure de sécurité. - applying a security countermeasure configuration associated with the start address of the second function before executing said second function includes activating the required security countermeasures in the countermeasure configuration security, associated with the start address of the second function and inactivated in the current security countermeasure configuration.
6. Procédé selon la revendication 5, comprenant : lorsque l'exécution de code passe d'une première fonction à une seconde fonction, la sauvegarde du contenu du registre matériel d'état sécurisé de processeur (psr_sec) mémorisant l'adresse de début de la première fonction en cours d'exécution et la mise à jour du registre matériel d'état sécurisé de processeur (psr_sec) avec l'adresse de début de la seconde fonction, et à la fin de l'exécution de la seconde fonction et lorsque l'exécution revient à la première fonction, le rechargement du contenu sauvegardé. The method of claim 5, comprising: when the code execution passes from a first function to a second function, saving the contents of the processor secure state hardware register (psr_sec) storing the start address of the processor. the first function running and updating the processor secure state hardware register (psr_sec) with the start address of the second function, and at the end of the execution of the second function and when execution returns to the first function, reloading the saved content.
7. Procédé selon la revendication 5 ou 6, dans lequel l'étape consistant à déterminer si l’un des registres matériels de sécurité mémorisent une adresse de début de la seconde fonction et/ou l'étape de sauvegarde du contenu et de rechargement du contenu sauvegardé est/sont effectuée(s) par un circuit matériel dédié. 7. The method of claim 5 or 6, wherein the step of determining whether one of the hardware security registers store a start address of the second function and / or the step of saving the content and reloading the. Saved content is / are performed by a dedicated hardware circuit.
8. Produit programme d’ordinateur directement chargeable dans la mémoire d’au moins un ordinateur, comprenant des instructions de code logiciel permettant d'exécuter les étapes du procédé selon l'une quelconque des revendications 1 à 7 lorsque ledit produit est exécuté sur l’ordinateur. 8. Computer program product directly loadable into the memory of at least one computer, comprising software code instructions making it possible to execute the steps of the method according to any one of claims 1 to 7 when said product is executed on the computer. 'computer.
9. Système électronique comprenant un processeur matériel, des registres matériels de sécurité et un système de détection, configurés pour exécuter les étapes selon l'une quelconque des revendications 1 à 7. 9. An electronic system comprising a hardware processor, hardware security registers and a detection system, configured to perform the steps according to any one of claims 1 to 7.
EP20848856.9A 2019-12-18 2020-12-18 Electronic system and methods for dynamic activation of countermeasures Pending EP4078418A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
EP19306680.0A EP3839779A1 (en) 2019-12-18 2019-12-18 Electronic system and methods for a dynamic activation of countermeasures
PCT/FR2020/052559 WO2021123684A1 (en) 2019-12-18 2020-12-18 Electronic system and methods for dynamic activation of countermeasures

Publications (1)

Publication Number Publication Date
EP4078418A1 true EP4078418A1 (en) 2022-10-26

Family

ID=74494940

Family Applications (2)

Application Number Title Priority Date Filing Date
EP19306680.0A Withdrawn EP3839779A1 (en) 2019-12-18 2019-12-18 Electronic system and methods for a dynamic activation of countermeasures
EP20848856.9A Pending EP4078418A1 (en) 2019-12-18 2020-12-18 Electronic system and methods for dynamic activation of countermeasures

Family Applications Before (1)

Application Number Title Priority Date Filing Date
EP19306680.0A Withdrawn EP3839779A1 (en) 2019-12-18 2019-12-18 Electronic system and methods for a dynamic activation of countermeasures

Country Status (3)

Country Link
US (1) US20230080096A1 (en)
EP (2) EP3839779A1 (en)
WO (1) WO2021123684A1 (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3376423A1 (en) * 2017-03-14 2018-09-19 Gemalto Sa Self-adaptive countermeasures
US10459477B2 (en) * 2017-04-19 2019-10-29 Seagate Technology Llc Computing system with power variation attack countermeasures
US10990682B2 (en) * 2017-12-18 2021-04-27 Nuvoton Technology Corporation System and method for coping with fault injection attacks

Also Published As

Publication number Publication date
WO2021123684A1 (en) 2021-06-24
EP3839779A1 (en) 2021-06-23
US20230080096A1 (en) 2023-03-16

Similar Documents

Publication Publication Date Title
EP1605333B1 (en) Program execution control
EP1904946B1 (en) Detection of faults during a long perturbation
FR2989504A1 (en) REGISTER PROTECTED FROM FAULT INJECTION ATTACKS
EP2880588A1 (en) System for detecting a modification of a subprogram call stack
EP0919026A1 (en) Method for modifying code sequences and related device
WO2012085482A1 (en) Protection of applets against hidden-channel analyses
EP3441902B1 (en) Method for protecting an electronic device against fault-injection attacks
EP4078418A1 (en) Electronic system and methods for dynamic activation of countermeasures
EP1939745B1 (en) Method and device for securing the reading of a memory
EP3198540B1 (en) Method of auto-detection of attempted piracy of an electronic payment card, corresponding card, terminal and programme
KR20140082542A (en) Method and apparatus for supporting dynamic change of authentication means for secure booting
EP2860660A1 (en) System and method for securely loading data in a cache memory associated with a secure processor
WO2012080139A1 (en) Dynamic method of controlling the integrity of the execution of an excutable code
EP3032451B1 (en) Method for running a program by a processor and electronic entity comprising such a processor
EP4145704B1 (en) Secure starting of a processing unit
EP2630605B1 (en) Method for securing the execution of a computer code by means of dynamic redundancy
FR3072477A1 (en) SECURING CONDITIONAL CONNECTION INSTRUCTIONS COMPOSED IN AN INTERMEDIATE CODE COMPUTER PROGRAM
EP3239845A1 (en) Method for allocating memory space
EP2343663A1 (en) Method for multiform protection of an executable code
FR2897452A1 (en) Malicious software e.g. computer viruses, execution preventing method, involves implementing permutation over subset of instructions, storing permutation sequence number, and implementing instructions in execution module
EP2698739B1 (en) Method for dynamic management of codes associated with security countermeasures, corresponding computer program product and device
EP3179400B1 (en) Method for loading a computing resource into an electronic device, electronic module and corresponding computer program
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
FR2996659A1 (en) Method for executing program by microprocessor of electronic entity, involves verifying data value located in location stored at address structure passed as parameter, and applying countermeasure in negative result event during verification

Legal Events

Date Code Title Description
STAA Information on the status of an ep patent application or granted ep patent

Free format text: STATUS: UNKNOWN

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

Free format text: STATUS: THE INTERNATIONAL PUBLICATION HAS BEEN MADE

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: REQUEST FOR EXAMINATION WAS MADE

17P Request for examination filed

Effective date: 20220718

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

DAV Request for validation of the european patent (deleted)
DAX Request for extension of the european patent (deleted)
STAA Information on the status of an ep patent application or granted ep patent

Free format text: STATUS: EXAMINATION IS IN PROGRESS

17Q First examination report despatched

Effective date: 20240405