# US 2023/0058046 A1 · Apparatus and Method for Protecting Shared Objects

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

- Number: US 2023/0058046 A1
- Document ID: US20230058046A1
- Status: Published application
- Kind: A1
- Application number: 17/792,292
- Filed: 2020-01-29
- Published: 2023-02-23
- Earliest claimed: 2020-01-29
- Assignees: Huawei Technologies Co., Ltd.
- Applicants: Huawei Technologies Co., Ltd.
- Inventors: Sampo Sovio; Qiming Li; Gang Lian; Kui Wang; Santeri Salko; Vladimir Ushakov
- Web page: https://patentgrep.com/patent/US20230058046A1

## CPC

- G06F 21/121: {Restricting unauthorised execution of programs}
- G06F 21/53: by executing in a restricted environment, e.g. sandbox or secure virtual machine
- G06F 21/74: operating in dual or compartmented mode, i.e. at least one secure mode
- G06F 2221/034: Test or assess a computer or a system
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

An apparatus is configured to protect the privacy of shared objects by loading shared object into a user memory of a rich execution environment. The shared object has an encrypted segment and metadata. A request for decryption is sent to a trusted execution environment and the encrypted segment is decrypted based on the metadata and a predetermined platform key to produce a decrypted segment. The decrypted segment is written into the shared object. A request to lock the shared object is sent and a memory occupied by the shared object is locked or set to execute only. The lock of the memory region occupied by the decrypted shared object maps the memory region to be non-readable and non-writable to applications executing at a first privilege level and to the operating system kernel executing at a second privilege level.

## Claims

### Claim 1

An apparatus comprising:
a memory configured to store instructions;
a processor coupled to the memory, wherein when executed by the processor, the instructions cause the apparatus to:
provide a rich execution environment and a trusted execution environment, wherein a secure memory and processes in the trusted execution environment are protected from access or modification by applications executing within the rich execution environment;
provide, within the rich execution environment a first computing environment configured to execute at a first privilege level and a second computing environment configured to execute at a second privilege level, wherein the first privilege level is more restrictive than the second privilege level;
load, within the rich execution environment, a shared object into a user memory, wherein the shared object comprises an encrypted segment and a metadata;
send, from the rich execution environment, a request for decryption to the trusted execution environment, wherein the request for decryption comprises the metadata and the encrypted segment;
decrypt, within the trusted execution environment and based on the metadata and a predetermined platform key, the encrypted segment to produce a decrypted segment;
send, from the trusted execution environment, a decryption response comprising the decrypted segment to the rich execution environment;
receive, within the rich execution environment, the decryption response from the trusted execution environment;
write the decrypted segment into the shared object;
send, from the first computing environment to the second computing environment, a request to lock the shared object; and
set, while executing at the second privilege level, a memory segment occupied by the shared object to execute only.

### Claim 2 (depends on 1)

The apparatus of claim 1, wherein the metadata comprises an encrypted asset key comprising an asset key encrypted based on the predetermined platform key, and wherein the instructions further cause the apparatus to:
decrypt, within the trusted execution environment, the encrypted asset key based on the predetermined platform key; and
decrypt the encrypted segment based on the decrypted asset key.

### Claim 3 (depends on 2)

The apparatus of claim 2, wherein the metadata comprises a plurality of encrypted keys each comprising the asset key encrypted based on a different platform key from a plurality of platform keys, and wherein the instructions further cause the apparatus to select an encrypted key from the plurality of encrypted keys based on the predetermined platform key.

### Claim 4 (depends on 1)

The apparatus of claim 1, wherein the request for decryption is sent by an agent executing within the rich execution environment, and wherein the instructions further cause the apparatus to validate, within the trusted execution environment, an integrity of the agent before decrypting the encrypted segment.

### Claim 5 (depends on 1)

The apparatus of claim 1, wherein the predetermined platform key is a public portion of an asymmetric key pair.

### Claim 6 (depends on 1)

The apparatus of claim 1, wherein the asset key is a symmetric key.

### Claim 7 (depends on 1)

The apparatus of claim 1, wherein the rich execution environment comprises a third computing environment configured to execute at a third privilege level, wherein the second privilege level is more restrictive than the third privilege level, and wherein the instructions further cause the apparatus to, while executing at the third privilege level, set the memory to execute only.

### Claim 8 (depends on 1)

The apparatus of claim 1, wherein the first computing environment comprises a user application, the second computing environment comprises an operating system, and the third computing environment comprises a hypervisor.

