A method, device and computer-readable medium for secure firmware upgrade

By transferring the upgrade package from the first data area to the isolated second data area for firmware upgrade, the problem of low security of firmware upgrade is solved and higher security and stability are achieved.

CN110806883BActive Publication Date: 2024-09-27ZTE CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201810882407.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-08-06
Publication Date
2024-09-27
Estimated Expiration
2039-01-12

AI Technical Summary

Technical Problem

When firmware is upgraded via OTA, there are security risks and it is easy to be attacked.

Method used

Save the downloaded upgrade package to the first data area, and transfer it to the second data area that is isolated from it, so as to use the upgrade package in the second data area to perform firmware upgrades and improve security through physical isolation.

Benefits of technology

It improves the security of firmware upgrades, reduces the risk of network attacks, and enhances the stability and security of firmware.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110806883B
    Figure CN110806883B
Patent Text Reader

Abstract

The embodiments of the present invention disclose a method, device and computer-readable medium for securely upgrading firmware, which relate to but are not limited to the field of firmware upgrading. The method comprises: downloading an upgrade package applicable to the firmware to a first data area; transmitting the upgrade package from the first data area to a second data area isolated from the first data area; and upgrading the firmware using the upgrade package in the second data area.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to, but are not limited to, the field of firmware upgrade, and in particular to a firmware secure upgrade method, device, and computer-readable medium. Background Art

[0002] Firmware refers to the software that performs the most basic and lowest-level work in devices such as smartphones, smart TVs, set-top boxes, data cards, tablets, and IoT terminals. It is generally stored in the EEPROM (Electrically Erasable Programmable read only memory) or FLASH (Encoded Flash Memory) chip in the device and can be upgraded via OTA (Over-the-Air Technology).

[0003] Firmware upgrade via OTA requires downloading the upgrade package from the network and using the upgrade package to complete the upgrade. Although the upgrade process is simple, convenient and easy to operate, it is easily exploited by attackers and poses a security risk. Summary of the invention

[0004] The embodiments of the present invention provide a firmware security upgrade method, device, equipment and storage medium to solve the problem of low firmware upgrade security.

[0005] A firmware security upgrade method provided according to an embodiment of the present invention includes:

[0006] Downloading an upgrade package applicable to the firmware to the first data area;

[0007] Transmitting the upgrade package from the first data area to a second data area isolated from the first data area;

[0008] The firmware is upgraded using the upgrade package in the second data area.

[0009] According to an embodiment of the present invention, a firmware security upgrade device is provided, the device comprising:

[0010] A downloading unit, used for downloading an upgrade package applicable to the firmware to the first data area;

[0011] a transmission unit, configured to transmit the upgrade package from the first data area to a second data area isolated from the first data area;

[0012] An upgrading unit is used to upgrade the firmware using the upgrading package in the second data area.

[0013] According to an embodiment of the present invention, a firmware security upgrade device is provided, the device comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the above-mentioned firmware security upgrade method when executed by the processor.

[0014] According to an embodiment of the present invention, a computer readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned firmware security upgrade method are implemented.

[0015] The technical solution provided by the embodiment of the present invention has the following beneficial effects:

[0016] The embodiment of the present invention improves the security of firmware upgrade by isolating the second data area from the first data area. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 It is a flowchart of a firmware security upgrade method provided by an embodiment of the present invention;

[0018] Figure 2 is a first schematic block diagram of a firmware security upgrade system provided by an embodiment of the present invention;

[0019] Figure 3 is a second schematic block diagram of a firmware security upgrade system provided by an embodiment of the present invention;

[0020] Figure 4 yes Figure 3 An example diagram of the interaction between the cloud and firmware in the system architecture shown;

[0021] Figure 5 yes Figure 3 A schematic diagram of the interaction process between the cloud and the second and third data areas in the system architecture shown;

[0022] Figure 6 is a schematic block diagram of a firmware security upgrade device provided by an embodiment of the present invention;

[0023] Figure 7 It is a schematic block diagram of a firmware security upgrade device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0024] The embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. It should be understood that the embodiments described below are only used to illustrate and explain the present invention, and are not used to limit the present invention.

