# US 12,118,128 B2 · Running a trusted application using a dynamic library

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 12,118,128 B2
- Document ID: US12118128B2
- Status: Granted
- Kind: B2
- Application number: 17/682,034
- Filed: 2022-02-28
- Published: 2022-09-01
- Granted: 2024-10-15
- Earliest claimed: 2019-08-30
- Assignees: Huawei Technologies Co., Ltd.
- Applicants: Huawei Technologies Co., Ltd.
- Inventors: Jianxin Peng
- Web page: https://patentgrep.com/patent/US12118128B2

## CPC

- G06F 21/64: Protecting data integrity, e.g. using checksums, certificates or signatures
- G06F 21/74: operating in dual or compartmented mode, i.e. at least one secure mode
- G06F 9/44521: {Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading}
- G06F 21/53: by executing in a restricted environment, e.g. sandbox or secure virtual machine
- G06F 21/57: Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
- G06F 21/6218: {to a system of files or objects, e.g. local or distributed file system or database}
- G06F 21/78: to assure secure storage of data (address-based protection against unauthorised use of memory G06F12/14; record carriers for use with machines and with at least a part designed to carry digital markings G06K19/00)
- G06F 2221/2149: Restricted operating environment
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A trusted application running method applied to a computer system on which a trusted execution environment (TEE) and a rich execution environment (REE) are deployed, where one or more trusted applications (TAs) run on the TEE operating system. The TEE operating system may start a target TA. Then, the target TA may send, to the TEE operating system, a loading request for a target dynamic library supporting the target service. The TEE operating system may load the target dynamic library to memory space of the target TA in response to the loading request. In this way, before the target TA runs the target service, a program module used to support the target service does not need to be loaded to the memory space of the TA, thereby reducing a waste of the memory space of the TA.

## Claims

### Claim 1

A trusted application (TA) running method applied to a computer system, wherein a rich execution environment (REE) and a trusted execution environment (TEE) are deployed in the computer system, wherein an REE operating system is deployed in the REE, wherein a TEE operating system is deployed in the TEE, wherein one or more trusted applications (TAs) are deployed on the TEE operating system, and wherein the TA running method comprises:
starting a target TA in the one or more TAs;
receiving a loading request from the target TA in response to a running request of a target service, wherein the loading request indicates to load a target dynamic library, wherein the target service is provided by the target TA, wherein the running request of the target service is from a target client application (CA) deployed on the REE operating system, wherein the target CA has permission to invoke the target service, wherein the TEE operating system receives the target dynamic library in response to a second transfer request, wherein the second transfer request is sent to the REE operating system by the target CA in response to a first transfer request, and wherein the first transfer request is sent to the target CA by the target TA in response to the running request of the target service; and
loading the target dynamic library to memory space of the target TA in response to the loading request,
wherein the target dynamic library is configured to support running of the target service.

### Claim 2 (depends on 1)

The TA running method of claim 1, wherein loading the target dynamic library comprises loading the target dynamic library from a first memory space of the TEE operating system to the memory space of the target TA.

### Claim 3 (depends on 1)

The TA running method of claim 1, wherein loading the target dynamic library comprises:
obtaining the target dynamic library from the REE operating system, and
loading the target dynamic library to the memory space of the target TA.

### Claim 4 (depends on 3)

The TA running method of claim 3, wherein obtaining the target dynamic library comprises:
sending a transfer request of the target dynamic library to the REE operating system, wherein the transfer request comprises an identifier of the target dynamic library, and wherein the transfer request indicates to the REE operating system to send the target dynamic library to the TEE operating system; and
receiving the target dynamic library from the REE operating system.

### Claim 5 (depends on 3)

The TA running method of claim 3, wherein obtaining the target dynamic library comprises:
obtaining an encrypted file from the REE operating system; and
decrypting the encrypted file to obtain a decrypted file, wherein the decrypted file comprises the target dynamic library.

### Claim 6 (depends on 1)

The TA running method of claim 1, wherein starting the target TA comprises:
obtaining one or more dynamic libraries from the REE operating system; and
storing the one or more dynamic libraries into the memory space of the TEE operating system, wherein the one or more dynamic libraries are recorded in a target file of the target TA.

### Claim 7 (depends on 1)

The TA running method of claim 1, wherein loading the target dynamic library comprises:
loading the target dynamic library to the memory space of the target TA when the target TA has permission to invoke the target dynamic library, wherein whether the target TA has permission to invoke the target dynamic library is based on target permission information.

### Claim 8 (depends on 1)

