A control method and apparatus

By performing state information-driven legality verification in the embedded controller (EC) and utilizing a multi-verification mechanism to ensure the legality of firmware data, the problem of firmware data being tampered with or attacked in EC devices is solved, enabling the normal enabling and safe operation of components.

CN113051579BActive Publication Date: 2026-04-14LENOVO (BEIJING) LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
LENOVO (BEIJING) LTD
Filing Date
2021-03-31
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Embedded controllers (ECs) require enhanced security mechanisms to ensure the proper functioning of their corresponding components within the device and to prevent firmware data from being tampered with or attacked, which could render the components inoperable.

Method used

When an electronic device receives a startup command, the controller's status information is used to verify its legitimacy. Different verification methods are used to verify the legitimacy of the target data, ensuring that only legitimate firmware data can enable the corresponding components.

Benefits of technology

It effectively prevents firmware data from being tampered with or attacked, ensuring that the corresponding components can be enabled normally, and avoiding situations where components cannot be enabled due to illegal data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113051579B_ABST
    Figure CN113051579B_ABST
Patent Text Reader

Abstract

The application discloses a control method and device. The method comprises the following steps: in the case that an electronic device obtains a starting instruction, performing legality verification on target data according to the state information of a controller in a determined verification mode to obtain a verification result; the target data at least corresponds to firmware data in the controller; if the verification result represents that the target data is legal, executing the firmware data to control the enable state of a component corresponding to the firmware data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a control method and apparatus. Background Technology

[0002] Currently, embedded controllers (ECs) require higher security mechanisms to ensure the normal operation of the corresponding components within the device in which the EC resides. Summary of the Invention

[0003] In view of the above, this application provides a control method and apparatus, as follows:

[0004] A control method, comprising:

[0005] When the electronic device receives a start command, the target data is validated for legality according to the controller's status information and a determined verification method to obtain a verification result; the target data corresponds at least to the firmware data within the controller;

[0006] If the verification result indicates that the target data is valid, the firmware data is executed to control the enable state of the component corresponding to the firmware data.

[0007] The above method, preferably, involves verifying the legality of the target data according to a determined verification method based on the controller's status information to obtain the verification result, including:

[0008] The target data is searched within the controller's own first storage area to obtain the controller's status information;

[0009] If the status information indicates that the target data exists in the first storage area, the target data is validated for legality according to the first verification method to obtain the verification result;

[0010] And / or,

[0011] If the status information indicates that the target data is not present in the first storage area, the target data is validated for legality in the second storage area corresponding to the boot system of the electronic device according to the second verification method to obtain the verification result.

[0012] Preferably, after performing legality verification on the target data according to the first verification method to obtain the verification result, the method further includes:

[0013] If the verification result corresponding to the first verification method indicates that the target data is invalid, delete the target data in the first storage area; and / or,

[0014] The electronic device is controlled to restart, so that when the electronic device receives a restart command again, the target data is validated in the second storage area corresponding to the boot system of the electronic device according to the second verification method to obtain a verification result.

[0015] Preferably, after verifying the legality of the target data according to the second verification method in the second storage area corresponding to the boot system of the electronic device to obtain the verification result, the method further includes:

[0016] If the verification result corresponding to the second verification method indicates that the target data is valid, the target data in the second storage area is loaded into the first storage area.

[0017] The above method, preferably, also includes:

[0018] If the verification result corresponding to the second verification method indicates that the target data is abnormal, the backup data is verified for legality in the second storage area corresponding to the boot system of the electronic device according to the second verification method to obtain the verification result;

[0019] In this second storage area, the target data is located in the first storage location, and the backup data corresponds to the target data and is located in the second storage location within the second storage area.

[0020] Preferably, after performing a validity check on the backup data according to a second verification method in the second storage area corresponding to the boot system of the electronic device to obtain the verification result, the method further includes:

[0021] If the verification result corresponding to the backup data indicates that the backup data is invalid, a flag is set, and the flag prompts the controller to perform backup processing on the target data on the next startup.

[0022] Preferably, after performing a validity check on the backup data according to a second verification method in the second storage area corresponding to the boot system of the electronic device to obtain the verification result, the method further includes:

[0023] If the verification result corresponding to the backup data indicates that the backup data is valid, the target data in the first storage location is restored using the backup data in the second storage location and loaded into the first storage area.

[0024] The above method, preferably, also includes:

[0025] If updated target data is obtained, the updated target data is validated for legality.

[0026] If the updated target data is valid, the updated target data is backed up to the second storage location in the second storage area to update the backup data in the second storage location.

[0027] In the above method, preferably, the target data contains at least the signature data corresponding to the firmware data, and the signature data is obtained by encrypting the signature string corresponding to the firmware data using a private key;

[0028] The first verification method is used to verify the legality of the target data to obtain the verification result, including:

[0029] The signature data in the target data is decrypted using the public key corresponding to the private key to obtain the decrypted string;

