Fast and safe starting method, device and equipment based on heterogeneous multi-core system and medium

By using dual systems in parallel to implement the startup process and security verification in a heterogeneous multi-core system, the problem of slow boot speed in the secure boot process in the existing technology is solved, a fast and secure boot is achieved, and the security of the system is ensured.

CN118626155APending Publication Date: 2024-09-10SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 0 Cites 10 Cited by

Patent Information

Application Number
CN202410832400.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

In the existing technology, during the secure boot process of the server, the integrity and reliability of the kernel and file system need to be verified, which results in a greatly increased boot speed and a long system boot time.

Method used

Using a fast and secure startup method based on heterogeneous multi-core systems, the firmware program signature is obtained from the preset binary verification file at startup through the boot read-only memory, and hash value splicing and asymmetric encryption and decryption algorithm signature verification are performed. The system implements the normal startup process and safe startup process of the universal boot loader in parallel, and uses the real-time operating system to share the safe startup verification work and speed up the boot time.

Benefits of technology

It achieves fast and secure startup, reduces boot time, and ensures system security and integrity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118626155A
    Figure CN118626155A
Patent Text Reader

Abstract

The embodiment of the invention provides a rapid and safe starting method based on a heterogeneous multi-core system, and the method comprises the steps: obtaining a first firmware program signature when a read-only memory is guided to be started, and carrying out the first verification of the first firmware program signature; if the first verification succeeds, the read-only memory is guided to control the first central processing unit to run a universal boot loader and control the second central processing unit to run a real-time operating system, and the real-time operating system obtains a second firmware program signature and performs second verification on the second firmware program signature; storing a result of the second verification to the shared memory; after the second verification is completed, guiding the read-only memory to control the universal boot loader to perform fit mirror verification; and if the fit mirror image verification is successful, starting the fit mirror image by the universal boot loader to complete the safe starting of the heterogeneous multi-core system. According to the embodiment of the invention, the quick startup of the system is realized, and meanwhile, the startup safety of the system is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a fast and secure startup method, device, equipment and medium based on a heterogeneous multi-core system. Background Art

[0002] ARM (Advanced RISC Machine) processors are used in various industries. For example, in the server field, ARM processors are used as BMC (Baseboard Management Controller) to monitor and manage servers. As the complexity of BMC applications increases, especially after the secure boot function is added, the boot speed tends to increase significantly. Uboot (Universal Boot Loader) needs to increase the processing link to verify the integrity and reliability of the kernel and file system. This part of the data verification signature and decryption process is time-consuming.

[0003] In the prior art, after the device is turned on, BootRom first performs uboot data verification to ensure that the data verification is normal before starting up. After uboot is running, it performs necessary initialization and then starts to verify the kernel and file system. After waiting for the verification to be completed, the corresponding kernel and file system are loaded and started. Although it is a complete secure boot, the system boot time is relatively long due to following the chain process. Summary of the invention

[0004] In view of the above problems, the present invention proposes a fast and secure startup method, device, equipment and medium based on a heterogeneous multi-core system.

[0005] In a first aspect of an embodiment of the present invention, a fast and secure startup method based on a heterogeneous multi-core system is first provided, which is applied to a boot read-only memory, wherein the boot read-only memory is deployed in a heterogeneous multi-core system, wherein the heterogeneous multi-core system includes at least two central processing units, and a real-time operating system and a Linux system are also running in the system, wherein the method includes:

[0006] When the boot read-only memory is started, a first firmware program signature is obtained from a preset binary verification file, and a first verification is performed on the first firmware program signature, wherein the preset binary verification file is used to record the first firmware program signature and the second firmware program signature; the first firmware program signature is obtained by concatenating a firmware program hash value of a universal boot loader and a firmware program hash value of the real-time operating system, and the second firmware program signature is obtained by concatenating a firmware program hash value of a kernel and a firmware program hash value of a file system;

[0007] If the first verification is successful, the boot read-only memory controls the first central processing unit to run a universal boot loader, and controls the second central processing unit to run a real-time operating system, the real-time operating system obtains the second firmware program signature from the preset binary verification file, and performs a second verification on the second firmware program signature;

[0008] The result of the second verification is stored in the shared memory, and the universal boot loader obtains the result of the second verification from the shared memory; the universal boot loader is used to start the kernel and the file system;

[0009] After the second verification is completed, the boot read-only memory controls the universal boot loader to perform fit image verification;

[0010] The fit image verification succeeds, and the universal boot loader starts the fit image to complete the safe startup of the heterogeneous multi-core system.

[0011] Optionally, the preset binary verification file is specifically obtained by hashing the firmware program file of the universal boot loader and the firmware program file of the real-time operating system through a secure hash algorithm to obtain a first hash value; hashing the firmware program file of the kernel and the firmware program file of the file system through a secure hash algorithm to obtain a second hash value; signing the first hash value through an asymmetric encryption and decryption algorithm to obtain the first firmware program signature; signing the second hash value through an asymmetric encryption and decryption algorithm to obtain the second firmware program signature; and writing the first firmware program signature and the second firmware program signature into the created empty binary verification file.

[0012] Optionally, obtaining a first firmware program signature from a preset binary verification file, and performing a first verification on the first firmware program signature includes:

[0013] Verify the first firmware program signature by using an asymmetric encryption and decryption algorithm to obtain the first hash value;

