Systems and methods for non-intrusive automatic trusted operator migration

WO2024243786A1PCT designated stage expired Publication Date: 2024-12-05HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/097000
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-05-30
Publication Date
2024-12-05

Smart Images

  • Figure CN2023097000_05122024_PF_FP_ABST
    Figure CN2023097000_05122024_PF_FP_ABST
Patent Text Reader

Abstract

The disclosure provides for systems and methods for non-intrusive automatic trusted operator migration. According to an aspect, a method is provided for executing a code in a secure environment. The method includes receiving, a code comprising an annotated portion and an unannotated portion. The annotated portion indicating a portion of the code for secure execution. The method may further includes constructing, in a trusted execution environment (TEE), a trusted application (TA) corresponding to the annotated portion. The method may further include constructing, in a rich execution environment (REE), a client application (CA) corresponding to the unannotated portion.
Need to check novelty before this filing date? Find Prior Art

Description

Systems and Methods for Non-Intrusive Automatic Trusted Operator Migration

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This the first application related to the present disclosure.TECHNICAL FIELD

[0003] The present disclosure pertains to the field of computer security, and in particular to systems and methods for non-intrusive automatic trusted operator migration.BACKGROUND

[0004] Computer security is an evolving field that faces several challenges in ensuring the confidentiality and integrity of computing systems and their data. Cyber attacks and threats are some of these challenges that may require constant monitoring and updating of security measures. In addition, modern computing systems are complex, with a wide range of hardware and software components that must be secured. This complexity can create vulnerabilities that are difficult to detect and address. Existing solutions, while providing some advantages, also face a number of limitations and challenges. One of the limitations with existing solutions is software compatibility. For example, existing solutions require modifications of original program to accommodate the new environment and safety features. Further, current uses of these technologies can come with a performance overhead, which can impact the overall performance of the system.

[0005] Therefore, there is a need for systems and methods for non-intrusive automatic trusted operator migration that obviates or mitigates one or more limitations of the prior art.

[0006] This background information is provided to reveal information believed by the applicant to be of possible relevance to the present invention. No admission is necessarily intended, nor should be construed, that any of the preceding information constitutes prior art against the present invention.SUMMARY

[0007] The disclosure provides for systems and methods for non-intrusive automatic trusted operator migration. According to an aspect, a method is provided for executing a code in a secure environment. The method includes receiving a code comprising an  annotated portion and an unannotated portion, the annotated portion indicating a portion of the code for secure execution. The method may further include constructing, in a trusted execution environment (TEE) , a trusted application (TA) corresponding to the annotated portion. The TEE may be a TEE of TrustZone. The method may further includes constructing, in a rich execution environment (REE) , a client application (CA) corresponding to the unannotated portion.

[0008] The method may further include receiving, at the CA, a request to execute a function in the TA based on data included in the request. The method may further include sending, from the CA to the TA, the request. The method may further include executing, at the TA, the function based on the request to obtain a result. The method may further include sending, from the TA to the CA, the result. The method may further include sending, from the CA to the caller, the result.

[0009] The step of sending, from the CA to the TA, the request may further include serializing, at the CA, the data to obtain a serialized data. Sending, from the CA to the TA, the request may further include sending, from the CA to the TA, the request including the serialized data.

[0010] The step of executing, at the TA, the function based on the request to obtain a result may include deserializing, at the TA, the serialized data to obtain the data. Executing, at the TA, the function based on the request to obtain a result may further include executing, at the TA, the function based on the data to obtain the result.

[0011] Sending, from the TA to the CA, the result may include serializing, at the TA, the result to obtain a serialized result. Sending, from the TA to the CA, the result may further include sending, from the TA to the CA, the serialized result.

[0012] Sending, from the CA, the result may include deserializing, at the CA, the serialized result to obtain the data.

[0013] The method may further include establishing a communication channel between the CA and the TA. The method may further include generating a serialization function and a deserialization function for use in the communication channel.

[0014] According to embodiments, an in-file annotation or an out-of-file annotation is used to annotate the annotated portion. The out-of-file annotation may be a meta-file of a defined domain specific language (DSL) . The meta-file of the DSL may be a YAML file.  The in-file annotation may be in a form of MACRO, C++ custom attributes, or Doxygen parameters. The annotated portion may include one or more of: classes and functions.

[0015] According to another aspect, an apparatus is provided. The apparatus includes modules configured to perform one or more of the methods described herein.

[0016] According to one aspect, an apparatus is provided, where the apparatus includes: a memory, configured to store a program; a processor, configured to execute the program stored in the memory, and when the program stored in the memory is executed by the processor, the apparatus is configured to perform one or more of the methods described herein.