[0030] Based on the decrypted string, a verification result is obtained. If the decrypted string matches a preset fixed string, the verification result indicates that the target data is legitimate.

[0031] The public key is stored in a third storage area in the controller, and the third storage area is a non-writable area.

[0032] A control device, comprising:

[0033] A data verification unit is used to verify the legality of target data according to a determined verification method based on the status information of the controller when a start command is received, so as to obtain a verification result; the target data corresponds at least to firmware data within the controller;

[0034] The data execution unit is configured to execute the firmware data if the verification result indicates that the target data is valid, thereby controlling the enable state of the component corresponding to the firmware data.

[0035] An electronic device, comprising:

[0036] Controller;

[0037] The processor; the controller is capable of performing a first function, such that the processor can perform a second function when a preset condition is met;

[0038] The controller is configured to: upon receiving a startup command, perform a validity verification of the target data according to a determined verification method based on the controller's status information to obtain a verification result; the target data corresponds at least to firmware data within the controller; if the verification result indicates that the target data is valid, execute the firmware data to control the enable state of the component corresponding to the firmware data.

[0039] A storage medium storing computer-executable instructions, which, when loaded and executed by a processor, implement the control method as described in any of the preceding claims.

[0040] As can be seen from the above scheme, in the control method and apparatus provided in this application, when the electronic device receives a start command, the target data corresponding to at least the firmware data within the controller is validated according to the controller's status information and a determined validation method, thereby obtaining a validation result indicating whether the target data is valid. If the validation result indicates that the target data is valid, the firmware data can be executed to control the enabled state of the component corresponding to the firmware data. Therefore, in this application, firmware data execution is only allowed if the target data corresponding to the firmware data within the controller is valid, thus enabling the corresponding component and preventing the component from being disabled due to invalid firmware data within the controller, such as tampering or attacks. Attached Figure Description

[0041] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0042] Figure 1 A flowchart of a control method provided in Embodiment 1 of this application;

[0043] Figures 2-11 These are partial flowcharts of a control method provided in Embodiment 1 of this application;

[0044] Figure 12 This is a schematic diagram of the structure of a control device provided in Embodiment 2 of this application;

[0045] Figure 13 This is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of this application;

[0046] Figures 14-17 These are application example diagrams for EC in this application. Detailed Implementation

[0047] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0048] refer to Figure 1 This is a flowchart illustrating the implementation of a control method provided in Embodiment 1 of this application. This method can be applied to controllers that need to protect contained firmware data, such as embedded controllers (ECs). Unlike processors, controllers can perform a first function, enabling processors to perform a second function when preset conditions are met. For example, a controller can perform the first function based on its internally stored data, thereby satisfying preset conditions, such as operating environment or startup conditions, to support the processor in performing the second function under these preset conditions. This data can be processor data obtained by the controller from elsewhere to perform the first function. For example, the processor can be a central processing unit (CPU), while the controller can be an EC. The CPU can start the operating system after power-on, thereby providing users with computing or application processing functions. The EC, based on its internal data, controls the power-on timing at the hardware level, providing power-on startup conditions for the CPU and other components, thereby supporting CPU startup. Specifically, after the EC starts, it controls the power-on sequence to support the CPU startup, so that the CPU can call and start the operating system, start the entire computer and provide computing services to the user; or, when the CPU load is heavy, the EC reads the CPU temperature through the control bus, thereby controlling the CPU cooling fan or system fan speed to increase the speed of heat dissipation; and so on.

[0049] Specifically, the method in this embodiment may include the following steps:

[0050] Step 101: When the electronic device receives a start command, the target data is validated according to the controller's status information and a determined verification method to obtain the validation result.

[0051] The target data corresponds at least to the firmware data within the controller. This firmware data corresponds to the custom control data of the corresponding components within the electronic device, such as fans, keyboards, touch controls, mice, cameras, microphones, and speakers. This firmware data drives the corresponding components so that they operate according to the corresponding operating rules. For example, if the firmware data is the drive data for a fan, the fan speed can be adjusted according to the heat dissipation control rules in the firmware data to achieve heat dissipation.

[0052] It should be noted that the startup instruction here can be understood as the instruction by which the controller performs the first function so that the processor can perform the second function, such as the computer's power-on instruction, etc.

[0053] In practice, when verifying the legality of target data, different verification methods can be used depending on the controller's state information, thereby obtaining a verification result characterizing whether the target data is legal. If the target data is legal, it can be determined that the firmware data within the corresponding controller is legitimate and has not been tampered with or attacked. If the target data is invalid, it can be determined that the firmware data within the corresponding controller is invalid, possibly due to tampering or attack, rendering the firmware data unusable.

[0054] The controller's status information can characterize whether the controller contains data for validity verification. For example, whether the controller's own first storage area contains the status information of the target data to be verified. Based on this, different verification methods are used to verify the validity of the target data when the controller's own first storage area contains the target data and when the controller's own first storage area does not contain the target data, in order to obtain the verification result.