[0014] Performing hash calculation on the firmware program file of the universal boot loader and the firmware program file of the real-time operating system by using a secure hash algorithm to obtain a third hash value;

[0015] The third Hash value is compared with the first Hash value. If the third Hash value is the same as the first Hash value, the first verification is successful.

[0016] Optionally, if the first verification is successful, the boot read-only memory controls the first central processing unit to run a universal boot loader, and controls the second central processing unit to run a real-time operating system, the real-time operating system obtains the second firmware program signature from the preset binary verification file, and performs a second verification on the second firmware program signature, including:

[0017] If the first verification is successful, the boot read-only memory releases the central processing unit; the central processing unit runs the universal boot loader by default;

[0018] Selecting any one of the central processors except the first central processor running the universal boot loader as the second central processor from the central processors;

[0019] The boot read-only memory controls the second central processor to run a real-time operating system, and controls the first central processor and other central processors other than the second central processor to sleep; the real-time operating system is used to obtain the second firmware program signature from the preset binary checksum file;

[0020] Verify the second firmware program signature by using an asymmetric encryption and decryption algorithm to obtain the second hash value;

[0021] Performing hash calculation on the firmware program of the kernel and the firmware program of the file system by using a secure hash algorithm to obtain a fourth hash value;

[0022] comparing the fourth Hash value with the second Hash value;

[0023] If the fourth Hash value is the same as the second Hash value, the second verification is successful.

[0024] Optionally, the result of the second verification is stored in a shared memory, and the universal boot loader obtains the result of the second verification from the shared memory; the universal boot loader is used to start the kernel and the file system, including:

[0025] Storing the result of the second verification and the hash value of the firmware program file of the kernel in a shared memory;

[0026] If the second verification succeeds, the universal boot loader starts the kernel and the file system;

[0027] If the second verification fails, a prompt indicating the second verification failure is given and the universal boot loader is caused to enter an infinite loop to stop starting the heterogeneous multi-core system.

[0028] Optionally, after the second verification is completed, the boot read-only memory controls the universal boot loader to perform a fit image verification, including:

[0029] The universal boot loader obtains a hash value of the firmware program of the kernel from the shared memory;

[0030] Compare the hash value of the kernel firmware program with the hash value of the kernel firmware program stored in the fit image;

[0031] If the hash value of the kernel firmware program is the same as the hash value of the kernel firmware program in the fit image, the fit image verification is successful.

[0032] Optionally, if the fit image verification succeeds, the universal boot loader starts the fit image, and completes the secure startup of the heterogeneous multi-core system, including:

[0033] If the fit image verification succeeds, the universal boot loader starts the fit image to complete the fast and secure startup of the heterogeneous multi-core system;

[0034] If the fit image verification fails, the heterogeneous multi-core system cannot be started quickly and safely.

[0035] In a second aspect of an embodiment of the present invention, a fast and secure startup device based on a heterogeneous multi-core system is also provided, the device comprising:

[0036] a first verification module, configured to obtain a first firmware program signature from a preset binary verification file and perform a first verification on the first firmware program signature when the boot read-only memory is started, wherein the preset binary verification file is used to record the first firmware program signature and the second firmware program signature; the first firmware program signature is obtained by concatenating a firmware program hash value of a universal boot loader and a firmware program hash value of the real-time operating system, and the second firmware program signature is obtained by concatenating a firmware program hash value of a kernel and a firmware program hash value of a file system;

[0037] a second verification module, configured to, if the first verification succeeds, control the first central processing unit to run a universal boot loader by the boot read-only memory, and control the second central processing unit to run a real-time operating system, wherein the real-time operating system obtains the second firmware program signature from the preset binary verification file, and performs a second verification on the second firmware program signature;

[0038] A kernel and file system startup module, used for storing the result of the second verification into a shared memory, and the universal boot loader obtains the result of the second verification from the shared memory; the universal boot loader is used for starting the kernel and the file system;

[0039] A fit image verification module, used for guiding the read-only memory to control the universal boot loader to perform fit image verification after the second verification is completed;

[0040] The secure boot module is used for the fit image to be successfully verified, and the universal boot loader starts the fit image to complete the secure boot of the heterogeneous multi-core system.

[0041] In a third aspect of an embodiment of the present invention, an electronic device is also provided, comprising a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, a fast and secure startup method based on a heterogeneous multi-core system as described above is implemented.

[0042] In a fourth aspect of an embodiment of the present invention, a computer-readable storage medium is further provided, on which a computer program is stored. When the computer program is executed by a processor, the method for fast and secure startup based on a heterogeneous multi-core system as described above is implemented.

[0043] The embodiments of the present invention have the following advantages:

[0044] In an embodiment of the present invention, when the boot read-only memory is started, a first firmware program signature is obtained from a preset binary verification file, and a first verification is performed on the first firmware program signature. The preset binary verification file is used to record the first firmware program signature and the second firmware program signature; the first firmware program signature is obtained by splicing the firmware program hash value of the universal boot loader and the firmware program hash value of the real-time operating system, and the second firmware program signature is obtained by splicing the firmware program hash value of the kernel and the firmware program hash value of the file system; if the first verification is successful, the boot read-only memory controls the first central processing unit to run the universal boot loader, and controls the second central processing unit to run the real-time operating system, the real-time operating system obtains the second firmware program signature from the preset binary verification file, and performs a second verification on the second firmware program signature; the result of the second verification is stored in the shared memory, and the universal boot loader obtains the result of the second verification from the shared memory; the universal boot loader is used to start the kernel and the file system; after the second verification is completed, the boot read-only memory controls the universal boot loader to perform a fit image verification; if the fit image verification is successful, the universal boot loader starts the fit image, and completes the secure startup of the heterogeneous multi-core system. The dual systems can realize the normal startup process and the safe startup process of the general boot loader in parallel, which speeds up the boot time of the device safe startup and ensures the security of the system startup. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0046] Figure 1 This is a flowchart of a method for fast and secure startup of a heterogeneous multi-core system provided by an embodiment of the present invention;

[0047] Figure 2 is a schematic diagram of a binary checksum file provided by an embodiment of the present invention;

[0048] Figure 3 is a firmware program signature flow chart provided by an embodiment of the present invention;

[0049] Figure 4 is a system startup flow chart provided by an embodiment of the present invention;

[0050] Figure 5 This is a flow chart of real-time operating system signature verification provided by an embodiment of the present invention;

[0051] Figure 6 It is a flow chart of fit mirror verification provided by an embodiment of the present invention;

[0052] Figure 7 This is a structural block diagram of a device for fast and secure startup based on a heterogeneous multi-core system provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0053] To make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in the embodiments of the present invention, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can be implemented. The division of the following embodiments is for the convenience of description, and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined and referenced with each other without contradiction.

[0054] As the complexity of BMC applications increases and the secure boot function is added, uboot needs to increase the processing link to verify the integrity and reliability of the kernel and file system. Since the signature and decryption process of this part of the data is very time-consuming, the boot speed is greatly increased.

[0055] In the embodiment of the present invention, the core concept is to implement the normal boot process and the safe boot process of uboot in parallel in dual systems, and control the first central processing unit (CPU) to run the uboot program and control the second central processing unit to run the safe boot process by booting the read-only memory (BootRom). A fast and safe system startup solution is proposed, which speeds up the boot time of the device safe startup and also ensures the startup security of the system.

[0056] Among them, uboot is a kind of bootloader, which is used to boot the kernel. Its ultimate goal is to read the kernel from the flash, put it into the memory, and start the kernel. It is initially put on the flash, and then executed after power-on. It will complete hardware initialization, set the processor mode, turn off the watchdog, shield interrupts, initialize sdram, set the stack, set the clock, and boot the kernel from flash to memory.

[0057] Reference Figure 1 , shows a flowchart of a method for fast and secure startup based on a heterogeneous multi-core system provided by an embodiment of the present invention, which may specifically include the following steps:

[0058] Step 101 : when the boot read-only memory is started, a first firmware program signature is obtained from a preset binary verification file, and a first verification is performed on the first firmware program signature.

[0059] Among them, the boot read-only memory is BootRom. BootRom refers to on-chip BootRom, which is embedded with a small boot program (bootloader) inside the CPU chip, similar to the storage area of ​​BIOS (Basic Input OutputSystem) on the PC motherboard. The main functions of BootRom include: hardware initialization, self-test, boot loading and secure boot. Hardware initialization: The code in BootRom is responsible for initializing the CPU and other key hardware components to ensure that they are in an operational state; Self-test: Perform a power-on self-test to check whether the system hardware is working properly; Boot loading: The startup program in BootRom is responsible for loading more complex boot loaders or operating system kernels from external storage devices (such as hard disks, SSDs, USB drives, or networks); Secure boot: In some systems, BootRom may contain a secure boot mechanism to ensure that only verified code can be executed.

[0060] Firmware program refers to the complete program running on the ARM processor for the system to work normally, including BootLoader, Kernel, RootFs, OtherFs, etc.

[0061] The firmware program signature is mainly added for phased verification. In order to ensure full data verification, it is divided into two stages. The first stage is to package uboot and the firmware used to verify the secure boot together for BootRom verification. The second stage is to package the kernel and file system for signature.

[0062] Specifically, the preset binary verification file is obtained by performing hash calculation on the firmware program file of the universal boot loader and the firmware program file of the real-time operating system through a secure hash algorithm to obtain a first hash value; performing hash calculation on the firmware program file of the kernel and the firmware program file of the file system through a secure hash algorithm to obtain a second hash value; signing the first hash value through an asymmetric encryption and decryption algorithm to obtain a first firmware program signature; signing the second hash value through an asymmetric encryption and decryption algorithm to obtain a second firmware program signature; and writing the first firmware program signature and the second firmware program signature into the created empty binary verification file.

[0063] In an embodiment of the present invention, the secure hash algorithm (SHA, Secure Hash Algorithm) adopts SHA-256, which is a method of creating a small digital "fingerprint" from any kind of data. The hash function compresses the message or data into a digest, making the data amount smaller and fixing the format of the data. The function shuffles and mixes the data to recreate a fingerprint called a hash value (or hash value). The hash value is usually represented by a short string of random letters and numbers. For any length of message, SHA-256 will generate a 256-bit hash value, called a message digest.

[0064] The asymmetric encryption and decryption algorithm uses the RSA (Rivest-Shamir-Adleman) encryption algorithm with a key length of 2048 bits, recorded as RSA-2048. The sender and receiver each have a set of public keys and private keys. Due to the existence of power operations, its calculation speed is much slower than AES. It can be used to encrypt small amounts of data, such as for the encryption of keys. It uses private key signatures and public key signature verification.