[0025] The firmware security upgrade method provided in the embodiment of the present invention saves the downloaded upgrade package to the first data area, and then transmits the upgrade package from the first data area to the second data area isolated from the first data area, so as to perform a firmware security upgrade using the upgrade package in the second data area. The method can be specifically applied to version upgrades or program upgrades for devices such as smart phones, smart TVs, set-top boxes, data cards, tablet computers, and Internet of Things terminals, wherein the Internet of Things terminals can be widely used in remote meter reading, asset tracking, smart parking, smart agriculture, and other vertical industries. According to the above method, the embodiment of the present invention can implement a firmware security upgrade device in the form of software and / or hardware, and the device can be integrated in the above device. The firmware security upgrade method and device provided in the embodiment of the present invention are described in detail below.

[0026] Figure 1 FIG. 1 is a flow chart of a method for securely upgrading firmware provided by an embodiment of the present invention. Figure 1 As shown, the method may include:

[0027] Step S101: downloading an upgrade package applicable to the firmware to the first data area.

[0028] In this embodiment, if Figure 2 As shown, when partitioning, a first data area can be divided out to store upgrade packages. The upgrade packages can come from the cloud. The cloud is a server that stores the upgrade packages, or it can be a collection of multiple servers. The main function of the cloud is to manage the upgrade packages and communicate with the firmware for the firmware to search or download the upgrade packages.

[0029] Step S102: Transmit the upgrade package from the first data area to a second data area isolated from the first data area.

[0030] In this embodiment, if Figure 2 As shown, when partitioning, in addition to dividing the first data area, a second data area isolated from the first data area can also be divided to run a version or program, such as the original system.

[0031] Step S103: using the upgrade package in the second data area to upgrade the firmware.

[0032] In this embodiment, after detecting the existence of an upgrade package in the second data area, the upgrade package in the second data area is decompressed to obtain upgrade data, and the upgrade data is used to perform a firmware upgrade, which is a software upgrade, including an overall system upgrade, a single partition system upgrade, etc.

[0033] The upgrade package in this embodiment may be a complete upgrade package or a differential package having the difference between the new version and the old version.

[0034] In a preferred embodiment, the first data area may be an external data area for storing upgrade packages from the cloud, and the second data area may be an original system area for running the original system (or firmware system), in which case the upgrade package is used to upgrade the original system.

[0035] Based on the above embodiments, Figure 3 As shown, when partitioning, in addition to the first and second data areas, a third data area for running an external data access program can also be divided. The external data access program can download the upgrade package from the cloud to the first data area based on the public protocol of the cloud and the third data area, wherein the public protocol can be applied to HTTP (HyperText Transfer Protocol), or other protocols such as LWM2M (Light Weight M2M, lightweight machine to machine) protocol. The external data access program can also transmit the upgrade package of the first data area to the second data area isolated from the first data area based on the private protocol between the second data area and the third data area, that is, all interactions between the second data area and the first data area rely on the program of the third data area for interaction and transmission, wherein the private protocol is pre-agreed by the program of the third data area (such as the external data access program) and the program of the second data area (such as the original system), which can be a protocol based on socket communication, or a custom protocol or other protocols.

[0036] In this embodiment, Figure 4 As shown, the first data area is used to store the upgrade package downloaded from the cloud. When the partition is loaded, the first data area is loaded as a non-executable partition with only writable permissions, and the partition is invisible to the second data area and can only be accessed by the proprietary program of the third data area. When the partition is loaded, the third data area is loaded as a non-writable partition with only executable permissions. The program of the partition communicates with the program of the second data area using a private protocol. Among them, the second data area is the original partition, and all interactions between the second data area and the downloaded data (or the upgrade package of the first data area) rely on the program of the third data area for interaction and transmission.

[0037] On the basis of the above embodiment, before downloading the upgrade package applicable to the firmware to the first data area, it also includes an authentication step of authenticating the upgrade package to determine whether the upgrade package is applicable to the firmware, that is, using an external data access program running in the third data area, based on a private protocol between the second data area and the third data area, sending authentication data to the second data area, and receiving an authentication result from the second data area, if the authentication result is a successful authentication, it is determined that the upgrade package is applicable to the firmware, and if the authentication result is a failed authentication, it is determined that the upgrade package is not applicable to the firmware. Among them, the authentication data can be obtained by encrypting the identification code of the firmware (such as the version number of the firmware or the identification code of the device to which the firmware belongs) by the external data access program. The identification code of the firmware can be the identification code of the firmware applicable to the latest cloud upgrade package carried in the search package result, or it can be pre-stored in the external data access program area; the authentication result is determined by the firmware system matching the identification code obtained by decrypting the authentication data with the identification code pre-stored in the second data area. If the two match, the authentication is successful; if the two are inconsistent, the authentication fails.