[0017] According to another aspect, a computer readable medium is provided, where the computer readable medium stores program code executed by a processor associated with the device and the program code is used to perform one or more of the methods described herein.

[0018] According to one aspect, a chip is provided, where the chip includes a processor and a data interface, and the processor reads, by using the data interface, an instruction stored in a memory and executes said instructions configuring the chip to perform one or more of the methods described herein.

[0019] Other aspects of the disclosure provide for apparatus, and systems configured to implement the methods according to the first aspect disclosed herein. For example, a device can be a wireless station and access points. The device can be configured with machine readable memory containing instructions, which when executed by the processors of the device, configures the device to perform one or more of the methods and systems described herein.

[0020] Embodiments have been described above in conjunction with aspects of the present invention upon which they can be implemented. Those skilled in the art will appreciate that embodiments may be implemented in conjunction with the aspect with which they are described but may also be implemented with other embodiments of that aspect. When embodiments are mutually exclusive, or are incompatible with each other, it will be apparent to those skilled in the art. Some embodiments may be described in relation to one aspect, but may also be applicable to other aspects, as will be apparent to those of skill in the art.BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Further features and advantages of the present invention will become apparent from the following detailed description, taken in combination with the appended drawings, in which:

[0022] FIG. 1 illustrates prominent SGX implementations.

[0023] FIG. 2 illustrates a trust zone environment.

[0024] FIG. 3A illustrates an in-file-annotation at class level, according to an aspect.

[0025] FIG. 3B illustrates an in-file-annotation at function level, according to an aspect.

[0026] FIG. 3C illustrates an in-file-annotation based on Doxygen comment block, according to an aspect.

[0027] FIG. 4A illustrates an out-of-file annotation at class level, according to an aspect.

[0028] FIG. 4B illustrates an out-of-file annotation at function level, according to an aspect.

[0029] FIG. 5 illustrates a workflow diagram, according to an aspect.

[0030] FIG. 6 illustrates a compiler extension, for example Omnishield, in operation, according to an aspect.

[0031] FIG. 7 illustrates a method for performing a secure operation, according to an aspect.

[0032] FIG. 8 illustrates an apparatus that may perform any or all of operations of the above methods and features explicitly or implicitly described herein, according to different aspects of the present disclosure.

[0033] It will be noted that throughout the appended drawings, like features are identified by like reference numerals.DETAILED DESCRIPTION

[0034] The disclosure provides for systems and methods for non-intrusive automatic trusted operator migration. According to an aspect a method is provided for executing a code in a secure environment. The method includes receiving a code including an annotated portion and an unannotated portion. The annotated portion may indicate a portion of the code that needs to be moved to a secure environment for secure execution. The method may  further include constructing, in a trusted execution environment (TEE) , a trusted application (TA) corresponding to the annotated portion. The method may further include constructing, in a rich execution environment (REE) , a client application (CA) corresponding to the unannotated portion. In some embodiments, the annotated portion indicates one or more classes and functions of the code to be moved to the TEE. In some embodiments, an in-file annotation or an out-of-file annotation is used to annotate the annotated portion.

[0035] With cloud computing paradigm bringing high efficiency to many big data applications, the concern about its security and liability increases. On a public cloud, users can face attacks from other tenants and can be particularly vulnerable to privileged attacks, in which the entire OS might be under control of the attacker.

[0036] To address this concern,  provides the Software Guard eXtensions (SGX) that uses enclave, isolated memory regions, for secure computation.  provides a TrustZone, which has system-wide hardware enforced isolation between normal and trusted environments.

[0037] However, the burden remains for developers to modify their original program to accommodate the new environment and safety features. The code re-writing required for these modifications can be tedious, especially with the effort to minimize trusted computing base (TCB) for high performance.

[0038] Existing solutions can be categorized into two categories: the library operating system (LibOS) solution and the partitioning solution. The LibOS solutions require minimum, or even no code rewriting. However, these solutions transport the entire application to a secure environment, along with a light-weight operating system (OS) . Graphene-SGX is a lightweight LibOS that can run a single application with minimal host requirements in an isolated environment for SGX. Occulum is a memory-safe, multi-process LibOS for SGX. SCONE offers a secure Linux container on Intel SGX.

[0039] In addition, the partitioning solution moves part of the application to the trusted execution environment (TEE) , but generally requires significant and costly overhaul of legacy code. Sensitive code needs to be rewritten to make use of the SGX or TrustZone’s C or C++ application program interface (API) .

[0040] Furthermore, Uranus is a tool that can migrate a java virtual machine (JVM) program to SGX after the sensitive part of the code has been labeled with java annotation. Uranus also tackles some major vulnerabilities of the code reuse approach. RT- Trust is a tool that can migrate C programs with a real time feature to a trusted environment after the code has been labeled with a specific format of annotation.