### Claim 9 (depends on 1)

The apparatus of claim 1, wherein the shared object comprises a constructor routine that, when executed by the processor, causes the apparatus to send the decryption request.

### Claim 10 (depends on 1)

The apparatus of claim 1, wherein the rich execution environment comprises an agent, and wherein the trusted environment comprises a trusted application is that, when executed by the processor, causes the apparatus to:
receive the decryption request from the agent;
validate the integrity of the agent; and
decrypt, when the integrity is validated, the encrypted segment to produce the decrypted segment and return the decrypted segment to the agent.

### Claim 11 (depends on 1)

The apparatus of claim 1, wherein the encrypted segment occupies a first memory area, and wherein writing the decrypted segment comprises one of writing the decrypted segment into the first memory area, writing the decrypted segment into a second memory area, or incorporating the second memory area into the shared object.

### Claim 12 (depends on 1)

The apparatus of claim 1, wherein the apparatus comprises a mobile communications apparatus.

### Claim 13

A method implemented by a computing device, wherein the method comprises:
loading, within a rich execution environment, a shared object into a user memory, wherein the shared object comprises an encrypted segment, a metadata, and a constructor routine;
sending from the rich execution environment, a request for decryption to a trusted execution environment, wherein the request for decryption comprises the metadata and the encrypted segment;
decrypting within the trusted execution environment and based on the metadata and a predetermined platform key, the encrypted segment to produce an unencrypted segment;
send, from the trusted execution environment, a decryption response comprising the decrypted segment to the rich execution environment;
receiving, within the rich execution environment, the decryption response from the trusted execution environment;
writing the decrypted segment into the shared object;
setting, during executing at a second privilege level, a memory segment occupied by the shared object to execute only; and
accessing, at a first privilege level, the shared object from a user application, wherein the first privilege level is more restrictive than the second privilege level.

### Claim 14 (depends on 13)

The method of claim 13, wherein the encrypted segment is encrypted based on an asset key, wherein the metadata comprises an encrypted asset key comprising the asset key encrypted based on the predetermined platform key, and wherein the method further comprises:
decrypting, within the trusted execution environment, the encrypted asset key based on the predetermined platform key; and
decrypting, within the trusted execution environment, the encrypted segment based on the asset key.

### Claim 15

A program product comprising computer-executable instructions that are stored on a non-transitory computer readable medium and that, when executed by a processor, cause a device to:
load, within a rich execution environment, a shared object into a user memory, wherein the shared object comprises an encrypted segment, a metadata, and a constructor routine;
send from the rich execution environment, a request for decryption to a trusted execution environment, wherein the request for decryption comprises the metadata and the encrypted segment;
decrypt, within the trusted execution environment, the encrypted segment to produce an unencrypted segment, wherein the decryption is based on the metadata and a predetermined platform key;
receive, within the rich execution environment, a decryption response from the trusted execution environment, wherein the decryption response comprises a decrypted segment;
write the decrypted segment into the shared object;
set, during executing at a second privilege level, a memory segment occupied by the shared object to execute only; and
access, at a first privilege level, the shared object from a user application, wherein the first privilege level is more restrictive than the second privilege level.

### Claim 16 (depends on 14)

The method of claim 14, wherein the metadata comprises a plurality of encrypted keys each comprising the asset key encrypted based on a different platform key from a plurality of platform keys, and wherein the method further comprises selecting an encrypted key from the plurality of encrypted keys based on the predetermined platform key.

### Claim 17 (depends on 13)

The method of claim 13, wherein the request for decryption is sent by an agent executing within the rich execution environment, and wherein the method further comprises validating, within the trusted execution environment, an integrity of the agent before decrypting the encrypted segment.

### Claim 18 (depends on 13)

The method of claim 13, wherein the rich execution environment comprises a third computing environment configured to execute at a third privilege level, wherein the second privilege level is more restrictive than the third privilege level, and wherein the method further comprises, during executing at the third privilege level, setting the memory to execute only.

### Claim 19 (depends on 13)

The method of claim 13, wherein the shared object comprises a constructor routine that causes sending the decryption request.

### Claim 20 (depends on 13)

The method of claim 13, wherein the rich execution environment comprises an agent, and wherein the method further comprises when executing a trusted application in the rich execution environment:
receiving the decryption request from the agent;
validating the integrity of the agent; and
decrypting, when the integrity is validated, the encrypted segment to produce the decrypted segment and return the decrypted segment to the agent.
