Non-volatile memory with access control circuit for secure startup of an electronic device
The non-volatile memory with an access control circuit segregates codes into immutable and mutable zones, using a volatile register to secure the startup phase against malicious code execution and ensure a safe transition to the application phase.
Patent Information
- Application Number
- FR2022005096
- Authority / Receiving Office
- FR · FR
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2022-05-27
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2042-05-27
AI Technical Summary
Existing solutions are ineffective in preventing attackers from introducing malicious codes during the startup sequence of electronic devices.
A non-volatile memory with an access control circuit that segregates codes into immutable and mutable zones, prohibiting execution of mutable codes during startup and access to immutable codes during application, triggered by a reference value stored in a volatile register.
Prevents execution of malicious codes during startup and ensures secure transition to application phase, thwarting attacks that modify the execution sequence.
Smart Images

Figure 00000013_0000 
Figure 00000013_0001 
Figure 00000013_0002
Abstract
Description
Title of the invention: Non-volatile memory with access control circuit for secure startup of an electronic device Technical field
[0001] The present description relates to the field of methods and devices for the security of electronic circuits, and in particular a device and a method for carrying out a secure start-up of such a circuit. Prior art
[0002] The startup of an electronic device is based on the execution of codes such as software and / or firmware codes. The startup sequence of a device is an important step and only authentic codes and / or software should be executed.
[0003] It is desirable to prevent an attacker of the device from introducing malicious codes and / or software into the device and executing them during the boot sequence. However, existing solutions are often ineffective in this regard. Summary of the invention
[0004] There is a need to improve the security of startup procedures and more particularly to improve protection against attacks aimed at executing malicious startup codes.
[0005] One embodiment overcomes all or part of the drawbacks of known treatment devices.
[0006] One embodiment provides a method of starting an electronic device comprising: - a first phase in which one or more first codes stored in a first immutable area of a non-volatile memory are executed, the non-volatile memory further comprising an access control circuit configured to prohibit the execution of any codes stored in a second area of the non-volatile memory during the first phase; and - a second phase in which one or more second codes stored in the second zone are executed, the access control circuit being configured to prohibit any access to the entire first zone during the second phase.
[0007] According to one embodiment, the first and second zones are defined by one or more addresses contained in a non-volatile register.
[0008] According to one embodiment, the transition from the first phase to the second phase is triggered by the storage of a reference value in a volatile register of the device.
[0009] According to one embodiment, the access control circuit is further configured to read the contents of the volatile register and to prohibit any access to the entire first zone on the basis of the reference value and to prohibit the execution of any codes stored in the second zone on the basis of a value different from the reference value.
[0010] According to one embodiment, the access control circuit is further configured to authorize reading and writing in the second area of the non-volatile memory during the first phase.
[0011] According to one embodiment, the storage of the reference value in the volatile register of the device is caused by the execution of a third code stored in the non-volatile memory.
[0012] According to one embodiment, the third code is stored in the first area of the non-volatile memory.
[0013] According to one embodiment, the third code is stored in a third area of the non-volatile memory.
[0014] According to one embodiment, the non-volatile memory access control circuit is configured to authorize access for reading and executing the codes contained in the third zone and to always prohibit access for writing in the third zone during the first and second phases.
[0015] According to one embodiment, the first codes stored in the first zone are start-up codes of the device.
[0016] According to one embodiment, the second codes stored in the second zone are application codes.
[0017] One embodiment provides a non-volatile memory of an electronic device comprising an access control circuit, the access control circuit being configured to: - during a first phase in which one or more first codes stored in a first area of the non-volatile memory are executed, prohibiting the execution of any codes stored in a second area of the non-volatile memory; and - during a second phase during which one or more second codes stored in the second zone are executed, prohibit all access to the entire first zone.
[0018] According to one embodiment, the above memory comprises a non-volatile register, the first and second zones being defined by one or more addresses contained in the non-volatile register.
[0019] One embodiment provides an electronic device comprising the above non-volatile memory, and a volatile register, wherein the transition from the first phase to the second phase is triggered by the storage of a reference value in the volatile register.
[0020] According to one embodiment, the access control circuit is further configured to read the contents of the volatile register and to prohibit any access to the entire first zone on the basis of the reference value and to prohibit the execution of any codes stored in the second zone on the basis of a value different from the reference value. Brief description of the drawings
[0021] These characteristics and advantages, as well as others, will be explained in detail in the following description of particular embodiments given without limitation in relation to the attached figures among which:
[0022] [Fig.l] represents, very schematically and in the form of blocks, an electronic device according to an embodiment of the present description;
[0023] [Fig.2] illustrates memory areas accessible during and after startup of the device of [Fig.l] according to an embodiment of the present description;
[0024] [Fig.3] illustrates memory areas accessible during and after startup of the device of [Fig.l] according to another embodiment of the present description; and
[0025] [Fig.4] is a flowchart representing operations of a secure startup method of an electronic device according to an exemplary embodiment of the present description. Description of the embodiments
[0026] The same elements have been designated by the same references in the different figures. In particular, the structural and / or functional elements common to the different embodiments may have the same references and may have identical structural, dimensional and material properties.
[0027] For the sake of clarity, only the steps and elements useful for understanding the described embodiments have been shown and are detailed. In particular, the design of processing devices is well known to those skilled in the art and certain elements have not been detailed in the description which follows.
[0028] Unless otherwise specified, when referring to two elements connected to each other, this means directly connected without intermediate elements other than conductors, and when referring to two elements connected (in English "coupled") to each other, this means that these two elements can be connected or be connected by means of one or more other elements.
[0029] In the following description, when referring to absolute position qualifiers, such as the terms "front", "back", "top", "bottom", "left", "right", etc., or relative position qualifiers, such as the terms "above", "below", "upper", "lower", etc., or to orientation qualifiers, such as the terms "horizontal", "vertical", etc., it is made reference unless otherwise specified to the orientation of the figures.
[0030] Unless otherwise specified, the expressions "about", "approximately", "substantially", and "of the order of" mean to within 10%, preferably to within 5%.
[0031] [Fig. 1] represents, very schematically and in the form of blocks, an electronic device 100 comprising a processing device 102 according to an embodiment of the present description.
[0032] The electronic device 100 is for example an electronic card such as a microcircuit card, hardware for computer use, a microprocessor circuit, etc.
[0033] The processing device 102 comprises, for example, a non-volatile memory 104 (NV MEM), for example a flash memory. The non-volatile memory 104 is connected via a bus 106 to a generic processor 108 (CPU) and to a volatile memory 110 (RAM). The generic processor 108 comprises an ordinal counter 114 (PC) containing, for example, the memory address of the instruction currently being executed by the generic processor 108 or the memory address of the next instruction to be executed. The contents of the counter are incremented during execution of the instruction and the instructions are executed sequentially by the generic processor 108, according to the value of the ordinal counter 114.
[0034] The processing device 102 further comprises a register 112 (REGISTER).
[0035] The non-volatile memory 104 comprises a first zone 116 (ZONE1) in in which several codes are stored, such as for example startup codes, and / or data, as well as a second zone 118 (ZONE2) in which several other codes are stored, such as for example application codes, and / or other data. The execution of the codes contained in zones 116 and 118 is coordinated by the ordinal counter 114. For example, the contents of zone 116 are immutable. In certain embodiments, the non-volatile memory 104 further comprises a non-volatile register 119 (NV REGISTER).
[0036] In the described embodiments, access to the areas 116 and 118 is conditioned by an access control circuit 120 (ACCESS CONTROL). The access control circuit 120 is configured to prohibit the execution of any codes stored in the second area 118 during a first phase, which is for example a start-up phase of the device 100. The start-up phase of the device 100 consists for example of the execution of one or more codes among the codes stored in the memory area 116. For example, during a request to the non-volatile memory 104, during the first phase, for access to a code for execution, the access control circuit 120 is configured to determine whether the address of the code is part of the second area 118, and if so, to prohibit access to this code. For example, the access control circuit 120 is configured to compare the address of the code to an address threshold defining a boundary between areas 116, 118. If the code address is lower than the threshold address, the code is in area 116 and execution is authorized by access control circuit 120. If the code address is higher than the threshold address, the code is in area 118 and execution of this code is denied by access control circuit 120. For example, the threshold address is a last address in area 116, and if the code address is equal to the threshold address, access is allowed. In another example, the threshold address is a first address in area 118, and if the code address is equal to the threshold address, access is denied.
[0037] In the embodiments described, the access control circuit 120 is further configured to prohibit access to the entire first zone 116 during a second phase, which is for example an application phase of the device 100. The application phase consists for example of the execution of one or more codes among the codes stored in the zone 118. For example, during a request, to the non-volatile memory 104 and during the second phase, for access to a code for execution, the access control circuit 120 is configured to determine whether the address of the code is part of the first zone 116, and if so, to prohibit access to this code. For example, the access control circuit 120 is configured to compare the address of the code to the same threshold address mentioned above. If the code address is lower than the threshold address, the code is in zone 116, and access is prohibited by access control circuit 120.If the code address is greater than the threshold address, the code is in area 118, and access is permitted by access control circuit 120. For example, the threshold address is a last address in area 116, and if the code address is equal to the threshold address, access to the code is prohibited. In another example, the threshold address is a first address in area 118, and if the code address is equal to the threshold address, access is permitted.
[0038] According to one embodiment, the authorization and / or prohibition of access to the zones 116 and 118 by the access control circuit 120 is conditioned by a value contained in the register 112. For example, the access control circuit 120 is coupled to the register 112 in order to read a value stored in this register. The register 112 is for example implemented in a volatile manner.
[0039] For example, when a reference value is stored in register 112, access control circuit 120 is configured to prohibit all access to area 116. For example, when register 112 is empty or contains a value different from the reference value, access control circuit 120 is configured to authorize the execution of codes stored in area 116 as well as writing and reading of area 118 and to prohibit the execution of all codes stored in area 118.
[0040] In some cases, the threshold address, used by the access control circuit 120 to distinguish addresses forming part of the first and second zones 116, 118, is a hard-coded value, and which is therefore not modifiable during the life of the device 100. In other examples, the threshold address is stored non-volatile in the non-volatile memory 104, but it is configurable. For example, the access control circuit 120 is further coupled to the non-volatile register 119 and the non-volatile register 119 contains for example a value making it possible to define the boundary between the zones 116 and 118.
[0041] [Fig.2] illustrates the memory areas accessible during the startup phase and during the application phase of the device 100.
[0042] The areas shown as empty in [Fig. 2] are the memory areas whose access for execution is authorized by the access control circuit 120 and the areas shown as full are the memory areas whose access for execution is prohibited by the access control circuit 120. In addition, arrows 200 illustrated in [Fig. 2] represent the progression of the contents of the ordinal counter 114. The progression of the value of the ordinal counter 114 illustrated in [Fig. 2] does not necessarily reflect the physical order of the memory addresses at which the codes are stored in the non-volatile memory 104. Indeed, two instructions executed one after the other according to the order of the ordinal counter 114 are not necessarily stored on two neighboring memory addresses of the non-volatile memory 104 although this case is illustrated in [Fig. 2] for the sake of clarity.
[0043] On the left of [Fig.2], the state of the non-volatile memory 104 is illustrated, and more particularly of the two memory zones 116 and 118 when the electronic device 100 is in the start-up phase.
[0044] During the start-up phase, no value, or a value different from the reference value, is stored by default in the register 112. The access control circuit 120 is then configured to authorize access to the area 116. More particularly, the access control circuit 120 authorizes access for reading and executing the data and / or codes stored in the area 116. For example, writing in the area 116 is prohibited by the access control circuit 120.
[0045] For example, the processor 108 controls, via the bus 106, the execution of a code stored in the zone 116. The memory address of the code is then transmitted to the access control circuit 120. Since the reference value is not stored in the register 112, the access control circuit 120 authorizes access for execution of the code of the zone 116.
[0046] For example, a write instruction in the zone 118, for example an instruction to write a new application code, is coordinated by the ordinal counter 114. According to one embodiment, the access control circuit 120 is configured to authorize writing and reading in and from the zone 118 when the reference value is not stored in the register 112. In other words, when the device 100 is in the startup phase. Writing of the new application code is then authorized by the access control circuit 120. However, the access control circuit 120 is configured to prohibit the execution of codes, and consequently of the new application code, stored in the area 118 when the reference value is not stored in the register 112.
[0047] It is of course possible, in another embodiment, to further prohibit the reading and / or writing of area 118 when register 112 is empty or contains a value different from the reference value. An advantage of allowing the reading of area 118 when register 112 is empty or contains a value different from the reference value is that this allows the code in area 116 to read and authenticate the code stored in area 118 when executing the code in area 116.
[0048] The storage of the reference value in the register 112, and consequently the transition from the start-up phase to the application phase, is for example carried out during the execution of a storage instruction stored in the zone 116. For example, the storage instruction corresponds to a last instruction of the start-up code and is executed when the ordinal counter 114 is incremented to a last value relating to the start-up phase. The last instruction of the start-up code is located for example at the very end of the zone 116.
[0049] In another example, in the case where the boundary between areas 116, 118 is defined by a value in register 119, there is no store instruction in the code, and instead, the storage of the reference value in register 112 is triggered, for example by control circuit 120, upon access to a last address of area 116 defined by the value contained in register 119. For example, the threshold address stored in register 119 is a last address of area 116, and if the address of the code at which execution is requested is equal to the threshold address, access control circuit 120 is configured to store the reference value in register 112.
[0050] On the right of [Fig.2] is illustrated the state of the non-volatile memory 104, and in particular of the zones 116 and 118, during the application phase of the device 100. The reference value being stored in the register 112, the access control circuit 120 is configured to prohibit any access to the whole of the zone 116 and to authorize access for reading, writing and execution to the zone 118.
[0051] It is of course possible, in another embodiment, to only authorize access for execution to zone 118 during the application phase.
[0052] [Fig.3] is similar to [Fig.2], but illustrates the memory areas accessible during the startup phase and during the application phase of the device 100 according to another embodiment.
[0053] In the embodiment illustrated in [Fig.3], the non-volatile memory 104 further comprises a gateway area 300 in which the instruction for storing the reference value in the register 112 is stored. The access control circuit 120 is then configured to always, i.e. regardless of the value contained in the register 112, authorize access for reading and executing the gateway area 300 and to always prohibit access for writing. The implementation of the gateway area 300 makes it possible to prevent the processor 108 from being blocked when the register 112 is updated, for example when the reference value is stored in the register 112.
[0054] For example, register 119 contains addresses forming the address range implementing the gateway zone. For example, register 119 contains a first threshold address defining the boundary between zone 116 and gateway zone 300 and a second threshold address defining the boundary between gateway zone 300 and zone 118. Register 119 then makes it possible to adjust the size of each zone 116, 118 and of gateway zone 130.
[0055] [Fig.4] is a flowchart representing operations of a secure startup method of the electronic device 100 according to an exemplary embodiment of the present description.
[0056] In a step 401 (RESET), the device 401 is turned on for the first time or is reset and the device 100 enters the start-up phase. The ordinal counter 114 is initialized to an initial value, for example zero. By default, no value, or a value different from the reference value, is stored in the register 112. For example, the reference value is predetermined during the manufacture of the device 100 and is stored in the non-volatile memory 104 or in another non-volatile memory of the device 100. The access control circuit 120 is then configured to authorize the reading as well as the execution of the codes stored in the area 116 of the non-volatile memory 104 and to prohibit the execution of any codes stored in the area 118.
[0057] When the non-volatile memory 104 further comprises the gateway zone 300, the access control circuit 120 is configured to authorize, upon completion of step 401, the reading and execution of data and / or codes stored in the zone 300. For example, in the case where the gateway zone 300 is defined by values stored in the register 119, the access control circuit 120 is configured to always authorize the reading and execution of data and / or codes stored between the two threshold addresses contained in the register 119.
[0058] In a step 402 (BOOT STAGE), the generic processor 108 executes, sequentially and according to the increments of the ordinal counter 114, the startup codes stored in the zone 116. For example, if an attacker manages to modify the value of the ordinal counter 114 to a value corresponding to the address memory of an instruction stored in the memory area 118, the access control circuit 120 will not give access to the memory area 118 for the execution of this code.
[0059] Step 402 ends, for example, when a last instruction of the area 116 is executed. In some cases, this last instruction is the storage instruction. In one example, the storage instruction is located at the end of the area 116 so that after the storage execution, the value of the ordinal counter 114 corresponds to an instruction of the area 118. In another example, the storage instruction is located in the gateway area 300, and in this case, the access control circuit 120 allows access for reading and execution to the area 116 until the execution of the storage instruction.In another example, there is no store instruction, and the access control circuit 120 is configured to store the reference value in the register 112 upon a request for access to the last address in the area 116, or to an address in the gateway area 300, defined by one or more values contained in the register 119.
[0060] In a step 403 (EXECUTION OF SWITCH CODE), subsequent to step 402, the reference value is stored in the register 112. The storage of the reference value is either caused by execution by the processor 108 of the storage instruction, or caused by a request for access to the last address of the zone 116, or of an address in the gateway zone 300. Following the reading of the reference value in the register 112, the access control circuit 120 is configured to prohibit any access to the whole of the zone 116 and to authorize the execution of the codes contained in the zone 118.
[0061] For example, when the memory further comprises the gateway zone 300, the access control circuit 120 is configured to authorize the reading and execution of this zone even when the reference value is stored in the register 112. In addition, the gateway zone 300 is for example immutable regardless of the phase of the device 100. In other words, whether or not the reference value is stored in the register 112, the access control circuit 120 is configured to prohibit writing in the gateway zone 300.
[0062] In a step 404 (APP STAGE), subsequent to step 403, the device 100 enters the application phase and the codes, for example application codes, stored in the zone 118 are executed by the processor. For example, if following an error or an attack, the value of the ordinal counter 114 is modified in order to coordinate the execution of a startup code stored in the zone 116, the access control circuit 120 will prohibit this operation.
[0063] Although [Fig. 4] illustrates an example in which area 116 contains startup codes and in which area 118 contains application codes, the embodiments of the present description can be implemented when both areas 116 and 118 contain start codes, for example in order to separate the start sequence of the device 100 into two phases. It would also be possible for there to be one or more other zones, in addition to the two zones 116, 118, for which access is controlled by the access control circuit 120. For example, one or more other zones contain start codes and / or application codes.
[0064] An advantage of the embodiments described is that they prevent the execution of codes that may be malicious during the startup phase of the device 100. Thus, any glitch-type attack consisting of the modification of the ordinal counter 114 in order to coordinate the execution of a code previously stored in the zone 118 during the startup phase is thwarted by the access control circuit 120.
[0065] Various embodiments and variations have been described. Those skilled in the art will understand that certain features of these various embodiments and variations could be combined, and other variations will occur to those skilled in the art.
[0066] Finally, the practical implementation of the embodiments and variants described is within the reach of the person skilled in the art from the functional indications given above. In particular, as regards the location of the register 112, it could be an integral part of the non-volatile memory 104.
Claims
Claims
1. A method for starting an electronic device (100) comprising: - a first phase in which one or more first codes stored in a first immutable area (116) of a non-volatile memory (104) are executed, the non-volatile memory further comprising an access control circuit (120) configured to prohibit the execution of any codes stored in a second area (118) of the non-volatile memory during the first phase; and - a second phase in which one or more second codes stored in the second area are executed, the access control circuit being configured to prohibit any access to the entire first area during the second phase, the first and second areas being defined by one or more addresses contained in a non-volatile register (119).
2. The method of claim 1, wherein the transition from the first phase to the second phase is triggered by storing a reference value in a volatile register (112) of the device (100).
3. The method of claim 2, wherein the access control circuit (120) is further configured to read the contents of the volatile register (112) and to prohibit any access to the entire first area (116) based on the reference value and to prohibit the execution of any codes stored in the second area (118) based on a value different from the reference value.
4. A method according to any one of claims 1 to 3, wherein the access control circuit (120) is further configured to authorize reading and writing in the second area (118) of the non-volatile memory (104) during the first phase.
5. A method according to any one of claims 2 to 4, wherein the storage of the reference value in the volatile register (112) of the device (100) is caused by the execution of a third code stored in the non-volatile memory (104).
6. The method of claim 5, wherein the third code is stored in the first area (116) of the non-volatile memory (104).
7. The method of claim 5, wherein the third code is stored in a third area (300) of the non-volatile memory (104).
8. The method of claim 7, wherein the access control circuit (120) to the non-volatile memory (104) is configured to to allow access for reading and executing the codes contained in the third zone (300) and to always prohibit access for writing in the third zone during the first and second phases.
9. A method according to any one of claims 1 to 8, wherein the first codes stored in the first area (116) are startup codes of the device (100).
10. A method according to any one of claims 1 to 9, wherein the second codes stored in the second area (118) are application codes.
11. A non-volatile memory (104) of an electronic device (100) comprising an access control circuit (120), the access control circuit being configured to: - during a first phase in which one or more first codes stored in a first area (116) of the non-volatile memory are executed, prohibit the execution of any codes stored in a second area (118) of the non-volatile memory; and - during a second phase during which one or more second codes stored in the second area are executed, prohibit all access to the entire first area, the first and second areas of the non-volatile memory being defined by one or more addresses contained in a non-volatile register.
12. The non-volatile memory of claim 11, comprising a non-volatile register (119), the first and second areas (116, 118) being defined by one or more addresses contained in the non-volatile register (119).
13. An electronic device (100) comprising the non-volatile memory of claim 11 or 12, and a volatile register (112), wherein the transition from the first phase to the second phase is triggered by the storage of a reference value in the volatile register (112).
14. The device of claim 13, wherein the access control circuit (120) is further configured to read the contents of the volatile register (112) and to prohibit any access to the entire first area (116) based on the reference value and to prohibit the execution of any codes stored in the second area (118) based on a value different from the reference value.