[0065] Specifically, Figure 2 As shown, it is a schematic diagram of a binary verification file provided by an embodiment of the present invention, which stores the firmware program files of the universal boot loader and the firmware program files of the real-time operating system, and the corresponding first firmware program signatures, and also stores the firmware program files of the kernel and the firmware program files of the file system, and their corresponding second firmware program signatures.

[0066] like Figure 3 As shown, it is a firmware program signature flow chart provided by an embodiment of the present invention. First, an empty binary checksum file is created, recorded as secure.bin. If the creation is successful, the firmware program file uboot.bin of the universal boot loader is filled with a size of 600K, and then the firmware program file RTOS.bin of the real-time operating system (RTOS) is filled with a size of 64K. uboot.bin and RTOS.bin are spliced, and the spliced ​​data is written into the created secure.bin. The hash value of the spliced ​​firmware program is calculated using SHA-256, and then the calculated result is signed by RSA-2048, and then the signed 256 bytes are written to the 700KB position of secure.bin, that is, Figure 2The first firmware program signature in the file is then concatenated with the kernel firmware program signature file kernel.bin and the file system firmware program signature file fs.bin, and the concatenated data is written to the created secure.bin 1MB offset position, and SHA-256 is used to calculate the hash value of the concatenated kernel.bin and fs.bin, and then RSA-2048 is used to calculate the hash signature value, and the calculated result is written to the end of secure.bin, that is, Figure 2 At the second firmware program signature in the firmware program, that is, the firmware program signature ends, the obtained binary verification file secure.bin is stored in the physical storage medium.

[0067] In the embodiment of the present invention, if the creation of an empty binary verification file fails, a signature failure is directly prompted, and the firmware program signature is directly terminated.

[0068] Step 102, if the first verification is successful, the boot read-only memory controls the first central processing unit to run a universal boot loader, and controls the second central processing unit to run a real-time operating system, the real-time operating system obtains the second firmware program signature from the preset binary verification file, and performs a second verification on the second firmware program signature.

[0069] After the signature verification of the uboot and RTOS firmware programs is passed, BootRom can release all CPUs. All CPUs will run uboot by default. The first CPU runs uboot to perform the normal initialization loading process, and the second CPU jumps to RTOS to perform the security verification process. The RT OS system is used to facilitate the configuration of the CPU. Other CPUs are controlled to be in a dormant state, so that the dual systems can implement the normal startup process and the secure startup process of uboot in parallel, speeding up the boot time of the device secure startup while ensuring the security of the system startup.

[0070] Step 103: Store the result of the second verification in a shared memory, and the universal boot loader obtains the result of the second verification from the shared memory; the universal boot loader is used to start the kernel and the file system.

[0071] The result of the secure boot check performed by the RTOS system is stored in the shared memory, which is a storage space shared by the first CPU and the second CPU. Through this shared memory, the result of the secure boot check performed by the RTOS system can be notified to uboot, so that uboot decides whether to start the kernel and file system based on the result of the secure boot check.

[0072] Step 104: After the second verification is completed, the boot read-only memory controls the universal boot loader to perform fit image verification.

[0073] In an embodiment of the present invention, when uboot performs fit image verification, a more time-saving fit image verification is provided. Specifically, in step 103, the result of the secure boot verification performed by the RTOS is stored in the shared memory, and the hash value of kernel.bin calculated in step 102 can be stored in the shared memory. Then, when uboot performs fit image verification, the hash value of kernel.bin obtained through the shared memory can be compared with the hash value of the kernel firmware program in the fit image itself. If the two are equal, the fit image verification is successful.

[0074] Step 105, the fit image verification succeeds, the universal boot loader starts the fit image, and completes the secure startup of the heterogeneous multi-core system.

[0075] In the embodiment of the present invention, after uboot completes the fit image verification, uboot continues to load the fit image to start, and the system completes the fast and safe startup.

[0076] Furthermore, in the embodiment of the present invention, step 101 further includes the following steps:

[0077] Step 1011: Verify the first firmware program signature through an asymmetric encryption and decryption algorithm to obtain the first hash value.

[0078] Specifically, the hardware RSA-2048 is used to verify the first firmware program signature of secure.bin, the obtained first hash value is temporarily stored in the hardware memory, and the public key of RSA-2048 is stored in the one-time password OTP (One-Time Password). The RSA-2048 used here is the RSA-2048 integrated in the CPU hardware, which can ensure the full utilization of the hardware module.

[0079] Step 1012: Perform hash calculation on the firmware program file of the universal boot loader and the firmware program file of the real-time operating system by using a secure hash algorithm to obtain a third hash value.

[0080] Specifically, the hash values ​​of uboot.bin and RTOS.bin are calculated using hardware SHA-256, which is recorded as the third hash value. The SHA-256 used in this step is also integrated in the CPU hardware module to ensure full utilization of the hardware module.

[0081] Step 1013: compare the third Hash value with the first Hash value. If the third Hash value is the same as the first Hash value, the first verification is successful.

[0082] After BootRom is started, in order to prevent malware from being loaded during the boot process, modern computer systems will perform signature verification in the early stages of boot. This usually involves verifying the digital signature of the universal boot loader (uboot). Only when the signature verification passes will the system continue the boot process.

