Processing unit, electronic device and safety control method

By designing multiple isolated security zones and permission management systems in the processing unit, the problem of insufficient security in electronic devices in traditional technology is solved, and independent security protection and resource optimization of applications are achieved.

CN113139175BActive Publication Date: 2024-12-06ALIBABA GROUP HOLDING LTD
View PDF 23 Cites 0 Cited by

Patent Information

Application Number
CN202010058578.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-01-19
Publication Date
2024-12-06
Estimated Expiration
2040-01-19

AI Technical Summary

Technical Problem

Traditional processor architectures have difficulty in establishing an effective and trusted execution environment in electronic devices, resulting in insufficient security and inefficiency in transmission of sensitive information.

Method used

Design a processing unit that contains multiple isolated security areas, including application security areas, runtime security areas and password security areas. Each security area has a unique permission configuration, and can be encrypted and decrypted through processor cores and key management components. Operation and manage permissions and control interval communication through the security monitoring system.

Benefits of technology

It realizes independent security protection for applications, enhances the security of sensitive information, reduces the duplication of storage resources, reduces design complexity and cost, and is suitable for lightweight processing units and electronic devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113139175B_ABST
    Figure CN113139175B_ABST
Patent Text Reader

Abstract

Disclosed are a processing unit, an electronic device, a computer-readable storage medium, and a security control method. The processing unit includes: a processor; a memory coupled to the processor, suitable for providing multiple security zones isolated from each other, the multiple security zones including multiple application security zones, each application security zone is used to run corresponding application programs, and the multiple security zones also include at least one of the following: a runtime security zone, suitable for providing storage space required for callable programs; a password security zone, suitable for providing storage space required for password-related programs, the runtime security zone and the password security zone have read and write permissions to multiple application security zones, and each application security zone does not have read and write permissions to the runtime security zone and the password security zone. The processing unit security control method provided in an embodiment of the present invention establishes a trusted execution environment based on multiple application security zones, as well as a password security zone and / or a runtime security zone, so as to protect sensitive information involved in the application program.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of processors, and more specifically, to a processing unit, an electronic device, a computer-readable storage medium, and a security control method. Background Art

[0002] With the continuous development of smart terminal technology, various applications (Application, referred to as App) have brought convenience to users, and with it, users are concerned about the security of these applications. Especially in the fields of Internet of Things, artificial intelligence and other fields, for applications involving some sensitive information (such as identity information, property information, etc., which are not wanted to be obtained by others), users expect that these sensitive information can be effectively protected.

[0003] Therefore, it is hoped that a trusted execution environment (TEE) can be established based on hardware structures such as processors and memories to provide an execution environment with security protection functions for applications that need to be protected.

[0004] Traditional technical solutions are mainly based on complex processor architecture and independent security chips (separate from the processor chip) to establish the TEE of the entire electronic device. Therefore, in the process of transmitting information between the security chip and other hardware structures in the electronic device, good security performance cannot be guaranteed and the transmission efficiency is low. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a processing unit, an electronic device, a computer-readable storage medium, and a security control method to solve the above problems.

[0006] To achieve this objective, in a first aspect, a processing unit is provided, comprising: a processor, suitable for running programs; a memory, coupled to the processor, and suitable for providing a plurality of mutually isolated security zones, the plurality of security zones comprising a plurality of application security zones, each of the application security zones being respectively used to run a corresponding application program, the plurality of security zones further comprising at least one of the following: a runtime security zone, suitable for providing a storage space required for the running of callable programs; a password security zone, suitable for providing a storage space required for the running of password-related programs, wherein the runtime security zone and the password security zone at least have read and write permissions to the plurality of application security zones, and each of the application security zones does not have read and write permissions to the runtime security zone and the password security zone.

[0007] In some embodiments, the callable program is a shared program and / or a universal driver for different application programs.

[0008] In some embodiments, the processor includes a first processor core adapted to run the cryptographic-related program for cryptographic services within the cryptographic security zone.

[0009] In some embodiments, the processing unit also includes a key management component, which is suitable for providing the cryptographic service to generate encryption / decryption results. The first processor core is coupled to the key management component, and writes the encryption / decryption results into the corresponding application security area by running the cryptographic-related program in the cryptographic security area.

[0010] In some embodiments, the processor further includes a second processor core adapted to respectively run corresponding application programs in the plurality of application security zones.

[0011] In some embodiments, the second processor core is implemented based on the RISC-V instruction set architecture.

[0012] In some embodiments, the processing unit further includes: a bus structure, coupled to the first processor core, the second processor core and the memory respectively.

[0013] In some embodiments, the processing unit also includes: an address register for storing address information corresponding to each of the security zones; and a permission register for storing permission information for each of the security zones, and the processor is suitable for controlling access operations of each of the security zones according to access permissions indicated by the permission information, and the access permissions include at least read and write permissions and execute permissions.

[0014] In some embodiments, the permission information of the application security zone is configured to have no access rights to the application security zone other than itself.

[0015] In some embodiments, the permission information of the application security zone is configured to have execution permissions for the password security zone and the runtime security zone, and / or, the permission information of the password security zone and the runtime security zone is configured to have read, write and execution permissions for the application security zone.

[0016] In some embodiments, the permission information of the runtime security zone is configured to have no read and write permissions to the password security zone, and the permission information of the password security zone is configured to have no read and write permissions to the runtime security zone.

[0017] In some embodiments, the permission information of the runtime security zone is configured to have no execution permission on the cryptographic security zone.

[0018] In some embodiments, a first application security zone among the multiple application security zones shares permission information with a designated second application security zone, so that the second application security zone has temporary access rights to the first application security zone.

[0019] In some embodiments, the processor is suitable for: running an operating system; running one or more of the application, the callable program, and the password-related program in user mode; and running a security monitoring system in machine mode to configure the address register and the permission register, and switch control of the processor among programs in different security zones.

[0020] In some embodiments, the permission information of each of the security zones is configured to not have access to the security monitoring system, the permission information of the application security zone is configured to not have access to the operating system, and the permission information of the password security zone and the runtime security zone are configured to have read, write and execute permissions to the operating system.

[0021] In some embodiments, the processing unit also includes a boot sequence register suitable for storing boot sequence information. Based on the boot sequence information, the processor is suitable for first running the security monitoring system during the boot process and then running the password-related program in the password security area.

[0022] In some embodiments, at least one of the security zones is configured with a corresponding enable tag, the enable tag indicating that the security zone is in an enabled state, a disabled state, or a partially disabled state.

[0023] In some embodiments, the memory includes one or more memory modules selected from the group consisting of a read-only memory module, a dynamic and / or static random access memory module, a non-volatile random access memory module, and a memory mapping input / output interface module.

[0024] In some embodiments, the processing unit further comprises: a direct storage access controller, responsive to a request of the processor to access the memory; and / or a power management module, adapted to provide a power supply voltage required for the processing unit to operate.

[0025] In some embodiments, the processing unit is integrated into a system on a chip.

[0026] In some embodiments, the processing unit is a microcontroller.

[0027] In a second aspect, the present invention provides an electronic device, comprising a processing unit provided according to any embodiment of the present invention.

[0028] In a third aspect, the present invention provides a security control method, comprising: configuring a plurality of mutually isolated security zones in a memory, the plurality of security zones comprising a plurality of application security zones, and a runtime security zone and / or a password security zone; running a corresponding application program in each of the application security zones respectively; and running a callable program in the runtime security zone, and / or running a password-related program in the password security zone, wherein the runtime security zone and the password security zone have at least read and write permissions to the plurality of application security zones, and each of the application security zones does not have read and write permissions to the runtime security zone and the password security zone.

[0029] In some embodiments, the callable program is a shared program and / or a universal driver for different application programs.

[0030] In some embodiments, the security control method further includes: writing the encryption / decryption result into the corresponding application security zone, the encryption / decryption result being obtained by the password-related program running in the password security zone.

[0031] In some embodiments, in user mode, the password-related program is executed by a first processor core, and each of the application programs is executed by a second processor core.

[0032] In some embodiments, the second processor core is implemented based on the RISC-V instruction set architecture.

[0033] In some embodiments, the step of configuring the multiple security zones isolated from each other in the memory includes: running a security monitoring system in machine mode, wherein the security monitoring system is suitable for configuring address information and permission information corresponding to each of the security zones, so that the security control method can control the access operation of each of the security zones in user mode according to the access rights indicated by the permission information, wherein the access rights include at least read and write rights and execute rights.

[0034] In some embodiments, the security monitoring system is further adapted to: during or after the execution of a program in one of the plurality of security zones, switch to another of the security zones so that the program in the other security zone is executed by a corresponding processor core.

