# US 2022/0277108 A1 · Trusted Application Running Method, Information Processing Method, Memory Allocation Method, and Apparatus

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

- Number: US 2022/0277108 A1
- Document ID: US20220277108A1
- Status: Published application
- Kind: A1
- Application number: 17/682,034
- Filed: 2022-02-28
- Published: 2022-09-01
- Earliest claimed: 2019-08-30
- Assignees: Huawei Technologies Co., Ltd.
- Applicants: Huawei Technologies Co., Ltd.
- Inventors: Jianxin Peng
- Web page: https://patentgrep.com/patent/US20220277108A1

## 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, by the TEE operating system, a target TA in the one or more TAs;
receiving, by the TEE operating system, 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, and wherein the target service is provided by the target TA; and
loading, by the TEE operating system, 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 according to claim 1, wherein loading the target dynamic library comprises loading, by the TEE operating system, 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 according to claim 1, wherein loading the target dynamic library comprises:
obtaining, by the TEE operating system, the target dynamic library from the REE operating system, and
loading, by the TEE operating system, the target dynamic library to the memory space of the target TA.

### Claim 4 (depends on 3)

The TA running method according to claim 3, wherein obtaining the target dynamic library from the REE operating system comprises:
sending, by the TEE operating system, 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, by the TEE operating system, the target dynamic library from the REE operating system.

### Claim 5 (depends on 3)

The TA running method according to claim 3, wherein obtaining, by the TEE operating system, the target dynamic library from the REE operating system comprises:
obtaining, by the TEE operating system, an encrypted file from the REE operating system; and
decrypting, by the TEE operating system, 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 according to claim 1, 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 target dynamic library is sent to the TEE operating system by the REE operating system 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.

### Claim 7 (depends on 1)

The TA running method according to claim 1, wherein starting the target TA comprises:
obtaining, by the TEE operating system, 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 8 (depends on 1)

The TA running method according to claim 1, wherein loading, by the TEE operating system, the target dynamic library comprises:
determining, by the TEE operating system based on target permission information, whether the target TA has permission to invoke the target dynamic library; and
loading, by the TEE operating system, the target dynamic library to the memory space of the target TA based on determining that the target TA has permission to invoke the target dynamic library.

### Claim 9 (depends on 1)

The TA running method according to claim 1, further comprising:
obtaining, by the TEE operating system, 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, by the TEE operating system, 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, by the TEE operating system, the first memory to the target TA.

### Claim 10 (depends on 9)

The TA running method according to claim 9, wherein the first memory is greater than the memory applied by the memory request.

### Claim 11 (depends on 9)

The TA running method according to claim 9, wherein allocating, by the TEE operating system, the first memory to the target TA comprises:
configuring, by the TEE operating system, the first memory as secure memory; and
allocating, by the TEE operating system to the target TA, the first memory configured as the secure memory.

### Claim 12 (depends on 9)

The TA running method according to claim 9, wherein after the allocating the first memory to the target TA, the TA running method further comprises:
receiving, by the TEE operating system, 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, by the TEE operating system, the first memory in response to the TA memory release request.

### Claim 13 (depends on 12)

The TA running method according to claim 12, wherein releasing the first memory comprises:
configuring, by the TEE operating system, the first memory as non-secure memory; and
releasing, by the TEE operating system, the first memory configured as the non-secure memory.

### Claim 14 (depends on 12)

The TA running method according to claim 12, wherein after releasing the first memory, the TA running method further comprises sending, by the TEE operating system, 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 15

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
a processor coupled to the memory and configured to execute the instructions to:
start, by the TEE operating system, a target TA in the one or more TAs;
receiving, by the TEE operating system, 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, and wherein the target service is a service provided by the target TA; and
loading, by the TEE operating system, 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 16 (depends on 15)

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

### Claim 17 (depends on 15)

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

### Claim 18

A non-transitory computer-readable storage medium, comprising instructions executable by a processor 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 processor executes the instructions, the computer device is configured to:
start, by the TEE operating system, a target TA in the one or more TAs;
receive, by the TEE operating system, 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, and wherein the target service is provided by the target TA; and
loading, by the TEE operating system, 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 according to claim 18, wherein loading the target dynamic library comprises loading, by the TEE operating system, 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 according to claim 18, wherein loading the target dynamic library comprises:
obtaining, by the TEE operating system, the target dynamic library from the REE operating system; and
loading the target dynamic library to the memory space of the target TA.