[0083] Through the above operations, when BootRom starts running, the firmware program signatures of uboot and RTOS are verified to protect the system from malware and unauthorized modifications.

[0084] Furthermore, in the embodiment of the present invention, step 102 further includes the following steps:

[0085] Step 1021: If the first verification succeeds, the boot ROM releases the central processing unit; the central processing unit runs the universal boot loader by default.

[0086] Step 1022: Select any one of the central processors except the first central processor running the universal boot loader as the second central processor.

[0087] Step 1023, the boot ROM controls the second CPU to run a real-time operating system, and controls other CPUs except the first CPU and the second CPU to sleep;

[0088] In the embodiment of the present invention, the first CPU runs the normal startup process of uboot, and the second CPU runs RTOS to execute the security verification process to actively share the security startup verification work of uboot. The dual systems implement the normal startup process and the security startup process of uboot in parallel, which can speed up the boot time of the device security startup and ensure the security of the system startup. The use of the RTOS system to perform the security verification process can facilitate the configuration of the CPU.

[0089] Step 1024: The real-time operating system is used to obtain the second firmware program signature from the preset binary verification file.

[0090] Step 1025: Verify the second firmware program signature by using an asymmetric encryption and decryption algorithm to obtain the second hash value.

[0091] Specifically, the hardware RSA-2048 is used to verify the second firmware program signature of secure.bin, and the obtained result is recorded as the second hash value. The public key of RSA-2048 is stored in the one-time password OTP (One-Time Password). The RSA-2048 used here is the RSA-2048 integrated in the CPU hardware, which can ensure the full utilization of the hardware module.

[0092] Step 1026: Perform hash calculation on the firmware program of the kernel and the firmware program of the file system by using a secure hash algorithm to obtain a fourth hash value.

[0093] Specifically, the hash values ​​of kernel.bin and fs.bin are calculated using hardware SHA-256, which is recorded as the fourth hash value. The SHA-256 used in this step is also integrated in the CPU hardware module to ensure full utilization of the hardware module.

[0094] Step 1027, comparing the fourth Hash value with the second Hash value;

[0095] Step 1028: If the fourth Hash value is the same as the second Hash value, the second verification is successful.

[0096] Specifically, Figure 5 As shown, it is a real-time operating system verification signature flow chart provided by an embodiment of the present invention. After the real-time operating system RTOS is started, the last 256 bytes of the kernel.bin and fs.bin positions in the storage medium, that is, the second firmware program signature in secure.bin, are obtained, and then RSA-2048 in the hardware module is used to verify the signature to obtain a second hash value, marked as K3, and then SHA-256 is used to calculate the hash values ​​of kernel.bin and fs.bin to obtain a fourth hash value, marked as K4, and the comparison result of K3 and K4 is notified to uboot to determine whether uboot executes the subsequent startup process.

[0097] Through the above operations, the second CPU uses the CPU's hardware algorithm module to complete the kernel and file system verification process by running RTOS, sharing the time consumption of uboot startup to improve the signature verification speed of secure startup.

[0098] Furthermore, in the embodiment of the present invention, step 103 further includes the following steps:

[0099] Step 1031: store the result of the second verification and the hash value of the kernel firmware program file into a shared memory.

[0100] When the RTOS system performs secure boot verification, the calculated hash value of kernel.bin can also be stored in the shared memory to provide a comparison basis for subsequent fit image verification.

[0101] Step 1032: If the second verification succeeds, the universal boot loader starts the kernel and the file system.

[0102] If the result of the secure boot check performed by the RTOS system read by uboot from the shared memory is successful, uboot continues to execute the subsequent boot process, loading the kernel and file system to start.

[0103] Step 1033: If the second verification fails, a prompt indicating the second verification failure is given and the universal boot loader enters an infinite loop to stop starting the heterogeneous multi-core system.

[0104] If the result of the secure boot check performed by the RTOS system read by uboot from the shared memory fails, the uboot execution process enters an infinite loop and cannot execute subsequent boot processes, and the system boot stops.

[0105] Specifically, Figure 4 As shown, it is a system startup flow chart provided by an embodiment of the present invention. The specific system startup flow is as follows:

[0106] 1. After BootRom is started, read 256 bytes at the 664KB position of the storage medium, which is the signature of the first firmware program in secure.bin;

[0107] 2. Use the RSA-2048 of the hardware module to verify the signature of the first firmware program, marked as K1;

[0108] 3. Use the SHA-256 of the hardware module to calculate the hash value of the first 664KB of the storage medium, namely uboot.bin and RTOS.bin, marked as K2;

[0109] 4. Compare K1 and K2. If they are equal, BootRom releases all CPUs to run uboot. If they are not equal, it prompts that the signature verification failed.

[0110] 5. After BootRom releases the CPU, it gives control to uboot. uboot detects the current CPU. The first CPU runs uboot normally, and the second CPU executes RTOS to perform secure boot verification;

[0111] 6. RTOS informs uboot of the result of the secure boot check through shared memory, and uboot executes the normal uboot boot process based on the result of the secure boot check;

[0112] 7. If the signature result is successful, uboot loads the kernel and file system to run. If the signature result fails, it prompts that the signature verification failed, then the uboot normal startup process enters an infinite loop and the system startup stops.

