A method, apparatus, medium and device for controlling application program access to target elements
By performing legitimacy verification on applications within a trusted execution environment and generating and destroying legitimacy verification data, the security threat of applications in a trusted execution environment accessing target units in a non-trusted execution environment is addressed, thereby improving security and data integrity.
Patent Information
- Application Number
- CN202211428340.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-15
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2042-11-15
AI Technical Summary
In the prior art, applications running in trusted execution environments face security threats when accessing target units in untrusted execution environments, and cannot effectively defend against illegal intrusions by malware.
In a trusted execution environment, the application is validated. The validation service module generates and destroys validation data to ensure that only legitimate applications can access the target unit.
It enhances the security of trusted execution environment applications accessing non-trusted execution environment target units, prevents unauthorized applications from intruding, and ensures data security and integrity.
Smart Images

Figure CN115618337B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of trusted execution environments, and more specifically, embodiments of this application relate to a method, apparatus, medium, and device for controlling application access to target units. Background Technology
[0002] Trusted Execution Environments (TEEs) are a technology that protects data and programs through isolation. Compared with traditional security technologies, they can proactively defend against security threats from the outside and more effectively protect their own security.
[0003] A Trusted Execution Environment (TEE) is a processable environment that provides security and integrity protection for processes, memory, and storage. This approach proactively selects the data and processes that need protection, using isolation methods to protect sensitive data from malware and hackers, and more effectively ensures data security and integrity compared to traditional security technologies. Summary of the Invention
[0004] The purpose of this application is to provide a method, apparatus, medium, and device for controlling application access to a target unit. Some embodiments of this application can ensure the exclusive use of the interface for accessing the target unit by adding a function to verify the legitimacy of the application. This prevents other applications from illegally infringing on the second processor when the application running in the trusted execution environment is running on the target unit in a non-trusted execution environment.
[0005] In a first aspect, embodiments of this application provide a method for controlling application access to a target unit. The method includes: when any application needs to access the target unit through a first interface, performing a legitimacy verification on the application in a trusted execution environment, wherein the application runs on a first processor, the first interface can be called by all programs running on the first processor, the first interface runs in an untrusted execution environment, and the target unit runs in an untrusted execution environment; if the verification passes, the application is allowed to access the target unit through the first interface; if the verification fails, the application is prohibited from accessing the target unit.
[0006] Some embodiments of this application require verification of the legitimacy of an application when it needs to access a target unit, thereby ensuring that the task running on the target unit is protected. In other words, some embodiments of this application prevent insecure applications from accessing the target unit through security authentication, thereby improving the security of applications running in a trusted environment when using target units running in an untrusted environment.
[0007] In some embodiments, the first processor is a CPU processor, the target unit is a second processor, and the first interface is an interface developed for accessing the second processor.
[0008] Some embodiments of this application provide a method for controlling how an application running in a trusted execution environment accesses a processor running in an untrusted execution environment, thereby enabling the application in the trusted execution environment to use the processor running in the untrusted execution environment more securely and reliably.
[0009] In some embodiments, the legitimacy verification of any application in a trusted execution environment includes: providing data to be verified to the first interface; the first interface providing the data to be verified to a verification service providing module running in the trusted environment, wherein the verification service providing module completes the legitimacy verification of any application based on the data to be verified; and the verification service providing module completes the legitimacy verification of any application based on the data to be verified.
[0010] Some embodiments of this application use a verification service program running in a trusted execution environment to verify the legitimacy of the application accessing the target unit based on the data to be verified, which can improve the legitimacy of the legitimacy authentication result and enhance the security of the application in the trusted execution environment accessing the target unit.
[0011] In some embodiments, before providing the data to be verified to the first interface, the method further includes: requesting data from the verification service providing module required to verify the legitimacy of any application; receiving the data to be verified generated by the verification service providing module for any application; wherein the verification service providing module determines whether to provide legitimate verification data to the application based on the application's attribute information, the attribute information including whether the application is running in a trusted execution environment.
[0012] Some embodiments of this application also control the distribution of data used for legitimacy verification through a verification service module (i.e., a program) running in a trusted execution environment, which can further enhance the flexibility of legitimacy result verification. For example, sending an empty string to an insecure application to prevent subsequent legitimacy verification of it can prevent the insecure application from accessing the target unit.
[0013] In some embodiments, any application is a first application running in a trusted execution environment, and the verification service providing module is configured to generate valid verification data for the first application in response to a request from the first application, and the verification service providing module is further configured to invalidate the valid verification data according to a preset invalidation rule; any application is a second application running in a non-trusted execution environment, and the verification service providing module is configured to generate invalid verification data for the second application in response to a request from the second application.
[0014] Some embodiments of this application generate data for legitimacy verification and destroy such data in real time by using a verification service module running in a trusted execution environment, and perform legitimacy verification on applications to be accessed by the target unit, which can improve the accuracy of application legitimacy verification results.
[0015] In some embodiments, the valid verification data may be represented in the form of a string, a certificate, or a hash value.
[0016] In some embodiments, the valid verification data is represented by a non-empty string, and the invalid verification data is an empty string.
[0017] In some embodiments, allowing any application to access the target unit through the first interface includes: unloading application-side data corresponding to any application to a non-secure area and calling the first interface; sending the application-side data and calculation instructions to the target unit through the first interface, wherein the target unit completes the target task and obtains the processing result according to the calculation instructions and the application-side data; and providing the processing result to any application through the first interface.
[0018] Some embodiments of this application allow access to the target unit via the corresponding interface after passing legality verification.
[0019] Secondly, some embodiments of this application provide an apparatus for controlling application access to a target unit. The apparatus includes: a legitimacy verification module configured to perform legitimacy verification on any application in a trusted execution environment when any application needs to access the target unit through a first interface, wherein the application runs on a first processor, the first interface can be invoked by all programs running on the first processor, the first interface runs in an untrusted execution environment, and the target unit runs in an untrusted execution environment; and an access control module configured to: allow any application to access the target unit through the first interface if the verification passes; and prohibit any application from accessing the target unit if the verification fails.
[0020] Thirdly, some embodiments of this application provide a device for controlling access to a processing unit in an insecure operating environment. The device includes: a verification service providing module running in a trusted execution environment, configured to: generate data for legitimacy verification, destroy the data, or receive a call to a first interface to perform legitimacy verification on any application when the application needs to access the target unit through the first interface, wherein the application runs on a first processor, the first interface can be called by all programs running on the first processor, the first interface runs in an untrusted execution environment, and the target unit runs in an untrusted execution environment; and an interface processing module configured to, upon receiving a request from the application to access the target unit through the first interface, obtain data to be verified corresponding to the application and call the verification service providing module to enable the verification service providing module to complete the legitimacy verification of the application based on the data to be verified, and access the target unit after the legitimacy verification is successful.
[0021] Fourthly, some embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can implement the methods described in any embodiment of the first aspect.
[0022] Fifthly, some embodiments of this application provide an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, can implement the method as described in any embodiment of the first aspect. Attached Figure Description
[0023] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0024] Figure 1 A schematic diagram illustrating a method for accessing a processor in an untrusted execution environment, provided by the related technologies in the embodiments of this application;
[0025] Figure 2 A schematic diagram illustrating a method for accessing a processor in an untrusted execution environment provided in an embodiment of this application;
[0026] Figure 3 One of the flowcharts of a method for controlling an application to access a target unit provided in an embodiment of this application;
[0027] Figure 4 A second flowchart illustrating a method for controlling an application to access a target unit, provided in an embodiment of this application.
[0028] Figure 5 The third flowchart of the method for controlling an application to access a target unit provided in this application embodiment;
[0029] Figure 6 The fourth flowchart of the method for controlling an application to access a target unit provided in this application embodiment;
[0030] Figure 7 A block diagram of a device for controlling an application to access a target unit, provided in an embodiment of this application;
[0031] Figure 8 This is a schematic diagram of the electronic device provided in the embodiments of this application. Detailed Implementation
[0032] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.
[0033] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0034] Please refer to Figure 1 , Figure 1This provides a method for trusted applications running in a trusted execution environment and client applications running in a normal execution environment to access the CPU in an untrusted execution environment through an untrusted port.
[0035] like Figure 1 As shown, both the normal execution environment and the trusted execution environment include an application layer, an interface layer, a system layer, and a platform hardware layer. The application layer includes multiple client applications running in the normal execution environment and multiple trusted applications running in the trusted execution environment. The client interfaces below the application layer can communicate with the trusted ports of the trusted execution environment. The system layer includes the TEE OS corresponding to the normal execution environment and the TEEOS corresponding to the trusted execution environment. The platform hardware layer includes TrustZone hardware. Except for the bottom layer, which is a hardware layer, all other layers are software layers. For example, the TrustZone hardware includes a first CPU processor. The inventors of this application discovered that if an application in the trusted execution environment on the first CPU processor needs to perform some operations using the CPU of the untrusted execution environment, the client application running in the normal execution environment can also simultaneously call the untrusted interface to access the CPU of the untrusted execution environment. Therefore, this poses a significant security risk to the trusted applications running in the trusted execution environment.
[0036] The embodiments of this application, at least to address this type of security vulnerability, require performing legitimacy verification on each application when it accesses the untrusted execution environment CPU (or GPU or other types of processors) through an untrusted interface, and only allowing applications that pass legitimacy verification to access the target unit of the untrusted execution environment (e.g., ...) via the untrusted interface. Figure 1 Untrusted execution environments (CPU, GPU, etc.)
[0037] The following is combined with Figure 3 The present application provides, by way of exemplarily illustrating some embodiments, methods for validating the legitimacy of various applications.
[0038] like Figure 3 As shown, embodiments of this application provide a method for controlling an application's access to a target unit (e.g., Figure 1A method for accessing a target unit in an untrusted execution environment (such as a CPU), comprising: S101, when any application needs to access the target unit through a first interface, performing a legitimacy verification on the application in a trusted execution environment, wherein the application runs on a first processor, the first interface can be called by all programs running on the first processor, the first interface runs in an untrusted execution environment, and the target unit runs in an untrusted execution environment; S102, if the verification passes, allowing the application to access the target unit through the first interface; S103, if the verification fails, prohibiting the first application from accessing the target unit. For example, in some embodiments of this application, the first processor is a CPU processor, the target unit is a second processor, and the first interface is an interface developed for accessing the second processor.
[0039] In other words, some embodiments of this application first verify the legitimacy of an application when it needs to access a target unit, thereby ensuring the protection of tasks running on the target unit. That is, some embodiments of this application prevent insecure applications from accessing the target unit through legitimacy authentication, improving the security of applications running in a trusted environment when using target units running in an untrusted environment. Some embodiments of this application provide a method for controlling how applications running in a trusted execution environment access processors running in an untrusted execution environment, enabling applications in a trusted execution environment to use processors running in an untrusted execution environment more securely and reliably.
[0040] The implementation process of S101 is illustrated below.
[0041] In some embodiments of this application, the legitimacy verification of any of the applications in a trusted execution environment includes:
[0042] The first step is to provide the data to be verified to the first interface.
[0043] In some embodiments of this application, the data to be verified is generated from a verification service providing module running in a trusted execution environment. For example, in some embodiments of this application, before providing the data to be verified to the first interface, the method for controlling the application to access the target unit further includes: requesting data from the verification service providing module required to verify the legitimacy of any application; receiving the data to be verified generated by the verification service providing module for any application; wherein the verification service providing module determines whether to provide legitimate verification data to the application based on the application's attribute information, the attribute information including whether the application is running in a trusted execution environment.
[0044] It should be noted that, in some embodiments of this application, any application running in a trusted execution environment is a first application, and the verification service providing module is configured to generate valid verification data for the first application in response to a request from the first application, and the verification service providing module is also configured to invalidate the valid verification data according to a preset invalidation rule; any application running in a non-trusted execution environment is a second application, and the verification service providing module is configured to generate invalid verification data for the second application in response to a request from the second application. Some embodiments of this application, by using a verification service module running in a trusted execution environment to generate data for validity verification and immediately destroy this data, as well as to perform validity verification on applications to be accessed by the target unit, can improve the accuracy of application validity verification results.
[0045] It is easy to understand that some embodiments of this application also control the distribution of data used for legitimacy verification through a verification service module (i.e., a program) running in a trusted execution environment, which can further improve the flexibility of legitimacy result verification. For example, sending an empty string to an insecure application to prevent subsequent legitimacy verification from failing can prevent the insecure application from accessing the target unit.
[0046] In the second step, the first interface provides the data to be verified to the verification service provider module running in a trusted environment, wherein the verification service provider module completes the legality verification of any application based on the data to be verified.
[0047] It is understandable that the verification service module is a program running in a trusted execution environment, and this program can be called by the interface developed for the accessed object (i.e., the target unit), thereby enabling the application that wants to access the target unit to first perform a legality verification.
[0048] The third step involves the verification service provider module performing a legitimacy verification for any of the applications based on the data to be verified.
[0049] For example, the verification is performed by comparing the data to be verified with the valid data corresponding to the application stored in the verification service module. If the two are consistent, the verification is considered to have passed; otherwise, the verification is considered to have failed.
[0050] Some embodiments of this application use a verification service program running in a trusted execution environment to verify the legitimacy of the application accessing the target unit based on the data to be verified, which can improve the legitimacy of the legitimacy authentication result and enhance the security of the application in the trusted execution environment accessing the target unit.
[0051] For example, in some embodiments of this application, the valid verification data may be represented in the following forms: string, certificate, or hash value. In some embodiments of this application, the valid verification data is represented in the form of a non-empty string, and the invalid verification data is an empty string.
[0052] The implementation process of S102 is illustrated below.
[0053] For example, in some embodiments of this application, allowing any application to access the target unit through the first interface includes: unloading application-side data corresponding to any application to a non-secure area and calling the first interface; sending the application-side data and calculation instructions to the target unit through the first interface, wherein the target unit completes the target task and obtains the processing result according to the calculation instructions and the application-side data; and providing the processing result to any application through the first interface. In some embodiments of this application, the target unit can be accessed through the corresponding interface after passing legality verification.
[0054] The following is combined with Figures 4-6 The examples illustrate methods for controlling an application to access a target unit provided by some embodiments of this application. In these embodiments, the target unit is a GPU running in an untrusted execution environment, and the application runs on a CPU processor that can run applications located in trusted execution environments or applications located in untrusted execution environments.
[0055] Some embodiments of this application can ensure the security of application access cards in a Trusted Execution Environment (TEE).
[0056] Some embodiments of this application are based on the existing SDK and TEE framework, adding the registration (i.e., obtaining a lease, which can be a string or numerical certificate, etc.) and verification process for TEE APP (i.e., an application running in a trusted execution environment).
[0057] In some embodiments of this application, such as Figure 4 As shown, a verification service provider module, tee lease service, is added to the Trusted Execution Environment (TEE) side. This verification service provider module provides lease generation, destruction, and verification services to applications that require them. In some embodiments of this application, lease saving and deletion, as well as check functions (here, check refers to calling the verification function provided by tee lease service in the SDK) are added to the SDK interface (as an example of the first interface).
[0058] like Figure 4 As shown in some embodiments of this application, if an application running in a trusted execution environment (TEE app) needs to obtain a lease through the verification service provider module tee leaseservice before using a GPU located in an untrusted execution environment, and set the obtained lease in the SDK, the CUDA function interface of the SDK needs to perform the following operations before accessing the GPU: First, call the check interface of the verification service provider module tee leaseservice to determine the validity of the saved lease. If it is invalid, it will directly report an error and exit. If it is valid, it will continue to perform the operation of accessing the GPU.
[0059] Compared with the prior art, some embodiments of this application employ the above technical solutions and have the following technical effects: by adding the function of the verification service provider module tee lease check, it can ensure the exclusive use of the interface CUDA by the application running in the trusted execution environment, i.e., the tee application, and prevent other applications from illegally infringing on the tee application during runtime.
[0060] like Figure 5 As shown in some embodiments of this application, a first application running a Trusted Execution Environment (TEE) needs to perform the following operations before accessing a GPU running in a non-trusted execution environment: 1. Obtain a lease, i.e., request a lease produced by the GPU Lease Service, a verification service provider running in the trusted execution environment; 2. Pass the obtained lease to CUDA (as an example of the first interface); 3. Check the validity of the lease through the GPU Lease Service; 4. Renew the lease. If another application attempts to obtain a lease produced by the GPU Lease Service at this time, the lease acquisition will fail to prevent the application from accessing the GPU. It is understood that if the application no longer uses the GPU (i.e., the application requests the GPU Lease Service to release the lease) or after a preset time, the GPU Lease Service will invalidate the valid leases produced and issued by it.
[0061] It is understood that in some embodiments of this application, such as Figure 5The Trusted Execution Environment (TEE) shown above provides a GPU lease service module for verification services. This module provides external interface services via gRPC, offering four interfaces: Rent (for generating a lease), Renew (for renewing the lease when the app restarts after an abnormal exit), Cancel (for destroying the lease after the app finishes running), and Check (for determining the validity of the current application lease at the CUDA level). The first three interfaces are called by the app, while the last check interface is called by the SDK.
[0062] After the TEE app runs, it first calls the rent interface to obtain the lease, and then calls the SDK interface to pass the lease to the SDK for saving. When the CUDA interface is called later, the CUDA interface will pass the saved lease to the TEE GPU lease service through gRPC to check the validity of the lease. If it is invalid, it will be saved and the app will not be able to run.
[0063] like Figure 6 As shown, when the GPU does not support a trusted execution environment for TEEs, if a CPU-side TEE application needs to call the GPU for computation, execution continues after the validity verification passes: 1. The application unloads data to a non-secure area; 2. It calls the CUDA interface (taking a BI card as an example); 3. It transfers the data to the GPU through this interface and then sends commands to the GPU for computation. After the computation is completed, 4. It calls the CUDA copy interface to copy the data from the GPU side back to the CPU-side non-secure area. It is understandable that every application requiring GPU access must first pass a validity verification before execution. Figure 6 This process, therefore, allows for the control of whether an application can access the GPU through authentication, effectively preventing applications running in a trusted execution environment from performing actions such as... Figure 6 During the access process shown, if other insecure applications attempt to access the GPU, their access to the GPU will be blocked. This effectively prevents these insecure applications from obtaining or corrupting data.
[0064] Please refer to Figure 7 , Figure 7 The present application provides an apparatus for controlling an application's access to a target unit. It should be understood that this apparatus is similar to the one described above. Figure 3Corresponding to the method embodiments, it is capable of executing the various steps involved in the above method embodiments. The specific functions of the device can be found in the description above, and detailed descriptions are omitted here to avoid repetition. The device includes at least one software function module that can be stored in the memory or embedded in the device's operating system in the form of software or firmware. The device for controlling application access to the target unit includes: a legality verification module 101 and an access control module 102.
[0065] The legitimacy verification module 101 is configured to perform legitimacy verification on any application in a trusted execution environment when any application needs to access the target unit through a first interface, wherein the application runs on a first processor, the first interface can be called by all programs running on the first processor, the first interface runs in a non-trusted execution environment, and the target unit runs in a non-trusted execution environment.
[0066] Access control module 102 is configured to: allow any application to access the target unit through the first interface if the verification is successful; and prohibit any application from accessing the target unit if the verification fails.
[0067] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the device described above can be referred to the corresponding process in the aforementioned method, and will not be elaborated further here.
[0068] like Figure 5 As shown, some embodiments of this application provide a device for controlling access to a processing unit in an insecure operating environment. The device includes: a verification service providing module (i.e., a tee leaseservice module) running in a trusted execution environment, configured to: generate data for legitimacy verification, destroy the data, or receive a call to a first interface to perform legitimacy verification on any application when the application needs to access the target unit through the first interface, wherein the application runs on a first processor, the first interface can be called by all programs running on the first processor, the first interface runs in an untrusted execution environment, and the target unit runs in an untrusted execution environment; and an interface processing module (i.e., an SDK), configured to, upon receiving a request from the application to access the target unit through the first interface, obtain data to be verified corresponding to the application and call the verification service providing module to enable the verification service providing module to complete the legitimacy verification of the application based on the data to be verified, and access the target unit after the legitimacy verification is passed.
[0069] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the device described above can be referred to the corresponding process in the aforementioned method, and will not be elaborated further here.
[0070] Some embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can implement the methods described in any of the above embodiments.
[0071] like Figure 8 As shown, some embodiments of this application provide an electronic device 500, including a memory 510, a processor 520, and a computer program stored in the memory 510 and executable on the processor 520, wherein the processor 520 executes the program to implement the methods described in any of the above embodiments.
[0072] Processor 520 can process digital signals and can include various computing architectures. For example, it can be a complex instruction set computer architecture, a reduced instruction set computer architecture, or an architecture that implements multiple instruction set combinations. In some examples, processor 520 can be a microprocessor.
[0073] The memory 510 can be used to store instructions executed by the processor 520 or data related to the execution of instructions. These instructions and / or data may include code used to implement some or all of the functions of one or more modules described in the embodiments of this application. The processor 520 of the embodiments of this disclosure can be used to execute the instructions in the memory 510 to implement… Figures 3-6 The method shown. Memory 510 includes dynamic random access memory, static random access memory, flash memory, optical memory, or other memory well known to those skilled in the art.
[0074] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0075] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0076] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0077] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application. It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0078] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0079] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
Claims
1. A method for controlling an application's access to a target unit, characterized in that, The method includes: When any application needs to access the target unit through the first interface, the legitimacy of the application is verified in a trusted execution environment, wherein the application runs on the first processor, the first interface can be called by all programs running on the first processor, the first interface runs in a non-trusted execution environment, and the target unit runs in a non-trusted execution environment. If the verification passes, any application is allowed to access the target unit through the first interface; If the verification fails, any application is prohibited from accessing the target unit. The step of performing legitimacy verification on any application in a trusted execution environment includes: providing data to be verified to the first interface; the first interface providing the data to be verified to a verification service providing module running in the trusted environment, wherein the verification service providing module completes the legitimacy verification of any application based on the data to be verified; and the verification service providing module completes the legitimacy verification of any application based on the data to be verified. Before providing the data to be verified to the first interface, the method further includes: requesting data from the verification service providing module required to verify the legitimacy of any application; receiving the data to be verified generated by the verification service providing module for any application; wherein the verification service providing module determines whether to provide legitimate verification data to the application based on the application's attribute information, the attribute information including: whether the application is running in a trusted execution environment; The first application is a first application running in a trusted execution environment. The verification service providing module is configured to generate valid verification data for the first application in response to a request from the first application, and the verification service providing module is also configured to invalidate the valid verification data according to a preset invalidation rule. The second application is a second application running in a non-trusted execution environment. The verification service providing module is configured to generate invalid verification data for the second application in response to a request from the second application.
2. The method as described in claim 1, characterized in that, The first processor is a CPU processor, the target unit is a second processor, and the first interface is an interface developed for accessing the second processor.
3. The method as described in claim 1, characterized in that, The legitimate verification data is represented in the following forms: string, certificate, or hash value.
4. The method as described in claim 3, characterized in that, The valid verification data is represented by a non-empty string, and the invalid verification data is an empty string.
5. The method according to any one of claims 1-4, characterized in that, Allowing any application to access the target unit through the first interface includes: The application-side data corresponding to any of the applications is unloaded to a non-secure area, and the first interface is called; The application-side data and operation instructions are sent to the target unit through the first interface, wherein the target unit completes the target task and obtains the processing result according to the operation instructions and the application-side data; The processing result is provided to either of the applications through the first interface.
6. A device for controlling an application's access to a target unit, characterized in that, The device includes: The legitimacy verification module is configured to perform legitimacy verification on any application in a trusted execution environment when any application needs to access the target unit through the first interface. The application runs on the first processor, the first interface can be called by all programs running on the first processor, the first interface runs in an untrusted execution environment, and the target unit runs in an untrusted execution environment. The access control module is configured to: allow any application to access the target unit through the first interface if the verification is successful; and prohibit any application from accessing the target unit if the verification fails. The step of performing legitimacy verification on any application in a trusted execution environment includes: providing data to be verified to the first interface; the first interface providing the data to be verified to a verification service providing module running in the trusted environment, wherein the verification service providing module completes the legitimacy verification of any application based on the data to be verified; and the verification service providing module completes the legitimacy verification of any application based on the data to be verified. Before providing the data to be verified to the first interface, the system requests data from the verification service providing module required to verify the legitimacy of any application; and receives the data to be verified generated by the verification service providing module for any application; wherein, the verification service providing module determines whether to provide legitimate verification data to the application based on the application's attribute information, the attribute information including whether the application is running in a trusted execution environment; The first application is a first application running in a trusted execution environment. The verification service providing module is configured to generate valid verification data for the first application in response to a request from the first application, and the verification service providing module is also configured to invalidate the valid verification data according to a preset invalidation rule. The second application is a second application running in a non-trusted execution environment. The verification service providing module is configured to generate invalid verification data for the second application in response to a request from the second application.
7. A device for controlling access to a processing unit in an insecure operating environment, characterized in that, The device includes: A verification service providing module running in a trusted execution environment is configured to: generate data for legitimacy verification, destroy the data, or receive a call to a first interface to perform legitimacy verification on any application when the application needs to access the target unit through the first interface, wherein the application runs on a first processor, the first interface can be called by all programs running on the first processor, the first interface runs in a non-trusted execution environment, and the target unit runs in a non-trusted execution environment; The interface processing module is configured to, upon receiving a request from any application to access the target unit through a first interface, obtain the data to be verified corresponding to any application and call the verification service providing module to enable the verification service providing module to complete the legality verification of any application based on the data to be verified, and access the target unit after the legality verification is passed; The legitimacy verification of any application in a trusted execution environment includes: providing data to be verified to the first interface; the first interface providing the data to be verified to a verification service providing module running in the trusted environment, wherein the verification service providing module completes the legitimacy verification of any application based on the data to be verified; and the verification service providing module completes the legitimacy verification of any application based on the data to be verified. Before providing the data to be verified to the first interface, the system requests data from the verification service providing module required to verify the legitimacy of any application; and receives the data to be verified generated by the verification service providing module for any application; wherein, the verification service providing module determines whether to provide legitimate verification data to the application based on the application's attribute information, the attribute information including whether the application is running in a trusted execution environment; The first application is a first application running in a trusted execution environment. The verification service providing module is configured to generate valid verification data for the first application in response to a request from the first application, and the verification service providing module is also configured to invalidate the valid verification data according to a preset invalidation rule. The second application is a second application running in a non-trusted execution environment. The verification service providing module is configured to generate invalid verification data for the second application in response to a request from the second application.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, it can implement the method described in any one of claims 1-5.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein, When the processor executes the program, it can implement the method described in any one of claims 1-5.
Citation Information
Patent Citations
Method of accessing secure element (SE), terminals and computer-readable storage medium
CN108171063A