[0041] Another solution, though not falling under the two mentioned categories, is Huawei secGear. This solution aims to provide a unified development framework for different hardware devices, shielding the differences between underlying confidential computing architectures and APIs, including SGX hardware and TrustZone. secGear provides extensibility capabilities at both the middleware layer and service layer, allowing developers to call security components and directly use the confidential computing services.

[0042] However, the existing solutions have their limitations. FIG. 1 illustrates prominent SGX implementations. The library OS simulates the functionality of an OS with optimized function calls based on contexts while interacting with the host OS via enclave interface. The shim layer acts as a layer of indirection that simply passes calls from within the enclave to the underlying host OS. However, these solutions may require applications to be packaged in its entirety, even the non-sensitive functions. This inevitably causes an increase in TCB, hence performance degradation, especially for data-intensive applications. Combining with the limited space in TEE, LibOS solutions are not suitable for tackling big data problems.

[0043] FIG. 2 illustrates a trusted environment. The trusted environment requires code to be partitioned and rewritten for its API. For the partitioning approach, some solutions also provide in-file annotation to aid code migration. However, their limitations are non-negligible. For example, Uranus only supports java virtual machine (JVM) language code migration. In addition, annotation associated with RT-Trust is intrusive. For example, after the code has been annotated with RT-Trust’s design, it is incompatible for compiling by a general C compiler.

[0044] Further, existing techniques are intrusive because their application requires changing the code as per the partitioning best practices from  According to  to use TrustZone, one would have to partition, via changing their code, their application into two parts (Client Application &Trusted Application) . Such modification can be considered intrusive. In addition, existing solutions migrate the whole code, including the portions that do not need protection, to the TEE, which further increases the attack surface, i.e., TCB.

[0045] A common disadvantage of existing solutions is that they only handle data size on the megabyte (MB) level. This disadvantage will be increasingly prominent since real-world applications require more and more ability to process large amounts of data. In addition, almost all tools target  SGX.  TrustZone runs a separate secure OS that already offers the OS functionality that a LibOS attempts to provide.

[0046] An aspect of the disclosure may obviate the need for developers to perform tedious and error-prone code rewriting in order to use  TrustZone for confidential computing. Some aspects may also ameliorate the problem of low performance caused by unnecessary transportation of data into and out of  TrustZone.

[0047] According to an aspect, a non-intrusive compiler extension may be provided that leverages existing syntax to support automatic conversion of non-trusted functions into trusted functions. The compiler extension which in some embodiments, may also be referred to as Omnishield. The compiler extension can be easy to use with multiple forms of non-intrusive annotation.

[0048] In some aspects, both non-trusted and trusted functions can co-exist as part of the binary output and it can be decided at runtime time whether using either a trusted or non-trusted version of the function can be based on the sensitivity of the data. According to an aspect, an adaptive execution pipeline may be provided where non-sensitive data used in the application will be processed using the non-trusted functions for improved performance. Thus, a data-exchange strategy may be adapted based on the size of data involved.

[0049] According to an aspect, the framework described herein may provide automatic memory management, secure data serialization and deserialization. As may be appreciated, during the process, sensitive data may be serialized into and out of the secure environment. Serialization may be done via employing security data serialization techniques to ensure that data is properly and securely fed into the secure environment and results are obtained from the secure environment.

[0050] According to some aspects, batched processing for data intensive applications with improved performance and security may be enabled. In an embodiment several operators may be enabled to work together to provide for batch processing (e.g., using one function call to perform multiple operations) . For example, assuming three operations are needed to be performed, a typical way is to call the operations one by one, resulting in three function calls. According to an aspect, the calling of multiple operations may be streamlined  into a single function call. From a customer’s perspective, one function call may be used to perform multiple operations. The streamlining of multiple operations into a single function call, e.g., batch processing, may allow for reduced roundtrips into and out of the secure environment, and thereby reducing security risk and the overhead involved with the transfer process to and from the secure environment (since each roundtrip involves encryptions and decryption operations, among others) .

[0051] According to an aspect, secure classes and functions can be chained together to reduce the overhead caused by transportation of the information to and from a secure environment. As a compiler extension, the preprocessing may be applied automatically during the compiling stage and controlled or initiated by compiler flag.

[0052] According to an aspect, a user’s code (e.g., a C or C++ program) may be preprocessed in which a portion (e.g., one or more classes and functions of the program) may operate on sensitive data. After preprocessing, the code may be migrated to a form suitable for the  TrustZone API or other similar trusted execution environment for secure calculation.