[0038] In this embodiment, if the authentication is successful, the external data access program of the third data area directly downloads the upgrade package from the cloud to the external data area. Alternatively, the external data access program of the third data area notifies the user through the program of the second data area, and the user determines whether to download the upgrade package. If the user determines to download the upgrade package, the program of the second data area generates a user upgrade request and sends it to the external data access program of the third data area based on a private protocol. At this time, the external data access program of the third data area downloads the upgrade package applicable to the firmware from the cloud to the first data area based on the public protocol according to the received user upgrade request.

[0039] Based on the above embodiment, before executing the authentication step, it also includes using an external data access program running in the third data area to interact with the cloud (or cloud network) to search for upgrade packages to determine whether there is an upgrade package suitable for the firmware in the cloud.

[0040] The firmware of the embodiment of the present invention considers isolating the data downloaded from the network (or cloud) and the operating environment from the firmware system itself through physical isolation.

[0041] To explain in detail the interaction between the cloud and the second and third data zones, Figure 5 To explain, Figure 5 As shown, the process is as follows:

[0042] Step 61: The package search program for searching for cloud upgrade packages running in the third data area interacts with the cloud (or cloud network) to search for upgrade packages, which specifically includes step 611 of searching for upgrade packages and step 612 of feeding back search results.

[0043] Step 611: Search for upgrade packages.

[0044] The packet search program running in the third data area interacts with the cloud network and searches for upgrade packages at fixed time intervals according to the public protocol. For example, by default, the packet search program running in the third data area interacts with the cloud network and sends a packet search request to the cloud (or cloud network, cloud server) at a time period (e.g., 15 days) according to the public protocol HTTP or LWM2M.

[0045] Step 612: Search result feedback.

[0046] After receiving the packet search request, the cloud server performs a search and match in the server, and feeds back the search result to the packet search program in the third data area.

[0047] Step 62: The package search program running in the third data area interacts with the latest upgrade package stored in the cloud server based on a private protocol to authenticate the upgrade package and determine whether the upgrade package is applicable to the firmware, which specifically includes step 621 of sending authentication data and step 622 of waiting for data transmission after successful authentication.

[0048] Step 621: Send authentication data.

[0049] When the upgrade package is searched, the package search program running in the third data area uses a private protocol for authentication. The authentication method can be generated by the IMEI (International Mobile Equipment Identity) number of the device (i.e., the identification code of the device to which the firmware belongs) according to SSL (Secure Sockets Layer) encryption. That is, the upgrade package stores a list of IMEI numbers of the devices that need to be upgraded. When the third data area interacts with the second data area, the IMEI is first encrypted, and then sent to the second data area after SSL encryption, that is, the authentication data is sent to the second data area.

[0050] Step 622: Wait for data transmission after successful authentication.

[0051] The authentication program in the second data area decrypts the encrypted IMEI according to the private key, and matches the decrypted IMEI with the IMEI in the second data area (i.e., the IMEI of the device to which the firmware stored in the second data area belongs). After a successful match, data transmission can be carried out, including the transmission of package search requests and upgrade packages.

[0052] Step S63: The communication program running in the second data area notifies the user, and the user determines to download the upgrade package, which specifically includes step 631 of notifying the user to choose, step 632 of starting to download the upgrade package after the user chooses, and step 633 of downloading the upgrade package to the first data area.

[0053] Step 631: Notify the user of the selection.

[0054] The communication program in the second data area is notified in a socket manner that an upgrade package is available, and the communication program transmits the information of the upgrade package to the UI interface for the user to select.

[0055] Step 632: After the user selects, start downloading the upgrade package.

[0056] After the user selects to upgrade, the communication program running in the second data area transmits the upgrade request to the download program running in the third data area which downloads the upgrade package through the network transmission protocol, thereby starting the download process.

[0057] Step 633: Download the upgrade package to the first data area.

[0058] After the download process is started, the download program running in the third data area downloads the upgrade package from the cloud to the first data area.

[0059] Step 64: Transfer the upgrade package of the first data area to the second data area and perform the upgrade, which specifically includes step 641 of transmitting the upgrade package and step 642 of completing the upgrade of the original system using the upgrade package.

[0060] Step 641: Transmit the upgrade package.

[0061] After the download is completed, the download program running in the third data area transmits the upgrade package to the communication program running in the second data area, and the communication program receives the upgrade package and stores it in the second data area.

[0062] Step 642: Use the upgrade package to complete the original system upgrade.