[0055] Step 102: Determine whether the verification result indicates that the target data is valid. If the verification result indicates that the target data is valid, proceed to step 103.

[0056] Step 103: Execute firmware data to control the enable state of the component corresponding to the firmware data.

[0057] The controller executes firmware data to enable components such as fans, keyboards, touchpads, touchscreens, and mice. These enabled components then operate according to the control rules contained in the firmware data. For example, the fan adjusts its speed according to the heat dissipation control rules in the firmware data to cool components such as the motherboard and CPU inside the computer.

[0058] As can be seen from the above scheme, in the control method provided in Embodiment 1 of this application, when the electronic device receives a start command, the target data corresponding to at least the firmware data within the controller is validated according to the controller's state information and a determined validation method, thereby obtaining a validation result indicating whether the target data is valid. If the validation result indicates that the target data is valid, the firmware data can be executed to control the enabled state of the component corresponding to the firmware data. Therefore, in this embodiment, firmware data execution is only allowed if the target data corresponding to the firmware data within the controller is valid, ensuring that the corresponding component is enabled, thus avoiding situations where the component cannot be enabled due to invalid firmware data within the controller, such as tampering or attacks.

[0059] In one implementation, step 101, when verifying the legality of the target data according to the determined verification method based on the controller's state information, can be implemented through the following process: Figure 2 As shown:

[0060] Step 201: Search for the target data in the controller's own first storage area to obtain the controller's status information.

[0061] The first storage area is a storage area divided within the controller, such as the read-only memory (ROM) in the EC. In this embodiment, the first storage area is used to detect whether target data is stored, that is, to check whether target data is stored in the first storage area, thereby obtaining the controller's status information.

[0062] Step 202: Determine whether the status information indicates that there is target data in the first storage area. If the status information indicates that there is target data in the first storage area, proceed to step 203. If the status information indicates that there is no target data in the first storage area, proceed to step 204.

[0063] Step 203: Perform legality verification on the target data according to the first verification method to obtain the verification result.

[0064] After validating the target data according to the first verification method, step 204 can be executed based on the obtained verification result. For example, if the verification result obtained from validating the target data according to the first verification method indicates that the target data is invalid, step 204 can continue to be executed. Figure 3 As shown in the image.

[0065] Step 204: Verify the legality of the target data in the second storage area corresponding to the boot system of the electronic device according to the second verification method to obtain the verification result.

[0066] Here, the boot system can be understood as the basic input / output system of an electronic device, such as the BIOS (Basic Input Output System) in a computer. The boot system has a corresponding second storage area, such as the ROM in the BIOS. If the controller does not contain the target data in its own first storage area, it performs a validity check on the target data contained in the second storage area corresponding to the BIOS of the electronic device.

[0067] It should be noted that the target data in the second storage area can be understood as backup data of the target data in the first storage area in the controller. If the target data in the first storage area is tampered with or attacked, the target data in the second storage area will be used as an alternative.

[0068] In other words, this embodiment has multiple methods for verifying the target data:

[0069] In one specific implementation, when the controller's own first storage area contains target data, the controller performs a validity check on the target data in the first storage area according to a first verification method to obtain the verification result.

[0070] In another specific implementation, if the target data is contained in the first storage area of ​​the controller itself, the controller first performs a validity check on the target data in the first storage area according to the first verification method. If the verification result corresponding to the first verification method indicates that the target data in the first storage area is invalid, the controller then performs a validity check on the target data in the second storage area corresponding to the boot system of the electronic device according to the second verification method to obtain the verification result.

[0071] In another specific implementation, if the target data is not contained in the controller's own first storage area, the controller directly verifies the legality of the target data in the second storage area corresponding to the electronic device's boot system according to the second verification method to obtain the verification result.

[0072] Furthermore, in this embodiment, after verifying the legality of the target data according to the first verification method in step 203 to obtain the verification result, the following steps may also be included: Figure 4 As shown:

[0073] Step 205: Determine whether the verification result corresponding to the first verification method indicates that the target data is valid. If the verification result corresponding to the first verification method indicates that the target data is invalid, proceed to step 206.

[0074] Step 206: Delete the target data in the first storage area.

[0075] For example, delete the fan drive data from the EC's ROM.

[0076] Alternatively, if step 205 determines that the verification result corresponding to the first verification method indicates that the target data is invalid, it may also include the following steps, such as... Figure 5 As shown:

[0077] Step 207: Control the electronic device to restart, in order to execute step 204: When the electronic device receives the restart command again, perform legality verification on the target data in the second storage area corresponding to the boot system of the electronic device according to the second verification method, so as to obtain the verification result.

[0078] Alternatively, if in step 205 it is determined that the verification result corresponding to the first verification method indicates that the target data is invalid, step 206 can be executed first, followed by step 207. Figure 6 As shown in the image.