[0035] In some embodiments, the permission information of the multiple security zones indicates at least one of the following configurations: the application security zone does not have access rights to the application security zones other than itself; the application security zone has execution rights to the password security zone and the runtime security zone; the password security zone and the runtime security zone have read, write and execution rights to the application security zone; the runtime security zone does not have read and write rights to the password security zone; the password security zone does not have read and write rights to the runtime security zone; the runtime security zone does not have execution rights to the password security zone; and each of the security zones does not have access rights to the security monitoring system.

[0036] In some embodiments, the security control method also includes: running an operating system, the permission information of the application security zone is configured to have no access rights to the operating system, and the permission information of the password security zone and the runtime security zone are configured to have read, write and execute rights to the operating system.

[0037] In some embodiments, the security control method first runs the security monitoring system during the startup phase, and then runs the password-related program in the password security area.

[0038] In a fourth aspect, the present invention further provides a computer-readable storage medium having instructions stored thereon, which, when executed, implement the steps in the security control method disclosed in the present invention.

[0039] Compared with traditional solutions, the processing unit, electronic device and security control method provided by the embodiments of the present invention can establish TEE within the processing unit based on multiple application security zones, as well as password security zones and / or runtime security zones, thereby allocating independent application security zones for various applications, so that the processing unit can independently run the corresponding application in the application security zone, thereby ensuring that each application is independently protected, enhancing security, and preventing sensitive information involved in the application from being stolen.

[0040] In some embodiments, the memory includes a password security zone that is different from the application security zone. The processing unit can run password-related programs in the password security zone to further protect password information from being illegally obtained, thereby improving the security of the processing unit.

[0041] In some embodiments, the memory includes a runtime security zone that is different from the application security zone. The processor can run shared resources such as shared programs in the runtime security zone, thereby reducing the occurrence of repeated occupation of storage resources and saving storage space.

[0042] In some optional embodiments, the present invention can set up multiple security zones with multiple categories by setting only two modes (user mode and machine mode), thereby simplifying the design, saving costs, and being better suitable for lightweight processing units and electronic devices without the need for a complex software and hardware architecture system.

[0043] In some embodiments, the processing unit of the present invention sets up multiple security zones and corresponding processor cores within the on-chip system to implement the trusted execution environment required for the security protection function, so that the application program can communicate with the trusted execution environment within the chip, reducing the design difficulty, complexity and cost, and also improving security. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The above and other objects, features and advantages of the present invention will become more apparent through the description of the embodiments of the present invention with reference to the following drawings, in which:

[0045] Figure 1 A schematic block diagram showing an electronic device according to an embodiment of the present invention;

[0046] Figure 2 A schematic diagram showing an exemplary application scenario of an electronic device according to an embodiment of the present invention;

[0047] Figure 3 A schematic diagram showing the structure of a processing unit according to an embodiment of the present invention;

[0048] Figure 4 A schematic block diagram showing a key management system according to an embodiment of the present invention;

[0049] Figure 5 A schematic diagram showing a transfer path of processor control rights in a processing unit according to an embodiment of the present invention;

[0050] Figure 6 A schematic diagram showing the software architecture of a processing unit according to an embodiment of the present invention;

[0051] Figure 7 A schematic diagram showing permission information of various security zones according to an embodiment of the present invention;

[0052] Figure 8 A schematic diagram of a flow chart of a secure boot method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0053] The present invention is described below based on embodiments, but the present invention is not limited to these embodiments. In the detailed description of the present invention below, some specific details are described in detail. It is possible for a person skilled in the art to fully understand the present invention without the description of these details. In order to avoid confusing the essence of the present invention, known methods, processes, and procedures are not described in detail. In addition, the drawings are not necessarily drawn to scale.

[0054] The following terms are used in this article.

[0055] Microcontroller: Microcontroller Unit, referred to as MCU, usually refers to a system-on-chip or system-on-chip (SoC) based on processors, memory and other hardware modules. The microcontroller can run operating systems (OS) and applications. In the fields of the Internet of Things, artificial intelligence and some other fields, microcontrollers are widely used due to their significant advantages such as high integration and customization.

[0056] Memory: It can be integrated into the processing unit and is a physical structure used to store information. The information stored in the memory includes instruction information and / or data information represented by data signals, such as data provided by the processor, application code, etc. It can also be used to realize information exchange between the processor and the storage device outside the processing unit.

[0057] Read and write permissions: a general term for read permissions and write permissions; if a specified program has read permissions for a target storage area, it means that the information (code and / or data) in the target storage area can be read, so that the information in the target storage area can be loaded into the storage area used to run the specified program; if a specified program has write permissions for a target storage area, it means that the specified program can modify the information in the target storage area.

[0058] Execution permission: If a specified program has execution permission for a target storage area, it means that the specified program is allowed to execute or call the code stored in the target storage area, but the execution permission does not mean that the specified program is allowed to view or read the code stored in the target storage area.

[0059] The embodiments of the present application can be applied to the Internet and the Internet of Things (IoT), such as 5G mobile Internet systems, security identification systems, etc., and can establish a trusted execution environment for protecting sensitive information in the processing unit. The following uses an application scenario of a smart refrigerator as an example to illustrate the embodiments of the present invention, but it should be understood that the application scenarios of the embodiments of the present invention are not limited to this, and can also be applied to any scenario where sensitive information needs to be protected in the processing unit.

[0060] System Overview

[0061] Figure 1 A schematic block diagram of an electronic device is shown according to an embodiment of the present invention. Figure 2 A schematic diagram showing an exemplary application scenario of an electronic device according to an embodiment of the present invention is shown. As described above, Figure 2 The application scenario shown is only an illustrative example and is not intended to limit the actual application scenario of the electronic device of the embodiment of the present invention.

[0062] Figure 1 The electronic device 1000 shown in the figure is intended to illustrate at least some components of one or more electronic devices, and in other embodiments of the present invention, the components may be omitted. Figure 1 Some of the components shown may be connected to each other in a different architecture, and may also include Figure 1 Some hardware and / or software modules not shown in FIG. Figure 1 Two or more components shown in the figure may also be combined into one component in a software system and / or a hardware system.

[0063] In some embodiments, the electronic device 1000 may be a mobile device, a handheld device, or an embedded device, such as a processing platform for a smart car, smart home appliance, biometric information recognition system, bank management system, or IoT device using 5G technology. The electronic device 1000 may also be applied to wearable devices (such as smart watches, smart glasses, etc.), or may be a television, set-top box, or other device.

[0064] like Figure 1 and 2 As shown, the electronic device 1000 may include one or more processing units 1100. In some embodiments, the processing unit 1100 in the electronic device 1000 may be flexibly designed in terms of architecture and function. For example, in a scenario where low power consumption and dedicated functions are required, the electronic device 1000 of the embodiment of the present invention may be more streamlined and have lower power consumption than large computer devices such as personal computers and server terminals, and is therefore suitable for various Internet of Things devices, embedded devices, smart terminal devices, and the like.

[0065] One or more processing units 1100 in the electronic device 1000 may be implemented based on a printed circuit board, or may be an independently packaged chip (such as a microcontroller), or may be implemented by a hardware structure and / or software integrated in a system on chip.

[0066] In some embodiments, the electronic device 1000 may further include one or more coprocessors for executing instructions and data that do not involve sensitive information.

[0067] like Figure 1 As shown, the electronic device 1000 further includes a system bus 1200, and the processing unit 1100 may be coupled to one or more system buses 1200. The system bus 1200 may be used to transmit signals between the processing unit 1100 and other components in the electronic device 1000, such as transmitting addresses, data, or control signals. The system bus 1200 may include, but is not limited to, a bus based on the Peripheral Component Interconnect (PCI) standard, a memory bus, or other types of buses.

[0068] Usually, if Figure 1 As shown, the electronic device 1000 may further include one or more storage devices 1300 communicating with the processing unit 1100 via the system bus 1200. The storage device 1300 is used to provide additional storage space for the electronic device, for example, for storing data and / or instructions other than sensitive information.

[0069] The electronic device 1000 may also be coupled to an input / output device 1400 via the system bus 1200. In some embodiments, the input / output device 1400 may provide a user interface in response to a user operation, and information provided or collected by the input / output device 1400 based on the user operation may be stored in the storage device 1300 and / or the processing unit 1100 under the control of the processing unit 1100. Typically, sensitive information (e.g., fingerprint information, property data, etc.) provided by the input / output device 1400 may be processed in the TEE established by the processing unit 1100.

