Data processing apparatus and method for data flow attestation
The data processing apparatus with memory tagging and attestation system addresses the ineffectiveness of existing technologies against data-oriented attacks by ensuring secure memory access and providing robust data flow attestation, effectively preventing DOP and DDM attacks.
Patent Information
- Application Number
- PCT/EP2023/055573
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-03-06
- Publication Date
- 2024-09-12
AI Technical Summary
Existing software security technologies are ineffective against data-oriented attacks, such as Data-Oriented Programming (DOP) and Direct Data Manipulation (DDM), which exploit memory vulnerabilities and can bypass defenses like Control Flow Integrity (CFI) and Data Execution Prevention (DEP).
A data processing apparatus with a memory tagging extension that tags volatile memory access and allocation instructions with a finite set of tags, triggering exceptions for mismatched tags, and operates in an attestation system involving a verifier server to secure memory objects and prevent data flow attacks.
The solution effectively prevents and detects data-oriented attacks by ensuring only authorized memory access, reducing the likelihood of successful DOP and DDM attacks, and provides a secure data flow attestation mechanism.
Smart Images

Figure EP2023055573_12092024_PF_FP_ABST
Abstract
Description
[0001] DATA PROCESSING APPARATUS AND METHOD FOR DATA FLOW ATTESTATION
[0002] TECHNICAL FIELD
[0003] The present disclosure relates to security technology. More specifically, the present disclosure relates to a data processing apparatus, a data flow attestation system and a method for data flow attestation.
[0004] BACKGROUND
[0005] Software attacks are a threat that may never cease to exist. Most attacks on software can be described to the presence of bugs and vulnerabilities in the code of a target application. Applications may be developed using unsafe programming languages such as C and C++ that may introduce vulnerabilities, i.e. bugs that may allow attackers to tamper with the execution flow or sensitive data of the application, which may lead to various exploits and attacks. The widespread deployment of Data Execution Prevention (DEP) technologies as defenses has raised the bar for attackers to successfully mount code injection attacks.
[0006] Recently, code-reuse attacks have become a popular software exploitation technique. Besides the common Control-flow hijacking attacks, run-time attacks have recently emerged: noncontrol Data, so-called Data-Oriented attacks. Such attacks exploit memory vulnerabilities in a different way by attacking the entirety of the data space of a program, i.e. the target application while remaining within the legitimate control flow of the application. Data-Oriented attacks can be classified into two main classes: Direct Data Manipulation (DDM) and Data-Oriented Programming (DOP). Both can be effective and can succeed in the presence of common defenses, such as Control Flow Integrity (CFI) and Data Execution Prevention (DEP). Contrarily to DDM, DOP attacks can be generalized requiring generic DOP gadgets and DOP dispatchers, i.e. a specific piece of assembly instructions that can stitch several DOP gadgets in an anticipated manner. Moreover, DOP attacks can be automated, thus representing a big security threat. SUMMARY
[0007] It is an objective to provide an improved data processing apparatus, a system and a method for data flow attestation.
[0008] The foregoing and other objectives are achieved by the subject matter of the independent claims. Further implementation forms are apparent from the dependent claims, the description and the figures.
[0009] According to a first aspect a data processing apparatus for executing a software application defined by an application machine code, e.g. a target binary image, is provided. The data processing apparatus comprises a volatile memory configured to store a plurality of memory objects during execution of an application machine code defining the application.
[0010] The data processing apparatus further comprises a processing circuitry configured to execute the application machine code. The processing circuitry comprises a memory tagging extension and the application machine code comprises a plurality of volatile memory access and / or allocation instructions for accessing and / or allocating the volatile memory at a plurality of memory locations, i.e. addresses. Each memory access and / or allocation instruction and its associated memory location are tagged, i.e. assigned with a tag from a finite set of tags, including one or more reserved tags and a plurality of assignable tags. Adjacent memory locations are tagged with different tags from the plurality of assignable tags. Each tag of the plurality of assignable tags is assigned to about the same number of memory locations and a tag to be assigned to a memory location is selected randomly from the plurality of assignable tags. During the execution of the application machine code the processing circuitry is further configured to trigger, i.e. throw an exception, if a tag of a memory access and / or allocation instruction does not match a tag of the memory location to be accessed and / or allocated. Thus, an improved data processing apparatus allowing data flow attestation is provided.
[0011] In a further possible implementation form of the first aspect, the application machine code is a modified, i.e. hardened version of an original version of the application machine code. The original version of the application machine code may comprise the plurality of volatile memory access and / or allocation instructions for accessing and / or allocating the volatile memory at the plurality of memory locations, i.e. addresses. The modified version of the application machine code may further comprise for each memory access and / or allocation instruction and its associated memory location of the plurality of memory locations a tag from the finite set of tags. Thus, the tagging may be performed during a compilation stage of generating an application machine code and the data processing apparatus may execute a modified, i.e. hardened version of a potentially insecure original version of an application machine code.
[0012] In a further possible implementation form of the first aspect, the processing circuitry is configured to tag each memory access and / or allocation instruction and its associated memory location of the plurality of memory locations with a tag from the finite set of tags during the execution of the application machine code. Thus, the tagging may be performed during an execution stage of a potentially insecure version of an application machine code.
[0013] In a further possible implementation form of the first aspect, the one or more memory access instructions are associated with one or more tagged pointers. Each pointer may be pointing to a respective memory location to be accessed.
[0014] In a further possible implementation form of the first aspect, the application machine code comprises one or more data-oriented programming, DOP, dispatcher instruction blocks (so- called gadgets) and each of the one or more DOP dispatcher instruction blocks is tagged with a reserved DOP dispatcher tag from the one or more reserved tags. Thus, the data processing apparatus may secure DOP gadgets.
[0015] In a further possible implementation form of the first aspect, the volatile memory comprises a stack memory. The stack memory may be configured to store one or more safe stack memory objects and the wherein the one or more safe stack memory objects are tagged with a reserved safe stack memory object tag from the one or more reserved tags. Thus, the data processing apparatus may secure safe stack memory objects.
[0016] In a further possible implementation form of the first aspect, the processing circuitry is configured to operate a run-time monitor. The run-time monitor may be configured to execute the application machine code in two modes, including an attack detection mode and an attack prevention mode. Thus, the data processing apparatus may operate in a computationally more efficient, i.e. computationally less expensive or in a more secure mode. In a further possible implementation form of the first aspect, by default the run-time monitor is configured to execute the application machine code in the attack detection mode and, if an attack is detected in the attack detection mode, the run-time monitor is further configured to restart execution of the application machine code in the attack prevention mode. Thus, the data processing apparatus may operate in the more secure mode, once security threats have been detected in the computationally more efficient more.
[0017] In a further possible implementation form of the first aspect, the volatile memory comprises a heap memory and / or a static and global data memory portion. Thus, the data processing apparatus may allow secure remote data flow attestation for memory objects stored in a heap memory and / or a static and global data memory portion thereof.
[0018] In a further possible implementation form of the first aspect, the data processing apparatus further comprises a non-volatile storage memory and the processing circuitry is configured, if an exception is triggered, to store exception metadata in the storage memory. Thus, the data processing apparatus may store the exception metadata to be used as part of the remote attestation report.
[0019] In a further possible implementation form of the first aspect, the data processing apparatus further comprises a communication interface configured to report attestation data to a verifier server. The attestation data may be based on the exception metadata. Thus, the data processing apparatus enables a remote data flow attestation by the verifier based on the exception metadata.
[0020] In a further possible implementation form of the first aspect, the communication interface is configured to report the attestation data to the verifier server, in response to a verification request from the verifier server. Thus, the data processing apparatus allows the verifier server to verify the data flow integrity of the data processing apparatus.
[0021] According to a second aspect a data flow attestation system is provided, comprising at least one data processing apparatus according to the first aspect configured to generate attestation data. The data flow attestation system further comprises a verifier server configured to receive the attestation data from the at least one data processing apparatus and to attest the integrity of the at least one data processing apparatus based on the attestation data. According to a third aspect a data processing method for executing a software application defined by an application machine code, e.g. a target binary image, is provided, the data processing method comprises: executing an application machine code by a processing circuitry, wherein the processing circuitry comprises a memory tagging extension and wherein the application machine code comprises a plurality of volatile memory access and / or allocation instructions for accessing and / or allocating a volatile memory at a plurality of memory locations, i.e. addresses, wherein each memory access and / or allocation instruction and its associated memory location are tagged, i.e. assigned with a tag from a finite set of tags, including one or more reserved tags and a plurality of assignable tags, wherein adjacent memory locations are tagged with different tags from the plurality of assignable tags, wherein each tag of the plurality of assignable tags is assigned to about the same number of memory locations and wherein a tag to be assigned to a memory location is selected randomly from the plurality of assignable tags; and triggering an exception, if a tag of a memory access and / or allocation instruction does not match a tag of the memory location to be accessed and / or allocated.
[0022] The data processing method according to the third aspect of the present disclosure can be performed by the data processing apparatus according to the first aspect of the present disclosure. Thus, further features of the data processing method according to the third aspect of the present disclosure result directly from the functionality of the data processing apparatus according to the first aspect of the present disclosure as well as its different implementation forms described above and below.
[0023] Details of one or more embodiments are set forth in the accompanying drawings and the description below. Other features, objects, and advantages will be apparent from the description, drawings, and claims.
[0024] BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In the following, embodiments of the present disclosure are described in more detail with reference to the attached figures and drawings, in which: Fig. 1 shows a schematic diagram illustrating a data flow attestation system according to an embodiment comprising a least one first data processing apparatus according to an embodiment and a verifier server;
[0026] Fig. 2 shows a schematic diagram illustrating an architecture of a data processing apparatus according to an embodiment;
[0027] Fig. 3 shows an example of visualizing a memory layout of a volatile memory after applying steps performed by a smart tagging algorithm implemented by a data processing apparatus according to an embodiment;
[0028] Fig. 4 schematically shows building blocks implemented by a data processing apparatus according to an embodiment;
[0029] Fig. 5 illustrates steps performed by a data processing apparatus according to an embodiment or a further data processing apparatus in a compilation phase;
[0030] Fig. 6 illustrates steps performed by a data processing apparatus according to an embodiment in a runtime phase;
[0031] Fig. 7 shows an attestation process of a data processing apparatus according to an embodiment at a runtime phase; and
[0032] Fig. 8 shows a flow diagram illustrating a data processing method for executing a software application defined by an application machine code.
[0033] In the following, identical reference signs refer to identical or at least functionally equivalent features.
[0034] DETAILED DESCRIPTION OF THE EMBODIMENTS
[0035] In the following description, reference is made to the accompanying figures, which form part of the disclosure, and which show, by way of illustration, specific aspects of embodiments of the present disclosure or specific aspects in which embodiments of the present disclosure may be used. It is understood that embodiments of the present disclosure may be used in other aspects and comprise structural or logical changes not depicted in the figures. The following detailed description, therefore, is not to be taken in a limiting sense, and the scope of the present disclosure is defined by the appended claims.
[0036] For instance, it is to be understood that a disclosure in connection with a described method may also hold true for a corresponding device or system configured to perform the method and vice versa. For example, if one or a plurality of specific method steps are described, a corresponding device may include one or a plurality of units, e.g. functional units, to perform the described one or plurality of method steps (e.g. one unit performing the one or plurality of steps, or a plurality of units each performing one or more of the plurality of steps), even if such one or more units are not explicitly described or illustrated in the figures. On the other hand, for example, if a specific apparatus is described based on one or a plurality of units, e.g. functional units, a corresponding method may include one step to perform the functionality of the one or plurality of units (e.g. one step performing the functionality of the one or plurality of units, or a plurality of steps each performing the functionality of one or more of the plurality of units), even if such one or plurality of steps are not explicitly described or illustrated in the figures. Further, it is understood that the features of the various exemplary embodiments and / or aspects described herein may be combined with each other, unless specifically noted otherwise.
[0037] Figure 1 shows a schematic diagram illustrating a data flow attestation system 100 according to an embodiment comprising a least one data processing apparatus 110 according to an embodiment and a verifier server 120. The data flow attestation system 100 may further comprise a further data processing apparatus 130 according to an embodiment. The data processing apparatus 110 may be, for instance, an IOT device, a smartphone, a network device, an electronic control unit, a server, in particular a cloud server, a base station, a cloud machine, a router, etc. The further data processing apparatus 130 may be, for instance, a server, in particular a cloud server, a base station, a cloud machine, a router, etc. The verifier server 120 may be a cloud server.
[0038] As illustrated in figure 1 and will be described in more detail below, the data processing apparatus 110 comprises a processing circuitry 111, which may comprise, for instance, one or more central processing circuitries, CPUs, and / or one or more microcontrollers. The processing circuitry 111 may be implemented in hardware and / or software and may comprise digital circuitry, or both analog and digital circuitry. Digital circuitry may comprise components such as application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), or general-purpose processors. Moreover, the data processing apparatus 110 may comprise an electronic non-volatile memory 115b configured to store data, for instance, a FLASH memory 115b. The non-volatile memory 115b may store executable program code which, when executed by the processing circuitry 111, causes the data processing apparatus 110 to perform the functions and methods described herein. The data processing apparatus 110 may further comprises a communication interface 113, in particular a wireless and / or wired communication interface allowing the data processing apparatus 110 to communicate with the verifier server 120, the further data processing apparatus 130 and / or other network devices.
[0039] Likewise, the further data processing apparatus 130 may comprise a processing circuitry 131, which may comprise, for instance, one or more central processing circuitries, CPUs, and / or one or more microcontrollers. The processing circuitry 131 may be implemented in hardware and / or software and may comprise digital circuitry, or both analog and digital circuitry. Digital circuitry may comprise components such as application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), or general-purpose processors. Moreover, the further data processing apparatus 130 may comprise an electronic non-volatile memory 135 configured to store data, for instance, a FLASH memory 135. The non-volatile memory 135 may store executable program code which, when executed by the processing circuitry 131, causes the further data processing apparatus 130 to perform the functions and methods described herein. The further data processing apparatus 130 may further comprises a communication interface 133, in particular a wireless and / or wired communication interface allowing the further data processing apparatus 130 to communicate with the verifier server 120, the data processing apparatus 110 and / or other network devices.
[0040] The data processing apparatus 110 or the further data processing apparatus 130 may be configured to modify an original version of an application machine code 141 (also referred to as source code 141) defining a software application into a modified, e.g. hardened, version 143 of the application machine code 141.
[0041] The data processing apparatus 110 is configured for executing a software application defined by the application machine code 143, e.g. a target binary image. The data processing apparatus 110 comprises a volatile memory 115a configured to store a plurality of memory objects during execution of the application machine code 143 defining the application.
[0042] The processing circuitry 111 of the data processing apparatus 110 is configured to execute the application machine code 143. The processing circuitry 111 comprises a memory tagging extension and the application machine code 143 comprises a plurality of volatile memory access and / or allocation instructions for accessing and / or allocating the volatile memory 115a at a plurality of memory locations, i.e. addresses. Each memory access and / or allocation instruction and its associated memory location are tagged, i.e. assigned with a tag from a finite set of tags, including one or more reserved tags and a plurality of assignable tags. Adjacent memory locations are tagged with different tags from the plurality of assignable tags. Each tag of the plurality of assignable tags is assigned to about the same number of memory locations and a tag to be assigned to a memory location is selected randomly from the plurality of assignable tags. During the execution of the application machine code 143 the processing circuitry I l l is further configured to trigger, i.e. throw an exception, if a tag of a memory access and / or allocation instruction does not match a tag of the memory location to be accessed and / or allocated.
[0043] The verifier server 120 is configured to receive attestation data 145 from the at least one data processing apparatus 110 and to attest the integrity of the at least one data processing apparatus 110 based on the attestation data 145.
[0044] Figure 2 shows a schematic diagram illustrating an architecture of the data processing apparatus 110 according to an embodiment. As described further below, the architecture may be implemented by the data processing apparatus 110. Alternatively, at least some elements of the architecture, in particular related to a building phase, may be implemented by the further data processing apparatus 130. The architecture may leverage a hardware / software co-design to mitigate data-only attacks.
[0045] As illustrated in figure 2, the application may be a user-space application running on an architecture that provides hardware support for a Memory Tagging Extension (MTE), i.e. the capability of extending Instruction Set Architecture (ISA) with instructions for tag manipulation for the entire memory 115a. The processing circuitry 111 of the data processing apparatus 110 may be a processing circuitry 111 which provides the above hardware support, for example an ARM processor of v8.5, with a higher architectures of class A.
[0046] The verifier server 120 may be a remote trusted entity, e.g., a management service, which gets some metadata 201 from the deployment service, i.e. the further data processing apparatus 130, after it compiles the corresponding application that can be used in verifying the attestation data 145, i.e. data-flow attestation report. At any point in time, the verifier server 120 may contact a remote attestation service or agent 203, i.e. a user-space process, to ask about the data-flow integrity status of the data processing apparatus 110. The remote attestation service 203 may reply with a report that will be verified by the verifier server 120 with respect to the received metadata 201.
[0047] The hardware components of the data processing apparatus 110 may comprise the processing circuitry 111 supporting MTE instructions, which can be inserted in certain places in the binary software to tag pointers and their corresponding memory objects.
[0048] The hardware components of the data processing apparatus 110 further comprise the volatile memory 115a, for example a DRAM, which may hold all software modules when turning the data processing apparatus 110 on.
[0049] The hardware components of the data processing apparatus 110 may further comprise the nonvolatile memory 115b providing a storage space where software modules and other files may be permanently stored in both of the on and off statuses of the data processing apparatus 110.
[0050] The hardware components of the data processing apparatus 110 may further comprise a root of trust (RoT) hardware module 211 that may be responsible for generating a chain of trust among the various software layers and thus for detecting any forgeable report.
[0051] As will be appreciated, the hardware components of the data processing apparatus 110 may further comprise further hardware components 119, such as the communication interface 113.
[0052] The software components of the data processing apparatus 110 may comprise in a kernel, i.e. high privileged software that controls other software modules running on top of it, a MTE Exception Handler 207. The MTE exception handler 207 may be a kernel module that is responsible for handling all violations triggered because of accessing a memory area that holds a different tag than the stored one in the pointer, i.e. violations triggered by a tag mismatch).
[0053] The software components of the data processing apparatus 110 may further comprise in the kernel a RoT driver 209. The RoT driver 209 may be a kernel module that is responsible for handling all interactions with the RoT hardware module 211.
[0054] The software components of the data processing apparatus 110 may comprise in a user-space the remote attestation agent 203. The remote attestation agent 203 may be a user-space process (application) that is responsible for receiving commands from the verifier server 120 and answers accordingly after retrieving relative data from other modules. The remote attestation agent 203 may be mainly dedicated to attest the data-flow integrity. The remote attestation agent 203 may be implemented in a safe language, e.g. Rust, to report in a trustworthy way the recorded logs to the verifier server 120.
[0055] The software components of the data processing apparatus 110 may further comprise in the user-space the application machine code 143, i.e. the corresponding user-space application that is monitored and protected as described in embodiments above and below.
[0056] As will be appreciated, the software components of the data processing apparatus 110 may comprise further modules 213 in the kernel and / or further applications 205 in the user-space.
[0057] The data processing apparatus 110 or the further data processing apparatus 130 may operate in a building phase, i.e. the compilation process, after which the resulted application machine code 143 has the needed instrumentation instructions.
[0058] As described above and below in embodiments, the data processing apparatus 110 or the further data processing apparatus 130 may be provided with the source code 141 comprising all dependent files of the target application.
[0059] The data processing apparatus 110 or the further data processing apparatus 130 may comprise, in particular the processing circuitry 111 of the data processing apparatus 110 or the processing circuitry 131 of the further data processing apparatus 130 may implement, a compiler tool chain 13 la, i.e. a compiler infrastructure 131a used in compiling the target application 143.
[0060] The data processing apparatus 110 or further data processing apparatus 130 may further comprise, in particular the processing circuitry 111 of the data processing apparatus 110 or the processing circuitry 131 of the further data processing apparatus 130 may implement, a plugin 131b. The plugin 131b may be a software library that may be implemented and plugged into the compiler tool chain 131a. The plugin 131b may execute when passing its corresponding flag to the compiler infrastructure 131a and may add the needed instrumentation instructions to the target application 143.
[0061] More specifically, the plugin 131b may be configured to perform an insertion of static tagging instructions when allocating safe objects on the stack and / or an insertion of static tagging instructions for initialized data, i.e. global and static data, and unsafe stack objects.
[0062] The plugin 131b may be further configured to perform memory function overloading for dynamic tagging. For instance, for the malloc instruction the plugin 131b may receive as a second argument the tagging schema, tag memory using a smart colouring algorithm and return a tagged pointer.
[0063] With further reference to figure 3, the plugin 131b may be further configured to perform an insertion of tag integrity checks for unsafe pointers to prevent the use of a safe-stack reserved tag and / or prevent the use of a DOP dispatcher tag.
[0064] Moreover, the plugin 131b may be further configured to perform an insertion of tag integrity checks for DOP dispatcher pointers.
[0065] As described above and below in embodiments, the source code 141, i.e. the original version of the application code 141 may be compiled by the extended compiler toolchain 131a, 131b comprising the plugin 131b.
[0066] The extended compiler toolchain 131a, 131b may produces the hardened target binary image 143 and also some metadata 201 to be used by the verifier server 120 for verification purposes. The target binary image 143 may be deployed later on the target device, i.e. the data processing apparatus 110.
[0067] The binary image 143 can be executed normally. When an MTE-related violation is detected, the corresponding MTE exception handler 207 may be fired. The MTE exception handler 207 may log some data in an append-only log file, stored in the non-volatile memory 115b. Also, The MTE exception handler 207 may notify the RoT driver 209 about the current hash value of this file. The RoT driver 209 may extend / update the RoT hardware 211 with this hash value.
[0068] Whenever needed, the verifier server 120 may send at attestation request to the remote attestation agent 203, asking about the data-flow integrity of the underlying device, i.e. the data processing apparatus 110. The remote attestation agent 203 may query relevant information from with the help of the RoT 211 and may send all signed data to the verifier server 120 in the attestation report 145. Upon receiving the attestation report 145, the verifier server 120 may start verifying it.
[0069] Figure 3 shows an example of visualizing a memory layout of the volatile memory 115a after applying steps performed by a smart tagging algorithm implemented by the data processing apparatus 110 according to an embodiment. As illustrated in figure 3, the memory layout may comprise a stack 301, a heap 303 and static and global data 305.
[0070] As further illustrated in figure 3, the data processing apparatus 110 may use memory tagging to reserve one tag for the safe stack elements 307 and reserve one tag for DOP dispatchers 309, e.g. loop variables.
[0071] The data processing apparatus 110 may further assign remaining tags in a smart way to the rest of the unsafe data 31 la-d, including the fields of the structs, i.e. intra-object protection.
[0072] Then the data processing apparatus 110 may instrument and monitor the application. This may comprise one or more of the following: (i) instrumenting the pointers of both unsafe data 311a- d and loop variables in order to prevent a usage of reserved tags and thus deterministically isolating safe stack 307 and DOP dispatchers 309, (ii) overloading memory management functions, e.g., malloc and free, to comply with the smart tagging algorithm disclosed herein for both dynamic memory and struct fields, (iii) construct a monitoring process, i.e. the attestation agent 203, to select the best operation mode: detection or prevention and / or implement the custom exception handler 207 as a kernel module that may log some data for further attestation and verification by the verifier server 120.
[0073] Figure 4 schematically shows building blocks implemented by the data processing apparatus 110 according to an embodiment.
[0074] The middle box represents the tag memory data attestation 401, i.e. the core aspect of embodiments disclosed herein. The tag memory data attestation 401 may comprise one or more of the following components. These components may operate in two phases: one relates to the building, i.e. compilation phase, and the other one takes place during execution, i.e. the runtime phase.
[0075] The tag memory data attestation 401 may comprise hardware memory tagging 403, i.e. a tagging feature of the processing unit 111 of the data processing apparatus 110.
[0076] The tag memory data attestation 401 may comprise data analysis 405, i.e. a compiler pass or plugin which may identify safe stack objects.
[0077] The tag memory data attestation 401 may comprise smart algorithms 407, i.e. two embedded algorithms for the stack 301 and heap 303 to assign tags in a smart unpredictable way, such as the smart tagging algorithms described above and below.
[0078] The tag memory data attestation 401 may comprise runtime instrumentation 409, i.e. instrumenting some functions to adhere to the runtime enforcement policy.
[0079] The tag memory data attestation 401 may comprise a compiler extension, i.e. the plugin 131b (pass) which may be responsible for instrumenting the application with MTE instructions.
[0080] The tag memory data attestation 401 may comprise a run-time monitor 411 which may comprise a user-space process along with a custom kernel module to handle violations and switch between attack detection and prevention modes as needed. As further illustrated in figure 4, the tag memory data attestation 401 may run on top of, or integrated with, all other security defenses 413 for providing data flow protection.
[0081] Figure 5 illustrates steps performed by the data processing apparatus 110 according to an embodiment or the further data processing apparatus 130 in the compilation phase.
[0082] When compiling any source code application 141 in addition to the compiler infrastructure 131a the following components may be used: (i) the related compiler plugin 131b that may insert relevant MTE instructions and / or (ii) overloaded shared library functions 501 that may maintain awareness of runtime isolation depending on referenced smart tagging algorithms 407. The result of the compilation phase is the target binary image 143 that may be instrumented as required.
[0083] Figure 6 illustrates steps performed by the data processing apparatus 110 according to an embodiment in the runtime phase.
[0084] The kernel space 603 may be configured with the custom exception handler 207 that may mainly deal with MTE violations.
[0085] The user-space 601 may comprise the attestation agent process 203 that may function as a security monitor and decide what mode should other applications launched in: protection or detection. Given that attacks are the exceptional case, all new applications may be launched in the detection mode which may be faster. In case of detecting a violation, the corresponding application can be killed and launched again in the prevention mode.
[0086] The user-space 601 may also comprise the instrumented version 501 of the shared libraries to maintain compatibility.
[0087] As illustrated by circle 1 in figure 6, after loading the target binary 143 as an application in the user-space 601, it may start executing normally.
[0088] As illustrated by circle 2 in figure 6, in case of a tag mismatch, the corresponding exception handler 207 may be triggered. As illustrated by circle 3 in figure 6, the exception handler 207 may accordingly record some information about the current state of this software module in an append-only log file, and also notify the attestation agent process 203 about this case.
[0089] As illustrated by circle 4 in figure 6, the attestation agent process 203 may crash the application 143.
[0090] As illustrated by circle 5 in figure 6, the attestation agent process 203 may re-launch the application 143 again in another mode, with different tag values, leveraging the smart tagging algorithms 407.
[0091] The smart tagging algorithms 407 may minimize the probability of success for the attackers by tagging the memory smartly in the sense that the tags are assigned in an unpredictable way while maximizing the variety among them. The algorithms 407 may be designed with the following properties: (i) tag equity, i.e. using an equal distribution of tags in order to achieve that each tag used tags approximately the same number of allocations, (ii) tag alternation, i.e. never using the same tag for two adjacent allocations and / or (iii) leak-resistance, i.e. not leaking insight on the tagging sequence so that knowing the tag of an allocation does not gain the attacker any advantage over another allocation.
[0092] An exemplary pseudo code for the smart tagging algorithm 407 for the stack 301 may be as follows:
[0093] A = {set of all tags} / / Filled depending on the schema used
[0094] R = {reserved tags} / / Filled depending on the reserved tags foreach alloc in allocations / / Cycle through stack allocations x = randomFrom(A - R) / / Pick random tag from set subtraction setTag(alloc,x) / / Tag allocation with x if A == R + x then / / Are there any more available tags?
[0095] R = {reserved tags} / / Restore D to original set
[0096] R += x / / Remove tag x from available tags
[0097] An exemplary pseudo code for the smart tagging algorithm 407 for the heap 303 may be as follows: S = {set of all tags} D = getBackupSet() / / Retrieve backup of used tags alloc = allocatorFit() / / Retrieve memory area to be allocated bef = getPrecedentTag(alloc) / / Retrieve tag of precedent memory area aft = getSubsequentTag(alloc) / / Retrieve tag of subsequent memory area if (S - D - bef - aft) = {empty} then / / Check it colours are available
[0098] D = {reserved tags} / / Reset the set (depending on colouring schema)
[0099] D = D + bef + aft / / Add adjacent memory tags x = randomFrom(S - D) / / Pick random tag from available colours setTag(alloc,x) / / Tag allocation with colour x
[0100] D += x / / Add x to used tags setBackup(D) / / Save used set for later use
[0101] Figure 7 shows an attestation process of the data processing apparatus 110 according to an embodiment at the runtime phase.
[0102] As described in embodiments herein, when the target application 143 is deployed, it can advantageously keep running normally without disclosing or logging any information. The inserted MTE instructions may fire an exception in case of a violation. When triggered, the corresponding exception handler 207 may log relevant metadata 201 in an append-only log file that is saved in the non-volatile memory 115b and its integrity may be verified using a static remote attestation scheme. The exception handler 207 may also anchor the hash value of the added record in the RoT hardware component 211 to detect any tampering that might happen in the future. Finally, the exception handler 207, i.e. in collaboration with the attestation agent 203 may stop the corresponding user-space process because it is most likely compromised.
[0103] At any point in time, if the verifier server 120 is interested to attest the data-flow integrity status of the data processing apparatus 110, it may send an attestation request to the remote attestation agent process 203 questioning about the value of the dedicated register in the RoT 211. The remote attestation agent 203 may query this value from the RoT 211 through its driver 209 and send it back to the verifier server 120. If the value is as expected, for example zero, the attestation process may be then terminated at this stage and a conclusion may be made that the data processing apparatus 110 is in the benign state. Otherwise, the verifier server 120 may proceed with the attestation process asking for the entire signed log file. The remote attestation agent 203 may retrieve this log file from the non-volatile memory 115b and send it back along with all metadata 201 needed from the RoT 211 to verify its integrity and authenticity. The verifier server 120 may then perform further investigation on the execution state of the data processing apparatus 110 depending on the recorded data in the received report, i.e. the attestation report 145.
[0104] Embodiments disclosed herein can provide a comprehensive solution to prevent and detect all data-oriented attacks. This can make launching Data-Oriented attacks such as DOP and DDM very difficult, as data pointers will not be able to access memory areas with different tag values. Although the attacker has a very minimal probability, for example smaller than 7%, to succeed in launching DDM by guessing the right tag only once, DOP attacks are prevented deterministically as they cannot be launched by overwriting tag values in pointers.
[0105] Embodiments disclosed herein can further provide trustworthy evidence about the data-flow integrity status. This can involve the notion of data flow attestation using memory tagging. Thus, with the help of a trusted remote party, i.e. the verifier server 120, false cases can be detected, and measures and improvements can be considered.
[0106] Embodiments disclosed herein can further provide neat security-performance trade-off with deterministic detection of attacks. This can involve alternating from detection mode to prevention mode when needed. Thus, providing the best trade-off between performance and security guarantees.
[0107] Embodiments disclosed herein can further provide minimal and informative reports. This can involve sending the attestation report 145 when there is a data-flow violation.
[0108] Embodiments disclosed herein can further provide a high scalability. Given the small size attestation reports 145, and the scarcity of them (they are sent only when there is a violation), the verifier server 120 can scale to manage a big number of data processing apparatus 110.
[0109] Advantageously, embodiments disclosed herein can targets all data pointers and variables in memory including heap 303, stack 301, global ones 305, etc. Moreover, embodiments disclosed herein can provide a comprehensive solution that can alternate between detection (attestation) and prevention (integrity enforcement) as required, preserving both strong security guarantees and good performance.
[0110] Embodiments disclosed herein can further provide cover protection for intra-objects inside structs (C data structures).
[0111] Moreover, embodiments disclosed herein can provide both data flow Integrity and attestation using available hardware features, in particular memory tagging.
[0112] Embodiments disclosed herein can further provide a flexible solution in the sense that some of its target protection modes can be enabled or disabled depending on the security and performance requirements. For instance, intra-object protection can be left untouched without affecting on other data variables.
[0113] Moreover, embodiments disclosed herein can be applied not only to processors 111 such as ARM, but also to Intel architecture, with minimal design changes, and to any other computing architecture with memory tagging support.
[0114] Figure 8 shows a flow diagram illustrating a data processing method 800 for executing the software application defined by the application machine code 143, e.g. the target binary image.
[0115] The data processing method 800 comprise a step 801 of executing the application machine code 143 by the processing circuitry 111, wherein the processing circuitry 111 comprise a memory tagging extension and wherein the application machine code 143 comprises a plurality of volatile memory access and / or allocation instructions for accessing and / or allocating the volatile memory 115a at a plurality of memory locations, i.e. addresses, wherein each memory access and / or allocation instruction and its associated memory location are tagged, i.e. assigned with a tag from a finite set of tags, including one or more reserved tags and a plurality of assignable tags, wherein adjacent memory locations are tagged with different tags from the plurality of assignable tags, wherein each tag of the plurality of assignable tags is assigned to about the same number of memory locations and wherein a tag to be assigned to a memory location is selected randomly from the plurality of assignable tags. The data processing method 800 further comprise a step 803 of triggering an exception, if a tag of a memory access and / or allocation instruction does not match a tag of the memory location to be accessed and / or allocated.
[0116] As the data processing method 800 can be implemented by the data processing apparatus 110, further features of the data processing method 800 result directly from the functionality of the data processing apparatus 110 and its different embodiments described above and below.
[0117] The person skilled in the art will understand that the "blocks" ("units") of the various figures (method and apparatus) represent or describe functionalities of embodiments of the present disclosure (rather than necessarily individual "units" in hardware or software) and thus describe equally functions or features of apparatus embodiments as well as method embodiments (unit = step).
[0118] In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. The described embodiment of an apparatus is merely exemplary. For example, the unit division is merely logical function division and may be another division in an actual implementation. For example, a plurality of units or components may be combined or integrated into another system, or some features may be ignored or not performed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections may be implemented by using some interfaces. The indirect couplings or communication connections between the apparatuses or units may be implemented in electronic, mechanical, or other forms.
[0119] The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
[0120] In addition, functional units in the embodiments described herein may be integrated into one processing circuitry, or each of the units may exist alone physically, or two or more units are integrated into one unit.
Claims
CLAIMS1. A data processing apparatus (110) for executing an application, wherein the data processing apparatus (110) comprises: a volatile memory (115a) configured to store a plurality of memory objects during execution of an application machine code (143) defining the application; and a processing circuitry (111) configured to execute the application machine code (1 3), wherein the processing circuitry (111) comprises a memory tagging extension and wherein the application machine code (143) comprises a plurality of memory access and / or allocation instructions for accessing and / or allocating the volatile memory (115a) at a plurality of memory locations, wherein each memory access and / or allocation instruction and its associated memory location are tagged with a tag from a finite set of tags, including one or more reserved tags and a plurality of assignable tags, wherein adjacent memory locations are tagged with different tags from the plurality of assignable tags, wherein each tag of the plurality of assignable tags is assigned to about the same number of memory locations and wherein a tag to be assigned to a memory location is selected randomly from the plurality of assignable tags; wherein during the execution of the application machine code (143) the processing circuitry (111) is further configured to trigger an exception, if a tag of a memory access and / or allocation instruction does not match a tag of the memory location to be accessed and / or allocated.
2. The data processing apparatus (110) of claim 1, wherein the application machine code (143) is a modified version of an original version (141) of the application machine code (143), wherein the original version (141) of the application machine code (143) comprises the plurality of memory access and / or allocation instructions for accessing and / or allocating the volatile memory (115a) at the plurality of memory locations, and wherein the modified version of the application machine code (143) further comprises for each memory access and / or allocation instruction and its associated memory location of the plurality of memory locations a tag from the finite set of tags.
3. The data processing apparatus (110) of claim 1 or 2, wherein the processing circuitry (111) is configured to tag each memory access and / or allocation instruction and its associated memory location of the plurality of memory locations with a tag from the finite set of tags during the execution of the application machine code (143).
4. The data processing apparatus (110) of any one of the preceding claims, wherein the one or more memory access instructions are associated with one or more pointers, wherein each pointer is pointing to a respective memory location to be accessed.
5. The data processing apparatus (110) of any one of the preceding claims, wherein the application machine code (143) comprises one or more data oriented programming, DOP, dispatcher instruction blocks and wherein each of the one or more DOP dispatcher instruction blocks is tagged with a DOP dispatcher tag.
6. The data processing apparatus (110) of any one of the preceding claims, wherein the volatile memory (115a) comprises a stack memory, wherein the stack memory is configured to store one or more safe stack memory objects and the wherein the one or more safe stack memory objects are tagged with a safe stack memory object tag.
7. The data processing apparatus (110) of any one of the preceding claims, wherein the processing circuitry (111) is configured to operate a run-time monitor (411), wherein the runtime monitor (411) is configured to execute the application machine code (143) in two modes, including an attack detection mode and an attack prevention mode.
8. The data processing apparatus (110) of claim 7, wherein by default the run-time monitor (411) is configured to execute the application machine code (143) in the attack detection mode and wherein, if an attack is detected in the attack detection mode, the run-time monitor (411) is further configured to restart execution of the application machine code (143) in the attack prevention mode.
9. The data processing apparatus (110) of any one of the preceding claims, wherein the volatile memory (115a) comprises a heap memory and / or a static and global data memory portion.
10. The data processing apparatus (110) of any one of the preceding claims, wherein the data processing apparatus (110) further comprises a non-volatile storage memory (115b) and wherein the processing circuitry (111) is configured, if an exception is triggered, to store exception metadata (201) in the storage memory (115b).
11. The data processing apparatus (110) of claim 10, wherein the data processing apparatus (110) further comprises a communication interface (113) configured to report attestation data (145) to a verifier server (120), wherein the attestation data (145) is based on the exception metadata (201).
12. The data processing apparatus (110) of claim 11, wherein the communication interface (113) is configured to report the attestation data (145) to the verifier server (120), in response to a verification request from the verifier server (120).
13. A data flow attestation system (100), comprising: at least one data processing apparatus (110) according to any one of the preceding claims configured to generate attestation data (145); and a verifier server (120) configured to receive the attestation data (145) from the at least one data processing apparatus (110) and to attest the integrity of the at least one data processing apparatus (110) based on the attestation data (145).
14. A data processing method (800) for executing an application, wherein the data processing method (800) comprises: executing (801) an application machine code (143) by a processing circuitry (111), wherein the processing circuitry (111) comprises a memory tagging extension and wherein the application machine code (143) comprises a plurality of memory access and / or allocation instructions for accessing and / or allocating a volatile memory (115a) at a plurality of memory locations, wherein each memory access and / or allocation instruction and its associated memory location are tagged with a tag from a finite set of tags, including one or more reserved tags and a plurality of assignable tags, wherein adjacent memory locations are tagged with different tags from the plurality of assignable tags, wherein each tag of the plurality of assignable tags is assigned toabout the same number of memory locations and wherein a tag to be assigned to a memory location is selected randomly from the plurality of assignable tags; and triggering (803) an exception, if a tag of a memory access and / or allocation instruction does not match a tag of the memory location to be accessed and / or allocated.
15. A computer program product comprising a computer-readable storage medium for storing program code which causes a computer or a processor to perform the method (800) of claim 14, when the program code is executed by the computer or the processor.