[0079] For example, if the fan driver data in the EC's ROM is determined to be invalid, the invalid driver data in the EC's ROM can be directly erased. Alternatively, the EC can be controlled to perform a validity check on the driver data contained therein in the BIOS after the computer restarts. Or, the invalid driver data in the EC's ROM can be erased first, then the computer can be controlled to restart, and then the EC can perform a validity check on the driver data contained therein in the BIOS.

[0080] Based on the above implementation, after step 204, in which the target data is validated according to the second verification method in the second storage area corresponding to the boot system of the electronic device to obtain the verification result, the method in this embodiment may further include the following steps, such as... Figure 7 As shown:

[0081] Step 208: Determine whether the verification result corresponding to the second verification method indicates that the target data is valid. If the verification result corresponding to the second verification method indicates that the target data is valid, proceed to step 209.

[0082] Step 209: Load the target data in the second storage area into the first storage area.

[0083] Therefore, after the valid target data in the second storage area is loaded into the first storage area of ​​the controller, the target data in the first storage area is valid, so that the controller can enable the corresponding components according to the firmware data corresponding to the target data.

[0084] It should be noted that after loading the target data in the second storage area into the first storage area, the controller can execute the firmware data corresponding to the target data in the first storage area after restarting the electronic device to enable the component corresponding to the firmware data. Alternatively, the controller can execute the firmware data corresponding to the target data in the first storage area directly without restarting the electronic device to enable the component corresponding to the firmware data.

[0085] For example, if the driver data contained in the BIOS ROM is valid, the EC loads the driver data from the BIOS into the EC's ROM. At this point, the computer can be restarted. After restarting, the driver data in the EC can be verified and confirmed to be valid. Then, the EC executes the driver data to enable the corresponding fan. Alternatively, after loading the driver data from the BIOS into the EC's ROM, the EC can directly execute the reloaded driver data in the EC's ROM to enable the corresponding fan without restarting. Or, the validity of the reloaded driver data in the EC's ROM can be verified first. In this case, the verification is usually valid. Therefore, after the verification is valid, the reloaded driver data in the EC's ROM can be directly executed to enable the corresponding fan.

[0086] Furthermore, if in step 208 it is determined that the verification result corresponding to the second verification method indicates that the target data is abnormal, such as being invalid, the following steps can be performed, such as... Figure 8 As shown:

[0087] Step 210: Perform a legality verification on the backup data in the second storage area corresponding to the boot system of the electronic device according to the second verification method to obtain the verification result;

[0088] In the second storage area, the target data is located in the first storage location, and the backup data corresponds to the target data and is located in the second storage location within the second storage area.

[0089] In other words, in this embodiment, after verifying the target data on the first storage location corresponding to the boot system and determining that the target data on the first storage location is invalid, the backup data on the second storage location corresponding to the boot system is then verified.

[0090] It should be noted that the backup data in the second storage location can be understood as the backup data of the target data in the first storage location. Combining the implementation method described above, it can be understood as follows: the boot system sets up two backups for the target data contained in the first storage area within the controller. First, a backup of the target data in the first storage area is stored in the first storage location of the boot system, i.e., the target data in the first storage location. At the same time, a backup of the target data in the first storage area is also stored in the second storage location of the boot system, i.e., the backup data in the second storage location. Thus, the security of the target data within the controller is ensured through multiple backups.

[0091] For example, the BIOS stores two backups of the fan driver data in the EC: one in the first storage location of the BIOS and the other in the second storage location of the BIOS. In this embodiment, if the fan driver data in the EC's ROM is determined to be invalid, the EC can first perform a validity check on the driver data contained in the first storage location in the BIOS. If the driver data contained in the first storage location is invalid, the EC can then perform a validity check on the driver data contained in the second storage location in the BIOS.

[0092] Based on this, after the controller performs a validity check on the backup data in the second storage area corresponding to the boot system of the electronic device according to the second verification method in step 210 to obtain the verification result, the method in this embodiment may further include the following steps, such as... Figure 9 As shown:

[0093] Step 211: Determine whether the verification result corresponding to the backup data indicates that the backup data is valid. If the verification result corresponding to the backup data indicates that the backup data is invalid, proceed to step 212.

[0094] Step 212: Set a flag bit that can be used to prompt the controller to back up the target data on the next startup.

[0095] For example, a flag such as "x" or "0" can be set in a preset position on the EC. When the controller starts up next time, the target data is backed up by recognizing the value of this flag. The target data being backed up here is data that has been verified for legitimacy.

[0096] Based on the above implementation method, in step 211, if the verification result corresponding to the backup data indicates that the backup data is valid, the following steps can also be performed, such as... Figure 10 As shown:

[0097] Step 213: Use the backup data in the second storage location to restore the target data in the first storage location and load it into the first storage area.

[0098] Specifically, the controller can write the backup data of the second storage bit into the first storage bit, overwriting the verified invalid target data, and record the backup data of the second storage bit into the controller's own first storage area. Thus, both the second storage bit in the boot system and the controller's own first storage area contain verified valid data, so that the controller can enable the corresponding components according to the firmware data corresponding to the verified valid target data and control the components to operate normally.