[0063] After the upgrade program in the second data area detects the upgrade package, it decompresses the upgrade package to complete the upgrade of the entire system, and the upgrade process ends.

[0064] The embodiments of the present invention solve the network attacks during firmware upgrade via OTA, improve the security and stability of the firmware, can greatly improve product quality, and can be applied to scenarios with unlimited bandwidth as well as scenarios with limited bandwidth, such as IoT terminals.

[0065] In order to better support the firmware security upgrade function in different environments, the firmware in the embodiment of the present invention can use a public protocol in the protocol for interacting with the server, such as the HTTP protocol or the LWM2M protocol. In order to ensure security, the protocol between the third data area and the second data area is defined as a private protocol, which is agreed upon by the two partitions and can be agreed upon as an authentication transmission protocol based on socket communication.

[0066] Figure 6 is a schematic block diagram of a firmware security upgrade device provided by an embodiment of the present invention, such as Figure 6 As shown, the device may include:

[0067] The downloading unit 21 is used to download the upgrade package applicable to the firmware to the first data area. The first data area is a partition divided during partition division for storing external data (such as the upgrade package). The upgrade package can come from the cloud.

[0068] The transmission unit 22 is used to transmit the upgrade package from the first data area to a second data area isolated from the first data area, wherein the second data area is a partition divided during partition division for running versions or programs, and the second data area is isolated from the first data area.

[0069] The upgrading unit 23 is used to upgrade the firmware using the upgrading package of the second data area. The firmware upgrading is a software upgrading, including the upgrading of the whole system, the upgrading of the single partition system and the like.

[0070] The upgrade package described in this embodiment may be a complete upgrade package or a differential package having the difference between the new version and the old version.

[0071] In a preferred embodiment, the first data area may be an external data area for storing upgrade packages from the cloud, and the second data area may be an original system area for running the original system (or firmware system), in which case the upgrade package is used to upgrade the original system.

[0072] On the basis of the above embodiment, in addition to the first and second data areas, a third data area may be further divided during the partitioning. The third data area may download the upgrade package from the cloud to the first data area based on the public protocol between the cloud and the third data area, wherein the public protocol may be HTTP protocol or LWM2M protocol, etc. The third data area may also transmit the upgrade package of the first data area to the second data area isolated from the first data area based on the private protocol between the second data area and the third data area, that is, all interactions between the second data area and the first data area depend on the third data area for interaction and transmission, wherein the private protocol is pre-agreed between the third data area and the second data area, and may be a protocol based on socket communication, or a custom protocol or other protocols.

[0073] In this embodiment, when the partition is loaded, the first data area is loaded as a non-executable partition with writable permission, the first data area is invisible to the second data area, and is only accessed by the proprietary program of the third data area. When the partition is loaded, the third data area is loaded as a non-writable partition with executable permission.

[0074] On the basis of the above embodiment, the device may further include an authentication unit 24, which is used to authenticate the upgrade package applicable to the firmware before downloading the upgrade package to the first data area to determine whether the upgrade package is applicable to the firmware. That is, the authentication unit 24 uses an external data access program running in the third data area to send authentication data to the second data area based on a private protocol, and receives an authentication result from the second data area. If the authentication result is a successful authentication, it is determined that the upgrade package is applicable to the firmware, and if the authentication result is a failed authentication, it is determined that the upgrade package is not applicable to the firmware. Among them, the authentication data is obtained by encrypting the identification code of the firmware (for example, the version number of the firmware or the identification code of the device to which the firmware belongs) by the external data access program. The identification code of the firmware can be the identification code of the firmware applicable to the latest cloud upgrade package carried in the search package result, or it can be pre-stored in the external data access program area; the authentication result is determined by the firmware system matching the identification code obtained by decrypting the authentication data with the identification code pre-stored in the second data area. If the two match, the authentication is successful; if the two are inconsistent, the authentication fails.

[0075] In this embodiment, if the authentication result of the authentication unit 24 is successful, the download unit 21 directly downloads the upgrade package from the cloud to the external data area using the external data access program of the third data area, or receives a user upgrade request using the external data access program of the third data area, and downloads the upgrade package applicable to the firmware from the cloud to the first data area based on the public protocol between the cloud and the second data area according to the user upgrade request, and the user upgrade request is generated by the firmware system according to the user selection and sent from the second data area to the third data area based on the private protocol. Then the transmission unit 22 transmits the upgrade package of the first data area to the second data area based on the private protocol between the second data area and the third data area using the external data access program of the third data area.