[0070] The input / output device 1400 may include a display device to display information that the user needs to know, and the display device is, for example, a cathode ray tube (CRT) display, a liquid crystal display (LCD) or an organic light-emitting diode (OLED) array display. In some embodiments, the input / output device 1400 may include an input device such as a touch panel, which is used to transmit information corresponding to the user operation to the processing unit 1100 and / or the corresponding coprocessor via the system bus 1200, so that the processing unit 1100 and / or the coprocessor can respond to the user operation. In some embodiments, the input / output device 1400 may include a collection device, which may be coupled to the system bus 1200 to transmit instructions and data related to information that can be collected, such as images / sounds, and the collection device is, for example, a microphone and / or a video camera or camera for collecting images.

[0071] The electronic device 1000 may include one or more interfaces 1500, such as a network interface, etc., integrated in the processing unit 1100 or coupled to the processing unit 1100 via the system bus 1200. The electronic device 1000 may access a network via the network interface and a corresponding communication module, and the network may be, for example, a local area network (LAN), a wide area network (WAN), a metropolitan area network (MAN), a personal area network (PAN), Bluetooth, a cloud network, a mobile network (such as a Long Term Evolution, LTE) network, a 3G network, a 4G network or a 5G network, etc.), an intranet, the Internet, etc. The network interface may include a wireless network interface having at least one antenna and / or a wired network interface communicating via a network cable, and the network cable may be an Ethernet cable, a coaxial cable, an optical fiber cable, a serial cable or a parallel cable.

[0072] The network interface may, for example, provide access to a LAN according to IEEE 802.11b and / or 802.11g standards, or provide access to a personal area network according to the Bluetooth standard, or may support other wireless network interfaces and / or protocols, including existing communication standards and future communication standards. The network interface may also utilize a time division multiple access (TDMI) protocol, a global system for mobile communications (GSM) protocol, a code division multiple access (CDMA) protocol, and / or other types of wireless communication protocols.

[0073] It should be noted that the above and Figure 1It is only used to exemplarily describe the electronic device 1000, and is not used to limit the specific implementation of the electronic device 1000. The electronic device 1000 may also include other components, such as a data processing unit, etc.; the various components of the electronic device 1000 described above may also be appropriately omitted in practical applications.

[0074] As an example, Figure 1 The electronic device 1000 shown is, for example, Figure 2 The refrigerator 1000' is shown. Figure 2 In the example provided, the input / output device 1400 includes, for example, a display touch screen, an image acquisition device, etc., wherein the image acquisition device can obtain a user's facial image, and the processing unit 1100 can run a facial recognition program based on the image data obtained by the image acquisition device, and run a push program based on the facial recognition result to push information related to the current user's historical records (e.g., frequently purchased ingredients and related purchase links, etc.) to the display touch screen. The user can obtain information provided by the network 3000 by operating the display touch screen, or can directly configure the processing unit 1100 in the refrigerator 1000' by operating the mobile terminal device 2000 (e.g., a smart phone) or configure the processing unit 1100 in the refrigerator 1000' through the network 3000, and can also view the information returned by the processing unit 1100 to the mobile terminal device 2000.

[0075] exist Figure 2 In the example, the processing unit 1100 can also run a face payment program to complete the online payment process based on the facial image data provided by the user.

[0076] exist Figure 2 In the example, when the processing unit 1100 built into the refrigerator 1000' is controlled by the mobile terminal device 2000, the mobile terminal device 2000 needs to pair with the processing unit 1100 and exchange information. The pairing process and the information exchange process may require the processing unit 1100 to complete the encryption and decryption of the information. Sensitive information such as facial image data, shopping habit data, and property account data also needs to be securely protected in the processing unit 1100. The processing unit 1100 of the embodiment of the present invention can prevent sensitive information and password information from being stolen by unwanted programs by setting up multiple security zones, thereby improving the security of the electronic device 1000.

[0077] Processing Unit

[0078] The processing unit 1100 of the embodiment of the present invention is used to establish and control one or more TEEs that can provide security protection functions. For each TEE, instructions that are not allowed by it cannot access the TEE, and the program running in the TEE may not be interfered with by the conventional operating system and / or other TEEs, so that instructions and / or data running in different TEEs can be independently protected in the corresponding TEE to have higher security, privacy and integrity.

[0079] The processing unit 1100 of the embodiment of the present invention is, for example, a microcontroller implemented based on the collaborative work of a hardware architecture and a software architecture integrated in a system on chip or a single chip. Figure 3 is a schematic block diagram of a processing unit 1100 according to an embodiment of the present invention.