[0099] For example, the EC can write the fan driver data from the second storage bit in the BIOS ROM to the first storage bit, overwriting the invalid driver data, and record the backup data from the second storage bit into the EC's own ROM. Thus, both the second storage bit in the BIOS and the EC's own ROM contain valid driver data, so that the EC can control the fan to enable and control the fan to run normally according to the valid driver data.

[0100] In one implementation, the target data can be updated in the guidance system. Based on this, the method in this embodiment may further include the following steps: Figure 11 As shown:

[0101] Step 1101: If updated target data is obtained, verify the validity of the updated target data.

[0102] The target data to be updated here can be the updated target data obtained from the first storage bit of the boot system. For example, if the fan driver data is detected to be updated in the first storage bit of the ROM in the BIOS, then the updated fan driver data is obtained.

[0103] Specifically, in this embodiment, the updated target data can be validated according to the first verification method to obtain the verification result.

[0104] Step 1102: If the target data to be updated is valid, back up the target data to the second storage location in the second storage area to update the backup data in the second storage location.

[0105] Furthermore, in this embodiment, the updated target data can also be loaded into the controller's first storage area.

[0106] For example, after the EC obtains updated fan driver data from the BIOS, it verifies the validity of the updated driver data. If the verification result indicates that the updated driver data is valid, it backs up the updated driver data to the second memory location of the BIOS, thereby updating the backup data. Furthermore, the EC can load the updated driver data into its ROM, so that the EC can use the updated driver to enable the fan and control its normal operation.

[0107] In one implementation, the target data contains at least the signature data corresponding to the firmware data; alternatively, the target data may also contain the firmware data itself. The signature data is obtained by encrypting the signature string corresponding to the firmware data using a private key. For example, the signature data is obtained by encrypting the signature string corresponding to the firmware data using an algorithm such as Elliptic Curve Digital Signature Algorithm (ECDSA) or an asymmetric signature algorithm with a private key.

[0108] Based on this, in step 203, when verifying the legality of the target data according to the first verification method to obtain the verification result, it can be achieved in the following way:

[0109] First, the signature data in the target data is decrypted using the public key corresponding to the private key to obtain the decryption string. Then, the verification result is obtained based on the decryption string. If the decryption string matches the preset fixed string, the verification result indicates that the target data is legitimate, that is, the firmware data in the target data has not been tampered with or attacked.

[0110] The public key is stored in a third storage area within the controller, which is a non-writable area. For example, the third storage area could be the OTP (one-time program) area within the EC, ensuring that the public key cannot be overwritten.

[0111] Furthermore, the method of verifying the legality of target data in the second storage area corresponding to the boot system of the electronic device according to the second verification method, and the method of verifying the legality of backup data in the second storage area corresponding to the boot system of the electronic device according to the second verification method, are similar to the method of verifying target data according to the first verification method mentioned above, and will not be repeated here.

[0112] refer to Figure 12 This is a schematic diagram of a control device provided in Embodiment 2 of this application. This device can be configured in a controller that needs to protect the contained firmware data. In this embodiment, the controller can be an EC (Electronic Control Unit) or similar component, capable of performing a first function, so that the processor in the electronic device can perform a second function when preset conditions are met. Based on this:

[0113] The control device in this embodiment may include the following units:

[0114] The data verification unit 1201 is used to perform legality verification on target data according to a determined verification method based on the status information of the controller when a start command is received, so as to obtain a verification result; the target data corresponds at least to firmware data in the controller;

[0115] The data execution unit 1202 is used to execute the firmware data if the verification result indicates that the target data is valid, so as to control the enable state of the component corresponding to the firmware data.

[0116] As can be seen from the above scheme, in the control device provided in Embodiment 2 of this application, when the electronic device receives a start command, it performs a legality check on the target data corresponding to at least the firmware data within the controller according to the controller's status information and a determined verification method, thereby obtaining a verification result characterizing whether the target data is legal. If the verification result indicates that the target data is legal, the firmware data can be executed to control the enabled state of the component corresponding to the firmware data. Therefore, in this embodiment, firmware data execution is only allowed if the target data corresponding to the firmware data within the controller is legal, thus enabling the corresponding component and preventing the component from being disabled due to invalid firmware data within the controller, such as tampering or attacks.

[0117] In one implementation, the data verification unit 1201 is specifically configured to: search for the target data in a first storage area of ​​the controller itself to obtain the controller's status information; if the status information indicates that the target data exists in the first storage area, perform a validity verification on the target data according to a first verification method to obtain a verification result; and / or, if the status information indicates that the target data does not exist in the first storage area, perform a validity verification on the target data in a second storage area corresponding to the electronic device's boot system according to a second verification method to obtain a verification result.

[0118] Based on the above implementation, after the data verification unit 1201 performs legality verification on the target data according to the first verification method to obtain the verification result, it is further used to:

[0119] If the verification result corresponding to the first verification method indicates that the target data is invalid, the target data in the first storage area is deleted; and / or, the electronic device is controlled to restart, so that when the electronic device receives a restart command again, the target data is verified for legality in the second storage area corresponding to the boot system of the electronic device according to the second verification method to obtain a verification result.

[0120] In one implementation, after the data verification unit 1201 verifies the legality of the target data in the second storage area corresponding to the boot system of the electronic device according to the second verification method to obtain the verification result, it is further configured to: if the verification result corresponding to the second verification method indicates that the target data is legal, load the target data in the second storage area into the first storage area.

[0121] Furthermore, the data verification unit 1201 is also used to: if the verification result corresponding to the second verification method indicates that the target data is abnormal, perform a legality verification on the backup data in the second storage area corresponding to the boot system of the electronic device according to the second verification method to obtain a verification result;

[0122] In this second storage area, the target data is located in the first storage location, and the backup data corresponds to the target data and is located in the second storage location within the second storage area.

[0123] Optionally, after the data verification unit 1201 performs a legality verification on the backup data in the second storage area corresponding to the boot system of the electronic device according to the second verification method to obtain the verification result, it is further configured to: if the verification result corresponding to the backup data indicates that the backup data is invalid, set a flag bit, and the flag bit prompts the controller to perform backup processing on the target data at the next startup.

[0124] In one implementation, the data verification unit 1201 performs a validity check on the backup data in the second storage area corresponding to the boot system of the electronic device according to a second verification method. After obtaining the verification result, it is further configured to:

[0125] If the verification result corresponding to the backup data indicates that the backup data is valid, the target data in the first storage location is restored using the backup data in the second storage location and loaded into the first storage area.

[0126] Based on the above implementation, the data verification unit 1201 is also used to: if updated target data is obtained, perform legality verification on the updated target data;

[0127] If the updated target data is valid, the updated target data is backed up to the second storage location in the second storage area to update the backup data in the second storage location.

[0128] In one implementation, the target data includes at least signature data corresponding to the firmware data, and the signature data is obtained by encrypting the signature string corresponding to the firmware data using a private key;

[0129] Specifically, when the data verification unit 1201 verifies the legality of the target data according to the first verification method to obtain a verification result, it is used to: decrypt the signature data in the target data using the public key corresponding to the private key to obtain a decryption string; obtain a verification result based on the decryption string; and if the decryption string matches a preset fixed string, the verification result indicates that the target data is legal.

[0130] The public key is stored in a third storage area in the controller, and the third storage area is a non-writable area.

[0131] It should be noted that the specific implementation of each unit in this embodiment can be referred to the corresponding content above, and will not be described in detail here.

[0132] In addition, Embodiment 3 of this application provides a controller, wherein both the controller and the processor are components disposed within an electronic device, wherein:

[0133] In this embodiment, the controller can be a component such as an EC (Electronic Control Unit), capable of performing the first function, so that the processor in the electronic device can perform the second function when the preset conditions are met. Based on this:

[0134] Specifically, the controller is used to: upon receiving a start command, perform legality verification on the target data according to a determined verification method based on the controller's status information, and obtain a verification result; the target data corresponds at least to firmware data within the controller; if the verification result indicates that the target data is legal, execute the firmware data to control the enable state of the component corresponding to the firmware data.

[0135] As can be seen from the above scheme, in the controller provided in Embodiment 3 of this application, when the electronic device receives a start command, the controller performs a validity check on the target data corresponding to at least the firmware data within the controller according to a determined verification method based on the controller's state information, thereby obtaining a verification result indicating whether the target data is valid. If the verification result indicates that the target data is valid, the firmware data can be executed to control the enabled state of the component corresponding to the firmware data. Therefore, in this embodiment, firmware data execution is only allowed if the target data corresponding to the firmware data within the controller is valid, ensuring that the corresponding component is in an enabled state, thus avoiding situations where the component cannot be enabled due to invalid firmware data within the controller, such as tampering or attacks.

[0136] It should be noted that the specific implementation of the controller in this embodiment can be referred to the corresponding content above, and will not be described in detail here.

[0137] refer to Figure 13This is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of this application. The electronic device can be a computer or a server or other similar device.

[0138] Specifically, the electronic device in this embodiment may include the following structure:

[0139] Controller 1301, such as EC;

[0140] Processor 1302; such as a CPU, the controller 1301 is capable of performing a first function so that the processor 1302 can perform a second function when a preset condition is met;

[0141] The controller 1301 is configured to: upon receiving a startup command, perform a validity verification on target data according to a determined verification method based on the status information of the controller 1201, to obtain a verification result; the target data corresponds at least to firmware data within the controller; if the verification result indicates that the target data is valid, execute the firmware data to control the enable state of the component corresponding to the firmware data.

[0142] It should be noted that the components mentioned here can be internal components of electronic devices, such as fans.