[0053] According to an aspect, a user may annotate, non-intrusively, the code (e.g., source code) either inside the source code file or outside the source code file. As may be appreciated, non-intrusive annotation may indicate that a user does not need to make code changes as one would if they followed the partitioning best practices from  According to  in order to use TrustZone, one would have to partition their application into 2 parts (Client Application &Trusted Application) . In direct contrast, according to an aspect, a user need not make such modifications, as required for partitioning, to original source code while still having the ability to secure operations associated with the selected portions of code. A user may annotate, non-intrusively, their code via in-file annotation or out-of-file annotation. In some embodiments, a user may annotate the code in-file via simple C++ attribute. In some embodiments, a user may annotate the code via out-file-file annotation in a separate file form the code, and the source code is left unchanged. The non-intrusive annotation allow for increased flexibility since the code is not modified as would be required otherwise.

[0054] A user may annotate the source code to indicate one or more portions (e.g., one or more of classes and functions) of the source code file that require secure calculation in TEE (e.g., for migration into the secure environment) . Thus, according to an aspect, a non- intrusive approach may be provided which obviates the need for partitioning of source code. In some embodiments, an in-file annotation may be appropriate for a new code, whereas, an out-of-file annotation may be appropriate for legacy code.

[0055] According to an aspect, file annotation, whether in-file or out-of-file, may thus indicate one or more portions of the source code for migration to a secure environment. In some aspects, the file annotation may indicate further information relating to the code, e.g., data type that is being labeled, data size, etc.

[0056] The code annotation may take several forms as may be appreciated by a person skilled in the art. This flexibility can reduce annotating effort by accommodating different features of legacy code.

[0057] In an embodiment, for in-file annotation, annotations, such as SECURE label, may be placed next to a portion of the code (e.g., the functions or classes) to indicate the need for secure execution. In some embodiments, annotations may be in the form of MACRO, custom attributes, Doxygen parameters, or other suitable annotation syntax as would be readily understood. In some embodiments, annotations may include other descriptions, such as size, serialization / deserialization (serde) , of some function parameters when these features are undeterminable from a function declaration.

[0058] In some embodiments, the out-of-file annotation may involve generating a new file, e.g., a YAML file or other suitable file configuration, which indicates similar information as the in-file annotation. Thus, for out-of-file annotation, annotations may be kept in a meta-file of a defined domain specific language (DSL) , such as YAML. The DSL may describe the Qualified Name of the function and / or the class.

[0059] The indicated (for example marked or labelled) one or more portions of the annotated code may be moved into the secure environment. In some embodiments, an extension to the compiling process, a compiler extension, which in some embodiments is termed Omnishield, as described herein, may be used to perform the operations involved in moving the indicated one or more portions of the annotated code. In some embodiments, the extension of the compiling process may operate as a switch, by which a user may activate the extension by turning on the switch, to work on the labelled portion of the source code. The compiler may then operate accordingly.

[0060] FIG. 3A illustrates an in-file-annotation at class level, according to an aspect. In some embodiments, one or more classes may be labeled as secure to indicate the one or more  classes for migration to a secure environment. According to embodiments, the secure labelling may be done at class level. For example, in FIG. 3A, class “car” is labeled as secure. The annotation may further indicate helpful information, e.g., “size=parts_size; manual [inout] ; record [in] : serde=custom, size=record_size” .

[0061] In some aspects, secure labelling may be done at function level. FIG. 3B illustrates an in-file-annotation at function level, according to an aspect. For example, function “MaintenanceRecord*GetRecord” is labeled as secure in FIG. 3B. It should be appreciated that while annotations in FIG. 3A and 3B are based on C++ custom attribute, other appropriate annotation approaches may be used, e.g., Doxygen comment block, as illustrated in FIG. 3C. FIG. 3C illustrates an in-file-annotation based on Doxygen comment block, according to an aspect.

[0062] As described herein, for out-of-file annotation, users may provide a YAML format file that includes the name and basic information of secure classes and functions. FIG. 4A illustrates an out-of-file annotation at class level, according to an aspect. FIG. 4B illustrates an out-of-file annotation at function level, according to an aspect.

[0063] As illustrated in FIGs. 4A and 4B, the original source code remains the same. The new file, e.g., YAML file, may include the required annotation for indicating one or more portions of the source code for migration. Similar to the in-file annotation, out-of-file annotation can be used to label one or more classes or one or more functions as secure, thereby identifying the labelled class or function for transfer to a secure environment for execution.

[0064] In some embodiments, to reduce the amount of annotation required, extra information other than a “secure” label may be needed. For example, if there is a pointer in function argument list, its size may need to be provided. In some embodiments, extra information may be needed if a reference or pointer in an associated argument list will be used to hold output. In this instance, an [out] or [inout] symbol may be required. In some embodiments, extra information may be needed if an argument list contains a user defined type, wherein this type of embodiment may be annotated as “serde=custom” .