[0113] In the embodiment of the present invention, after the signature verification of the uboot and RTOS firmware programs is passed, the first CPU runs the normal startup process of uboot, and the second CPU runs the RTOS to execute the security verification process, actively sharing the security startup verification work of uboot, so that the dual systems implement the normal startup process and the security startup process of uboot in parallel, respectively, which can speed up the boot practice of device security startup, and also ensure the security of system startup.

[0114] Furthermore, in another embodiment of the present invention, another time-saving FIT mirror verification method is provided, in which the FIT data is written into the hardware module, and finally only the hardware module operation needs to be completed.

[0115] like Figure 6 As shown, it is a flow chart of fit mirror verification provided by an embodiment of the present invention, and the specific process is as follows:

[0116] 1. Wait for the module responsible for performing the hash operation, that is, the hash module enters the idle state;

[0117] 2. Divide the fit image file into 16KB data blocks and remaining data;

[0118] 3. Determine whether the 16KB data block is written into the hash hardware module;

[0119] 4. If the writing is not completed, continue to write 16KB data blocks, wait for the data writing status to be completed, and then write the remaining data;

[0120] 5. If writing is completed, continue writing the remaining data;

[0121] 6. Wait for the data writing status to be completed, that is, the remaining data writing is completed;

[0122] 7. Get the status of the hardware hash module until it is in idle state;

[0123] 8. Get the result of the hash module;

[0124] 9. Reverse the four bytes of the result and end.

[0125] 10. Uboot records the startup of the fit image, and the system completes fast and safe startup.

[0126] Through the above operations, the hash integrity check of the fit image is performed based on the hardware algorithm, which improves the fit image verification speed.

[0127] In an embodiment of the present invention, when the boot read-only memory is started, a first firmware program signature is obtained from a preset binary verification file, and a first verification is performed on the first firmware program signature. The preset binary verification file is used to record the first firmware program signature and the second firmware program signature; the first firmware program signature is obtained by splicing the firmware program hash value of the universal boot loader and the firmware program hash value of the real-time operating system, and the second firmware program signature is obtained by splicing the firmware program hash value of the kernel and the firmware program hash value of the file system; if the first verification is successful, the boot read-only memory controls the first central processing unit to run the universal boot loader, and controls the second central processing unit to run the real-time operating system, the real-time operating system obtains the second firmware program signature from the preset binary verification file, and performs a second verification on the second firmware program signature; the result of the second verification is stored in the shared memory, and the universal boot loader obtains the result of the second verification from the shared memory; the universal boot loader is used to start the kernel and the file system; after the second verification is completed, the boot read-only memory controls the universal boot loader to perform a fit image verification; if the fit image verification is successful, the universal boot loader starts the fit image, and completes the secure startup of the heterogeneous multi-core system. The dual systems can realize the normal startup process and the safe startup process of the general boot loader in parallel, which speeds up the boot time of the device safe startup and ensures the security of the system startup.

[0128] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0129] Reference Figure 7 , shows a schematic diagram of the structure of a device for fast and secure startup based on a heterogeneous multi-core system provided by an embodiment of the present invention, which may specifically include the following modules:

[0130] A first verification module 201 is used to obtain a first firmware program signature from a preset binary verification file when the boot read-only memory is started, and perform a first verification on the first firmware program signature, wherein the preset binary verification file is used to record the first firmware program signature and the second firmware program signature; the first firmware program signature is obtained by concatenating a firmware program hash value of a universal boot loader and a firmware program hash value of the real-time operating system, and the second firmware program signature is obtained by concatenating a firmware program hash value of a kernel and a firmware program hash value of a file system;

[0131] A second verification module 202, configured to, if the first verification succeeds, control the first central processing unit to run a universal boot loader, and control the second central processing unit to run a real-time operating system, wherein the real-time operating system obtains the second firmware program signature from the preset binary verification file, and performs a second verification on the second firmware program signature;

[0132] The kernel and file system startup module 203 is used to store the result of the second verification in the shared memory, and the universal boot loader obtains the result of the second verification from the shared memory; the universal boot loader is used to start the kernel and the file system;

[0133] A fit image verification module 204, used for guiding the read-only memory to control the universal boot loader to perform a fit image verification after the second verification is completed;

[0134] The secure boot module 205 is used to verify the fit image successfully, and the universal boot loader starts the fit image to complete the secure boot of the heterogeneous multi-core system.

[0135] Optionally, the first verification module 201 includes:

[0136] A first hash value calculation module, used to verify the first firmware program signature through an asymmetric encryption and decryption algorithm to obtain the first hash value;

[0137] A third hash value calculation module, used to perform hash calculation on the firmware program file of the universal boot loader and the firmware program file of the real-time operating system by using a secure hash algorithm to obtain a third hash value;

[0138] The first comparison module is used to compare the third Hash value with the first Hash value. If the third Hash value is the same as the first Hash value, the first verification is successful.

[0139] Optionally, the second verification module 202 includes:

[0140] A central processing unit release module, configured to release the central processing unit by the boot read-only memory if the first verification succeeds; the central processing unit runs the universal boot loader by default;

[0141] A second central processor selection module, used for selecting any central processor except the first central processor running the universal boot loader from the central processors as the second central processor;