[0143] As can be seen from the above scheme, in the electronic device provided in Embodiment 4 of this application, when the electronic device receives a start command, it performs a legality check on the target data corresponding to at least the firmware data within the controller according to the controller's status information and a determined verification method, thereby obtaining a verification result indicating whether the target data is legal. If the verification result indicates that the target data is legal, the firmware data can be executed to control the enabled state of the component corresponding to the firmware data. Therefore, in this embodiment, firmware data execution is only allowed if the target data corresponding to the firmware data within the controller is legal, ensuring that the corresponding component is in an enabled state, thus avoiding situations where the component cannot be enabled due to illegal firmware data within the controller, such as tampering or attacks.

[0144] It should be noted that the specific implementation of the controller in this embodiment can be referred to the corresponding content above, and will not be described in detail here.

[0145] In addition, this application also provides a storage medium storing computer-executable instructions, which, when loaded and executed by a processor, implement the data processing method as described in any of the preceding claims.

[0146] Taking the controller as the EC in a computer as an example, the technical solution of this application will be illustrated in detail:

[0147] As EC (Electronic Control Center) plays an increasingly important role, it also requires more robust security and self-healing mechanisms. Therefore, it is essential to ensure that the EC's firmware (fw) never crashes, meaning that the EC's firmware cannot be attacked.

[0148] To address the aforementioned problems and the shortcomings of existing solutions, the technical solution proposed in this application includes the following technical implementation:

[0149] First, an OTP area is provided inside the EC chip, so that important data can never be rewritten once the engineering mode is completed.

[0150] For frequently updated EC (EC) firmware, such as fan drive data, ECDSA or an asymmetric signature algorithm is used to sign the data. The signing process is performed on a dedicated security server to ensure absolute security, and the public key for the sign is stored in the OTP (Over-The-Top) area. The EC's boot code needs to use the public key to check the signed EC firmware for correctness. If correct, it executes the new EC data, i.e., executes the verified boot code; otherwise, it executes the recovery mechanism.

[0151] Additionally, the BIOS ROM stores two copies of the EC (Electronic Control Function) data: one primary (ECFW_PRIM) and one backup (ECFW_BK). The primary copy is the area that needs frequent updates (the first memory location), while the backup copy is the area that cannot be rewritten after factory installation (the second memory location). If the data in the primary copy is corrupted, the data in the backup copy is copied to the primary copy area, and then the process is restarted. Figure 14 , Figure 15 and Figure 16 The specific implementation plan is as follows:

[0152] like Figure 14 As shown:

[0153] 1. The EC's boot code begins executing the ECFW loader function, which loads ECFW_ACT from ROM into eflash;

[0154] 2. The ECFW loader checks if ECFW_ACT, i.e., the target data, exists in eflash (EC's ROM). If it is found, it starts verifying ECFW_ACT.

[0155] 3. If the verification is successful, ECFW_ACT will be executed, which means executing the firmware data corresponding to the target data;

[0156] 4. If the verification fails, erase the ECFW signature and restart.

[0157] Furthermore, such as Figure 15 As shown:

[0158] 1. EC begins executing the ECFW loader;

[0159] 2. The ECFW loader searches for ECFW_ACT in eflash. If ECFW_ACT is not found in eflash, proceed to step 3.

[0160] 3. EC finds the address of the first memory location ECFW_PRIM pointed to by ECFW_pointer in the BIOS Descriptor;

[0161] 4. The EC verifies the stored ECFW_ACT in ECFW_PRIM;

[0162] 5. If the data in ECFW_PRIM is valid, then load ECFW_ACT from ECFW_PRIM into eflash; if the validation fails, it indicates that the data in ECFW_PRIM is corrupted, and proceed with the subsequent steps, such as... Figure 16 As shown in the image.

[0163] Furthermore, such as Figure 16 As shown, continue Figure 14 Step 2 or Figure 15 In step 5, if ECFW_ACT is not found in eflash, or the ECFW_ACT check in ECFW_PRIM is invalid:

[0164] 1. The ECFW loader begins verifying ECFW_BK, i.e., the backed-up ECFW;

[0165] Among them, if in Figure 14 An error occurred during step 4 of the process to find the ECFW_ACT. An erased ECFW signature can also prevent the ECFW_ACT from being found. In this case, execution can still begin. Figure 16 Step 1 in the process;

[0166] 2. If the ECFW_BK verification is successful, copy the backed-up data in ECFW_BK to the ECFW_PRIM area and proceed to step 3. If the ECFW_BK verification fails, set the flag bit to set EC to the rolling state. Thus, EC will re-backup according to the flag bit the next time it powers on.

[0167] 3. EC restart, after which a new boot process will begin.

[0168] If the backup ECFW also fails to verify, the ECFW will set a flag, then fail to boot, restart, and start a new boot process. The flag is used by the EC to back up updated data after the restart.

[0169] Additionally, in ECFW update scenarios, the backup ECFW can be updated via BIOS during release or via EC boot code in G3 mode. And it will never be updated after SS. Figure 17 As shown:

[0170] Back up the EC update conditions and follow these steps:

[0171] 1. The host notifies the EC via the internal integrated southbridge PCH (Platform Controller Hub): ECFW_PRIM has been updated;

[0172] 2. System startup power-down sequence;

[0173] 3. EC verifies the updated ECFW_PRIM(new);

[0174] 4. Backup ECFW_PRIM(new) to ECFW_BK;

[0175] 5. EC checks whether the backup process is complete;

[0176] 6. The EC removes its EC signature from the header, and the EC is reset;

[0177] 7. When the EC loader cannot find the EC signature in the header, the ECFW loader loads ECFW_PRIM into eflash.

[0178] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.

[0179] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0180] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0181] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A control method, comprising: When the electronic device receives a start command, the target data is validated according to the controller's status information and a determined verification method to obtain the validation result; The target data corresponds at least to the firmware data within the controller, and the firmware data includes control data for at least one of the following in the electronic device: fan, keyboard, touch control, mouse, camera, microphone, or speaker; If the verification result indicates that the target data is valid, the firmware data is executed, and the component corresponding to the firmware data is controlled to enter the enabled state, so as to drive the corresponding component to run according to the running rules corresponding to the firmware data; The components include at least one of a fan, keyboard, touch control, mouse, camera, microphone, or speaker in an electronic device.