[0065] In some embodiments, if a class or function is indicated by an aforementioned attribute as being sensitive, the class or function may be migrated to a trusted environment or secure environment automatically. In some embodiments, functions that are required to be executed may be classified into stateless and stateful functions. In some embodiments,  stateless functions may be carried out by a traditional function, e.g., int Multiply (int x, int y) . Stateful functions may be carried out by an instance of a class (i.e. an object) , e.g., void Operator. AddInput (VectorBatch*) .

[0066] According to an aspect, migrating a class or function to a trusted environment or secure environment may involve generating serde (serialization, deserialization) for data transmission. In some embodiments, for annotated stateless functions, function parameters may be collected to generate serdes. In some embodiments, for stateful functions, parameters of all class member functions, including constructors, may be collected to generate serdes. In some embodiments, custom serdes may be specified in order to override automatically generated serdes.

[0067] According to an aspect, migrating a class or function to trusted environment or secure environment may involve code generation. In some embodiments, the “non-trusted” function may be wrapped in a proxy to intercept the parameters needed by functions. In some embodiments, the “non-trusted” function may be wrapped in a proxy to create a corresponding trusted application (TA) with the original non-trusted code. In some embodiments, the “non-trusted” function may be wrapped in a proxy to serialize the parameters into shared secure memory. In some embodiments, the “non-trusted” function may be wrapped in a proxy to CA to invoke the TA with the parameters. In some embodiments, the “non-trusted” function may be wrapped in a proxy to retrieve the output from the secure memory.

[0068] According to an aspect, a compiler extension, for example which in some embodiments, may be referred to as Omnishield, may mark the portion of a code (one or more functions and classes) that require confidential computing, leaving the rest untouched. Accordingly, Omnishield may enable auto migration of target functions into TEE via annotation. Omnishield may further reduce or minimize TCB of the system for improved security. Omnishield may further allow for improved performance as only the necessary functions may run in resource scarce TEE. Omnishield may further automate pre-processing associated with compiling. Omnishield may further allow for transparency as security enhancements are non-intrusive. Omnishield may further flexibly serialize and deserialize buffers, and send and receive large sized data, which can make this format of compiler extension an ideal tool for big data applications.

[0069] FIG. 5 illustrates a workflow diagram, according to an aspect. A customer may annotate code 502, via, for example, C++ custom attribute annotations or appropriate techniques, to indicate a portion of the code for migrating to the TEE. A compiler extension, which in some embodiments, may be referred to as Omnishield, may receive the customer code with annotations and preprocess 504 the customer code. Omnishield may generate code for migrating the indicated portion of the code (for example indicative of sensitive parts of the program) to TEE. Generating code may involve generating 506 secure counterparts (e.g., TA) for the indicated portion (which may be sensitive classes and functions) . Generating code may further involve generating 508 TA and CA supporting files. Generating code may further involve generating 510 serde (serialization / deserialization data) , data input functions and data output functions.

[0070] According to embodiments in order to generate serde for an annotated function or class, at client application (CA) side, the secure function, either an annotated function or a member function of a secure class, may be intercepted and associated parameters can be collected to generate a serde. Generating serde maybe automated in some embodiments. In some embodiments, a user can also provide specific serde parameters or indications in order to override an automatically generated serde. Then serialized parameters may be transported into secure memory in TEE. CA may then invoke a TA call and retrieve output from the secure memory.

[0071] As mentioned, a secure counterpart of a function may be generated at TA side. A compiler extension, which in some embodiments, may be referred to as Omnishield, may deserialize function parameters and perform function operations, subsequently sending the results back. In instances where there are large outputs, the results may be sent back in batches.

[0072] In an embodiment, the preprocessed code may be combined or integrated within the trusted environment. For example, Huawei iTrustee SDK, supporting files, such as its integrity feature, and pre-written serde for all standard types are integrated within the trusted environment.

[0073] As may be appreciated, when several functions or operators are chained together, they may be combined into a single CA-to-TA-to-CA process. In some embodiments, a compiler extension, which in some embodiments, may be referred to as Omnishield, may obviate the need for the unnecessary transport of middle stage results, and thus the transport  of these middle stage results may not take place. This feature (namely avoiding the transport of middle stage results) can be advantageous for big data applications, since SQL requests generally includes a chain of operations and only need the final result.