[0076] Based on the above embodiment, the device may also include a package search unit 25, which is used to interact with the cloud (or cloud network) to search for upgrade packages using an external data access program running in the third data area before the authentication unit 24 performs authentication processing, and determine whether there is an upgrade package suitable for the firmware in the cloud.

[0077] Figure 7 is a schematic block diagram of a firmware security upgrade device provided by an embodiment of the present invention, such as Figure 7 As shown, the device includes: a processor 31, a memory 32, and a computer program stored in the memory 32 and executable on the processor 31, and the computer program implements the steps of the above-mentioned firmware security upgrade method when executed by the processor 31.

[0078] The embodiment of the present invention may also provide a computer-readable medium on which a computer program is stored, and the computer program implements the steps of the above-mentioned firmware security upgrade method when executed by the processor. It can be understood by those of ordinary skill in the art that all or some steps, systems, and functional modules / units in the device disclosed in the above method can be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As is well known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0079] Since the types of requests sent by programs running in the third data area and the programs running in the second data area can be limited during the development stage, such as searching for packets, downloading packets, and transmitting packets, other network requests will be isolated in the second data area. This will form a closed protection system to improve the security and stability of module products. It can not only be used in upgrades, but also in other businesses that are limited by network bandwidth, such as exporting relevant information in the device, problem analysis, and monitoring device status.

[0080] Although the embodiments of the present invention are described in detail above, the embodiments of the present invention are not limited thereto, and those skilled in the art can make various modifications based on the principles of the embodiments of the present invention. Therefore, any modifications made based on the principles of the embodiments of the present invention should be understood to fall within the protection scope of the present invention.

Claims

1. A method for securely upgrading firmware, characterized in that: The method comprises: Downloading an upgrade package applicable to the firmware to the first data area; The upgrade package is transferred from the first data area to a second data area isolated from the first data area, the firmware further comprising a third data area for running an external data access program, the external data access program transferring the upgrade package of the first data area to the second data area based on a private protocol between the second data area and the third data area; Upgrading the firmware using the upgrade package in the second data area; Among them, when the partition is loaded, the third data area is loaded as a non-writable partition with executable permissions; when the partition is loaded, the first data area is loaded as a non-executable partition with writable permissions, the first data area is not visible to the second data area, and can only be accessed by the proprietary program of the third data area.

2. The method according to claim 1, characterized in that Before downloading the upgrade package applicable to the firmware to the first data area, the method further includes: The external data access program sends authentication data to the second data area based on the private protocol, and receives an authentication result from the second data area; If the authentication result is successful, the external data access program determines that the upgrade package is applicable to the firmware.

3. The method according to claim 2, characterized in that The authentication data is obtained by encrypting the identification code of the firmware by the external data access program, and the authentication result is determined by matching the identification code obtained by decrypting the authentication data with the identification code pre-stored in the second data area.

4. The method according to any one of claims 1 to 3, characterized in that: The step of downloading the upgrade package applicable to the firmware to the first data area comprises: The external data access program receives a user upgrade request, wherein the user upgrade request is generated according to a user selection and sent from the second data area to the third data area based on a private protocol; The external data access program downloads the upgrade package applicable to the firmware from the cloud to the first data area based on the public protocol between the cloud and the third data area according to the user upgrade request.

5. The method according to claim 1, characterized in that The first data area is an external data area for storing the upgrade package, the second data area is an original system area for running the original system, and the upgrade package is used to upgrade the original system.

6. A firmware security upgrade device, characterized in that: The device comprises: A downloading unit, used for downloading an upgrade package applicable to the firmware to the first data area; a transmission unit, configured to transmit the upgrade package from the first data area to a second data area isolated from the first data area, the firmware further comprising a third data area for running an external data access program, the external data access program transmitting the upgrade package from the first data area to the second data area based on a private protocol between the second data area and the third data area; An upgrading unit, configured to upgrade the firmware running on the firmware using an upgrade package in the second data area; Among them, when the partition is loaded, the third data area is loaded as a non-writable partition with executable permissions; when the partition is loaded, the first data area is loaded as a non-executable partition with writable permissions, the first data area is not visible to the second data area, and can only be accessed by the proprietary program of the third data area.

7. A firmware security upgrade device, characterized in that: The device comprises: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the firmware security upgrade method as claimed in any one of claims 1 to 5 when executed by the processor.

8. A computer-readable medium, characterized in that A computer program is stored thereon, and when the computer program is executed by a processor, the steps of the firmware security upgrade method as claimed in any one of claims 1 to 5 are implemented.