[0142] A central processing unit processing module, used for the boot read-only memory to control the second central processing unit to run a real-time operating system, and to control the sleep of other central processing units other than the first central processing unit and the second central processing unit; the real-time operating system is used to obtain the second firmware program signature from the preset binary checksum file;

[0143] A second hash value calculation module, used to verify the second firmware program signature through an asymmetric encryption and decryption algorithm to obtain the second hash value;

[0144] a fourth hash value calculation module, configured to perform hash calculation on the firmware program of the kernel and the firmware program of the file system by using a secure hash algorithm to obtain a fourth hash value;

[0145] A second comparison module, configured to compare the fourth Hash value with the second Hash value;

[0146] The second verification recording module is configured to verify that if the fourth hash value is the same as the second hash value, the second verification is successful.

[0147] Optionally, the kernel and file system startup module 203 includes:

[0148] A storage module, used for storing the result of the second verification and the hash value of the firmware program file of the kernel into a shared memory;

[0149] A startup module, configured to enable the universal boot loader to start a kernel and a file system if the second verification succeeds;

[0150] The stopping module is used for prompting the failure of the second verification and causing the universal boot loader to enter an infinite loop if the second verification fails, so as to stop starting the heterogeneous multi-core system.

[0151] Optionally, the fit image verification module 204 includes:

[0152] An acquisition module, used for the universal boot loader to acquire a hash value of the firmware program of the kernel from the shared memory;

[0153] A third comparison module, configured to compare the hash value of the kernel firmware program with the hash value of the kernel firmware program stored in the fit image;

[0154] The fit image verification result module is used to verify that if the hash value of the firmware program of the kernel is the same as the hash value of the firmware program of the kernel in the fit image, the fit image verification is successful.

[0155] In an embodiment of the present invention, when the boot read-only memory is started, a first firmware program signature is obtained from a preset binary verification file, and a first verification is performed on the first firmware program signature. The preset binary verification file is used to record the first firmware program signature and the second firmware program signature; the first firmware program signature is obtained by splicing the firmware program hash value of the universal boot loader and the firmware program hash value of the real-time operating system, and the second firmware program signature is obtained by splicing the firmware program hash value of the kernel and the firmware program hash value of the file system; if the first verification is successful, the boot read-only memory controls the first central processing unit to run the universal boot loader, and controls the second central processing unit to run the real-time operating system, the real-time operating system obtains the second firmware program signature from the preset binary verification file, and performs a second verification on the second firmware program signature; the result of the second verification is stored in the shared memory, and the universal boot loader obtains the result of the second verification from the shared memory; the universal boot loader is used to start the kernel and the file system; after the second verification is completed, the boot read-only memory controls the universal boot loader to perform a fit image verification; if the fit image verification is successful, the universal boot loader starts the fit image, and completes the secure startup of the heterogeneous multi-core system. The dual systems can realize the normal startup process and the safe startup process of the general boot loader in parallel, which speeds up the boot time of the device safe startup and ensures the security of the system startup.

[0156] An embodiment of the present invention further provides an electronic device, which may include a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, the above-mentioned fast and secure startup method based on a heterogeneous multi-core system is implemented.

[0157] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned fast and secure startup method based on a heterogeneous multi-core system is implemented.

[0158] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0159] Those skilled in the art will appreciate that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0160] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0161] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0162] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0163] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0164] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the above elements.

[0165] The above is a detailed introduction to a fast and secure startup method, device, equipment and medium based on a heterogeneous multi-core system. In this article, specific examples are used to illustrate the principles and implementation methods of the present invention. Although the implementation methods of the present invention are described as above, the above description content and definitions are only for the convenience of understanding the implementation methods of the present invention, and are not used to limit the present invention. Any modifications and changes made without departing from the spirit and scope of the present invention, especially the system format of heterogeneous dual systems, including but not limited to Linux and RTOS (such as bare metal programs, BIOS, etc.), firmware program security and integrity algorithm modifications and changes, are within the scope of protection of the present invention. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A fast and secure boot method based on a heterogeneous multi-core system, applied to a boot read-only memory, wherein the boot read-only memory is deployed in the heterogeneous multi-core system, wherein the heterogeneous multi-core system includes at least two central processing units, and a real-time operating system and a Linux system are also running in the system, characterized in that: The method comprises: When the boot read-only memory is started, a first firmware program signature is obtained from a preset binary verification file, and a first verification is performed on the first firmware program signature, wherein the preset binary verification file is used to record the first firmware program signature and the second firmware program signature; the first firmware program signature is obtained by concatenating a firmware program hash value of a universal boot loader and a firmware program hash value of the real-time operating system, and the second firmware program signature is obtained by concatenating a firmware program hash value of a kernel and a firmware program hash value of a file system; If the first verification is successful, the boot read-only memory controls the first central processing unit to run a universal boot loader, and controls the second central processing unit to run a real-time operating system, the real-time operating system obtains the second firmware program signature from the preset binary verification file, and performs a second verification on the second firmware program signature; The result of the second verification is stored in the shared memory, and the universal boot loader obtains the result of the second verification from the shared memory; the universal boot loader is used to start the kernel and the file system; After the second verification is completed, the boot read-only memory controls the universal boot loader to perform fit image verification; The fit image verification succeeds, and the universal boot loader starts the fit image to complete the safe startup of the heterogeneous multi-core system.