[0074] In some embodiments, the one or more features of a compiler extension, for example Omnishield, may be designed as a plugin, for example a Clang-plugin. It is to be understood that a plugin may be controlled using compiler flags. Accordingly, users can be provided with a mechanism for selecting or not selecting the activation of the compiler extension, namely the secure execution of certain classes or functions.

[0075] FIG. 6 illustrates a compiler extension, which in some embodiments, may be referred to as Omnishield, in operation, according to an aspect. Omnishield operations may refer to box 600. In an embodiment, a user or a caller 620 may annotate code to indicate one or more portions thereof which are identified for secure operations. The one or more portions of the code may include one or more classes and functions. According to the code and annotation, Omnishield may request additional information associated with the classes or functions as required.

[0076] Caller 620 may request Omnishield 600 for one or more services and provide Omnishield with the code which has the associated annotation. As part of the request, the caller may request, for example, construction of an instance of class A, where class A is included in the portion indicated for secure operation. Omnishield may intercept and ferry the call, e.g., the request, and related parameters to the TEE 628. At TEE 628, Omnishield may construct class A 624, within the trusted application. Omnishield may return, from class A 624, a handle 603, back to caller 620. The caller may use the handle as a ticket, for example, to redeem services. The interception, for example the ferry service, and the construction of class A 624 may refer to the TA / CA supporting files 508 of FIG. 5.

[0077] In an embodiment, the caller 620 may use the handle to invoke function A of class A by sending a second request 604 (e.g., invoke ClassA. functionA (Args…) . Omnishield may intercept, at the client application side in REE (for example at class A 626) , the second request. Omnishield may, at class A 622 in REE, serialize 605 the second request and send the serialized second request to class A 624 in TEE 628. At class A 624, the serialized second request may be deserialized to determine the second request. Thereafter, function A may be invoked 606 on class A in TEE to obtain a result. The result may then be serialized, at class A 624, and sent to the client application side class A 622. At the client application  side, the serialized result may be deserialized and sent back to the caller. In some embodiments, the TA class A 624 may be deleted by invoking a delete request 606, as illustrated in FIG. 6.

[0078] According to some aspects, multiform and non-intrusive annotation may be used to indicate the portion of code to be performed in a secure environment. Accordingly, the original code may stay intact and reduced work may be needed to perform secure operations. Some aspects may further allow for migration of C code and C++ code. As may be appreciated, many high performance codes are written in C++. One or more aspects may allow for migration of a code (e.g., a C++ code) into a trusted environment, for example  TrustZone or similar trusted execution environment that support the migration of the code) , thus incorporating the advantages of the C++ language into confidential computing. According to some aspects, secure functions may be chained together to improve performance, which further reduces unnecessary transportation of large data.

[0079] FIG. 7 illustrates a method for performing a secure operation, according to an aspect. The method 700 includes receiving 701, code including an annotated portion and an unannotated portion. The annotated portion indicates a portion of the code for secure execution. The annotation may be in a non-intrusive manner, which makes the annotated code compatible for compiling by a general C compiler. The non-intrusive aspect may further allow for accommodating increased data size, which is suitable for big data applications. As described herein, the annotation may be done in-file or out-of-file.

[0080] The method 700 may further include constructing 702, in a trusted execution environment (TEE) , a trusted application (TA) corresponding to the annotated portion. As may be appreciated, only the portion of the code indicated by the annotated portion may be moved to TEE for secure operation. This feature, i.e., migrating only the required portion of the code to TEE, may permit larger code sizes (compared to code sizes based on existing techniques) to be processed and substantially reduce the attack surface, i.e., TCB.

[0081] The TEE may refer any appropriate TEE, such as TrustZone TEE or other similar TEE. The method 700 may further include constructing 703, in a rich execution environment (REE) , a client application (CA) corresponding to the unannotated portion. The REE may refer any appropriate REE, such as TrustZone REE or other similar REE.

[0082] As may be appreciated, the migration of the code to TEE and the REE may be automatic. In an aspect, the code may be scanned and the required portion indicated via annotation (whether in-file or out-of-file) may be identified and moved accordingly.

[0083] In some embodiments, the method 700 may further include receiving, at the CA from the caller, a request to execute a function in the TA based on data included in the request. In some embodiments, the method 700 may further include sending, from the CA to the TA, the request. In some embodiments, the method 700 may further include executing, at the TA, the function based on the request to obtain a result. In some embodiments, the method 700 may further include. In some embodiments, the method 700 may further include sending, from the TA to the CA, the result. In some embodiments, the method 700 may further include sending, from the CA to the caller, the result.

[0084] In some embodiments, sending, from the CA to the TA, the request may include serializing, at the CA, the data to obtain a serialized data. In some embodiments, sending, from the CA to the TA, the request may further include sending, from the CA to the TA, the request including the serialized data.