2. The method according to claim 1, wherein the target data is validated according to a determined verification method based on the controller's status information to obtain a verification result, comprising: The target data is searched within the controller's own first storage area to obtain the controller's status information; If the status information indicates that the target data exists in the first storage area, the target data is validated for legality according to the first verification method to obtain the verification result; And / or, If the status information indicates that the target data is not present in the first storage area, the target data is validated for legality in the second storage area corresponding to the boot system of the electronic device according to the second verification method to obtain the verification result.

3. The method according to claim 2, after performing legality verification on the target data according to the first verification method to obtain the verification result, the method further includes: If the verification result corresponding to the first verification method indicates that the target data is invalid, delete the target data in the first storage area; And / or, The electronic device is controlled to restart, so that when the electronic device receives a restart command again, the target data is validated in the second storage area corresponding to the boot system of the electronic device according to the second verification method to obtain a verification result.

4. The method according to claim 2 or 3, after verifying the legality of the target data in the second storage area corresponding to the boot system of the electronic device according to the second verification method to obtain the verification result, the method further includes: If the verification result corresponding to the second verification method indicates that the target data is valid, the target data in the second storage area is loaded into the first storage area.

5. The method according to claim 4, further comprising: If the verification result corresponding to the second verification method indicates that the target data is abnormal, the backup data is verified for legality in the second storage area corresponding to the boot system of the electronic device according to the second verification method to obtain the verification result; In this second storage area, the target data is located in the first storage location, and the backup data corresponds to the target data and is located in the second storage location within the second storage area.

6. The method according to claim 5, after performing a validity check on the backup data in the second storage area corresponding to the boot system of the electronic device according to the second verification method to obtain a verification result, the method further includes: If the verification result corresponding to the backup data indicates that the backup data is invalid, a flag is set, and the flag prompts the controller to perform backup processing on the target data on the next startup.

7. The method according to claim 5, after performing a validity check on the backup data in the second storage area corresponding to the boot system of the electronic device according to the second verification method to obtain a verification result, the method further includes: If the verification result corresponding to the backup data indicates that the backup data is valid, the target data in the first storage location is restored using the backup data in the second storage location and loaded into the first storage area.

8. The method according to claim 5, further comprising: If updated target data is obtained, the updated target data is validated for legality. If the updated target data is valid, the updated target data is backed up to the second storage location in the second storage area to update the backup data in the second storage location.

9. The method according to claim 2, wherein the target data includes at least signature data corresponding to the firmware data, and the signature data is obtained by encrypting the signature string corresponding to the firmware data using a private key; in, The target data is validated according to the first validation method to obtain the validation result, including: The signature data in the target data is decrypted using the public key corresponding to the private key to obtain the decrypted string; Based on the decrypted string, a verification result is obtained. If the decrypted string matches a preset fixed string, the verification result indicates that the target data is legitimate. The public key is stored in a third storage area in the controller, and the third storage area is a non-writable area.

10. A control device, comprising: The data verification unit is used to verify the legality of target data according to a determined verification method based on the controller's status information when a start command is received, so as to obtain the verification result. The target data corresponds at least to the firmware data within the controller, and the firmware data includes control data for at least one of the following in the electronic device: fan, keyboard, touch control, mouse, camera, microphone, or speaker; The data execution unit is used to execute the firmware data and control the component corresponding to the firmware data to enter the enabled state if the verification result indicates that the target data is valid, so as to drive the corresponding component to run according to the running rules corresponding to the firmware data. The components include at least one of a fan, keyboard, touch control, mouse, camera, microphone, or speaker in an electronic device.

Citation Information

Patent Citations

  • Information processing method, electronic equipment and computer storage medium

    CN112099855A