Methods, equipment, and media for preventing rollback in multi-domain mirroring
By leveraging the combined efforts of hardware firewalls and system control processors, the problem of image version verification and updates in hard-isolated scenarios for multi-domain images is solved, enabling anti-rollback protection for multi-domain images and improving image startup security.
Patent Information
- Application Number
- CN202611374398.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-04
- Publication Date
- 2026-11-17
AI Technical Summary
In a hard isolation scenario with multi-domain images, the operating system cannot obtain image version data across domains, which makes it impossible to verify and update the image version, posing a security risk of image rollback.
By isolating cross-domain access to the bootloader through a hardware firewall and only granting temporary cross-domain access permissions when needed, the system controller processor reads and updates multiple operating system image versions from secure storage, ensuring image version matching, verification, and updates.
It implements anti-rollback protection for multi-domain images, improves image boot security in scenarios with hard isolation of multiple operating systems, and prevents any operating system domain from being attacked and having its image version tampered with.
Smart Images

Figure CN123114580A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of embedded system security technology, and specifically to a rollback prevention method, device and medium for multi-domain mirroring. Background Technology
[0002] When the device starts up, the Universal Boot Loader (U-BOOT) loads the image of the operating system (OS) from the storage device into memory, and U-BOOT's anti-rollback mechanism can verify and update the OS.
[0003] In related technologies, the device carries multiple operating systems such as OS1 and OS2. In a scenario where these multiple operating systems are in hard isolation, the image versions of OS1 and OS2 are stored separately in their respective domains. U-BOOT in domain 1 where OS1 is located cannot overcome the hard isolation restriction to obtain the image version data of domain 2 where OS2 is located. Therefore, it cannot verify and update the version of OS2, and it also cannot prevent OS1 from tampering with the image version data stored in its own domain, which poses a security risk of image rollback.
[0004] Therefore, there is an urgent need for a rollback prevention method for multi-domain mirrors to avoid the problem of tampering with the image version. Summary of the Invention
[0005] To address the aforementioned technical issues, this disclosure provides a rollback prevention method, device, and medium for multi-domain images, thereby resolving the problem of image version tampering after an OS attack.
[0006] The first aspect of this disclosure provides a rollback prevention method for multi-domain mirroring, comprising: In response to the system-on-a-chip supporting the isolated operation of multiple operating systems, a permission request is sent to the hardware firewall through the bootloader; wherein, the hardware firewall is used to isolate the bootloader's access to the second operating system among the multiple operating systems other than the first operating system; In response to being granted temporary access, the system obtains a first target image version of the first operating system and a second target image version of the second operating system through the bootloader, and generates an anti-rollback instruction. In response to the anti-rollback command, the system control processor reads the first current image version of the first operating system and the second current image version of the second operating system from the first storage area and the second storage area in the security memory, respectively. In response to determining a first matching relationship between the first target image version and the first current image version, and / or a second matching relationship between the second target image version and the second current image version that satisfies the version update condition, the system control processor writes the first target image version into the first storage area, and / or writes the second target image version into the second storage area.
[0007] A second aspect of this disclosure provides a system-on-a-chip including: a main processor, a system control processor, a hardware firewall, and a secure memory; The main processor is configured to send a permission request to the hardware firewall via a bootloader in response to the system-on-a-chip's support for the isolated operation of multiple operating systems; wherein the hardware firewall is configured to isolate the bootloader's access to a second operating system other than the first operating system among the multiple operating systems. The main processor is also configured to, in response to being granted temporary access rights, obtain a first target image version of the first operating system and a second target image version of the second operating system through the bootloader, and generate an anti-rollback instruction; The system control processor is configured to, in response to the anti-rollback command, read the first current image version of the first operating system and the second current image version of the second operating system from the first storage area and the second storage area in the security memory, respectively. The system control processor is further configured to, in response to determining a first matching relationship between the first target image version and the first current image version, and / or a second matching relationship between the second target image version and the second current image version satisfying a version update condition, write the first target image version into the first storage area, and / or write the second target image version into the second storage area.
[0008] A third aspect of this disclosure provides a computer-readable storage medium storing a computer program for performing the rollback prevention method for multi-domain mirroring described in the first aspect above.
[0009] A fourth aspect of this disclosure provides an electronic device comprising: a processor; a memory for storing executable instructions of the processor; the processor being configured to read the executable instructions from the memory and execute the instructions to implement the rollback prevention method for multi-domain mirroring described in the first aspect above.
[0010] A fifth aspect of this disclosure provides a computer program product that, when executed by an instruction processor, performs the rollback prevention method for multi-domain mirroring proposed in the first aspect of this disclosure.
[0011] The technical solution provided in this disclosure isolates cross-domain access of the bootloader through a hardware firewall. Temporary cross-domain access is granted to the bootloader only when it needs to obtain target image versions of multiple operating systems. This solves the problem that the bootloader cannot obtain image version data across domains in a hard isolation scenario. Moreover, since the image versions of multiple operating systems are uniformly stored in a secure storage, the system control processor with dedicated access rights uniformly reads the current image version in each storage area of the secure storage, completes the image version matching verification, and completes the image version writing update. Therefore, this method can not only uniformly complete the version verification and update of multi-domain images, but also avoid the problem of tampering with the image version stored in the domain after any operating system domain is attacked. This effectively realizes the anti-rollback protection of multi-domain images and improves the image boot security in a multi-operating system hard isolation scenario. Attached Figure Description
[0012] Figure 1 This is a schematic diagram of the structure of a system-on-a-chip provided in an exemplary embodiment of this disclosure.
[0013] Figure 2 This is a flowchart illustrating an exemplary embodiment of the present disclosure of a rollback prevention method for multi-domain mirroring.
[0014] Figure 3 This is a flowchart illustrating a rollback prevention method for multi-domain mirroring provided in another exemplary embodiment of this disclosure.
[0015] Figure 4 This is a flowchart illustrating a rollback prevention method for multi-domain mirroring provided in yet another exemplary embodiment of this disclosure.
[0016] Figure 5 This is a flowchart illustrating a rollback prevention method for multi-domain mirroring provided in yet another exemplary embodiment of this disclosure.
[0017] Figure 6 This is a structural diagram of an electronic device provided in an exemplary embodiment of this disclosure. Detailed Implementation
[0018] To explain this disclosure, exemplary embodiments of the disclosure will now be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the disclosure, and not all of them. It should be understood that the disclosure is not limited to exemplary embodiments.
[0019] It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of this disclosure.
[0020] Application Overview In the aforementioned technologies, the device carries multiple operating systems such as OS1 and OS2. In a scenario where these multiple operating systems are in hard isolation, the image versions of OS1 and OS2 are stored separately in their respective domains. U-BOOT in domain 1 where OS1 resides cannot overcome the hard isolation restriction to obtain the image version data of domain 2 where OS2 resides. Therefore, it cannot verify and update the version of OS2, and it also cannot prevent OS1 from tampering with the image version data stored in its own domain, which poses a security risk of image rollback.
[0021] Therefore, there is an urgent need for a rollback prevention method for multi-domain mirrors to avoid the problem of tampering with the image version.
[0022] To address the aforementioned issues, some related technologies employ a U-BOOT architecture within the isolation domain of multiple operating systems, such as OS1 and OS2, in scenarios with hard isolation. This allows for OS verification and updates via U-BOOT within each OS's isolation domain, thus overcoming cross-domain access restrictions. However, if any OS is compromised, a security risk arises where the image version data of the OS within its respective isolation domain can be tampered with.
[0023] To address the aforementioned issues, this disclosure provides a rollback prevention method for multi-domain images. In response to the system-on-a-chip supporting the isolated operation of multiple operating systems, a bootloader sends a permission request to a hardware firewall. After the bootloader is granted temporary access, it can obtain a first target image version of the first operating system and a second target image version of the second operating system, and generate a rollback prevention instruction. In response to this rollback prevention instruction, the system control processor reads the first current image version of the first operating system and the second current image version of the second operating system from a first storage area and a second storage area in the secure memory, respectively. Furthermore, in response to determining a first matching relationship between the first target image version and the first current image version, and / or a second matching relationship between the second target image version and the second current image version satisfying version update conditions, the system control processor writes the first target image version to the first storage area and / or writes the second target image version to the second storage area. The disclosed solution isolates cross-domain access to the bootloader through a hardware firewall, granting temporary cross-domain access only when multiple operating system target image versions are needed. This solves the problem of the bootloader being unable to obtain image version data across domains in hard isolation scenarios. Furthermore, since the image versions of multiple operating systems are uniformly stored in a secure storage, the system control processor with dedicated access permissions uniformly reads the current image version in each storage area of the secure storage, completes image version matching and verification, and writes and updates the image version. Therefore, this method can uniformly complete the version verification and update of multi-domain images, and also avoids the problem of tampering with the image version stored in the domain after any operating system domain is attacked. This effectively realizes anti-rollback protection for multi-domain images and improves the image boot security in multi-operating system hard isolation scenarios.
[0024] Exemplary System Figure 1 This is a schematic diagram of the structure of an on-chip system provided for an exemplary embodiment of this disclosure. For example... Figure 1 As shown, the system-on-a-chip includes: a main processor 101, a system control processor 102, a hardware firewall 103, a secure memory 104, and a hardware encryption / decryption unit 105.
[0025] In some embodiments, such as Figure 1As shown, the main processor 101, in response to the on-chip system supporting the isolated execution of multiple operating systems, sends a permission request to the hardware firewall 103 via a bootloader (e.g., U-BOOT); wherein the hardware firewall is used to isolate the bootloader's access to a second operating system among the multiple operating systems other than the first operating system. The main processor 101 is also configured, in response to being granted temporary access permissions, to obtain a first target image version of the first operating system and a second target image version of the second operating system via the bootloader, and generate an anti-rollback instruction. The system control processor 102, in response to the anti-rollback instruction, reads the first current image version of the first operating system and the second current image version of the second operating system from a first storage area and a second storage area in the secure memory 104, respectively. The system control processor 102 is also configured, in response to determining a first matching relationship between the first target image version and the first current image version, and / or a second matching relationship between the second target image version and the second current image version satisfying a version update condition, to write the first target image version to the first storage area, and / or write the second target image version to the second storage area.
[0026] In some embodiments, the bootloader is firmware running on the main processor 101, that is, the main processor 101 is the runtime environment for the bootloader. The main processor 101 is a general-purpose processor that supports the operation of the bootloader, a general-purpose operating system, etc. For example, the main processor 101 is a central processing unit (CPU).
[0027] In some embodiments, such as Figure 1 As shown, the main processor 101 is further configured to, in response to a rollback prevention command, parse the rollback prevention command through the security monitoring firmware to determine the anomaly level of the sender of the rollback prevention command. The system control processor 102 is specifically configured to, in response to the sender's anomaly level being anomaly level EL2, read a first current image version from a first storage area and a second current image version from a second storage area.
[0028] In some embodiments, the security monitoring firmware refers to the Arm Trusted Firmware (ATF) in the ARM architecture. The ATF is a firmware program running at exception level EL3 on the main processor 101, which is the hardware carrier for running the ATF. The ATF is used to verify the sender's permissions for the rollback prevention command. After the verification is successful, the ATF sends the rollback prevention command to the system control processor 102, which then performs the subsequent rollback prevention image version check and update operations.
[0029] In some embodiments, such as Figure 1As shown, the hardware encryption / decryption unit 105 is specifically used for: responding to the first current image version and the second current image version being encrypted data, decrypting the first current image version and the second current image version respectively to obtain the decrypted first current image version and the decrypted second current image version; and determining, through the system control processor, that the first matching relationship and / or the second matching relationship meet the version update conditions.
[0030] In some embodiments, such as Figure 1 As shown, the system control processor 102 is specifically used to: determine that the first matching relationship satisfies the version update condition in response to the first matching relationship being that the first target image version is higher than the first current image version; and / or, determine that the second matching relationship satisfies the version update condition in response to the second matching relationship being that the second target image version is higher than the second current image version.
[0031] In some embodiments, such as Figure 1 As shown, the hardware encryptor 105 is used to encrypt the first target image version to obtain the encrypted first target image version, and / or to encrypt the second target image version to obtain the encrypted second target image version.
[0032] In some embodiments, such as Figure 1 As shown, the system control processor 102 is specifically used for: writing the encrypted first target image version into the first storage area; and / or, writing the encrypted second target image version into the second storage area.
[0033] It should be noted that for a detailed description of the anti-rollback method for multi-domain mirroring provided in the embodiments of this disclosure for the above-mentioned system-on-chip, please refer to the detailed description in the following method embodiments section, which will not be repeated here.
[0034] The system-on-a-chip provided in this disclosure isolates cross-domain access of the bootloader through a hardware firewall. Temporary cross-domain access is granted to the bootloader only when it needs to obtain target image versions of multiple operating systems. This solves the problem that the bootloader cannot obtain image version data across domains in hard isolation scenarios. Moreover, since the image versions of multiple operating systems are uniformly stored in a secure storage, the system control processor with dedicated access permissions uniformly reads the current image version in each storage area of the secure storage, completes the image version matching and verification, and completes the image version writing and updating. Therefore, this method can not only uniformly complete the version verification and updating of multi-domain images, but also avoid the problem of tampering with the image version stored in the domain after any operating system domain is attacked. This effectively realizes the anti-rollback protection of multi-domain images and improves the image boot security in multi-operating system hard isolation scenarios.
[0035] Moreover, since the image version data stored in the secure storage is encrypted rather than plaintext, it can further prevent the image version data from being maliciously stolen and tampered with by attackers, thereby further improving the security of image version storage and ensuring the reliability of the anti-rollback mechanism.
[0036] Exemplary methods Figure 2 This is a schematic flowchart illustrating an exemplary embodiment of the present disclosure of a rollback prevention method for multi-domain mirroring. This embodiment can be applied to electronic devices, such as… Figure 2 As shown, it includes the following steps: Step 201: In response to the system-on-a-chip supporting the isolated operation of multiple operating systems, a permission request is sent to the hardware firewall through the bootloader.
[0037] The hardware firewall is used to isolate the bootloader from access to the second operating system in a multi-operating system, excluding the first operating system.
[0038] In this embodiment, the system-on-a-chip (SoC) uses a hardware isolation mechanism to run multiple operating systems in independent security isolation domains. The running spaces and access resources of different operating systems are isolated from each other by a hardware firewall, preventing unauthorized cross-domain access and improving system security. In this embodiment, "first operating system" and "second operating system" refer to the multiple isolated operating systems, with the first operating system being the operating system currently owned by the bootloader. Since the hardware firewall has already set access isolation for the bootloader, restricting it to accessing only the resources of the first operating system and not the resources of the second operating system, when a unified verification and update of multiple operating system image versions is required, a temporary access permission request for the second operating system needs to be requested from the hardware firewall. Therefore, the bootloader sends a permission request to the hardware firewall to request temporary access permission for the second operating system. It should be noted that after the version verification of the multiple operating systems is completed, the hardware firewall will restore the isolation state of the second operating system to ensure access security for the second operating system.
[0039] For example, the aforementioned System on Chip (SOC) refers to a system-level integrated circuit that integrates a main processor, a system control processor (SCP), a hardware firewall, and a secure memory (ISLAND NVM). For instance, a System on Chip can be an automotive intelligent driving chip or other chips equipped with the ARM TrustZone architecture.
[0040] For example, the first and second operating systems in the aforementioned plurality of operating systems can be isolated operating systems of the same type, such as two isolated Android systems. Alternatively, the first and second operating systems can also be isolated operating systems of different types, such as the first operating system being an Android system and the second operating system being a Linux system; or, the first operating system being a time-sharing operating system such as Android or Linux, and the second operating system being a real-time operating system such as VxWorks or QNX; or, for example, the first operating system being a VxWorks system and the second operating system being a QNX system. The specific type can be determined according to the actual situation, and this disclosure does not specifically limit the types of the plurality of operating systems. Furthermore, the plurality of operating systems may include a first operating system and at least one second operating system, that is, the number of the plurality of operating systems can be two, three, four, etc., and this disclosure does not limit this.
[0041] In some embodiments, the aforementioned bootloader refers to the secondary boot firmware executed after the system powers on, applied in the boot process of the on-chip system. For example, the bootloader can be a Universal Boot Loader (U-Boot), a Unified Extensible Firmware Interface (UEFI) bootloader, or other types of bootloaders. Taking the universal bootloader as an example, after the on-chip system powers on and undergoes hardware initialization, the universal bootloader is loaded and run. The universal bootloader is responsible for peripheral hardware initialization and loading and booting the operating system image. In this embodiment, the universal bootloader is subject to hardware firewall hard isolation constraints and can only read relevant resources of the operating system in its own domain (i.e., the first operating system). It needs to apply for temporary cross-domain permissions from the hardware firewall before it can obtain the target image version of the second operating system in other isolated domains, thereby achieving unified anti-rollback verification of the image versions of multiple operating systems. It should be noted that the following embodiments are all illustrative examples using the universal bootloader as the bootloader and do not constitute a limitation.
[0042] In some examples, the aforementioned hardware firewall refers to a firewall with hardware-level access isolation capabilities. Based on preset access control rules, it intercepts and manages access behavior between different security domains, allowing only authorized cross-domain access requests to pass, thereby achieving hard isolation between multiple operating system runtime domains. For example, the hardware firewall can be an independent hardware circuit integrated into a system-on-a-chip, or it can be an independent hardware circuit integrated inside the main processor; this disclosure does not specifically limit it in this way.
[0043] For example, the aforementioned permission request is an application to temporarily grant read-only access to a specified storage address or target security domain. For instance, the permission request could be an application to temporarily grant read-only access to the physical address range corresponding to the second operating system image, or an application to temporarily grant read-only access to the security domain where the second operating system resides. For example, the permission request could be a request instruction, which could carry the authorization type (e.g., read-only access), the address range or target security domain identifier corresponding to the second operating system image, and the permission validity period information, etc.
[0044] Step 202: In response to being granted temporary access, the first target image version of the first operating system and the second target image version of the second operating system are obtained through the bootloader, and anti-rollback instructions are generated.
[0045] In some embodiments, after receiving a permission request, the hardware firewall can verify the identity of the requester, the scope of the requested permission, and the validity period of the permission to perform a legality check. If the verification is successful, temporary access permission is granted to the general bootloader, that is, read-only access permission is granted to the storage area corresponding to the second operating system. If the verification fails, the permission request is directly blocked, and the access permission is not granted to avoid unauthorized access.
[0046] In some examples, the latest image files to be updated for both the first and second operating systems are stored in isolated storage partitions on a storage device that can be a non-volatile storage device that does not lose data when power is off. For example, this storage device could be an embedded multimedia card (eMMC), a secure digital memory card (SD card), or a NAND-type flash memory.
[0047] In some embodiments, after obtaining temporary access permissions, the general bootloader can read the latest images of the first operating system and the second operating system stored in the storage device, respectively, and extract the first target image version carried by the latest image of the first operating system and the second target image version carried by the latest image of the second operating system. In this embodiment, the first target image version and the second target image version are identification information used to identify the version of the corresponding image. This identification information can be an incrementing version number, a version timestamp, etc., with a larger version number or timestamp indicating a newer image version; the identification information can be in the form of strings, numeric numbers, etc.
[0048] In some embodiments, after obtaining the first target image version and the second target image version, the generic bootloader packages and generates an anti-rollback instruction based on the first target image version and the second target image version. Specifically, the data format of the anti-rollback instruction can be predefined. This data format may include a fixed frame header, an instruction type identifier, a data field, a checksum, and a fixed frame tail. The generic bootloader fills the obtained first target image version and second target image version into the corresponding data fields and encapsulates them according to the data format to generate the anti-rollback instruction. The checksum is used to prevent data tampering during the transmission of the anti-rollback instruction. The anti-rollback instruction is used to trigger subsequent version comparisons to determine whether the version update conditions are met.
[0049] After obtaining the first target image version and the second target image version, the generic bootloader packages the first and second target image versions to generate anti-rollback instructions and sends the anti-rollback instructions to the system control processor responsible for managing the secure storage. The system control processor then completes the subsequent version verification and writing operations. This avoids the security risks caused by the generic bootloader directly accessing the secure storage, and also utilizes the independent operation of the system control processor to ensure that the version verification process is not interfered with by the operating environment of each operating system, thereby improving the reliability of the anti-rollback mechanism.
[0050] Step 203: In response to the rollback prevention command, the system control processor reads the first current image version of the first operating system and the second current image version of the second operating system from the first storage area and the second storage area in the security memory, respectively.
[0051] After the system controller (SCP) receives the rollback prevention instruction, it parses the rollback prevention instruction and triggers the version verification and update process. Therefore, according to the pre-divided storage mapping relationship, the system controller reads the pre-stored first current image version from the first storage area corresponding to the first operating system in the secure storage, and reads the pre-stored second current image version from the second storage area corresponding to the second operating system.
[0052] In some examples, the aforementioned System Control Processor (SCP) is an independent control processor integrated within the system-on-a-chip (SoC), operating within a secure island that is isolated from the main processor. The secure island is a hardware-isolated security subsystem integrated into the SoC. This SCP is dedicated to performing security-related tasks such as secure storage management and data security verification. It possesses an independent operating space and exclusive access permissions, and can legally access secure memory storing the current image versions of various operating systems. In the SoC architecture disclosed herein, the SCP can be a dedicated microcontroller integrated within the SoC, or a coprocessor with an independent secure operating environment. Its operating permissions do not depend on the authorization of the main processor or various operating systems, and it can independently complete version information reading, comparison, and writing operations, ensuring that the security of the anti-rollback process is not affected by the operating state of the main operating system.
[0053] In some embodiments, secure memory is a hardware storage device within the secure island of an on-chip system specifically designed to store security-sensitive data (e.g., operating system image versions, anti-rollback counters, etc.). This hardware storage device is non-volatile memory, and can be referred to as secure island non-volatile memory (ISLAND NVM). Secure memory only grants access to authorized security components (e.g., the system control processor). General-purpose bootloaders and ordinary operating systems cannot directly read, write, or modify it, thus preventing malicious tampering of the image version data. For example, secure memory can be electrically erasable programmable read-only memory (EEPROM) or secure flash memory. The specific type of secure memory can be determined based on the security design requirements of the on-chip system, and this disclosure does not limit it.
[0054] In some embodiments, the secure storage can be divided into separate storage areas for each operating system. Specifically, a first storage area is allocated for the first operating system to store its current image version (i.e., the first current image version); a second storage area is allocated for the second operating system to store its current image version (i.e., the second current image version). Upon receiving a rollback prevention command, the System Control Processor (SCP), as a processing unit with secure access permissions to the secure storage, reads the currently stored image versions of different operating systems from their respective separate storage areas within the secure storage, preparing for subsequent version matching and verification.
[0055] It should be noted that, compared to related technologies where version information of each operating system is stored in its own isolated domain, the embodiments of this disclosure uniformly store the version information of different operating systems in an independent storage area of the secure storage device. This achieves both isolated storage of version information to avoid mutual interference and allows the system control processor to read and process it uniformly without having to read it across domains separately. Thus, the solution of the embodiments of this disclosure simplifies the rollback prevention verification process and, at the same time, leverages the security protection capabilities of the secure storage device to prevent version information from being maliciously tampered with or forged, thereby improving the security of the rollback prevention mechanism itself.
[0056] Step 204: In response to determining a first matching relationship between a first target image version and a first current image version, and / or a second matching relationship between a second target image version and a second current image version that satisfies the version update condition, the system control processor writes the first target image version to the first storage area, and / or writes the second target image version to the second storage area.
[0057] In some examples, a first target image version can be compared with a first current image version to determine a first matching relationship, and a second target image version can be compared with a second current image version to determine a second matching relationship. The first matching relationship can include two scenarios: the first target image version is higher than the first current image version, or the first target image version is lower than or equal to the first current image version. The second matching relationship follows the same scenario as the first matching relationship.
[0058] In some embodiments, the version update condition can be that version updates are allowed only when the version number of the target image is higher than the version number of the currently stored image, thereby achieving the anti-rollback effect and preventing the operating system from being maliciously replaced from a higher version image to a lower version image.
[0059] For example, if the first target image version is higher than the first current image version, then the first matching relationship is determined to meet the version update condition; if the first target image version is lower than or equal to the first current image version, then the first matching relationship is determined not to meet the version update condition. The determination of the second matching relationship is similar, and will not be elaborated upon in this embodiment.
[0060] In some examples, if both the first and second matching relationships meet the version update conditions, then the versions of both the first and second operating systems are updated simultaneously. Specifically, the system control processor writes the corresponding target image versions to their respective storage areas in the secure storage, overwriting the existing first and second current image versions. If only one target image version meets the version update conditions, then only the operating system that meets the conditions is updated by the system control processor; the operating system that does not meet the conditions is not updated.
[0061] For example, the SOC supports the isolated operation of the vehicle control system (i.e., the first operating system, hereinafter referred to as OS1) and the vehicle entertainment system (i.e., the second operating system, hereinafter referred to as OS2). After the SOC powers on and enters the U-Boot stage, since U-Boot belongs to OS1, it sends a permission request to the hardware firewall to request temporary read-only access to the security domain where OS2 resides. After the hardware firewall verifies the legitimacy of the permission request, it grants read-only access to the storage area corresponding to OS2 to the general bootloader. U-Boot reads the latest images of OS1 and OS2 from the two isolated partitions of the storage device, respectively, to extract the first target image version and the second target image version from their respective latest images, and generates an anti-rollback command based on the first target image version and the second target image version before sending it to the system control processor. The system control processor receives and responds to the anti-rollback command, reads the first current image version and the second current image version from the first storage area and the second storage area pre-divided in the secure storage, respectively, and determines the first matching relationship between the first current image version and the first target image version, as well as the second matching relationship between the second current image version and the second target image version. If at least one of the first or second matching relationships meets the version update condition, for operating systems that meet the condition, the system controller writes the corresponding target image version to a designated partition in the secure storage, overwriting the original image version. For operating systems that do not meet the condition, the version update operation is not performed, thus achieving image rollback protection. After this process is completed, the hardware firewall restores its default isolation policy and disables temporary access permissions.
[0062] Because different operating system image versions are stored in independent storage areas of the secure storage, the entire version verification and writing process is uniformly executed by the system control processor. Neither the operating system itself nor the general bootloader has the right to directly read or write the version information in the secure storage. Even if an operating system is illegally compromised, the attacker cannot bypass the system control processor's verification process and directly modify the current image version of itself or another operating system stored in the secure storage. Therefore, it is impossible to complete the rollback operation of replacing the high version image with the low version image. This mechanism blocks the attack path of illegally rolling back images of other domains after a single domain is compromised, and also solves the security problem of preventing rollback of multiple images under a multi-domain isolation architecture.
[0063] In other embodiments, a non-volatile count (NV Count) is also stored in the storage area corresponding to each operating system in the secure storage. The NV Count is used to record the number of times the image version has been updated. Whenever an operating system image completes a legitimate image version update, the NV Count value in the storage area corresponding to that operating system is incremented. Generally, the larger the NV Count value, the more times the operating system image has been updated, and the newer the corresponding image version. When comparing image versions using SCP, the NV Count in the corresponding storage area can also be read using SCP. If the matching relationship between the target image version and the current image version meets the update conditions, after writing the latest version using SCP, the NV Count in the corresponding storage area can also be updated using SCP, further enhancing the anti-tampering capability of the version information.
[0064] The technical solution provided in this disclosure isolates cross-domain access of the bootloader through a hardware firewall. Temporary cross-domain access is granted to the bootloader only when it needs to obtain target image versions of multiple operating systems. This solves the problem that the bootloader cannot obtain image version data across domains in a hard isolation scenario. Moreover, since the image versions of multiple operating systems are uniformly stored in a secure storage, the system control processor with dedicated access rights uniformly reads the current image version in each storage area of the secure storage, completes the image version matching verification, and completes the image version writing update. Therefore, this method can not only uniformly complete the version verification and update of multi-domain images, but also avoid the problem of tampering with the image version stored in the domain after any operating system domain is attacked. This effectively realizes the anti-rollback protection of multi-domain images and improves the image boot security in a multi-operating system hard isolation scenario.
[0065] In one embodiment of this disclosure, in the above Figure 2 On the basis of, such as Figure 3 As shown, step 203 above can specifically include the following steps: Step 2031: In response to the rollback prevention command, the rollback prevention command is parsed by the security monitoring firmware to determine the anomaly level of the sender of the rollback prevention command.
[0066] In some embodiments, within the ARM TrustZone architecture, the Security Monitoring Firmware (ATF) operates at the highest security anomaly level, EL3, to verify the legitimacy of rollback prevention commands across security domains, i.e., to verify the source of the rollback prevention commands. Rollback prevention commands that pass verification can be passed to the system control processor for subsequent processing; those that fail verification are directly intercepted and discarded by the ATF, effectively preventing malicious actors from forging rollback prevention commands and illegally tampering with version information.
[0067] In some examples, verifying the legitimacy of rollback prevention commands can include methods such as verifying the anomaly level of the sender of the rollback prevention command or verifying the identity of the sender of the rollback prevention command.
[0068] For example, consider verifying the exception level of the sender of the rollback prevention command. After the security monitoring firmware (ATF) receives the rollback prevention command, it parses the command to determine the exception level (EL) of the sender. If the exception level meets the preset requirements, the ATF is allowed to send the rollback prevention command to the system control processor; if the exception level does not meet the preset requirements, the rollback prevention process is terminated, and a corresponding exception alarm record is generated to prevent unauthorized entities from modifying the version information of the multi-domain image.
[0069] For example, after the security monitoring firmware ATF receives the anti-rollback command, it extracts the identifier field indicating the anomaly level from the data header of the anti-rollback command through the ATF, and compares the extracted identifier field with the preset anomaly level whitelist of legitimate senders; if the two match, it is determined that the anomaly level meets the requirements; if the two do not match, it is directly determined that the identity verification fails.
[0070] Step 2032: In response to the sender's exception level being exception level EL2, the system control processor reads the first current image version from the first storage area and the second current image version from the second storage area.
[0071] In the ARM architecture, the exception level (EL) (or privilege level) from highest to lowest is: EL3 > EL2 > EL1 > EL0. The general bootloader typically runs at exception level EL2, possessing the legitimate permission to send rollback prevention commands. Therefore, when the security monitoring firmware's ATF (Automatic Test Function) parses the sender's exception level as EL2, it can determine that the sender's identity verification for the rollback prevention command has passed, meaning the rollback prevention command is considered legitimate. The ATF forwards the rollback prevention command to the system controller, triggering subsequent version reading and comparison operations, i.e., executing step 2032 above. If the sender runs at a lower privilege level, such as EL1 or EL0, its exception level does not meet the requirements and will be judged as an unauthorized request. In other words, the rollback prevention command is considered illegitimate, and the ATF directly intercepts it, preventing the execution of step 2032. This exception level-based identity verification mechanism effectively intercepts illegal version modification requests at the request entry point, enhancing the overall protection level of the rollback prevention mechanism.
[0072] Based on the above embodiments, by pre-verifying the anomaly level of the sender of the anti-rollback command through the security monitoring firmware, only legitimate commands that meet the preset level requirements will be transmitted to the system control processor for processing. This can intercept malicious commands forged by illegal entities in advance, further improving the security of the anti-rollback mechanism.
[0073] In one embodiment of this disclosure, in the above Figure 2 On the basis of, such as Figure 4 As shown, step 204 above, which determines whether the first matching relationship between the first target image version and the first current image version, and / or the second matching relationship between the second target image version and the second current image version satisfies the version update condition, can specifically include the following steps: Step 2041: In response to the fact that the first current image version and the second current image version are encrypted data, the first current image version and the second current image version are decrypted by hardware encryption and decryption devices respectively to obtain the decrypted first current image version and the decrypted second current image version.
[0074] To ensure the secure storage of image version data, the current image version of each operating system stored in the secure storage is stored in encrypted form. Decryption is only performed by a hardware encryption and decryption unit when version verification is required, effectively avoiding the risk of information leakage caused by plaintext storage.
[0075] In some examples, the aforementioned hardware encryption / decryption unit can be an independent hardware circuit within the SOC. This hardware encryption / decryption unit has built-in encryption / decryption algorithm circuitry and can independently perform encryption and decryption operations using symmetric encryption algorithms. The transmission of encryption / decryption data and keys does not pass through the main processor, preventing the encryption key and plaintext version information from being stolen by malicious programs on the main processor, further enhancing the security of version storage. The encryption / decryption algorithm circuitry can be based on an Authenticated Encryption with Associated Data (AEAD) algorithm, specifically employing typical AEAD algorithms such as AES-GCM and SM4-GCM.
[0076] For example, taking the AEAD algorithm as an example of the SM4-GCM algorithm. If the first current image version stored in the first storage area of the secure memory is ciphertext data encrypted using the SM4-GCM algorithm, and the second current image version in the second storage area is also ciphertext data encrypted using the same algorithm, then after the system control processor reads these two encrypted image version data, it sends these two ciphertext data segments to the independent hardware encryption / decryption unit inside the SOC. The hardware encryption / decryption unit calls the pre-stored SM4 key to complete the decryption operation of the above two ciphertext data segments, and finally outputs the first and second current image versions in plaintext form. During the entire decryption process, the key will not leave the hardware encryption / decryption unit, and the plaintext version information will not be illegally read by the program on the main processor side.
[0077] In other embodiments, after obtaining the decrypted first current image version and the decrypted second current image version, an integrity check can be performed on the decrypted first current image version and the decrypted second current image version using a hardware encryption / decryption device to detect whether the version information has been tampered with. The integrity check can include methods such as hash digest verification and digital signature verification. If the integrity check fails, it indicates that the current image version data stored in the secure storage has been illegally tampered with, and the current anti-rollback process is terminated directly, triggering a tampering alarm to prevent incorrect update operations based on the tampered version information. If the integrity check passes, it indicates that the current image version data stored in the secure storage has not been illegally tampered with, and step 2042 can continue to be executed.
[0078] For example, the hardware encryption / decryption unit uses the AEAD algorithm to perform joint decryption and integrity verification. That is, while the hardware encryption / decryption unit is performing decryption, it can also perform hash digest verification on the decrypted version information based on the AEAD algorithm. If the verification result matches expectations, it indicates that the image version information has not been tampered with, and the subsequent image version comparison process can continue. If the verification result does not match, it indicates that the currently stored image version information has been maliciously tampered with, directly terminating the current image version update process and triggering a security alarm. This alerts the system administrator to investigate security risks, preventing incorrect update decisions based on tampered image version information, and further improving the reliability and security of the entire anti-rollback mechanism.
[0079] In other embodiments, the first storage area of the secure storage device stores an NV Count for recording the number of times the image version of the first operating system is updated, and the second storage area stores an NV Count for recording the number of times the image version of the second operating system is updated. Both NV Counts are stored in encrypted form. After reading these two NV Counts via SCP, decryption and integrity verification can be performed on them respectively. The specific operations are as described in the foregoing embodiments, and will not be repeated in this embodiment.
[0080] Step 2042: The system control processor determines that the first matching relationship and / or the second matching relationship meet the version update conditions.
[0081] In some embodiments, after obtaining the decrypted first current image version and the decrypted second current image version, the system control processor determines a first matching relationship between the first target image version and the decrypted first current image version, and determines a second matching relationship between the second target image version and the decrypted second current image version; and determines that the first matching relationship and / or the second matching relationship satisfy the version update condition. The version update condition is that the target image version is higher than the current image version of the corresponding operating system. That is, if the first target image version is higher than the first current image version, the first matching relationship is determined to satisfy the version update condition; if the second target image version is higher than the second current image version, the second matching relationship is determined to satisfy the version update condition.
[0082] It should be noted that the target image version of the corresponding operating system is only allowed to be written if the update conditions are met. If the conditions are not met, the update process of the corresponding operating system will be terminated directly. This strictly prevents image rollback and avoids malicious attacks that could cause a lower version image to overwrite a higher version image.
[0083] In some embodiments, step 2042 may specifically include: in response to the first matching relationship being that the first target image version is higher than the first current image version, determining by the system control processor that the first matching relationship meets the version update condition.
[0084] For example, suppose the first current image version of the first operating system is V12. If the first target image version to be updated is V15, then the first matching relationship is that the first target image version is higher than the first current image version. Therefore, the system control processor determines that the first matching relationship meets the version update conditions, thus allowing subsequent updates to the first current image version of the first operating system. If the first target image version to be updated is V10, then the first matching relationship is that the first target image version is lower than the first current image version. Therefore, the system control processor determines that the first matching relationship does not meet the version update conditions, and terminates the version update process of the first operating system.
[0085] In some embodiments, step 2042 may further include: in response to the second matching relationship being that the second target image version is higher than the second current image version, determining by the system control processor that the second matching relationship meets the version update condition.
[0086] For example, suppose the second current image version of the second operating system is V8. If the second target image version to be updated is V10, then the second matching relationship is that the second target image version is higher than the second current image version. Therefore, the system control processor determines that the second matching relationship meets the version update conditions, thus allowing subsequent update operations to the second current image version of the second operating system. If the second target image version to be updated is V5, then the second matching relationship is that the second target image version is lower than the second current image version. Therefore, the system control processor determines that the second matching relationship does not meet the version update conditions, and directly terminates the version update process of the second operating system.
[0087] Based on the above embodiments, by verifying the matching relationship between the target image version and the current image version of each operating system in a domain-based manner, version write updates are only performed on the corresponding operating system that meets the version update conditions. Therefore, it can not only support differentiated anti-rollback processing when multiple operating systems are updated synchronously, but also prevent illegal rollback of other operating system image versions after any operating system is tampered with, further improving the security and flexibility of the multi-domain image anti-rollback mechanism.
[0088] In one embodiment of this disclosure, in the above Figure 2 On the basis of, such as Figure 5 As shown, the steps in step 204 above, namely writing the first target image version to the first storage area and / or writing the second target image version to the second storage area, may specifically include the following steps 2043 and / or 2044.
[0089] Step 2043: The first target image version is encrypted using a hardware encryptor to obtain the encrypted first target image version, and the encrypted first target image version is written to the first storage area by the system control processor.
[0090] In some examples, for the first target image version that meets the version update conditions, it is not directly written to the reserved first storage area in the secure memory in plaintext form. Instead, it is first sent to a hardware encryptor for encryption. The hardware encryptor can read the built-in key and encrypt the first target image version using a pre-configured AEAD algorithm to generate ciphertext data with integrity verification information (i.e., the encrypted first target image version). The system control processor then writes the encrypted first target image version to the first storage area, overwriting the previously stored old version encrypted data, thus completing the update of the image version information corresponding to the first operating system. Throughout the entire encryption and writing process, the plaintext of the first target image version only circulates within the independent hardware encryptor and decryptor and does not appear on the main processor's bus or cache, preventing the plaintext version information from being stolen by malicious programs and further ensuring the security of version information storage.
[0091] In other embodiments, the first storage area of the secure memory also stores an NV Count for recording the number of times the image version of the first operating system is updated. If the system control processor determines that the first matching relationship meets the version update condition, it writes the encrypted first target image version into the first storage area, and simultaneously encrypts the updated NV Count using a hardware encryption / decryption device to obtain an encrypted NV Count, which is then written into the first storage area by the system control processor.
[0092] Step 2044: The second target image version is encrypted using a hardware encryptor / decryptor to obtain the encrypted second target image version, and then the encrypted second target image version is written to the second storage area by the system control processor.
[0093] For encrypting the second target image version using a hardware encryptor and decryptor, and writing the encrypted second target image version into the second storage area using a system control processor, please refer to the detailed description of updating the first target image version in the above embodiments. This disclosure will not repeat the details.
[0094] In other embodiments, the second storage area of the secure memory also stores an NV Count for recording the number of times the image version of the second operating system is updated. If the system control processor determines that the second matching relationship meets the version update condition, it writes the encrypted second target image version into the second storage area, and simultaneously encrypts the updated NV Count using a hardware encryptor to obtain an encrypted NV Count, which is then written into the second storage area by the system control processor.
[0095] Based on the above embodiments, the target image version is encrypted first using an independent hardware encryptor and decryptor before being written to the corresponding storage area in the secure storage. This method effectively reduces the risk of version information being illegally stolen and tampered with during storage. Compared with plaintext storage or schemes relying on software encryption, it significantly improves the security level of the storage stage, thereby further enhancing the security of the multi-domain image rollback prevention mechanism from the storage level.
[0096] Exemplary electronic devices Figure 6 A structural diagram of an electronic device provided in an embodiment of this disclosure includes at least one processor 111 and a memory 112.
[0097] The processor 111 may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 11 to perform desired functions.
[0098] The memory 112 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 111 may execute one or more computer program instructions to implement the rollback prevention method for multi-domain mirroring and / or other desired functions of the various embodiments of this disclosure described above.
[0099] In one example, the electronic device 11 may also include an input device 113 and an output device 114, which are interconnected via a bus system and / or other forms of connection mechanism (not shown).
[0100] The input device 113 may also include, for example, a keyboard, a mouse, etc.
[0101] The output device 114 can output various information to the outside, including, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.
[0102] Of course, for the sake of simplicity, Figure 6 Only some of the components of the electronic device 11 relevant to this disclosure are shown, omitting components such as buses, input / output interfaces, etc. In addition, the electronic device 11 may include any other suitable components depending on the specific application.
[0103] Exemplary computer program products and computer-readable storage media In addition to the methods and apparatus described above, embodiments of this disclosure may also provide a computer program product, including computer program instructions that, when executed by a processor, cause the processor to perform the steps in the rollback prevention methods for multi-domain mirroring described in the various embodiments of this disclosure in the "Exemplary Methods" section above.
[0104] Computer program products can be written in any combination of one or more programming languages to perform the operations of embodiments of this disclosure. These programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on a user's computing device, partially on a user's computing device, as a standalone software package, partially on a user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0105] Furthermore, embodiments of this disclosure may also be computer-readable storage media storing computer program instructions that, when executed by a processor, cause the processor to perform the steps in the rollback prevention methods for multi-domain mirroring described in the various embodiments of this disclosure in the "Exemplary Methods" section above.
[0106] Computer-readable storage media may take the form of any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may include, but is not limited to, systems, apparatuses, or devices that are electrical, magnetic, optical, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0107] The basic principles of this disclosure have been described above with reference to specific embodiments. However, the advantages, benefits, and effects mentioned in this disclosure are merely examples and not limitations, and should not be considered as essential features of each embodiment of this disclosure. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the scope of this disclosure to the necessity of employing the aforementioned specific details for implementation.
[0108] Various modifications and variations can be made to this disclosure without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this disclosure and their equivalents, this disclosure is also intended to include such modifications and variations.
Claims
1. A rollback prevention method for multi-domain mirroring, comprising: In response to the system-on-a-chip supporting the isolated operation of multiple operating systems, a permission request is sent to the hardware firewall through the bootloader; wherein, the hardware firewall is used to isolate the bootloader's access to the second operating system among the multiple operating systems other than the first operating system; In response to being granted temporary access, the system obtains a first target image version of the first operating system and a second target image version of the second operating system through the bootloader, and generates an anti-rollback instruction. In response to the anti-rollback command, the system control processor reads the first current image version of the first operating system and the second current image version of the second operating system from the first storage area and the second storage area in the security memory, respectively. In response to determining a first matching relationship between the first target image version and the first current image version, and / or a second matching relationship between the second target image version and the second current image version that satisfies the version update condition, the system control processor writes the first target image version into the first storage area, and / or writes the second target image version into the second storage area.
2. The method according to claim 1, wherein, In response to the anti-rollback command, the system control processor reads the first current image version of the first operating system and the second current image version of the second operating system from the first storage area and the second storage area in the secure memory, respectively, including: In response to the rollback prevention command, the security monitoring firmware parses the rollback prevention command to determine the anomaly level of the sender of the rollback prevention command; In response to the sender's exception level being exception level EL2, the system control processor reads the first current image version from the first storage area and the second current image version from the second storage area.
3. The method according to claim 1, wherein, The step of determining the first matching relationship between the first target image version and the first current image version, and / or the second matching relationship between the second target image version and the second current image version satisfying the version update condition, includes: In response to the fact that the first current image version and the second current image version are encrypted data, the first current image version and the second current image version are decrypted by hardware encryption and decryption devices respectively to obtain the decrypted first current image version and the decrypted second current image version; The system control processor determines that the first matching relationship and / or the second matching relationship meet the version update conditions.
4. The method according to claim 3, wherein, The step of determining, through the system control processor, that the first matching relationship and / or the second matching relationship satisfy the version update condition includes: In response to the first matching relationship being that the first target image version is higher than the first current image version, the system control processor determines that the first matching relationship satisfies the version update condition.
5. The method according to claim 4, wherein, The step of determining, via the system control processor, that the first matching relationship and / or the second matching relationship satisfy the version update condition further includes: In response to the second matching relationship being that the second target image version is higher than the second current image version, the system control processor determines that the second matching relationship satisfies the version update condition.
6. The method according to claim 1, wherein, The step of writing the first target image version to the first storage area and / or writing the second target image version to the second storage area includes: The first target image version is encrypted using a hardware encryption / decryption unit to obtain an encrypted first target image version, and then written to the first storage area via the system control processor; and / or, The second target image version is encrypted using a hardware encryptor to obtain an encrypted second target image version, and then written into the second storage area by the system control processor.
7. A system-on-a-chip, comprising: Main processor, system control processor, hardware firewall, and secure storage; The main processor is configured to send a permission request to the hardware firewall via a bootloader in response to the system-on-a-chip's support for the isolated operation of multiple operating systems; wherein the hardware firewall is configured to isolate the bootloader's access to a second operating system other than the first operating system among the multiple operating systems. The main processor is also configured to, in response to being granted temporary access rights, obtain a first target image version of the first operating system and a second target image version of the second operating system through the bootloader, and generate an anti-rollback instruction; The system control processor is configured to, in response to the anti-rollback command, read the first current image version of the first operating system and the second current image version of the second operating system from the first storage area and the second storage area in the security memory, respectively. The system control processor is further configured to, in response to determining a first matching relationship between the first target image version and the first current image version, and / or a second matching relationship between the second target image version and the second current image version satisfying a version update condition, write the first target image version into the first storage area, and / or write the second target image version into the second storage area.
8. The system-on-a-chip according to claim 7, wherein, The main processor is also configured to, in response to the rollback prevention command, parse the rollback prevention command through security monitoring firmware to determine the anomaly level of the sender of the rollback prevention command; The system control processor is specifically configured to, in response to the sender's exception level being exception level EL2, read the first current image version from the first storage area and read the second current image version from the second storage area.
9. A computer-readable storage medium storing a computer program for performing the rollback prevention method for multi-domain mirroring as described in any one of claims 1-6.
10. An electronic device, the electronic device comprising: processor; Memory used to store the processor's executable instructions; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the anti-rollback method for multi-domain mirroring as described in any one of claims 1-5; or, The electronic device includes a system-on-a-chip as described in any one of claims 7 and 8.