[0085] In some embodiments, executing, at the TA, the function based on the request to obtain a result may include deserializing, at the TA, the serialized data to obtain the data. In some embodiments, executing, at the TA, the function based on the request to obtain a result may further include executing, at the TA, the function based on the data to obtain the result.

[0086] In some embodiments, sending, from the TA to the CA, the result may include serializing, at the TA, the result to obtain a serialized result. In some embodiments, sending, from the TA to the CA, the result may further include sending, from the TA to the CA, the serialized result.

[0087] In some embodiments, sending, from the CA to the caller, the result may include deserializing, at the CA, the serialized result to obtain the data. In some embodiments, sending, from the CA to the caller, the result may further include sending, from the CA to the caller, the result.

[0088] In some embodiments, the method may further include establishing a communication channel between the CA and the TA. In some embodiments the method may further include generating a serialization function and a deserialization function for use in the communication channel.

[0089] In some embodiments, an in-file annotation or an out-of-file annotation is used to annotate the annotated portion. The in-file annotation may be done in any appropriate format as may be appreciated by a person skilled in the art, for example, in the form of MACRO, custom attributes (C++ custom attributes) , Doxygen parameters, or other suitable annotation syntax.

[0090] The out-of-file annotation may involve generating a new file, e.g., a YAML file or another suitable file configuration. For out-of-file annotation, annotations may be kept in a meta-file of a defined domain specific language (DSL) . In some embodiments, the out-of-file annotation is a YAML file. In some embodiments, the annotated portion comprises one or more of: classes and functions.

[0091] FIG. 8 illustrates an apparatus 800 that may perform any or all of the operations with one or more of the above methods and features explicitly or implicitly described herein, according to different aspects of the present disclosure. For example, a computer equipped with network function may be configured as the apparatus 800. In some aspect, apparatus 800 can a device that connects to the network infrastructure over a radio interface, such as a mobile phone, smart phone or other such device that may be classified as user equipment (UE) . In some aspects, the apparatus 800 may be a machine type communications (MTC) device (also referred to as a machine-to-machine (M2M) device) , or another such device that may be categorized as a UE despite not providing a direct service to a user. In some aspects, apparatus 800 may be used to implement one or more aspects described herein. For example, the apparatus 800 may be configured to implement a compiler extension, which in some embodiments, may be referred to as Omnishield. Apparatus 800 may further be configured to perform one or more operations described in reference to FIG. 5, 6, AND 7.

[0092] As shown, the apparatus 800 may include a processor 810, such as a central processing unit (CPU) or specialized processors such as a graphics processing unit (GPU) or other such processor unit, memory 820, non-transitory mass storage 830, input-output interface 840, network interface 850, and a transceiver 860, all of which are communicatively coupled via bi-directional bus 870. According to certain aspects, any or all of the depicted elements may be utilized, or only a subset of the elements. Further, apparatus 800 may contain multiple instances of certain elements, such as multiple processors, memories, or transceivers. Also, elements of the hardware device may be directly coupled to other elements without the bi-directional bus. Additionally, or alternatively to a processor and  memory, other electronics, such as integrated circuits, may be employed for performing the required logical operations.

[0093] The memory 820 may include any type of non-transitory memory such as static random-access memory (SRAM) , dynamic random-access memory (DRAM) , synchronous DRAM (SDRAM) , read-only memory (ROM) , any combination of such, or the like. The mass storage element 830 may include any type of non-transitory storage device, such as a solid-state drive, hard disk drive, a magnetic disk drive, an optical disk drive, USB drive, or any computer program product configured to store data and machine executable program code. According to certain aspects, the memory 820 or mass storage 830 may have recorded thereon statements and instructions executable by the processor 810 for performing any of the aforementioned method operations described above.

[0094] Aspects of the present disclosure can be implemented using electronics hardware, software, or a combination thereof. In some aspects, this may be is implemented by one or multiple computer processors executing program instructions stored in memory. In some aspects, the invention is implemented partially or fully in hardware, for example using one or more field programmable gate arrays (FPGAs) or application specific integrated circuits (ASICs) to rapidly perform processing operations.

[0095] It will be appreciated that, although specific aspects of the technology have been described herein for purposes of illustration, various modifications may be made without departing from the scope of the technology. The specification and drawings are, accordingly, to be regarded simply as an illustration of the invention as defined by the appended claims, and are contemplated to cover any and all modifications, variations, combinations or equivalents that fall within the scope of the present invention. In particular, it is within the scope of the technology to provide a computer program product or program element, or a program storage or memory device such as a magnetic or optical wire, tape or disc, or the like, for storing signals readable by a machine, for controlling the operation of a computer according to the method of the technology and / or to structure some or all of its components in accordance with the system of the technology.