The TA running method of claim 1, further comprising:
obtaining a memory request from the target TA in response to the running request of the target service, wherein the memory request is to apply to the TEE operating system for memory required for running the target service;
obtaining memory allocation information from the REE operating system in response to the memory request, wherein the memory allocation information instructs the REE operating system to allocate first memory to the TEE operating system; and
allocating the first memory to the target TA.

### Claim 9 (depends on 8)

The TA running method of claim 8, wherein the first memory is greater than the memory applied by the memory request.

### Claim 10 (depends on 8)

The TA running method of claim 8, wherein allocating the first memory to the target TA comprises:
configuring the first memory as secure memory; and
allocating, to the target TA, the first memory configured as the secure memory.

### Claim 11 (depends on 8)

The TA running method of claim 8, wherein after allocating the first memory to the target TA, the TA running method further comprises:
receiving a TA memory release request from the target TA, wherein the TA memory release request requests the TEE operating system to release the first memory; and
releasing the first memory in response to the TA memory release request.

### Claim 12 (depends on 11)

The TA running method of claim 11, wherein releasing the first memory comprises:
configuring the first memory as non-secure memory; and
releasing the first memory configured as the non-secure memory.

### Claim 13 (depends on 11)

The TA running method of claim 11, wherein after releasing the first memory, the TA running method further comprises sending a TEE memory release request to the REE operating system, and wherein the TEE memory release request requests the REE operating system to release the first memory.

### Claim 14

A computer device in which a rich execution environment (REE) and a trusted execution environment (TEE) are deployed, wherein an REE operating system is deployed in the REE and a TEE operating system is deployed in the TEE, wherein one or more trusted applications (TAs) are deployed on the TEE operating system, and wherein the computer device comprises:
a memory configured to store instructions; and
one or more processors coupled to the memory and configured to execute the instructions to:
start a target TA in the one or more TAs;
receive a loading request from the target TA in response to a running request of a target service, wherein the loading request indicates to load a target dynamic library, wherein the target service is a service provided by the target TA, wherein the running request of the target service is from a target client application (CA) deployed on the REE operating system, wherein the target CA has permission to invoke the target service, wherein the TEE operating system receives the target dynamic library in response to a second transfer request, wherein the second transfer request is sent to the REE operating system by the target CA in response to a first transfer request, and wherein the first transfer request is sent to the target CA by the target TA in response to the running request of the target service; and
load the target dynamic library to memory space of the target TA in response to the loading request, wherein the target dynamic library is configured to support running of the target service.

### Claim 15 (depends on 14)

The computer device of claim 14, wherein loading the target dynamic library comprises loading the target dynamic library from a first memory space of the TEE operating system to the memory space of the target TA.

### Claim 16 (depends on 14)

The computer device of claim 14, wherein loading the target dynamic library comprises:
obtaining the target dynamic library from the REE operating system, and
loading the target dynamic library to the memory space of the target TA.

### Claim 17 (depends on 16)

The computer device of claim 16, wherein obtaining the target dynamic library comprises:
obtaining an encrypted file from the REE operating system; and
decrypting the encrypted file to obtain a decrypted file, wherein the decrypted file comprises the target dynamic library.

### Claim 18

A non-transitory computer-readable storage medium, comprising instructions executable by one or more processors of a computer device, wherein a rich execution environment (REE) and a trusted execution environment (TEE) are deployed in the computer device, wherein an REE operating system is deployed in the REE and a TEE operating system is deployed in the TEE, wherein one or more trusted applications (TAs) are deployed on the TEE operating system, and wherein when the one or more processors execute the instructions, the computer device is configured to:
start a target TA in the one or more TAs;
receive a loading request from the target TA in response to a running request of a target service, wherein the loading request indicates to load a target dynamic library, wherein the target service is provided by the target TA, wherein the running request of the target service is from a target client application (CA) deployed on the REE operating system, wherein the target CA has permission to invoke the target service, wherein the TEE operating system receives the target dynamic library in response to a second transfer request, wherein the second transfer request is sent to the REE operating system by the target CA in response to a first transfer request, and wherein the first transfer request is sent to the target CA by the target TA in response to the running request of the target service; and
load the target dynamic library to memory space of the target TA in response to the loading request, wherein the target dynamic library is configured to support running of the target service.

### Claim 19 (depends on 18)

The non-transitory computer-readable storage medium of claim 18, wherein loading the target dynamic library comprises loading the target dynamic library from a first memory space of the TEE operating system to the memory space of the target TA.

### Claim 20 (depends on 18)

The non-transitory computer-readable storage medium of claim 18, wherein loading the target dynamic library comprises:
obtaining the target dynamic library from the REE operating system; and
loading the target dynamic library to the memory space of the target TA.