2. According to the method of claim 1, the preset binary checksum file is specifically obtained by performing hash calculation on the firmware program file of the universal boot loader and the firmware program file of the real-time operating system through a secure hash algorithm to obtain a first hash value; Performing hash calculation on the firmware program file of the kernel and the firmware program file of the file system by using a secure hash algorithm to obtain a second hash value; The first hash value is signed by an asymmetric encryption and decryption algorithm to obtain the first firmware program signature; the second hash value is signed by an asymmetric encryption and decryption algorithm to obtain the second firmware program signature; the first firmware program signature and the second firmware program signature are written into the created empty binary verification file.

3. The method according to claim 1 or 2, characterized in that: Obtaining a first firmware program signature from a preset binary verification file and performing a first verification on the first firmware program signature includes: Verify the first firmware program signature by using an asymmetric encryption and decryption algorithm to obtain the first hash value; Performing hash calculation on the firmware program file of the universal boot loader and the firmware program file of the real-time operating system by using a secure hash algorithm to obtain a third hash value; The third Hash value is compared with the first Hash value. If the third Hash value is the same as the first Hash value, the first verification is successful.

4. The method according to claim 1 or 2, characterized in that: If the first verification is successful, the boot read-only memory controls the first central processor to run a universal boot loader, and controls the second central processor to run a real-time operating system, the real-time operating system obtains the second firmware program signature from the preset binary verification file, and performs a second verification on the second firmware program signature, including: If the first verification is successful, the boot read-only memory releases the central processing unit; the central processing unit runs the universal boot loader by default; Selecting any one of the central processors except the first central processor running the universal boot loader as the second central processor from the central processors; The boot read-only memory controls the second central processor to run a real-time operating system, and controls the first central processor and other central processors other than the second central processor to sleep; the real-time operating system is used to obtain the second firmware program signature from the preset binary checksum file; Verify the second firmware program signature by using an asymmetric encryption and decryption algorithm to obtain the second hash value; Performing hash calculation on the firmware program of the kernel and the firmware program of the file system by using a secure hash algorithm to obtain a fourth hash value; comparing the fourth Hash value with the second Hash value; If the fourth Hash value is the same as the second Hash value, the second verification is successful.

5. The method according to claim 4, storing the result of the second verification in a shared memory, and the universal boot loader obtains the result of the second verification from the shared memory; The universal boot loader is used to start the kernel and file system, including: Storing the result of the second verification and the hash value of the firmware program file of the kernel in a shared memory; If the second verification succeeds, the universal boot loader starts the kernel and the file system; If the second verification fails, a prompt indicating the second verification failure is given and the universal boot loader is caused to enter an infinite loop to stop starting the heterogeneous multi-core system.

6. The method according to claim 1 or 5, after the second verification is completed, the boot read-only memory controls the universal boot loader to perform fit image verification, comprising: The universal boot loader obtains a hash value of the firmware program of the kernel from the shared memory; Compare the hash value of the kernel firmware program with the hash value of the kernel firmware program stored in the fit image; If the hash value of the kernel firmware program is the same as the hash value of the kernel firmware program in the fit image, the fit image verification is successful.

7. The method according to claim 6, wherein the fit image verification succeeds, the universal boot loader starts the fit image, and completes the secure startup of the heterogeneous multi-core system, comprising: If the fit image verification succeeds, the universal boot loader starts the fit image to complete the fast and secure startup of the heterogeneous multi-core system; If the fit image verification fails, the heterogeneous multi-core system cannot be started quickly and safely.

8. A fast and secure boot device based on a heterogeneous multi-core system, characterized in that: The device comprises: a first verification module, configured to obtain a first firmware program signature from a preset binary verification file and perform a first verification on the first firmware program signature when the boot read-only memory is started, wherein the preset binary verification file is used to record the first firmware program signature and the second firmware program signature; the first firmware program signature is obtained by concatenating a firmware program hash value of a universal boot loader and a firmware program hash value of the real-time operating system, and the second firmware program signature is obtained by concatenating a firmware program hash value of a kernel and a firmware program hash value of a file system; a second verification module, configured to, if the first verification succeeds, control the first central processing unit to run a universal boot loader by the boot read-only memory, and control the second central processing unit to run a real-time operating system, wherein the real-time operating system obtains the second firmware program signature from the preset binary verification file, and performs a second verification on the second firmware program signature; A kernel and file system startup module, used for storing the result of the second verification into a shared memory, and the universal boot loader obtains the result of the second verification from the shared memory; the universal boot loader is used for starting the kernel and the file system; A fit image verification module, used for guiding the read-only memory to control the universal boot loader to perform fit image verification after the second verification is completed; The secure boot module is used for the fit image to be successfully verified, and the universal boot loader starts the fit image to complete the secure boot of the heterogeneous multi-core system.

9. An electronic device, characterized in that: The invention comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the method for fast and secure startup based on a heterogeneous multi-core system as described in any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for fast and secure startup based on a heterogeneous multi-core system according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • System starting method and device adaptive to multiple chips, electronic equipment and readable storage medium

    CN119576435A

  • System starting method and device suitable for multiple chips, electronic equipment and readable storage medium

    CN119576435B

  • Operating system startup exception processing method, device and equipment, medium and program

    CN119690733A

  • Method and device for guiding loading program, electronic equipment and storage medium

    CN119759433A

  • A method, apparatus, electronic device and storage medium of a bootloader

    CN119759433B