[0096] Acts associated with the method described herein can be implemented as coded instructions in a computer program product. In other words, the computer program product is a computer-readable medium upon which software code is recorded to execute the method  when the computer program product is loaded into memory and executed on the microprocessor of the wireless communication device.

[0097] Further, each operation of the method may be executed on any computing device, such as a personal computer, server, PDA, or the like and pursuant to one or more, or a part of one or more, program elements, modules or objects generated from any programming language, such as C++, Java, or the like. In addition, each operation, or a file or object or the like implementing each said operation, may be executed by special purpose hardware or a circuit module designed for that purpose.

[0098] Through the descriptions of the preceding aspects, the present invention may be implemented by using hardware only or by using software and a necessary universal hardware platform. Based on such understandings, the technical solution of the present invention may be embodied in the form of a software product. The software product may be stored in a non-volatile or non-transitory storage medium, which can be a compact disc read-only memory (CD-ROM) , USB flash disk, or a removable hard disk. The software product includes a number of instructions that enable a computer device (personal computer, server, or network device) to execute the methods provided in the aspects of the present invention. For example, such an execution may correspond to a simulation of the logical operations as described herein. The software product may additionally or alternatively include a number of instructions that enable a computer device to execute operations for configuring or programming a digital logic apparatus in accordance with aspects of the present invention.

[0099] Although the present invention has been described with reference to specific features and aspects thereof, it is evident that various modifications and combinations can be made thereto without departing from the invention. The specification and drawings are, accordingly, to be regarded simply as an illustration of the invention as defined by the appended claims, and are contemplated to cover any and all modifications, variations, combinations or equivalents that fall within the scope of the present invention.

Claims

1.A method comprising:receiving a code comprising an annotated portion and an unannotated portion, the annotated portion indicating a portion of the code for secure execution;constructing, in a trusted execution environment (TEE) , a trusted application (TA) corresponding to the annotated portion; andconstructing, in a rich execution environment (REE) , a client application (CA) corresponding to the unannotated portion.2.The method of claim 1 further comprising:receiving, at the CA, a request to execute a function in the TA based on data included in the request;sending, from the CA to the TA, the request;executing, at the TA, the function based on the request to obtain a result;sending, from the TA to the CA, the result; andsending, from the CA, the result.3.The method of claim 1 or 2, wherein sending, from the CA to the TA, the request comprises:serializing, at the CA, the data to obtain a serialized data; andsending, from the CA to the TA, the request including the serialized data.4.The method of any one of claims 1 to 3, wherein executing, at the TA, the function based on the request to obtain a result comprises:deserializing, at the TA, the serialized data to obtain the data; andexecuting, at the TA, the function based on the data to obtain the result.5.The method of any one of claims 1 to 4, wherein sending, from the TA to the CA, the result comprises:serializing, at the TA, the result to obtain a serialized result; andsending, from the TA to the CA, the serialized result.6.The method of any one of claims 1 to 5, wherein sending, from the CA, the result comprises:deserializing, at the CA, the serialized result to obtain the data; andsending, from the CA, the result.7.The method of any one of claims 1 to 6 further comprising:establishing a communication channel between the CA and the TA; andgenerating a serialization function and a deserialization function for use in the communication channel.8.The method of any one of claims 1 to 7, wherein an in-file annotation or an out-of-file annotation is used to annotate the annotated portion.9.The method of claim 8, wherein the out-of-file annotation is a meta-file of a defined domain specific language (DSL) .10.The method of claim 9, wherein the meta-file of the DSL is a YAML file.11.The method of claim 8 wherein the in-file annotation is in a form of: MACRO, C++custom attributes, or Doxygen parameters.12.The method of any one of claims 1 to 11, wherein the annotated portion comprises one or more of: classes and functions.13.The method of any one of claims 1 to 12 wherein the TEE is a TEE of TrustZone.14.An apparatus comprising:at least one processor; andat least one machine-readable medium storing executable instructions which when executed by the at least one processor configure the apparatus to perform any one of method claims 1 to 13.15.A computer device comprising a non-transitory computer readable medium having instructions stored thereon which, when executed by a computer processor, causes the computer to perform the method as described in any one of claims 1 to 13.

Citation Information

Patent Citations

  • System and method for having access to credible execution environment and credible application

    CN104765612A

  • Trust zone-based operating system and method

    CN110348252A

  • User-level code and data security and credibility protection method and device based on TrustZone

    CN112818327A

  • Method for library operating system (LibOS) of trusted execution environment (TEE)

    CN115640571A

  • Method to upgrade a TEE trusted application to a server mode

    US20210334362A1