[0080] like Figure 1 and Figure 3 As shown, the processing unit 1100 may include a processor 100 for processing data and instructions, and the processor 100 may include one or more processor cores 10 ( Figure 3 The processor core 10A and the processor core 10S are shown as examples. A specific instruction set may be integrated into each processor core 10. In some embodiments, the instruction set may, for example, support complex instruction set computing (CISC), reduced instruction set computing (RISC), or very long instruction word (VLIW)-based computing. Different processor cores 10 may each process different instruction sets. In some embodiments, one or more processor cores 10 may also be other processing modules, such as a digital signal processor (DSP).

[0081] In some embodiments, Figure 3 As shown, the processor 100 may include one or more caches 13, and according to different architectures, the cache 13 may include a single or multiple levels of cache located inside and / or outside each processor core 10, or may include a cache shared by various components (e.g., different processor cores 10) in the processor 100. On the other hand, the cache 13 may include an instruction-oriented instruction cache and a data-oriented data cache.

[0082] Each processor core 10 can execute instructions based on the instruction pipeline. The instruction pipeline is an instruction processing method used to improve efficiency. It mainly divides the processing process of an instruction into multiple levels of instruction operations such as fetch, decode, execute, memory access, and retire. Each level of instruction operation is implemented by a dedicated unit. Figure 3 As shown, in order to process instructions, each processor core 10 may include an instruction pipeline structure 11 implemented by software and hardware in collaboration, and the instruction pipeline structure 11 may include: an instruction fetch unit for obtaining instructions, a decoding unit for decoding instructions into an executable format, an execution unit for executing instructions, a memory access unit for accessing a corresponding storage area according to instructions (which may also be considered as an execution unit), and a retirement unit for removing related scheduling processes after the execution of instructions is completed. In some embodiments, the instruction pipeline structure implements two or more levels of instruction operations, for example, the instruction processing may be implemented only through the instruction fetch unit and the execution unit, or the instruction processing may be partially implemented through the instruction fetch unit, the decoding unit, and the execution unit.

[0083] In some embodiments, each processor core 10 may further include a register file 12 and an intra-core interconnect structure 14. The register file 12 may include one or more physical registers, and the information stored in each physical register may indicate: one or more data types (e.g., scalar integer, scalar floating point, packed integer, packed floating point, vector integer, vector floating point, etc.), status (e.g., access permission information), address (e.g., pointer or address for fetching instructions), etc. Inside each processor core 10, the intra-core interconnect structure 14 may realize the interconnection between the various components in the processor core 10 (e.g., the register file 12 may provide a pointer for fetching instructions to the instruction fetch unit via the intra-core interconnect structure 14), and may also couple the various components in the processor core 10 to the bus structure 300 outside the processor core 10.

[0084] It should be noted that the present disclosure is only used to exemplarily describe one of the processors 100, and is not used to limit the specific implementation of the processor 100. The processor 100 may also include other components, such as a data processor (Digital Signal Processor, DSP), etc.; the various parts of the processor 100 described above may also be appropriately omitted in practical applications. In some embodiments, other processors not shown may also be integrated in the processing unit 1100.

[0085] Further, such as Figure 3As shown, the processing unit 1100 also includes a memory 200 for storing data information and code information. The memory 200 may include storage structures such as random access memory and read-only memory (ROM), wherein the random access memory in the memory 200 can be used to run the program, for example, including non-volatile random access memory (NVRAM), and may also include volatile dynamic random access memory (DRAM) and / or static random access memory (SRAM) and other storage structures; the ROM in the memory is implemented by a structure such as a flash memory (FLASH Memory), and is mainly used to store code information and instruction information. As an example, the processor 100 can access the ROM to obtain code information and instruction information, and implement data storage and / or reading and writing by accessing the random access memory, so that the processor 100 can implement the operation of the program based on the storage space provided by the memory 200.

[0086] In some optional embodiments, the memory 200 may also include an MMIO (Memory-mapped I / O) for coupling to a storage device outside the processing unit 1100 so that the storage device can jointly provide a storage space accessible to the processor 100 with the memory 200.

[0087] For the convenience of explanation, the present disclosure collectively refers to the storage space accessible by the processor 100 as the storage unit of the processing unit 1100. As described above, the storage unit of the processing unit 1100 may be physically implemented by the memory 200 integrated in the processing unit and / or a storage device coupled to the processing unit 1100 via MMIO. In some embodiments, each storage address corresponding to the storage unit of the processing unit 1100 may belong to the same addressing space for access by the processor 100.

[0088] In the embodiment of the present invention, the storage unit may include multiple mutually isolated security zones 20 (which may be referred to as Enclave, Secure Enclave, or partition, trusted zone, enclave, enclosure, or secure environment), each of which is equivalent to an independent trusted execution environment TEE. Figure 1 and 3The various security zones shown in FIG. 1 are drawn inside the memory 200. However, as described above, in some optional embodiments, at least part of one or some security zones 20 may also be implemented by a storage device 1300 coupled to the MMIO.

[0089] The physical structure based on each security zone 20 can be implemented by any one or more storage structures in the storage unit. For example, the security zone 20 used to run a certain program may include: a first storage area provided by ROM in the storage unit for storing the code of the program, a second storage area provided by NVRAM in the storage unit for storing data required by the program, and / or a third storage area mapped by MMIO, etc.

[0090] like Figure 3 As shown, the processing unit 1100 further includes a bus structure 300, so that the memory 200 can communicate with the processor 100 via the bus structure 300. The bus structure 300 is, for example, a SoC bus, which can be implemented based on a bus protocol such as AXI (Advanced Xtensible Interface).

[0091] As an example of the processing unit 1100, Figure 3 The processor core 10A shown in the figure can be implemented based on the RISC-V instruction set architecture and is mainly used to execute application code; Figure 3 The processor core 10S shown can be implemented based on various instruction sets, not limited to the RISC-V instruction set, and is mainly used to manage security information, such as executing codes related to cryptographic services. However, the embodiments of the present invention are not limited to this. Each processor core 10A integrated in the processing unit 1100 for executing applications can be implemented based on other instruction set architectures that can establish and control multiple TEEs through a storage protection mechanism, and the processing unit 1100 may include one or more processor cores 10A, and may also include one or more processor cores 10S. The processor core 10A and the processor core 10S may also be implemented in the same processor core.

[0092] For the convenience of explanation and distinction, the processor core 10A is referred to as the application processor core 10A, and the processor core 10S is referred to as the security processor core 10S. The application processor core 10A and the security processor core 10S may support the same instruction set (for example, the RISC-V instruction set), or may support different instruction sets (for example, the application processor core 10A supports the RISC-V instruction set, and the security processor core 10S supports other instruction sets).

[0093] The application processor core 10A and the security processor core 10S may be coupled to the bus structure 300 respectively, but the application processor core 10A may not be allowed to obtain information provided by the security processor core 10S via the bus structure 300. In order to realize two-way communication between the application processor core 10A and the security processor core 10S, in some embodiments, the application processor core 10A may communicate with the security processor core 10S via a "mailbox" mechanism. The "mailbox" mechanism may use a shared area (for example, including an inbox for receiving information and an outbox for sending information) set in the storage unit of the processing unit 1100. The shared area can be accessed by the application processor core 10A and the security processor core 10S, thereby realizing the message request and response process between the application processor core 10A and the security processor core 10S.

[0094] For example, the storage unit in the processing unit 1100 may include a first shared area mem1 and a second shared area mem2, wherein: the first shared area mem1 may be written with data by the application processor core 10A and may be read by the security processor core 10S; the second shared area mem2 may be written with data by the security processor core 10S and may be read by the application processor core 10A. For the application processor core 10A, the first shared area mem1 is equivalent to a sending box, and the second shared area mem2 is equivalent to an inbox. The application processor core 10A may write information that needs to be transmitted to the security processor core 10S into the first shared area mem1, and may read information from the second shared area mem2; for the security processor core 10S, the second shared area mem1 is equivalent to a sending box, and the first shared area mem1 is equivalent to an inbox. The security processor core 10S may write information that needs to be transmitted to the application processor core 10A into the second shared area mem2, and may read information from the first shared area mem1. Therefore, based on the first shared area mem1 and the second shared area mem2 , the application processor core 10A and the security processor core 10S can achieve bidirectional communication.

[0095] In the processing unit 1100, a key management system (KMS) can also be established based on the security processor core 10S. It is an integrated system for generating, distributing and managing password information of various devices and applications in electronic devices. It is a dedicated environment for implementing password services, which can ensure that the password services can run smoothly and securely from the hardware level. The functions of the key management system include, for example, encrypting sensitive information using keys, certificates, configuration files, etc. to protect the security of sensitive information.

[0096] Figure 4 A schematic block diagram showing a key management system according to an embodiment of the present invention.

[0097] In addition to the security processor core 10S, such as Figure 3 and Figure 4 As shown, the key management system may also include several key management components 700 integrated in the processing unit 1100 for providing or processing password information, and the key management components include but are not limited to: one or more of the following units: KME (Key Management Engine) unit, PKE (Public Key Encryption) unit, SME (Symmetric Encryption) unit, HASH (Hash function) algorithm unit, TRNG (True Random Number Generator), non-volatile memory NVM, etc. Among them, the non-volatile memory NVM in the key management system can be implemented by eFuse (a one-time programmable memory) and its controller, or by a storage structure such as a one-time programmable read-only memory (OneTime Programmable Read-Only Memory, referred to as OTP ROM) or a non-volatile random access memory.

[0098] In order to ensure the security of the key management system, the various key management components 700 in the key management system cannot be accessed by the application processor core 10A, but can only be accessed by the security processor 10S. The security processor core 10S can, for example, control the TRNG to generate true random numbers, and generate / store various cryptographic information (private keys, public keys, certificates, signature files, etc.) based on the true random numbers and various cryptographic algorithms. It can also provide various cryptographic services such as encryption and decryption operations to generate encryption / decryption results.

[0099] In some embodiments, Figure 4 As shown, in order to enhance the security of the key management system, a KMS bus 400 isolated from the bus structure 300 can be set in the security management system to implement the transmission of key-related information such as certificate information, verification information, signature information, random number information, etc. in the key management system. Each key management component 700 can be coupled to the KMS bus 400 to communicate with the security processor core 10S.

[0100] See also Figure 3In the illustrated embodiment, the processing unit 1100 further includes a direct memory access (DMA) controller 500, which is used to directly access the storage unit to obtain the information (data and / or code) stored therein and manage the data transmission inside the electronic device. The processor 100 can initialize the DMA controller 500 so that the DMA controller 500 can respond to the DMA transfer request to obtain the control right of the bus structure 300, and then the DMA controller 500 can establish the information transmission path required by the DMA transfer request by initiating read and write commands, so that each processor core 10, storage unit and other parts in the processing unit 1100 can realize information transmission under the premise of permission, and after completing the information transmission, the control right of the bus structure is returned to the processor 100, and wait for the next initialization.

[0101] The processing unit 1100 may also include: a bridge for bridging the bus structure 300 with the system bus 1200 of the electronic device, a power management module (Power Management Unit, PMU for short) 600, and an interface module for connecting to peripheral devices such as disks and sensors, etc. It may also include various analog components (such as analog-to-digital converters, digitally controlled amplifiers, phase-locked loops, transmit / receive modules, radio frequency modules, etc.), various digital components (such as image processors, audio processors and accelerators, etc.), and other hardware components described or not described above.

[0102] Figure 5 A schematic block diagram showing the software architecture of a processing unit according to an embodiment of the present invention.

[0103] Based on the above hardware architecture, the operating system can be executed on the processing unit 1100 provided in the embodiment of the present invention. The operating system can be used to: control, manage and arrange access to hardware resources (including memory, processor, storage device and / or other external devices, etc.) in the electronic device; provide corresponding interfaces (such as system call interface, System Call Interface) for various applications, so that users and / or applications can initiate access to the operating system via the corresponding interface to request the operating system to provide corresponding service support (such as realizing control of the hardware architecture), so that the processing unit 1100 can perform different tasks based on various applications.

[0104] The application is mainly used to perform set tasks according to user operations, and can be understood as software composed of one or more computer programs, that is, the application may include a series of instructions (corresponding to the code of the application) that can be executed by the processing unit 1100 and a collection of related data. The application may include, for example, a payment application for implementing property transactions, a service application for providing corresponding services according to the user's personal information, a game application, a media application, and an underlying driver for driving hardware resources, etc., wherein the data and code included in the payment application and the service application involving the user's privacy information need to be protected to prevent malicious software from stealing the user's privacy information / sensitive information.

[0105] Some applications may include a host application and a supplementary application (also called an applet). The executable code and related data of the host application are, for example, stored in the processing unit 1100 and / or in a storage space that can be read by the processing unit 1100. The supplementary application is, for example, a plug-in or accessory software, which is used to expand and / or supplement the functions and / or information of the corresponding host application; the code module provided by the supplementary application (for example, a module implemented by source code, object code, etc.) needs to be executed in conjunction with the host application. In the description of the present disclosure, the host application and the supplementary application are collectively described as applications, but it should be understood that the host application and the supplementary application can be respectively specified to run in mutually isolated storage areas in the storage unit of the processing unit 1100, or can be specified to run in the same storage area or two non-isolated storage areas in the storage unit of the processing unit 1100.

[0106] As mentioned above, since the processing of instructions and information is implemented by the processor 100, the user can control the operating system by using an application so that the processor 100 can obtain the corresponding instructions and information from the storage unit under the control of the operating system and complete the processing of the instructions and information. The processing results can also be stored in the storage unit.

[0107] In an embodiment of the present invention, the instruction set (e.g., RISC-V instruction set) architecture on which the processor 100 is based can define multiple privilege modes (also referred to as privileged modes, Privileged Mode), including at least: user mode (User Mode, which can be abbreviated as U-mode) and machine mode (Machine Mode, which can be abbreviated as M-mode, also called kernel mode).

[0108] In some optional embodiments, the processing unit 1100 may also include modes such as supervisor mode (Supervisor Mode, which may be abbreviated as S-mode) and management mode (Hypervisor Mode, which may be abbreviated as H-mode) to implement different functions according to different scenarios.

[0109] In some embodiments, the processing unit 1100 includes, for example, a mode status register (for example, located in the register stack 12, or may be implemented by other registers located within the processing unit) for providing operation codes corresponding to different permission modes. The processing unit 1100 can determine whether the current instruction can be executed in the current permission mode by checking these operation codes, thereby realizing functions such as task processing, task protection, hardware abstraction and virtualization in different permission modes.

[0110] In order to prevent untrusted applications from obtaining sensitive information, various applications can only run in protected user mode, so as not to affect the operation of the operating system and do not have the authority to affect various configurations of machine mode; the operating system can manage and control applications and other hardware and software resources in various electronic devices. The operating system runs at least in application mode, and in some optional embodiments, the operating system can also run in machine mode.

[0111] Machine mode can be understood as a trusted mode. In machine mode, the processing unit 1100 can run a trusted security monitoring system (SecureMonitor, referred to as SM) in a designated storage area of ​​the storage unit (different from the storage area storing the operating system). The code of the security monitoring system is usually defaulted to trusted code (which can be stored in a read-only memory in the memory), and can be trusted to access various parts of the electronic device such as the operating system, so as to control the storage unit, input / output interface, and the underlying functions required for the startup and configuration process of some electronic devices. Since the application usually includes untrusted code, the application cannot run in machine mode, and neither the operating system nor the application has the right to access the security monitoring system.

[0112] In an embodiment of the present invention, the security monitoring system can implement a physical memory protection (PMP) mechanism to specify the storage address space accessible to the user mode in the machine mode, and grant or deny permissions such as read permission, write permission, and execute permission.

[0113] Based on the PMP mechanism, in machine mode, the security monitoring system can be a plurality of mutually isolated security zones 20 (such as Figure 1 and 3The corresponding storage address space is configured as shown in FIG. 1 . All or part of the application can be loaded into a corresponding security zone 20 to be isolated from other applications and / or information. When the processor 100 needs to run a certain application, it can obtain the code and / or data stored in the corresponding security zone 20 through one or more authorization methods (such as verification, signature, etc.), and return the generated information to the security zone 20 to realize the independent operation of the application.

[0114] In some embodiments, the security monitoring system is also used to implement process switching between programs running in each security zone 20, and can also be used to implement process switching between programs running in each security zone 20 and other programs (such as operating systems). Figure 5 As shown, under the control of the security monitoring system, the control of the processor may be transferred between different security zones. Figure 5 The dotted line in the figure schematically shows the control transfer path of the processor. For example, when the code in a certain security zone is executed by the application processor core, the security zone can hand over the control to the security monitoring system, and the security monitoring system then hands over the control to the code running in another security zone to start running another application.

[0115] It can be seen that in user mode, even if the trustworthiness of an application is uncontrollable, the processing unit 1100 of the embodiment of the present invention can realize the independent operation of various applications by setting a security zone, thereby limiting each application to access only the specified storage space in the storage unit, and the sensitive information provided by the application limited to the specified storage space can also be protected. Therefore, the processing unit 1100 of the embodiment of the present invention can support the isolation of different storage areas in the storage unit in terms of software and hardware, so that multiple applications can be executed concurrently in their respective independent storage areas, and each application is independently protected and does not interfere with each other, thereby improving the security of the user mode.

[0116] Safe Zone

[0117] Figure 6 A schematic diagram showing a partial software architecture of a processing unit according to an embodiment of the present invention.

[0118] like Figure 3 , 5 and Figure 6As shown, the security monitoring system of the embodiment of the present invention divides the storage address space of the storage unit into security zones 20 with different functions, including but not limited to: multiple application security zones (AppEnclave, AE) for applications and non-application security zones for security information. Based on the different contents of the stored security information, the non-application security zone may further include independent cryptographic security zones (Crypto Enclave, CE) (also translated as encryption security zone or named other names) CE and / or runtime security zones (Runtime Enclave, RE). It should be noted that the embodiment of the present invention does not limit the naming of each security zone, that is, the application security zone, cryptographic security zone, and runtime security zone may also be named other names.

[0119] In some embodiments, the application processor core 10A can access the application security area AE to securely run the corresponding application program in each application security area AE; the security processor core 10S can access the non-application security area to run security-related (such as cryptographic services) designated programs in the non-application security area.

[0120] As an example, in the description of this embodiment, the multiple security zones divided by the security monitoring system include multiple application security zones AE, password security zones CE, and runtime security zones RE. However, it should be noted that the embodiments of the present invention are not limited to this example: in some embodiments of the present invention, the storage unit may include one or more password security zones CE; in some embodiments, the storage unit may include one or more runtime security zones RE; in some embodiments, the storage unit may only include one or more password security zones CE without including runtime security zones RE, or may only include one or more runtime security zones RE without including password security zones CE; in some embodiments, each non-application security zone may not be further divided into password security zones and / or runtime security zones, but may be used to uniformly store multiple types of security information.

[0121] The different security zones defined in the embodiments of the present invention are described below.

[0122] Application security zone AE: used to encapsulate the corresponding application (usually designated as an application involving sensitive information and / or an untrusted application), thereby isolating the application from other programs / information in user mode. The application security zone AE, for example, stores the executable code of the application and the data that can be obtained or generated by the application. The security monitoring system can divide different and mutually isolated application security zones AE for different applications (which may be all or part of the main application and / or supplementary application).

[0123] Password security zone CE: can be used to interact with the above-mentioned key management system KMS, responsible for feeding information to the key management system and / or collecting password information from the key management system (such as reading the private key of the certificate, etc.), so that the password information is protected.

[0124] In some embodiments, the designated program stored in the cryptographic security area CE may be a cryptographic-related program for cryptographic services, such as the code of a cryptographic service interface (CSI) program and / or the code of a key management system driver (KMS driver) for driving a key management system. When an application App1 stored in the application security area AE needs to call a function in the KMS (such as a symmetric key encryption algorithm provided by the SME unit), the security monitoring system SM transfers the control of the processor 100 from the application processor core 10A to the security processor core 10S, so that the security processor core 10S accesses the cryptographic security area CE in the storage unit to execute the required function. At this time, the security processor core 10S can access the application security area AE used to run the application App1 to obtain necessary information, and perform encryption and decryption algorithms on the information. After the algorithm is completed, the security processor core 10S stores the processing results in the application security area AE corresponding to the application App1, and then the security monitoring system SM switches the control of the processor 100 back to the application processor core 10A, so that the application processor core 10A can continue to run the application App1 in the application security area AE based on the processing results. Therefore, the operating system can drive and / or call the key management system by calling the program stored in the password security area CE to obtain the password information provided by the key management system.

[0125] Runtime Security Area RE: can be used to store shared information that can be called by different applications (such as shared programs and / or universal drivers) to save storage space. Figure 6As shown, the shared information includes, for example, callable programs such as shared libraries and / or shared drivers. In some embodiments, the shared library includes, for example, a common runtime library, which is used to support the development and operation of the operating system (for example, to provide callable library functions, initialization codes, error handling codes, and / or exit codes for various applications), so that the operating system can run different applications by calling the shared library stored in the runtime safety zone RE without repeatedly storing the same information in the storage unit, thereby saving storage space. In some embodiments, the shared driver includes, for example, a runtime driver (Common Runtime Driver), which can be called by the operating system to drive and configure programs such as initialization, error handling, and exit of different applications.

[0126] In some optional embodiments, each processor core 10 in the processor 100 may support an extended instruction set for each security zone, which extended instruction set may include, for example, operation instructions for each security zone and / or process switching instructions for each security zone, etc., for executing processes such as creation and configuration of each security zone.

[0127] In order to ensure the security performance of the processing unit 1100, the security monitoring system can set (grant / deny) corresponding permissions for different security zones. For example, in some embodiments, an application stored in the application security zone AE can request to call information in the password security zone CE and the runtime security zone RE, but cannot initiate read and write requests to the password security zone CE and the runtime security zone RE, thereby ensuring that the information stored in the non-application security zone is highly confidential and remains intact.

[0128] Figure 7 A schematic diagram showing permission settings of various parts in a processing unit according to an embodiment of the present invention is shown.

[0129] The following will be based on Figure 7 The security monitoring system's permission setting scheme for security zones is described exemplarily, however, the embodiments of the present invention are not limited thereto, and the security monitoring system may also adopt other schemes to achieve mutual isolation between different security zones and ensure that the information stored in each security zone is protected.

[0130] As an example, the permission information that can be configured by the security monitoring system can indicate access rights (including at least read and write permissions and execution permissions). The permission information of each security zone can be stored in a corresponding permission register (for example, implemented by the register file 12 of the processor core 10, or by other registers located in the processing unit) or a specified area in the storage unit.

[0131] The permission information of the application security zone AE is configured to have no access rights to application security zones AE other than itself, that is, the operating system cannot perform read operations (read information), write operations (write / modify information) and execute operations (execute / call executable code) on other application security zones AE based on the application stored in any application security zone AE, so that different application security zones AE can be isolated from each other and do not affect each other. As an example, Figure 7 The application programs stored in the illustrated application security zone AE1 do not have access rights to the application security zone AE2, and the application programs stored in the application security zone AE2 do not have access rights to the application security zone AE1.

[0132] In some embodiments, the permission information of the application security area AE can be configured to have execution permissions for the non-application security area (which can be the cryptographic security area CE or the runtime security area RE), but not read and write permissions for the non-application security area, thereby ensuring the confidentiality and integrity of the information stored in the non-application security area.

[0133] In some embodiments, the permission information of the non-application security area (which may be the cryptographic security area CE or the runtime security area RE) may be configured to have read, write and execute permissions on the application security area AE.

[0134] For example, when an application running in the application security area AE requires encryption / decryption services, it cannot directly perform read or write operations on the information in the non-application security area. Instead, the control is transferred to the security processor core through a trusted security monitoring system, so that the security processor core can execute the encryption / decryption service program in the corresponding non-application security area (such as the above-mentioned cryptographic security area CE) based on the request of the application, and the encryption / decryption service program can access the application security area AE to read the required data and / or execute the required code, and can also write the encryption / decryption results to the corresponding application security area AE; after the encryption / decryption results are stored in the application security area AE, the security monitoring system can return control to the application processor core, so that the application can continue to run in the application security area AE based on the encryption / decryption results.

[0135] In some embodiments, the permission information of the non-application security zone can be configured to have execution permissions for non-application security zones outside of itself, and not have read and write permissions for non-application security zones outside of itself. For example, the executable code stored in the password security zone CE (e.g., corresponding to the KMS driver) can call and execute the executable code stored in the runtime security zone RE (e.g., corresponding to a function in a shared library), but cannot perform read and write operations, thereby ensuring the confidentiality and integrity of the information stored in the runtime security zone RE.

[0136] In other embodiments with higher security, the password security zone CE for providing password-related services cannot be accessed (read, write, execute, call) by any other security zone (such as the runtime security zone described above), thereby ensuring the security of password-related information. In these embodiments with higher security, the runtime security zone RE cannot execute programs provided by the password security zone CE.

[0137] In some embodiments, the permission information of the application security area AE can be configured to have no access to the operating system, that is, the information stored in the storage area corresponding to the operating system cannot be read, written, modified and executed by the application programs stored in the application security area AE, thereby preventing untrusted applications from obtaining sensitive information by controlling / modifying the operating system, which is equivalent to achieving one-way isolation between the application security area AE and the operating system.

[0138] In some embodiments, the permission information of the non-application security zone (which can be the password security zone CE or the runtime security zone RE) can be configured to have read, write and execute permissions for the operating system. Since the content stored in the non-application security zone cannot be rewritten by the application program, the content stored in the non-application security zone has a higher degree of credibility, and the information in the operating system can usually be read, written, modified and executed by the executable code stored in the non-application security zone under safe conditions.

[0139] In some embodiments, the permission information of each security zone may be configured to have no access rights to the security monitoring system, thereby ensuring high credibility and high security of the security monitoring system.

[0140] Thanks to the above-mentioned PMP mechanism, in an optional embodiment, the storage address range of each security zone can be stored as an item list in a set area of ​​the storage unit and / or a specified register (for example, implemented by the register stack of the processor core 10, or by other registers located in the processing unit). The item list can only be accessed by the security monitoring system, and the security monitoring system can implement address allocation for the security zone through each entry in the configuration item list.

[0141] Each table entry may have a set data structure. In some optional embodiments, each table entry may include, in addition to an address tag (which may be stored in an address register) for indicating the storage address range of the corresponding security zone, a category tag for indicating the category information of the security zone (for indicating that the security zone is an application security zone, a non-application security zone, a password security zone, or a runtime security zone) and / or a permission tag for indicating the above-mentioned permission information. In some embodiments, each table entry may also be used to indicate auxiliary information such as the number of the security zone.

[0142] Each table entry may be stored in a designated protection area in the storage unit, and may be copied by the operating system to a register within the processor 100 (eg, implemented by a register stack of the processor core 10, or by other registers within the processing unit).

[0143] Based on the PMP mechanism, the operating system can protect each security zone at the physical level. For example, if an access request (for example, initiated by a DMA controller, etc.) does not have permission to access a security zone, the operating system will indicate the access request as referencing a non-existent storage address, so that the access request cannot be executed. For another example, when the processing unit 1100 in user mode attempts to fetch instructions or perform load / store operations based on a certain access address, the operating system can compare the access address with the storage address range indicated by each table entry in the item list, and determine whether the access address is allowed based on the comparison result. If so, the processing unit 1100 can continue to perform the corresponding operation based on the access address. If not, an access exception will be triggered.

[0144] In some embodiments, each security zone can be enabled or disabled. When each security zone is enabled, the specific description can refer to other embodiments of the present invention, which will not be repeated here; when a security zone is disabled, the program running in the security zone cannot be executed by the processor, nor can it be called, read or written by other programs.

[0145] In a further embodiment, each security zone may also be partially disabled to prohibit access, call or execution of some information in the security zone. For example, when the application security zone for running a facial recognition program is partially disabled, the facial recognition program can still generate a facial recognition result based on the received facial image data, but the facial recognition result cannot be used to perform subsequent operations (for example, the program running in the runtime security zone and / or the password security zone cannot obtain the facial recognition result).

[0146] As an example, based on the above embodiments, the table entries corresponding to each security zone may include an enable tag, which can be configured by the security monitoring system to set whether the security zone is enabled, fully disabled or partially disabled, and the enable tag indicates that the security zone is in an enabled state, a disabled state or a partially disabled state.

[0147] In some embodiments, an application program running in a certain (or certain) application security zone may share its permission information with a designated program, so that the designated program may have temporary access rights to the application security zone.

[0148] For example, when a risk detection program running in a certain application security zone detects that the risk coefficient of the current operating environment is high, the risk detection program can disable or partially disable the security zone involving sensitive information (for example, for running payment applications) to reduce the possibility of sensitive information being leaked; when the risk detection program detects that the risk coefficient of the current operating environment is within the allowable range, each security zone can be re-enabled to allow the processing unit to operate normally; when the risk detection program detects that the risk coefficient of the current operating environment is lower than a certain set value, it can be determined that the operating environment of the processing unit is very safe, and some applications App_h with relatively low confidentiality and sensitivity can share their permission information with the designated application App_s (running in the application security zone AE_s), so that the designated application App_s can temporarily access the application security zone AE_h where the application App_h is located, thereby allowing the application security zone App_s to access the application security zone App_h outside itself within a specific time period. This example is only used to illustrate a possible implementation of the above embodiment, and is not used to limit the embodiments of the present invention.

[0149] Safe Boot Method

[0150] After the processing unit 1100 is started (for example, in the case of booting, powering on, or restarting), the secure boot (SecureBoot) program is usually the first program that needs to be executed by the processor 100. In order to ensure that the processing unit 1100 can correctly and safely execute various programs and instructions after startup, the secure boot program can be used to control the startup sequence of various software and hardware parts in the processing unit 1100, and can verify each software and hardware part, so that illegal or malicious programs that cannot pass the verification are rejected or cannot be started, thereby ensuring the safety of the electronic device.

[0151] Figure 8 A schematic flow chart of a secure boot method according to an embodiment of the present invention is shown. The secure boot method is implemented, for example, based on any processing unit and / or electronic device disclosed by the embodiment of the present invention.

[0152] Step S101: The secure boot program may preferentially enable the security monitoring system. The boot sequence information followed by the secure boot program may be stored in a protected area of ​​the storage unit in the form of a list, and the boot sequence information may be copied by the secure boot program or the security monitoring system to the corresponding boot sequence register in the processor 100 for easy calling.

[0153] Step S102: After the security monitoring system starts running, a password security zone can be established within the storage address range based on the PMP mechanism, security information can be written into the password security zone, and the storage address range, permission information and / or category information corresponding to the password security zone can be configured to complete the setting of the password security zone; the runtime security zone can also be configured in step S102.

[0154] In some embodiments, the security monitoring system can, for example, write security information such as drivers and library functions stored in a non-volatile storage device (such as an external memory) into the corresponding cryptographic security area CE and runtime security area RE. In some embodiments, the cryptographic security area CE can be established synchronously with the runtime security area RE; in other embodiments, the cryptographic security area CE can be established before the runtime security area RE, or after the runtime security area RE is created.

[0155] In some embodiments, after completing step S102 , the key management system may be driven by a driver of the key management system stored in the non-application security area, thereby starting the password management service.

[0156] Step S103: After the security monitoring system starts running, multiple application security areas AE can be established within the storage address range based on the PMP mechanism, the specified application can be written into the corresponding application security area AE, and the storage address range, permission information and / or category information corresponding to the application security area can be configured to complete the setting of the application security area AE.

[0157] In some embodiments, the security monitoring system may, for example, write all / part of the executable code and data corresponding to the application stored in a non-volatile storage device (e.g., an external memory) into the corresponding application security zone AE to load various applications into the corresponding security zone in the storage unit. In some embodiments, step S103 may be executed simultaneously with step S102, or after step S102, or before step S102, and this application does not limit this.

[0158] In some embodiments, applications loaded in multiple application security zones AE may need to be started by default during the secure boot process. These applications and other software and hardware components that need to be started at startup can form a boot chain (BootChain). The startup process of each startup item in the boot chain can be controlled by the secure boot program provided in an embodiment of the present invention.

[0159] Step S104: The secure boot program locates the application program that currently needs to be started according to the boot sequence indicated by the boot sequence information, and performs verification before running each application program to ensure that the application program can run safely.

[0160] In some embodiments, each boot item in the boot chain needs to be verified (measured) and / or signed (signed) by the secure boot program. For example, the secure boot program can calculate the boot item to be verified based on the hash (HASH) algorithm to obtain a verification value, and compare the verification value with the expected hash value. If the two are inconsistent, the startup of the boot item or the entire electronic device fails. If the two are consistent, it can be indicated that the boot item can run safely.

[0161] Since the secure boot program needs to have a higher level of security, in some embodiments, the secure boot program may be stored in a read-only storage device integrated in the processing unit or in a read-only memory in the memory 200 to prevent the secure boot program from being modified and to ensure that the electronic device and the processing unit can be securely booted.

[0162] In some traditional solutions (such as Software Guard Extensions technology, referred to as SGX technology, which is a program security execution framework launched by Intel), since independently packaged security chips have good hardware protection performance and security functions, at least part of the Internet of Things devices are usually bound to an independently packaged security chip (the security chip is embedded in a computer device / server, for example) to implement a security protection solution. The security chip generally needs to communicate with the application on a printed circuit board (PCB) through a serial bus. Although it can isolate the application from the code and data in the security chip, the design difficulty and complexity at the printed circuit board level are high, and the cost is relatively high. In comparison, an embodiment of the present invention sets multiple security zones in the processing unit (for example, Figure 3 The multiple application security zones AE, cryptographic security zones CE and / or runtime security zones RE) shown are used to implement the trusted execution environment required for the security protection function, so that the application program can communicate with the trusted execution environment within the processing unit, reducing the design difficulty, complexity and cost, and also improving security.

[0163] In some traditional solutions (such as Arm's TrustZone technology), electronic devices are divided into two parts: a secure world and a normal world, where all trusted applications run in the secure world. Each application running in the entire secure world has the possibility of being attacked. Therefore, the more applications running in the secure world, the greater the risk of being attacked, and different applications running in the secure world will also interfere with each other. In contrast, in the embodiment of the present invention, each application that needs to be protected / trusted runs in different isolated security zones, and a non-application security zone for security information is added, so that each application can be independently protected and security information such as keys can be strengthened, thereby enhancing security. For example, in the processing unit of the embodiment of the present invention, the application App1 and the application App2 can be respectively run in the isolated application security zone AE1 and the application security zone AE2, so the application App1 and the application App2 will not interfere with each other, and the risk of being attacked in the application security zone AE1 mainly comes from the application App1, and the risk of being attacked in the application security zone AE2 mainly comes from the application App2. Compared with the TrustZone technology that adopts the overall security part, it can effectively reduce the risk coefficient of each security zone being attacked.

[0164] Some traditional solutions (such as the Keystone technology proposed by Berkeley) set up three modes (user mode, machine mode and management mode) to protect sensitive information based on independently packaged security chips. However, these traditional solutions are aimed at high-performance electronic devices such as servers, with complex designs and high costs, and are not suitable for lightweight electronic devices. In comparison, the embodiments of the present invention can be better applied to lightweight electronic devices, and at least only two modes (user mode and machine mode) can be set, that is, the application security zone and the non-application security zone can be set in the chip or system on chip where the processing unit is located, thereby simplifying the design and saving costs. In addition, in some preferred schemes, the embodiments of the present invention can use the non-application security zone to achieve more optimization (for example, setting a shared library to save storage space and / or further improve the security of the key management system), thereby further reducing costs and / or improving security performance. For example, the runtime security zone RE in the embodiment of the present invention can include shared information such as shared programs, and different applications can call the shared information of the RE in the runtime security zone, so that there is no need to repeatedly store the same shared information in the processing unit, saving storage space and reducing costs. For example, in some highly secure embodiments, the cryptographic security area CE is used to provide the storage space required to run cryptographic-related programs, and the information stored in the cryptographic security area CE cannot be read, written or even executed by any other security area (such as the application security area and the runtime security area), thereby ensuring that cryptographic-related programs can run in a highly secure trusted execution environment without being stolen by less secure programs, further improving security performance compared to the prior art.

[0165] To sum up, compared with traditional solutions, the processing unit and electronic device provided by the embodiments of the present invention can establish TEE within the processing unit based on multiple application security zones, as well as password security zones and / or runtime security zones, thereby allocating independent application security zones for various applications, so that the processing unit can independently run the corresponding application in the application security zone, thereby ensuring that each application is independently protected, enhancing security, and preventing sensitive information involved in the application from being stolen.

[0166] In some embodiments, the memory includes a password security zone that is different from the application security zone. The processing unit can run password-related programs in the password security zone to further protect password information from being illegally obtained, thereby improving the security of the processing unit.

[0167] In some embodiments, the memory includes a runtime security zone that is different from the application security zone. The processor can run shared resources such as shared programs in the runtime security zone, thereby reducing the occurrence of repeated occupation of storage resources and saving storage space.

[0168] In some optional embodiments, the present invention can set up multiple security zones with multiple categories by setting only two modes (user mode and machine mode), thereby simplifying the design, saving costs, and being better suitable for lightweight processing units and electronic devices without the need for a complex software and hardware architecture system.

[0169] In some embodiments, the processing unit of the present invention sets up multiple security zones and corresponding processor cores within the on-chip system to implement the trusted execution environment required for the security protection function, so that the application program can communicate with the trusted execution environment within the chip, reducing the design difficulty, complexity and cost, and also improving security.

[0170] The present application also discloses a security control method for implementing the above embodiments. For specific steps, please refer to the description in the above embodiments and will not be repeated here.

[0171] The present application also discloses a computer-readable storage medium including computer-executable instructions stored thereon, and when the computer-executable instructions are executed by a processor, the processor is caused to perform the methods of the embodiments described herein.

[0172] In addition, the present application also discloses an electronic device, which includes a device for implementing the methods of the embodiments described herein.

[0173] It should be understood that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, there are many variations of the embodiments of this specification. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

[0174] It should be understood that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the method embodiment, since it is basically similar to the method described in the device and system embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of other embodiments.

[0175] It should be understood that the above is a description of a specific embodiment of the present specification. Other embodiments are within the scope of the claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0176] It should be understood that an element described in singular form herein or shown in the drawings as only one does not limit the number of the element to one. In addition, modules or elements described or shown as separate herein may be combined into a single module or element, and modules or elements described or shown as single herein may be split into multiple modules or elements.

[0177] It should also be understood that the terms and expressions used herein are for description only, and one or more embodiments of this specification should not be limited to these terms and expressions. The use of these terms and expressions does not mean to exclude any equivalent features of the illustrations and descriptions (or parts thereof), and it should be recognized that various modifications that may exist should also be included in the scope of the claims. Other modifications, changes and substitutions may also exist. Accordingly, the claims should be deemed to cover all such equivalents.

Claims

1. A processing unit, characterized in that: include: a processor, suitable for running programs; A memory, coupled to the processor, adapted to provide a plurality of mutually isolated security zones, the plurality of security zones including a plurality of application security zones, each of the application security zones being used to run a corresponding application program, the plurality of security zones further comprising at least one of the following: A runtime security area, suitable for providing storage space required for the operation of callable programs; A password security area, suitable for providing storage space required for running password-related programs; a permission register, used to store permission information of each of the security zones, wherein the processor is adapted to control access operations of each of the security zones according to access permissions indicated by the permission information, The permission information of the application security zone is configured as: having execution permission for the password security zone and / or the runtime security zone, and not having read and write permission for the runtime security zone and the password security zone, The runtime security zone and the password security zone at least have read and write permissions to the multiple application security zones, and each application security zone does not have read and write permissions to the runtime security zone and the password security zone.

2. The processing unit according to claim 1, characterized in that The callable program is a shared program and / or a universal driver program for different application programs.

3. The processing unit according to claim 1, characterized in that The processor comprises a first processor core adapted to run the cryptographic-related program for cryptographic services in the cryptographic security zone.

4. The processing unit according to claim 3, characterized in that Also includes a key management component adapted to provide the cryptographic service to generate encryption / decryption results, The first processor core is coupled to the key management component, and writes the encryption / decryption result into the corresponding application security zone by running the password-related program in the password security zone.

5. The processing unit according to claim 3, characterized in that The processor also includes a second processor core, which is suitable for respectively running corresponding application programs in the multiple application security zones.

6. The processing unit according to claim 5, characterized in that The second processor core is implemented based on the RISC-V instruction set architecture.

7. The processing unit according to claim 5, characterized in that Also includes: A bus structure is coupled to the first processor core, the second processor core and the memory respectively.

8. The processing unit according to claim 1, characterized in that Also includes: The address register is used to store address information corresponding to each of the security zones.

9. The processing unit according to claim 1, characterized in that: The permission information of the application security zone is configured so as not to have access rights to the application security zone other than the application security zone itself.

10. The processing unit according to claim 1, characterized in that The permission information of the password security zone and the runtime security zone is configured to have read and write permissions and execution permissions for the application security zone.

11. The processing unit according to claim 1, characterized in that The permission information of the runtime security zone is configured not to have read and write permissions to the password security zone, and the permission information of the password security zone is configured not to have read and write permissions to the runtime security zone.

12. The processing unit according to claim 11, characterized in that The permission information of the runtime security zone is configured to have no execution permission on the cryptographic security zone.

13. The processing unit according to claim 1, characterized in that A first application security zone among the multiple application security zones shares permission information with a designated second application security zone, so that the second application security zone has temporary access rights to the first application security zone.

14. The processing unit according to claim 8, characterized in that The processor is adapted to: Run the operating system; Running one or more of the application program, the callable program, and the password-related program in user mode; and The security monitoring system is run in machine mode to configure the address register and the permission register, and to switch the control of the processor by programs in different security zones.

15. The processing unit according to claim 14, characterized in that The permission information of each of the security zones is configured to have no access rights to the security monitoring system, the permission information of the application security zone is configured to have no access rights to the operating system, and the permission information of the password security zone and the runtime security zone are configured to have read, write and execute rights to the operating system.

16. The processing unit according to claim 14, characterized in that Also includes a startup sequence register, suitable for storing startup sequence information, Based on the startup sequence information, the processor is adapted to first run the security monitoring system during the startup process, and then run the password-related program in the password security area.

17. The processing unit according to claim 1, characterized in that At least one of the security zones is configured with a corresponding enable tag, the enable tag indicating that the security zone is in an enabled state, a disabled state, or a partially disabled state.

18. The processing unit according to claim 1, characterized in that The memory includes one or more storage modules selected from the group consisting of a read-only storage module, a dynamic and / or static random access storage module, a non-volatile random access storage module, and a storage mapping input / output interface module.

19. The processing unit according to claim 1, characterized in that Also includes: a direct storage access controller, responsive to a request from the processor to access the memory; and / or The power management module is adapted to provide the power supply voltage required for the processing unit to operate.

20. The processing unit according to claim 1, characterized in that The processing unit is integrated into a system on a chip.

21. The processing unit according to claim 1, characterized in that The processing unit is a microcontroller.

22. An electronic device comprising the processing unit according to any one of claims 1 to 21.

23. A safety control method, characterized in that: include: Configuring a plurality of mutually isolated security zones in a memory, wherein the plurality of security zones include a plurality of application security zones, a runtime security zone and / or a password security zone; Running corresponding application programs in each of the application security zones respectively; Running a callable program in the runtime security zone, and / or running a password-related program in the password security zone; Storing permission information of each of the security zones; as well as The access operation of each of the security zones is controlled according to the access rights indicated by the permission information, wherein the permission information of the application security zone is configured as: having execution rights to the password security zone and / or the runtime security zone, and not having read and write rights to the runtime security zone and the password security zone, The runtime security zone and the password security zone at least have read and write permissions to the multiple application security zones, and each application security zone does not have read and write permissions to the runtime security zone and the password security zone.

24. The safety control method according to claim 23, characterized in that: The callable program is a shared program and / or a universal driver program for different application programs.

25. The safety control method according to claim 23, characterized in that: Also includes: The encryption / decryption result is written into the corresponding application security zone, and the encryption / decryption result is obtained by the password-related program running in the password security zone.

26. The safety control method according to claim 23, characterized in that: In user mode, the password-related program is executed by the first processor core, and each of the application programs is executed by the second processor core.

27. The safety control method according to claim 26, characterized in that: The second processor core is implemented based on the RISC-V instruction set architecture.

28. The safety control method according to claim 23, characterized in that: The step of configuring the plurality of mutually isolated security zones in the memory comprises: Run the security monitoring system in machine mode, The security monitoring system is suitable for configuring the address information and the permission information corresponding to each of the security zones, so that the security control method can control the access operation of each of the security zones according to the access rights indicated by the permission information in the user mode. The access rights include at least read and write rights and execute rights.

29. The safety control method according to claim 28, characterized in that: The safety monitoring system is also suitable for: During or after the execution of a program in one of the plurality of security zones, switching to another security zone allows the program in the other security zone to be executed by a corresponding processor core.

30. The safety control method according to claim 28, characterized in that: The permission information of the plurality of security zones indicates at least one of the following configurations: The application security zone does not have access permissions to application security zones other than itself; The password security zone and the runtime security zone have read and write permissions and execution permissions for the application security zone; The runtime security zone does not have read and write permissions to the password security zone; The password security zone does not have read and write permissions to the runtime security zone; The runtime security zone does not have execution authority over the password security zone; as well as Each of the security zones does not have access rights to the security monitoring system.

31. The safety control method according to claim 28, characterized in that: Also includes: Run the operating system, The permission information of the application security zone is configured to have no access rights to the operating system, and the permission information of the password security zone and the runtime security zone are configured to have read, write and execute rights to the operating system.

32. The safety control method according to claim 28, characterized in that: The security control method first runs the security monitoring system during the startup phase, and then runs the password-related program in the password security area.

33. A computer-readable storage medium having instructions stored thereon, wherein the instructions, when executed, implement the steps of the method of any one of claims 23 to 32.

Citation Information

Patent Citations

  • Encryption method and encryption system based on ARM TrustZone

    CN103514414A

  • Modifying memory permissions in a secure processing environment

    CN104881596A

  • Isolated guest creation in virtualized computing system

    CN104885057A

  • Security chip and access control method thereof

    CN106529349A

  • Using trusted execution environments for security of code and data

    CN107111715A