Control flow integrity measurement for validating control flow in a computing system - Patents.com
Control flow integrity measurements using a fault detection manager validate and enhance the resilience of computing systems against fault injection attacks by maintaining and comparing control flow measurements, ensuring system security.
Patent Information
- Application Number
- JP2024529608
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2021-11-19
- Filing Date
- 2022-03-25
- Publication Date
- 2024-10-31
- Estimated Expiration
- 2042-03-25
AI Technical Summary
Computing systems are vulnerable to fault injection attacks that can bypass security features and alter control flow, compromising system integrity and security.
Implementing control flow integrity measurements through a fault detection manager that maintains and compares control flow measurements during scope execution, using mathematical operations to validate the integrity of branch instructions and detect potential tampering.
Enhances the resilience of computing systems against fault injection attacks by ensuring the integrity of control flow, preventing unauthorized changes and maintaining system security.
Smart Images

Figure 2024540543000001_ABST
Abstract
Description
[Background technology]
[0001] The increasing computerization of society has increased the exposure of the world to a variety of potentially damaging cyber attacks. These cyber attacks can vary in severity and may not only affect the user's information security (e.g., digital currency transactions) but may also threaten the user's physical safety (e.g., autonomous driving). To thwart such cyber attacks, numerous security measures have been implemented in computing devices to prevent unauthorized access to and manipulation of the device's data and communications. While these security measures have already proven to withstand thorough cyber attacks, these computing devices are continuously tested against state-of-the-art techniques that simulate potential cyber attacks with the goal of identifying vulnerabilities in their hardware or software. The field of research dedicated to finding and breaching such security systems is called cryptanalysis.
[0002] Recent cryptanalytic evaluations have identified potentially security-threatening techniques, including fault injection. Fault injection attacks, as opposed to software injection, may involve an attacker intentionally altering the behavior of electronic components by physically injecting faults into a computing system. As a result, fault injection attacks may circumvent many system security features and alter the behavior of a computing system to achieve malicious purposes and / or extract sensitive information. Physical fault injection attacks may include voltage glitches, clock glitches, laser injection, and electromagnetic injection, among others. In some cases, these cyber attacks may subvert system security by introducing as few as four fault injections in well-defined locations. Summary of the Invention
[0003] Described herein are techniques and apparatus directed to implementing a control flow integrity measurement for validating control flow in a computing system. In an aspect, a method is disclosed that includes maintaining a measurement of control flow during a scope. The method further includes generating an expression return value for a calculation of the expression during the scope, the expression return value indicating that the calculation of the expression was successful or that the calculation of the expression was unsuccessful. The method also includes modifying the measurement according to the calculated value in response to generating the expression return value during the scope, the calculated value being based on the measurement and the expression return value. The method further includes comparing the measurement to a predetermined value to validate the control flow during the scope.
[0004] In an aspect, a system is also disclosed that includes an integrated circuit having at least one processor and at least one computer-readable storage medium coupled to the at least one processor, the computer-readable storage medium including instructions that, when executed by the at least one processor, cause the processor to perform the method described above.
[0005] This summary is provided to introduce simplified concepts for performing control flow consistency measurements to validate control flow in a computing system, which concepts are further described below in the detailed description and illustrated in the drawings. This summary is not intended to identify essential features of the claimed subject matter, nor is it intended for use in determining the scope of the claimed subject matter.
[0006] Details of one or more aspects of control flow consistency measurement for validating control flow in a computing system are described herein with reference to the following drawings, in which the same numbers are used in various instances and may indicate like features or components: [Brief description of the drawings]
[0007] [Figure 1]FIG. 1 illustrates an example operating environment including an example computing device in which control flow integrity measurements can be performed. [Diagram 2] FIG. 1 illustrates integrated circuit components implemented as a security-oriented integrated circuit. [Diagram 3] FIG. 1 illustrates an exemplary implementation of source code configured to implement control flow integrity measurements for validating control flow in a computing system. [Figure 4] FIG. 2 illustrates a fault detection manager configured to create measurements for measuring control flow during a scope. [Diagram 5] FIG. 1 illustrates a fault detection manager configured to generate an expression return value and modify a measurement value. [Figure 6] FIG. 2 illustrates a fault detection manager configured to compare measurements with predefined values to validate control flow during execution of instructions within a scope. [Figure 7] FIG. 2 illustrates an example implementation of a fault detection manager configured to maintain control flow integrity measurements to validate control flow in a computing system. [Figure 8] FIG. 1 illustrates an example of a method for implementing control flow consistency measurements to validate control flow in a computing system. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0008] overview Computing systems often include integrated circuits with security circuits and software that provide protection against defects, attacks, and other potentially compromising events. The security circuits and software may implement a number of security paradigms. For example, during a firmware update, Public Key Cryptography Standards (PKCS)-compliant security circuits and software may use digital signatures (e.g., cryptographic signatures) to verify the authenticity and integrity of data received and executed by the computing device. Digital signature methods are mathematical methods used to validate digital messages or documents. A valid digital signature allows the recipient to be confident that the message was generated by a known sender ("authenticity") and that it has not been tampered with anywhere in transit ("integrity"). In doing so, the security circuits and software reduce the opportunities for information to be inadvertently disclosed or for some functionality to be used in a harmful or unauthorized manner.
[0009] In today's computing environment, malicious attackers may use numerous attack vectors to attack computing devices at a myriad of levels. As an example, fault injection attacks reduce the protection that many of these security paradigms provide. For example, fault injection attacks may circumvent many system security features and alter system behavior to achieve malicious goals and / or expose confidential information. Using fault injection attacks, attackers may use glitches (e.g., sudden, temporary, injected faults in a system) to indirectly or directly alter the programmed operation of electronic components (e.g., central processing units). While such attacks may sometimes render a computing device "inoperable," in other cases, precise, targeted attacks may expose security threats. For example, a targeted fault injection attack may cause a central processing unit to bypass digital signature authentication. As a result, the computing device may receive and execute unverified data or code.
[0010] Branch instructions are frequently targeted by malicious attackers using fault injection attacks because they can be used to skip security level checks. Branch instructions used within unary error handling programming constructs are particularly vulnerable. For example, a processor executing a function with a branch instruction may return control outside the function if the enclosed function returns an error. Because this branch instruction is the only control dependency between the return value indicating successful execution and the error check (e.g., there is no data dependency between the two), it allows an attacker to make the function signal success by skipping the early return.
[0011] To protect computing systems from such hazardous events, this specification describes techniques and apparatus directed to control flow integrity measurement for validating control flow in a computing system. The following discussion describes an operating environment, techniques that may be used in the operating environment, example methods, and a system-on-a-chip (SoC) in which components of the operating environment may be incorporated.
[0012] Operating environment The following discussion describes the operating environment, technologies that may be used in the operating environment, and various devices or systems in which components of the operating environment may be incorporated. In the context of this disclosure, the operating environment is referred to as an example only.
[0013] 1 illustrates an example operating environment 100 including an example computing device 102 capable of implementing control flow integrity measurements. Examples of computing devices 102 include a smartphone 102-1, a tablet computer 102-2, a laptop computer 102-3, smart glasses 102-4, a computerized watch 102-5, and an automobile 102-6. Although not shown, the computing device 102 may be implemented as any of a mobile station (e.g., fixed or mobile STA), a mobile communication device, a client device, a home automation and control system, an entertainment system, a game console, a personal media device, a health monitoring device, a drone, a camera, an Internet appliance capable of wireless Internet access and browsing, an IoT device, a security system, and a server or data center device, etc. It should be noted that the computing device 102 may be wearable, non-wearable but mobile, or relatively stationary (e.g., desktop, appliance). Also, note that the computing device 102 can be used with or incorporated within many computing devices 102 or peripherals, such as in an automobile or as an attachment to a laptop computer. The computing device 102 may implement one or more macros configured to maintain control flow integrity measurements to validate control flow in a computing system. The computing device 102 may provide other functionality or include components or interfaces omitted from FIG. 1 for clarity or visual brevity.
[0014] The computing device 102 includes a printed circuit board assembly 104 (PCBA 104) on which the computing device's components and interconnects are assembled. Alternatively or additionally, the computing device 102's components can be assembled on other substrates, such as flexible circuit material or other insulating materials. Although not shown, the computing device 102 may also include a housing, various human input devices, a display, a battery pack, an antenna, and the like. Typically, the electrical and electromechanical components of the computing device 102 are assembled on a printed circuit board (PCB) to form the PCBA 104. The various components of the PCBA 104 (e.g., processor and memory) are then programmed and tested to verify the correct functioning of the PCBA 104. The PCBA 104 is connected to other parts of the computing device 102 or assembled into a housing.
[0015] As shown, the PCBA 104 includes one or more processors 106 and a computer-readable medium 108. The processor(s) 106 may be any suitable single-core or multi-core processor (e.g., an application processor (AP), a digital signal processor (DSP), a central processing unit (CPU), a graphics processing unit (GPU)). The processor(s) 106 may be configured to execute instructions or commands stored in the computer-readable medium 108 to implement an operating system 110 and a fault detection manager 112 stored in a computer-readable storage medium. The computer-readable storage medium may include one or more non-transitory storage devices, each coupled to a computer system bus, such as random access memory (RAM, dynamic RAM (DRAM), non-volatile RAM (NVRAM), or static RAM (SRAM)), read-only memory (ROM), or flash memory), a hard drive, an SSD, or any type of medium suitable for storing electronic instructions. The term "coupled" may refer to two or more elements that are in direct contact (e.g., physical, electrical, magnetic, optical, etc.) or two or more elements that are not in direct contact with each other, but that still co-operate, communicate, and / or interact with each other.
[0016] The PCBA 104 may also include I / O ports 114 and one or more communication systems 116. The I / O ports 114 allow the computing device 102 to interact with other devices or a user. The I / O ports 114 may include any combination of internal or external ports, such as USB ports, audio ports, Serial ATA (SATA) ports, PCI-express based ports or card slots, Secure Digital Input / Output (SDIO) slots, and / or other legacy ports. A variety of peripherals may be operatively coupled to the I / O ports 114, such as a human input device (HID), an external computer-readable storage medium, or other peripherals.
[0017] The communications system 116 may enable communication of device data, such as received data, transmitted data, or other information described herein, and may provide connectivity to one or more networks and other devices connected thereto. Examples of communication systems include NFC transceivers, WPAN radios conforming to the various IEEE 802.15 (Bluetooth®) standards, WLAN radios conforming to any of the various IEEE 802.11 (WiFi®) standards, WWAN (3GPP® compliant) radios for cellular phones, Wireless Metropolitan Area Network (WMAN) radios conforming to the various IEEE 802.16 (WiMAX®) standards, Infrared (IR) transceivers conforming to the Infrared Data Association (IrDA) protocol, and wired local area network (LAN) Ethernet transceivers. Device data communicated via the communication system 116 may be packetized or framed depending on the communication protocol or standard over which the computing device 102 is communicating. The communication system 116 may include a wired interface, such as an Ethernet interface or a fiber optic interface for communication over a local network, an intranet, or the Internet. Alternatively, or in addition, the communication system 116 may include a wireless interface facilitating communication over a wireless network, such as a wireless LAN, a cellular network, or a WPAN.
[0018] Although not shown, the computing device 102 may also include a system bus, interconnect, crossbar, or data transfer system that couples various components within the device. The system bus or interconnect may include any one or combination of a variety of bus structures, such as a memory bus or memory controller, a peripheral bus, a universal serial bus, and / or a processor bus or local bus utilizing any of a variety of bus architectures.
[0019] Further, integrated circuit component 118 may be operatively coupled to PCBA 104. In an embodiment, integrated circuit component 118 may be implemented as a general-purpose processor, a system-on-chip (SoC), or a security-oriented integrated circuit with hardened firmware (e.g., a silicon root of trust (RoT) chip). In an embodiment, integrated circuit component 118 may include at least a portion of computer-readable medium 108 or be coupled to a computer-readable storage medium. For example, integrated circuit component 118 may include fault detection manager 112.
[0020] The computing device 102 may also include a power system, which may be implemented as one or more power supplies and a power distribution grid configured to provide power to the integrated circuit components 118 and circuitry of the computing device 102 .
[0021] Consider now Fig. 2, which illustrates an integrated circuit component (e.g., integrated circuit component 118) implemented as a security-oriented integrated circuit 202. However, this is only one example, and the integrated circuit component may be implemented as a microprocessor, a microcontroller, an SoC, and the like. In an embodiment, the security-oriented integrated circuit 202 may include cryptographic software (e.g., a hash-based encryption function) and hardware modules (e.g., an enhanced memory protection unit). The techniques described herein, including maintaining measurements of control flow, may be integrated within any of a variety of computing systems that include one or more security-oriented components, such as the security-oriented integrated circuit 202.
[0022] As shown in FIG. 2, the security-oriented integrated circuit 202 includes a processor 204 having an arithmetic logic unit 206 (ALU 206), a register file 208, a control unit 210, and an input / output (I / O) unit 212. The ALU 206 may be configured to perform arithmetic and logic operations on received data. The register file 208 may be an array of processor registers (e.g., control registers) that act as a fast semi-temporary memory configured to allow quick access to data during processing of a program or function. The register file 208 may be tightly coupled to the ALU 206. To further facilitate access to data, the register file 208 may include multiple read ports or multiple write ports to allow the ALU 206 and / or execution units to simultaneously retrieve multiple operands in one cycle. The register file 208 may be formed from flip-flops to accelerate the reading and writing of bits of data. The control unit 210 may be configured to control the flow of data throughout the system(s). The I / O unit 212 may include ports that operatively interface with devices or other components of the security-directed integrated circuit 202 .
[0023] As further shown in FIG. 2, the security-oriented integrated circuit 202 may include a security-enhanced ROM 214. The security-enhanced ROM 214 may include at least a portion of the computer-readable medium 108 that includes the fault detection manager 112. In one example, the fault detection manager 112 may be implemented as executable code. The executable code may be generated by a compiler that converts macros (e.g., source code directives for inserting specific computational instructions) of source code (e.g., high-level language scripts) into executable code (e.g., low-level machine code). The fault detection manager 112 implemented as a set of macros in the source code (e.g., included as one or more header files) may include function-like macros, chain macros, and / or object-like macros. The source code may further include other programs, functions, scripts, and the like.
[0024] In an embodiment, the security-enhanced ROM 214 may be operatively coupled to the processor 204. In such a configuration, the processor 204 may execute executable code (e.g., read-only instructions) stored in the security-enhanced ROM 214. As a result, the processor 204 may execute instructions of the fault detection manager 112.
[0025] In an aspect, the source code of the fault detection manager 112 may include variables, arrays, objects, subroutines, loops, functions, and the like. For example, a function is a set of instructions that performs a task and outputs a return value. A return value ("return value") as described herein refers to a value of any data type, such as a string, Boolean, and integer, that a function, subroutine, program, and the like outputs during or after the execution of a task (e.g., calculation, string manipulation). In one example, a return value may be an error code, including a numeric value (e.g., hexadecimal) or an alphanumeric code. As further described herein, a scope refers to a block of code, including functions, subroutines, programs, and the like, that ends with a return value.
[0026] In some examples, during execution of a scope, the fault detection manager 112 may instruct the processor 204 to stop further execution (e.g., in scope, out of scope) due to an error occurring during execution of the scope. Additionally, the fault detection manager 112 may instruct the processor 204 to output a return value including an error code indicating failure to complete the task (a "failure error code"). In other examples, during execution of a scope, the fault detection manager 112 may instruct the processor 204 to output a return value including an error code indicating successful completion of the task (a "success error code") if no error occurs during execution of the scope.
[0027] In one example, the security-oriented integrated circuit 202 with security-enhanced ROM 214 may include executable instructions for a signature check function. The signature check function may cause a processor to perform tasks including executing a digital signature acquisition sub-function and executing a digital signature verification sub-function. The signature check function may be designed to output an error code indicating success and thus a return value having a validated digital signature (a "final return value").
[0028] While the processor 204 is executing the signature check function, an error may occur during the execution of the digital signature verification sub-function. For example, an error may occur during the comparison of the message digest obtained from the digital signature with the digest of the corresponding message being validated against the digital signature. As a result, the digital signature verification sub-function may return a value with a failure error code. As an example, the signature check function may be designed with a unary error handling structure. In such an implementation, the return value with the failure error code is compared with the expected return value with a success error code in a branch instruction. If the comparison fails, the signature check function returns early. Otherwise, if the comparison is successful, the program continues to operate. In this way, further operations and execution of the signature check function may be stopped and the signature check function may terminate early ("early return"). The output of the signature check function is the return value with the failure error code of the digital signature verification sub-function.
[0029] Attackers may use fault injection attacks to target branching instructions in an attempt to change the intended control flow of a computing system (e.g., the order in which individual statements, instructions, or function calls of an imperative program are executed or evaluated). In some cases, a fault injection attack targeting a branching instruction may cause the digital signature verification subfunction to signal success by skipping an early return, allowing the signature check function to continue operating and executing.
[0030] To prevent a scope (e.g., a signature check function) from outputting a final return value with a successful error code when a fault injection attack ("tampering") occurs, the security-enhanced ROM 214 may execute instructions of the fault detection manager 112.
[0031] Exemplary Techniques 3 illustrates an exemplary embodiment of source code 300 configured to perform control flow integrity measurements to validate control flow in a computing system. In one aspect, the source code 300 includes a fault detection manager (e.g., fault detection manager 112) implemented as a set of macros 302. In one example illustrated in FIG. 3, the source code 300 includes macros 302 defined outside of a function (e.g., main function 304). In other examples, the techniques of the fault detection manager can be applied (e.g., called, defined) within a function (e.g., main function 304).
[0032] As shown, macro 302 may be included in source code 300 as one or more header files. Source code 300 may include (e.g., within macro 302) one or more expected values (e.g., hard-coded values). The expected values may be pre-computed using any of a variety of mathematical operations including fingerprint functions and / or bit operations. In some examples, the mathematical operations are not encrypted. For example, the mathematical operations may include a non-cryptographic fingerprint function. In at least some examples, the mathematical operations may result in an encrypted message digest. For example, the mathematical operations may include a cryptographic fingerprint function.
[0033] The source code 300 may further include a main function 304 (e.g., a signature check function). In an aspect, a processor (e.g., processor 204) may execute executable code (e.g., compiled source code 300) to perform the operations of the main function 304. The main function 304 may include calls to other functions. For example, the main function 304 may perform fault detection by applying a defined macro 302 to the return value of a called sub-function. In doing so, the processor may implement a fault detection manager as a result of the processor executing the main function 304 and applying the macro 302 to the return value of the called sub-function. In this manner, the fault detection manager may measure control flow during the execution of the main function 304. For example, the main function 304 may include a call to a function CFI_BEGIN 306 defined in the macro 302.
[0034] 4, the fault detection manager creates measurements for measuring control flow during a scope. In one example, creating measurements 400 may cause a processor to allocate space in memory (e.g., RAM) to store a variable's name, a variable's data type, and / or a variable's value. Creating measurements 400 may be implemented in source code 300 through, for example, variable initialization, variable assignment, and / or variable declaration. Measurements may include numeric, alphanumeric, or alphabetic values. Additionally, measurements may be implemented as local or global variables. In one embodiment, measurements in source code 300 may be declared as having a data type of long, assigned an initial value (e.g., a secret value), and stored in memory (e.g., register file 208). Declaring measurements is effective to initiate scope control flow measurements at 402. For example, measurements may be created to maintain measurements of the scope's control flow.
[0035] Returning momentarily to Figure 3, after the call to CFI_BEGIN 306 in main function 304, source code 300 includes a call to function CFI_RETURN_IF_ERROR 308 defined in macro 302. Referring to Figure 5, the fault detection manager generates return values for expressions and modifies measurements.
[0036] The function CFI_RETURN_IF_ERROR 308 accepts one or more expressions (e.g., function calls) at 500. For example, the function CFI_RETURN_IF_ERROR 308 may accept a function call to obtain a digital signature. The function CFI_RETURN_IF_ERROR 308 may further calculate the expression at 502. For example, calculating the arguments may involve the ALU 206 accessing the register file 208 or accessing another memory storage device in the computing device 102 operatively coupled to the PCBA 104. The calculation of the expression results in a return value of the expression. The return value of the expression may include a failure error code or a success error code.
[0037] The function CFI_RETURN_IF_ERROR 308 instructs the processor to store the return value of the expression in memory (e.g., register file 208) at 504. The function CFI_RETURN_IF_ERROR 308 obtains a measurement value at 506. For example, obtaining the measurement value may involve ALU 206 accessing register file 208. The function CFI_RETURN_IF_ERROR 308 performs one or more mathematical operations on the return value and the measurement value to generate a calculated value at 508. In aspects, performing the mathematical operations may include utilizing either a non-cryptographic synthetic fingerprint algorithm, a non-cryptographic fingerprint algorithm (e.g., a Fowler-Noll-Vo hash function), or a cryptographic fingerprint algorithm, referred to herein simply as a fingerprint algorithm.
[0038] In an exemplary implementation, the non-cryptographic synthetic fingerprint algorithm combines the formula return value and the measurement and then hashes the combined input. The formula return value and the measurement are then combined using a non-communicating function that includes concatenation. In another implementation, the formula return value and the measurement are combined using an injection function that includes serialization. In another implementation, the non-cryptographic synthetic fingerprint algorithm maps the combined input to a fixed-sized digest value (e.g., hash, digest output, fingerprint) to generate a computed value.
[0039] In other embodiments, or in addition, performing the mathematical operations may involve multiplication, shifting, addition, and / or bit operations on the return value of the formula and the measurement value. In yet another embodiment, after performing one or more of the aforementioned mathematical operations, a Hamming weight of the resulting value produced by the mathematical operation may be determined. Performing the mathematical operations through such techniques can amplify small changes into large changes (e.g., an avalanche effect).
[0040] The function CFI_RETURN_IF_ERROR 308 modifies the measurement value at 510. For example, the fault detection manager modifies the measurement value based on the calculated value in response to generating the return value of the expression. In one example, the function CFI_RETURN_IF_ERROR 308 redefines the variable that maintains the measurement value (e.g., the previous measurement value) to the calculated value. In this way, the fault detection manager can maintain (e.g., update, change) the measurement value during execution of the scope.
[0041] The function CFI_RETURN_IF_ERROR 308 compares the return value of the expression in the branch instruction at 512. For example, a branch instruction with an expected successful error code may be compared to the return value of the expression using any of a variety of conditional statements. If the comparison is unsuccessful (e.g., the return value of the expression does not indicate the expected successful error code), the function CFI_RETURN_IF_ERROR 308 may skip further instructions in the main function and return early ("early return"). If the comparison is successful (e.g., the return value of the expression indicates the expected successful error code), the processor may continue executing further instructions in the main function.
[0042] Returning momentarily to Figure 3, after the call to CFI_RETURN_IF_ERROR 308 in the main function, the source code 300 includes a call to the function CFI_CHECK_ALL_OK 310. Referring to Figure 6, the fault detection manager compares measurements to predetermined values to validate the control flow during execution of instructions within the scope.
[0043] The function CFI_CHECK_ALL_OK 310 accepts 600 a number as a formal argument. The number may be statically known (e.g., known at compile time and hard-coded in the main function 304). In some examples, CFI_CHECK_ALL_OK 310 may accept any data type or variable associated with a number. In still other examples, the number may be predetermined (e.g., to the fault detection manager) and correspond to a predetermined number of calls to the function CFI_RETURN_IF_ERROR 308 within the main function (e.g., scope). In at least some examples, the number of calls to the function CFI_RETURN_IF_ERROR 308 may be predetermined based on executing one or more conditional statements (e.g., if-else statements) or iterative statements (e.g., for loops, do while loops) prior to CFI_CHECK_ALL_OK 310 accepting the number.
[0044] At 602, the function CFI_CHECK_ALL_OK 310 compares the measured value to a predetermined value. For example, in response to accepting the number 600, the function CFI_CHECK_ALL_OK 310 obtains (e.g., calculates, accesses memory) a predetermined value based on the accepted number corresponding to a predetermined number of calls to the function CFI_RETURN_IF_ERROR 308. The function CFI_CHECK_ALL_OK 310 compares 602 the measured value to the predetermined value using one or more conditional statements. In doing so, the fault detection manager verifies that an early return from one or more branch instructions was not skipped during one or more executions of the function CFI_RETURN_IF_ERROR 308.
[0045] In one example, if the function CFI_RETURN_IF_ERROR 308 is predetermined to be called and executed three times within a main function, the accepted number can be predetermined to correspond to a value of 3. If the predefined value obtained by the function CFI_CHECK_ALL_OK 310 based on the value of 3 does not correspond to (e.g., is not equal to, does not indicate) the measured value, such an instance can indicate that one or more early returns were skipped during execution of instructions in the main function (e.g., scope). If the comparison between the predefined value and the measured value fails, the fault detection manager can respond to the tampering, such as generating an interrupt, passing control to an alert handler, preventing access to certain data, or shutting down at least a portion of the integrated circuit.
[0046] Returning to FIG. 3, if the comparison between the predetermined value and the measured value is successful, the main function may output a scope return value 312. In yet another example, if the comparison between the predetermined value and the measured value is unsuccessful, the fault detection manager may be configured to return a scope return value indicating a tamper-induced failure rather than immediately shutting down. The fault detection manager may then use the scope return value indicating a tamper-induced failure to allow it to respond to the attack. Furthermore, such an implementation may be branch-free, making it difficult for an attacker to overcome. For example, the fault detection manager may respond to tampering by implementing a protection function rather than shutting down the security-enhanced integrated circuit.
[0047] With the techniques described herein, the control flow measurement creates an explicit data dependency between the early return decision (e.g., early return 714) and the scope return value by incorporating (e.g., hashing, combining) the return values of all expressions into the measurement. Furthermore, the fault detection manager can be implemented within a computing system without compiler optimizations. In at least some examples, a computing system using the techniques described herein can implement optimized code (e.g., source code), but those optimizations may not interfere with, for example, the particular ordering of computations performed to compute the measurement. Furthermore, a computing system using the techniques described herein can implement a fault detection manager without modifying a compiler.
[0048] Exemplary Implementations This section describes an exemplary implementation of a control flow integrity measurement for validating control flow in a computing system. Figure 7 illustrates an exemplary implementation 700 of a fault detection manager configured to maintain a control flow integrity measurement for validating control flow in a computing system.
[0049] 7, a fault detection manager (e.g., fault detection manager 112) may initialize a variable 702. Initializing a variable may include assigning an initial measurement value to the variable. The initial value may be a secret value stored in a hardened memory (e.g., ROM 214). Initializing the variable equal to the initial value may be accomplished before or at any time during execution of scope 704.
[0050] The fault detection manager may then calculate an equation 706 that is valid for generating a return value of the equation. The fault detection manager may then hash 708 the return value of the equation with the measurement using a non-cryptographic fingerprint algorithm (e.g., a synthetic fingerprint algorithm) to generate a calculated value. In response to generating the calculated value, the fault detection manager may redefine the variable to the calculated value.
[0051] Before, during, or after hashing 708 and / or redefining 710 the variables, the fault detection manager may compare 712 the return values of the expressions. For example, the fault detection manager may determine whether the return values of the expressions indicate that the calculation of the expressions was successful or unsuccessful. If the comparison 712 fails, the fault detection manager may return early 714. If the comparison 712 is successful, the fault detection manager may compare 716 the measurement to a predetermined value. In some examples, the fault detection manager may repeat the calculation 706 of the expressions, hashing 708, redefinition 710, and comparison 712 for multiple expressions.
[0052] If the comparison 716 fails, the fault detection manager can detect a fault injection attack. If the comparison 716 succeeds, the fault detection manager can return a scope return value.
[0053] Exemplary Methods This section describes an exemplary method for implementing control flow integrity measurements to validate control flow in a computing system. The method is illustrated as a set of blocks specifying operations to be performed, but is not necessarily limited to the order or combination shown for performing the operations by each block. Furthermore, any one or more of the operations may be repeated, combined, rearranged, or coordinated to provide a wide range of additional and / or alternative methods. Although references to the exemplary operating environment 100 and entities detailed in Figures 2-7 may be made in parts of the following discussion, such references are for illustrative purposes only. These techniques are not limited to being performed by one entity or multiple entities operating on one device. Figure 8 illustrates an exemplary method 800 for implementing control flow integrity measurements to validate control flow in a computing system.
[0054] At 802, a fault detection manager (e.g., fault detection manager 112) maintains measurements of control flow during a scope. For example, the fault detection manager can store variables with assigned values in memory. In another example, the fault detection manager can create (e.g., declare) a variable and assign it a value.
[0055] At 804, the fault-detection manager generates an expression return value for the expression calculation during the scope. The expression return value may indicate that the expression calculation was successful or that the expression calculation failed.
[0056] At 806, the fault detection manager, in response to generating the return value of the expression during the scope, modifies the measurement value according to the calculated value. The calculated value may be based on the measurement value and the return value of the expression. For example, modifying (e.g., updating) the measurement value may include setting the measurement value equal to the calculated value.
[0057] At 808, the fault detection manager compares the measurements to predetermined values to validate the control flow during the scope. For example, the fault detection manager can determine whether the measurements are not equal to the predetermined values, thereby identifying tampering (e.g., a fault injection attack) in the computing system.
[0058] System on a Chip FIG. 9 illustrates an integrated circuit component (e.g., integrated circuit component 118) implemented as an SoC 900 that can implement various aspects of control flow integrity measurements to validate control flow in a computing system. The SoC 900 can be a single chip including components fabricated on the same semiconductor substrate. Alternatively, the SoC can be multiple such chips glued together with epoxy. The SoC 900 can be implemented in any suitable device, such as a smartphone, mobile phone, netbook, tablet computer, server, wireless router, network attached storage, camera, smart appliance, printer, set-top box, or other suitable type of device. The entities of FIG. 9 are described with reference to an SoC, but may also be implemented as an ASIC or field programmable gate array (FPGA), or the like.
[0059] The SoC 900 can be integrated with electronic circuitry including components described in the operating systems listed herein. The SoC 900 can also include an integrated data bus (not shown) that couples various components of the SoC 900 and provides data communication between the components. The integrated data bus or other components of the SoC 900 may be exposed or accessed through an external port, such as a JTAG port. For example, components of the SoC 900 may be tested, configured, or programmed (e.g., flashed) through the external port at various stages of manufacturing.
[0060] In this example, SoC 900 includes computer readable medium 1102, one or more processor(s) 904, a hash engine 906, and an I / O unit 908. The computer readable medium may be stored on a computer readable storage medium including one or more non-transitory storage devices such as RAM ((DRAM, NVRAM, or SRAM), ROM, or flash memory), hard drives, SSDs, or any type of medium suitable for storing electronic instructions, each coupled to a computer system bus.
[0061] The computer-readable medium 902 of the SoC 900 may include executable code for a fault detection manager (e.g., the fault detection manager 112). One or more of the processor(s) 904 operatively coupled to a computer-readable storage medium having the computer-readable medium 902 may execute instructions of the fault detection manager.
[0062] Although the present subject matter has been described in language specific to structural features and / or method acts, it is understood that the subject matter defined in the appended claims is not necessarily limited to the particular features or acts described herein, including the order in which they are performed.
[0063] Additional Examples The following sections provide further examples.
[0064] Example 1: A computer-implemented method comprising: maintaining a measurement of control flow during a scope; and generating an expression return value of an expression calculation during the scope, the expression return value indicating success or failure of the expression calculation, the method further comprising, in response to generating the expression return value during the scope, modifying the measurement according to a calculated value, the calculated value being based on the measurement and the expression return value, the method further comprising comparing the measurement to a predetermined value to validate the control flow during the scope.
[0065] Example 2: The computer-implemented method of example 1, further comprising creating a variable configured to store the measurement value prior to maintaining the measurement value.
[0066] Example 3: The computer-implemented method of Example 2, further comprising assigning the initial value to the variable configured to store the measurement, effective to set the measurement equal to an initial value prior to maintaining the measurement.
[0067] Example 4: The computer-implemented method of example 3, wherein the initial value is a secret value stored in a security-enhanced read-only memory.
[0068] Example 5: The computer-implemented method of any preceding example, wherein creating the variable includes declaring a local variable.
[0069] Example 6: The computer-implemented method of any preceding example, wherein updating the measurement value includes setting the measurement value equal to the calculated value.
[0070] Example 7: The computer-implemented method of any preceding example, wherein the scope includes a plurality of expressions.
[0071] Example 8: The computer-implemented method of example 7, wherein the scope includes a function and the plurality of expressions includes a function call.
[0072] Example 9: The computer-implemented method of Example 7 or 8, further comprising repeating, during said scope, said generating and said updating for each of said plurality of expressions.
[0073] Example 10: The computer-implemented method of any preceding example, further comprising, in response to comparing the measured value to the predetermined value, returning a scope return value indicating that execution of the scope was successful or that execution of the scope was unsuccessful.
[0074] Example 11: The computer-implemented method of example 10, wherein the scope return value and the expression return value include at least one error code.
[0075] Example 12: The computer-implemented method of Example 10 or 11, further comprising determining, based on one or more conditional branch instructions, that a return value of the expression indicates that computation of the expression failed.
[0076] Example 13: The computer-implemented method of Example 12, further comprising, in response to determining that the expression return value indicates that the calculation of the expression failed, aborting further execution of the scope and returning the scope return value indicating that the execution of the scope failed.
[0077] Example 14: The computer-implemented method of any preceding embodiment, further comprising generating the calculated value using a hash function.
[0078] Example 15: The computer-implemented method of Example 14, wherein the hash function includes a non-cryptographic synthetic fingerprint algorithm and generating the computed value includes combining two inputs together using at least one of a non-commutative function including concatenation, or an injection function including serialization, and mapping the combined input to a fixed-size digest value.
[0079] Example 16: The computer-implemented method of any preceding example, wherein updating the measurement value according to the calculated value includes manipulating the measurement value through one or more mathematical or bitwise operations.
[0080] Example 17: The computer-implemented method of any preceding example, wherein the predetermined value is calculated prior to maintaining the measurement value and is based on a number of unary error return decisions within the scope.
[0081] Example 18: The computer-implemented method of example 17, wherein the predetermined value is stored in a security-enhanced memory.
[0082] Example 19: A system comprising an integrated circuit, the integrated circuit comprising at least one processor and at least one computer-readable storage medium coupled to the at least one processor and comprising instructions that, when executed by the at least one processor, cause the processor to perform a method as described in any preceding example.
[0083] Example 20: The system of example 19, wherein the integrated circuit is configured to perform the method of any one of the preceding examples without compiler optimizations.
[0084] Example 21: A computer-implemented method comprising: generating a measurement of a control flow of a signature checking function configured to verify a digital signature; generating an expression return value during a scope of the signature checking function indicating successful digital signature verification; and in response to generating the expression return value during the scope, updating the measurement according to a calculated value, the calculated value being based on the measurement and the expression return value, the method further comprising validating the control flow of the signature checking function by comparing the measurement to a predetermined value.
[0085] Example 22: The computer-implemented method of Example 21, wherein the return value of the expression is a return value of a second expression, and the computer-implemented method further includes generating a return value of a first expression indicating successful acquisition of a digital signature prior to generating the return value of the second expression.
[0086] Example 23: The computer-implemented method of example 22, wherein updating the measurements updates the measurements for each of the return values of the first formula and the return values of the second formula.
[0087] Example 24: The computer-implemented method of any preceding example, wherein updating the measurement value includes setting the measurement value equal to the calculated value.
[0088] Example 25: The computer-implemented method of any preceding example, further comprising, in response to validating the control flow of the signature check function, returning a scope return value.
[0089] Example 26: The computer-implemented method of Example 25, wherein the scope return value includes at least one error code, the at least one error code indicating successful validation of the control flow of the signature checking function or unsuccessful validation of the control flow of the signature checking function.
[0090] Example 27: The computer-implemented method of Example 25 or 26, wherein a return value of the expression includes at least one error code, the at least one error code indicating that digital signature verification was successful or that digital signature verification was unsuccessful.
[0091] Example 28: The computer-implemented method of Example 27, further comprising: determining, based on one or more conditional branch instructions, that a return value of the expression indicates a failure of the digital signature verification; and, in response to determining that the return value of the expression indicates a failure of the digital signature verification, stopping further execution of the scope of the signature checking function; and returning the scope return value indicating a failure of the validation of the control flow of the signature checking function.
[0092] Example 29: The computer-implemented method of any preceding example, further comprising generating the calculated value using a hash function.
[0093] Example 30: The computer-implemented method of Example 14, wherein the hash function includes a non-cryptographic synthetic fingerprint algorithm and generating the computed value includes combining two inputs together using at least one of a non-commutative function including concatenation, or an injection function including serialization, and mapping the combined input to a fixed-size digest value.
[0094] Example 31: The computer-implemented method of any preceding example, wherein updating the measurement value according to the calculated value includes manipulating the measurement value through one or more mathematical or bitwise operations.
[0095] Example 32: The computer-implemented method of any preceding example, wherein the predetermined value is calculated prior to maintaining the measurement value and is based on a number of unary error return decisions within the scope.
[0096] Example 33: The computer-implemented method of example 32, wherein the predetermined value is stored in a security-enhanced memory.
[0097] Example 34: A system comprising an integrated circuit, the integrated circuit comprising at least one processor and at least one computer-readable storage medium coupled to the at least one processor and comprising instructions that, when executed by the at least one processor, cause the processor to perform a method as described in any preceding example.
[0098] Example 35: The system of example 34, wherein the integrated circuit is configured to execute the instructions without compiler optimization.
[0099] Example 36: The system of example 34 or 35, wherein the system includes instructions compiled with optimizations configured to not interfere with maintaining the measurements.
[0100] Example 37: A computer-implemented method, the computer-implemented method including initializing a local variable implemented within a scope and configured to maintain a measurement of local control flow; and computing an expression, the computing of the expression effective to generate a return value, the method further including hashing the measurement and the return value together, the hashing effective to output a digest value, the method including, following the hashing, redefining the measurement of the local variable to the digest value; and comparing the measurement of the local variable to an expected value stored in a static variable, the comparing effective to validate control flow integrity.
[0101] Example 38: The computer implemented method of Example 37, further comprising repeating the hashing and redefining for each calculation of an expression in scope prior to comparing the measured value of the local variable to the expected value stored in the static variable.
[0102] Example 39: The computer-implemented method of Example 37 or Example 38, wherein the hashing is calculated by a non-cryptographic synthetic fingerprint algorithm that is effective to combine two inputs together, the combining being performed using a non-commutative function including concatenation, or an injection function including serialization, and the combining and mapping the combined inputs to a fixed-size digest value.
[0103] Example 40: The computer-implemented method of any one of the preceding examples, wherein the expected value of the static variable is pre-computed for a number of unary error return decisions within the scope.
[0104] Example 41: The computer-implemented method of any one of the preceding examples, wherein the return value is an error code, and the error code can indicate successful execution or failure of execution.
[0105] Example 42: The computer-implemented method of any one of the preceding examples, wherein the scope is a function having at least one check structure, the at least one check structure being configured to perform an early return if an error occurs.
[0106] Example 43: The computer-implemented method of any one of the preceding examples, wherein initializing the local variables initializes the measurements to an initial secret value.
[0107] Example 44: The computer-implemented method of any preceding example, wherein updating the measurement value according to the calculated value includes redefining a variable that maintains the measurement value to the calculated variable.
[0108] conclusion Although embodiments of control flow consistency measurement techniques and enabling apparatus for validating control flow in a computing system have been described in feature and / or method specific language, it should be understood that the subject matter of the appended claims is not necessarily limited to the particular features or methods described. Rather, the specific features and methods are disclosed as example implementations for enabling control flow consistency measurement for validating control flow in a computing system.
Claims
1. 1. A computer-implemented method comprising: generating control flow measurements of a signature checking function configured to verify a digital signature; generating, during the scope of the signature checking function, a return value of an expression indicating successful digital signature verification; and in response to generating a return value of the expression during the scope, updating the measurement value according to a calculated value, the calculated value being based on the measurement value and the return value of the expression, the method further comprising: A computer-implemented method comprising validating the control flow of the signature check function by comparing the measured value to a predetermined value.
2. 2. The computer-implemented method of claim 1, wherein the return value of the expression is a return value of a second expression, the computer-implemented method further comprising generating a return value of a first expression indicating successful acquisition of a digital signature prior to generating the return value of the second expression.
3. The computer-implemented method of claim 2 , wherein updating the measurements updates the measurements for each of the return values of the first formula and the return values of the second formula.
4. 10. A computer-implemented method according to any preceding claim, wherein updating the measurement comprises setting the measurement equal to the calculated value.
5. 10. The computer implemented method of any preceding claim, further comprising, in response to validating the control flow of the signature check function, returning a scope return value.
6. 6. The computer-implemented method of claim 5, wherein the scope return value includes at least one error code, the at least one error code indicating successful validation of the control flow of the signature checking function or unsuccessful validation of the control flow of the signature checking function.
7. 7. The computer-implemented method of claim 5 or 6, wherein a return value of the expression includes the at least one error code, the at least one error code indicating that digital signature verification was successful or that digital signature verification was unsuccessful.
8. determining, based on one or more conditional branch instructions, that a return value of the expression indicates failure of the digital signature verification; in response to determining that a return value of the expression indicates failure of the digital signature verification, stopping further execution of the scope of the signature checking function; 8. The computer implemented method of claim 7, further comprising: returning the scope return value indicating that the validation of the control flow of the signature check function failed.
9. 10. A computer implemented method according to any preceding claim, further comprising generating the computed value using a hash function.
10. the hash function comprises a non-cryptographic synthetic fingerprint algorithm; Generating the calculated value comprises: combining the two inputs together using at least one of a non-commutative function, including concatenation, or an injection function, including serialization; and mapping the combined input to a fixed size digest value.
11. 10. A computer-implemented method according to any preceding claim, wherein updating the measurement value in accordance with the calculated value comprises manipulating the measurement value through one or more mathematical or bitwise operations.
12. 10. A computer-implemented method according to any preceding claim, wherein the predetermined value is calculated prior to maintaining the measurements and is based on a number of unary error return decisions within the scope.
13. 13. The computer-implemented method of claim 12, wherein the predetermined value is stored in a security-enhanced memory.
14. an integrated circuit, the integrated circuit comprising: At least one processor; and at least one computer-readable storage medium coupled to said at least one processor and containing instructions that, when executed by said at least one processor, cause said processor to perform a method as described in any preceding claim.
Citation Information
Patent Citations
Electronic information storage medium, IC card, method for confirming data abnormality, and program for confirming data abnormality
JP2018088147A
Method and device for fault detection
US20130159791A1
Program flow monitoring for deterministic firmware functions
US20200153455A1
