A method and system for screening root causes of IoT firmware faults based on instruction behavior

Through a fault root cause screening method based on command behavior, backward taint analysis and binary disassembly technology are used to select assembly instructions related to IoT firmware faults, solving the problems of high false alarm rate and lack of semantics in the existing technology, and improving Accuracy and efficiency of failure analysis.

CN118524003BActive Publication Date: 2024-09-27ZHEJIANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410995403.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2024-09-27
Estimated Expiration
2044-07-24

AI Technical Summary

Technical Problem

Existing technologies cannot effectively analyze the root causes of IoT firmware failures, especially due to the lack of program semantics and difficulty in analyzing data flows, which results in a high false alarm rate and the inability to prioritize fault-related instructions, affecting the fault location efficiency of security auditors.

Method used

Adopt a fault root cause screening method based on command behavior, execute crash test samples by re-hosting IoT firmware, collect memory access and command execution information, combine backward taint analysis and binary disassembly, optimize loop conditions and data-related memory reads Write instructions, calculate the comprehensive suspicion value of each instruction, and obtain the assembly instruction sequence related to the fault after sorting.

Benefits of technology

It improves the accuracy and repair efficiency of IoT firmware fault analysis, reduces the time overhead of security auditors to manually confirm the root cause of faults, has good scalability, and is suitable for multiple scenarios and multiple fault types.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118524003B
    Figure CN118524003B
Patent Text Reader

Abstract

The present invention discloses a method and system for screening root causes of IoT firmware faults based on instruction behavior, and belongs to the field of IoT firmware fault location. The method comprises: simulating and running IoT firmware based on the crash test sample, collecting the state information of assembly instruction execution in IoT firmware during the operation; performing backward taint analysis based on the collected state information to obtain a set of polluted instructions; performing disassembly analysis to obtain instruction behavior information of IoT firmware, and calculating the comprehensive suspicion value of each polluted instruction in the polluted instruction set; reordering the polluted instruction set according to the reverse order of assembly instruction execution and the size of the comprehensive suspicion value, and obtaining a preferred instruction sequence after sorting, so as to troubleshoot the root cause of IoT firmware faults. The method and system for screening root causes of IoT firmware faults based on instruction behavior designed by the present invention can effectively reduce the time cost of security auditors manually analyzing the root cause of faults and improve the efficiency of fault repair.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of IoT firmware fault locating, and in particular to a method and system for screening root causes of IoT firmware faults based on instruction behavior. Background Art

[0002] The firmware of IoT devices plays a vital role in the IoT ecosystem. IoT firmware is the software embedded in the device hardware that provides the device's operating system and control logic, ensuring that the device can operate as designed. For example, in a smart home device, the firmware is responsible for controlling sensors, actuators, and communication modules, enabling the device to interact with other devices and systems.

[0003] However, program defects are inevitable in the development of IoT firmware, which leads to firmware crashes. Root cause analysis is an important task to ensure the security and reliability of IoT devices. By analyzing and screening out program instructions that are strongly related to the fault, security auditors can locate the root cause of the firmware crash more efficiently and quickly, thereby repairing program defects in a timely manner and avoiding potential economic losses. Although there are root cause analysis methods for Linux programs, these methods rely on resource-rich operating systems and cannot analyze IoT firmware. In addition, these methods still have the problem of high false positive rates, cannot prioritize instructions that are more related to the root cause of the fault, and cannot help security auditors perform IoT firmware fault analysis.

[0004] The main challenges in designing a root cause screening method for IoT firmware faults are as follows: (1) Lack of program semantics. Most IoT firmware is closed source and lacks source code to help understand the upper-level semantic information of the program. When reverse analyzing the firmware, the analysis level is assembly instructions, and there is usually a lack of symbol tables, making it difficult to debug. (2) The program data flow is difficult to analyze. In order to improve the detection capability, existing root cause analysis work often marks assembly instructions that are weakly related to the fault as vulnerable instructions, so there is an over-marking problem. In actual detection, the number of these instructions is huge, which misleads security auditors in the detection of faults and makes fault analysis tools unusable.

[0005] In summary, there is currently no screening method for root cause analysis of IoT firmware failures. It is important and necessary to design an automated method to select IoT firmware failure-related instructions to help security auditors effectively locate the faulty instructions. Summary of the invention

[0006] In view of the above, the purpose of the present invention is to provide a method and system for screening root causes of IoT firmware faults based on instruction behavior, so as to improve the efficiency of IoT firmware fault repair and enhance the security of IoT devices.

[0007] The method for screening root causes of IoT firmware faults based on instruction behavior of the present invention first uses a re-hosting method to run IoT firmware and execute crash test samples, collects program memory access and instruction execution information during the execution process, obtains the original contaminated instruction set based on a backward taint analysis method, and analyzes the semantic behavior of program instructions in combination with binary disassembly, preferably selects loop condition instructions in the loop structure, and preferably selects memory read and write instructions related to fault data in sequential execution, thereby obtaining assembly instructions related to firmware faults that can help security auditors analyze the root causes of faults, thereby improving the efficiency of IoT firmware fault repair.

[0008] In order to achieve the above object, the specific technical solution adopted by the present invention is as follows:

[0009] On the one hand, the present invention proposes a method for screening root causes of IoT firmware faults based on instruction behavior, comprising the following steps:

[0010] S1: Run the IoT firmware based on the crash test sample simulation. During the running process, the assembly instructions in the IoT firmware are executed, and the state information of the assembly instruction execution is collected. The state information includes the assembly instruction execution, the register information when the fault occurs, and the specific data value, data register information and memory address used for memory reading and writing;

[0011] S2: Perform backward taint analysis based on the collected state information to obtain a set of tainted instructions;

[0012] S3: Perform disassembly analysis on the IoT firmware to obtain instruction behavior information of the IoT firmware, and calculate the comprehensive suspicion value of each contaminated instruction in the contaminated instruction set based on the instruction behavior information;

[0013] S4: reordering the contaminated instruction set according to the reverse order of assembly instruction execution and the size of the comprehensive suspicion value, and obtaining a preferred instruction sequence after sorting. In the preferred instruction sequence, the higher the ranking of the instruction, the greater the probability that it is the root cause of the IoT firmware failure.

[0014] Furthermore, the status information of the assembly instruction execution specifically includes: 1) instruction register information used when the assembly instruction is executed; 2) specific data values, data register information and memory addresses used when reading or writing memory; 3) data register information and instruction register information used when a failure occurs after the assembly instruction is executed.

[0015] Furthermore, in step S3, the instruction behavior information of the IoT firmware includes explicit register read and write information, implicit register read and write information, and address jump information.

[0016] Furthermore, in step S3, the comprehensive suspicion value of each polluted instruction in the polluted instruction set is calculated as follows:

[0017] According to the register information when the assembly instruction is executed in the status information of the assembly instruction execution and the address jump information in the instruction behavior information, the loop execution structure contained in the Internet of Things firmware is analyzed, and the execution flow suspicion values ​​of the assembly instructions constituting the loop execution structure are all set to equal values ​​less than 0, and the execution flow suspicion values ​​of the remaining assembly instructions are all 0; at the same time, for the assembly instructions containing explicit register read and write information and / or implicit register read and write information, the specific data values ​​used for the corresponding memory read and write in the status information of the assembly instruction execution are compared and analyzed with the register information when the fault occurs. If any register read and written contains the same data as any register or memory when the fault occurs, the data flow suspicion value of the assembly instruction is set to an equal value greater than 0, and the data flow suspicion values ​​of the remaining assembly instructions are all 0; for all polluted instructions in the polluted instruction set, the comprehensive suspicion value of each polluted instruction is calculated by combining the execution flow suspicion value and data flow suspicion value of the polluted instruction.

[0018] On the other hand, the present invention also proposes an Internet of Things firmware fault root cause screening system based on instruction behavior, which is used to implement the above-mentioned Internet of Things firmware fault root cause screening method.

[0019] Compared with the prior art, the beneficial effects of the present invention include at least:

[0020] (1) The present invention proposes a binary disassembly instruction behavior analysis method, performs loop execution structure and contamination data analysis on binary firmware without a symbol table, and further proposes execution flow suspicion value and data flow suspicion value indicators, effectively improving the accuracy of IoT firmware fault root cause analysis;

[0021] (2) The present invention uses a sorted list to characterize the root cause of IoT firmware failures, estimates the probability of assembly instructions that are the root cause of the failures by using a comprehensive suspicion value, and selects high-probability assembly instructions, thereby reducing the time spent by analysts to manually confirm the root cause of the failures;

[0022] (3) The present invention has good scalability. For different IoT firmware, it only needs to update the calculation strategy of execution flow suspicion value and data flow suspicion value according to the firmware scenario and key fault type, so as to realize an efficient root cause screening method for multiple scenarios and multiple fault types. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0024] Figure 1 is a flow chart of a method for screening root causes of IoT firmware failures based on instruction behavior provided in this embodiment;

[0025] Figure 2 is a schematic diagram of the disassembly analysis and instruction behavior information acquisition process provided by this embodiment;

[0026] Figure 3 It is a structural diagram of the IoT firmware fault root cause screening system based on instruction behavior provided in this embodiment. DETAILED DESCRIPTION

[0027] To make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific implementation methods described herein are only used to explain the present invention and do not limit the scope of protection of the present invention.

[0028] In view of the shortcomings of the current academic and industrial circles in the root cause analysis of IoT firmware failures, this embodiment provides an IoT root cause screening method and system based on instruction behavior, which realizes the effective optimization and filtering of the root causes of IoT firmware failures, helping analysts to determine the root causes of failures more accurately and efficiently. Specifically, by using the re-hosting method to run the IoT firmware and execute crash test samples, the execution logs such as firmware memory access and instruction execution are collected during the execution process, the original set of contaminated instructions is obtained based on the backward taint analysis method, and the firmware is disassembled to obtain the control flow and data flow semantic information of the instruction execution, and the control flow and data flow suspicion values ​​are comprehensively calculated. The original set of contaminated instructions is reordered, and the assembly instructions related to the firmware failure that can effectively help security auditors analyze the root cause of the failure are optimized, thereby improving the efficiency of IoT firmware fault repair.

[0029] like Figure 1 As shown, the method for screening root causes of IoT firmware faults based on instruction behavior provided in this embodiment includes the following steps:

[0030] Step 1: Run the IoT firmware based on the IoT firmware emulator and collect log information during the execution process.

[0031] IoT firmware is a software program stored inside an IoT hardware device, which is used to drive the IoT hardware device. In the present invention, the IoT firmware in the form of assembly code is simulated and analyzed, and the IoT firmware in the form of assembly code includes multiple assembly instructions. In this embodiment, the collected log information includes memory access, instruction execution, and register information when a fault occurs. The collection method specifically includes the following steps:

[0032] Step 1-1, run the IoT firmware crash test sample and reproduce the fault. The IoT firmware crash test sample is the firmware input data that causes the firmware to crash during the actual operation test of the IoT firmware. Based on the crash test sample, the IoT firmware is simulated and run using an IoT firmware simulator. During the simulation operation of the IoT firmware, the function hook feature is used to monitor several specific operating states during firmware execution, and the function hook is used to execute the callback function to save the status information of the firmware at the current execution time. Specifically, before each assembly instruction of the firmware is executed, the instruction register information used when the assembly instruction is executed is obtained and saved. If the currently executed assembly instruction is a memory read or write instruction, in addition to the instruction register information, the data register information, memory address and specific data value used when the memory is read or written are also obtained and saved; when a fault occurs after the assembly instruction is executed, the data register information and instruction register information used when the fault occurs are obtained and saved.

[0033] In this embodiment, the IoT firmware is the Bluetooth peripheral device firmware Bluetooth_Peripheral_HIDs, and the IoT firmware crash test sample is binary text data. The Bluetooth peripheral device firmware will read, parse and process the binary text data when it is running, so as to realize the data interaction between the Bluetooth peripheral device and the IoT device. During the firmware processing, because the assembly code does not fully check the legality of the binary text data, the firmware accesses the empty address, triggers illegal memory reading and generates a program failure, that is, a firmware crash occurs. In this embodiment, the IoT firmware emulator Unicorn is used to execute the IoT firmware crash test sample. The emulator Unicorn provides a simulation running environment and function hook feature support for the IoT firmware. Through the four specific states of memory reading, memory writing, instruction execution and fault occurrence triggered during the firmware execution, the corresponding callback function is designed in this embodiment to save the status information at the execution time.

[0034] Step 1-2: according to the status information obtained in step 1-1, save it to the execution log.

[0035] Step 2: Perform backward taint analysis and obtain a set of tainted instructions based on the execution logs collected in step 1, including:

[0036] Step 2-1: Construct the use node and definition node according to the status information in the execution log. First, construct the use node and definition node for each assembly instruction in the IoT firmware assembly code. Specifically, for the Instructions with source operands, The source operand is defined as ,initialization The node used by the instruction , where each node uses By registers used for data reading The specific address of the memory read Similarly, for The instruction with a destination operand is The destination operand is defined as ,initialization Definition node of the instruction , where each definition node Registers for data writing The specific address written to the memory constitute.

[0037] Step 2-2, build a use-definition chain based on the use node and the definition node. Specifically, for the sequential execution A sequence of assembly instructions ,when When exist Upstream of the execution flow, exist If the execution flow downstream instruction The value of a source operand in the execution flow of an upstream instruction If a value is assigned to a destination operand, the use node is associated with the definition node.

[0038] In this embodiment, the association means that when two nodes are associated, if the information of one node is known, the information of the other node associated with it can be obtained. By associating the upstream definition node with the downstream use node, a definition-use chain is constructed, and any node on the chain is associated with its upstream definition node and downstream use node.

[0039] Step 2-3, determine the taint sink based on the instruction register information saved in the execution log when the fault occurs, and determine the tainted instruction set through backward taint analysis. Specifically, the taint sink refers to one or more usage nodes in the assembly instructions executed at the time of the fault. When performing backward taint analysis, obtain the associated upstream definition nodes based on the usage nodes in the taint sink, and mark the assembly instructions where these definition nodes are located as tainted instructions. Subsequently, continue to obtain the associated upstream definition nodes based on the usage nodes of these tainted instructions, and mark the assembly instructions where they are located as tainted instructions. Repeat this behavior until the upstream definition node cannot be obtained. At this time, all tainted instructions constitute a tainted instruction set.

[0040] In this embodiment, the contaminated instruction set includes instructions related to IoT faults, which can help security auditors to analyze the root cause of the faults. However, the instruction set at this time contains a large number of potentially irrelevant or weakly relevant instructions, which need to be further optimized through instruction behavior to help security auditors perform manual analysis.

[0041] Step 3: Disassemble and analyze the IoT firmware, obtain the instruction behavior information of the program execution and calculate the comprehensive suspicion value of the contaminated instructions, including:

[0042] Step 3-1, disassemble and analyze the firmware to obtain instruction behavior information executed by the program.

[0043] In this embodiment, the cross-architecture disassembly tool Capstone is used to perform disassembly analysis on the IoT firmware to obtain instruction behavior information of program execution, which includes explicit register read and write information, implicit register read and write information, and address jump information. Specifically, the explicit register refers to: the destination operand or source operand in the instruction of the IoT firmware directly includes the register number, and the register referred to by the register number is the explicit register, and the registers referred to by the register numbers directly included in the destination operand and the source operand are all explicit registers of the instruction. The implicit register refers to: the destination operand or source operand in the instruction of the IoT firmware does not directly include the register number, but the content of the register is also read and written when the instruction is executed. The register is the implicit register, and the registers referred to by the register numbers indirectly included in the destination operand and the source operand are all implicit registers of the instruction. Figure 2 As shown, in this embodiment, the IoT firmware includes Instructions and instruction, In the instruction, the explicit register written to is a general register , the implicit registers read and written are stack registers ,but The instruction behavior information of the instruction is register Write and register Read and write. The address jump means that after the instruction is executed, the program counter Modified situation. For example After the instruction is executed, the program counter The contents of the general register are modified The value of The instruction behavior information of the instruction is the program counter Modified as register It should be noted that Figure 2The firmware assembly code is only used as an example to help researchers in the field further understand the method of the present invention, and does not limit the specific type of assembly instructions analyzed by the method.

[0044] Step 3-2: Analyze the loop execution structure and calculate the execution flow suspicion value based on the instruction behavior information obtained in step 3-1, parse the execution log of step 1-2, calculate the data flow suspicion value based on the specific data values ​​used when reading and writing memory and the data register information when the fault occurs, and finally calculate the comprehensive suspicion value of the contaminated instruction. Specifically, analyze the assembly instruction execution sequence of the IoT firmware based on the instruction register information and address jump information. If there is a sequence of continuously executed instructions, ,in Indicates the same address jump instruction, then the instruction sequence It is called a loop execution structure, and the execution flow suspicion value of each assembly instruction in the loop execution structure is set to the same value. , the execution flow suspicion values ​​of the remaining instructions are all 0. In this embodiment, the execution flow suspicion value of the instruction in the loop execution structure is Set to -1. For instructions that contain explicit register read / write information and / or implicit register read / write information, retrieve the specific data values ​​used when reading and writing memory when the corresponding instruction is executed in the execution log and compare them with the data register information when the fault occurs. If any register read or written contains the same data as any register or memory when the fault occurs, set the data flow suspicion value of the assembly instruction to the same value. , the data flow suspicion values ​​of other instructions are all 0. In this embodiment Set to 100. Finally, for all the polluted instructions in the polluted instruction set obtained in step 2-3, calculate the comprehensive suspicion value of each polluted instruction ,in The number of times the polluted instruction has been executed.

[0045] Step 4: Based on the contaminated instruction set obtained in step 2 and the comprehensive suspicion value obtained in step 3, select the instructions related to the root cause of the fault as the final output result. The specific contents include:

[0046] Step 4-1: For the set of polluted instructions obtained in step 2, the polluted instructions are preliminarily sorted in the reverse order of assembly instruction execution. ,in is the number of instructions in the polluted instruction set, and they are arranged in reverse order as follows: Through the preliminary sorting, instructions closer to where the fault occurs have a higher ranking, and instructions with a higher ranking have higher analysis value.

[0047] Step 4-2, according to the size of the comprehensive suspicion value, re-sort the instruction sequence after preliminary sorting from large to small to obtain the sequence As the optimal instruction sequence related to the root cause of the IoT firmware failure. Assume that the root cause of the IoT firmware failure is located in instruction The probability of , then the comprehensive suspicion value and Positive correlation, that is .

[0048] Finally, the security auditor will check the instructions in the preferred instruction sequence one by one to confirm the root cause of the IoT firmware failure. Without loss of generality, if the root cause of the firmware failure is actually located in Instructions , then only the analysis The root cause of a fault can be confirmed with just one instruction.

[0049] In this embodiment, by sorting the suspicious values, Minimization means that instructions with higher suspicion values ​​are placed at a higher position in the preferred instruction sequence, and have a higher analysis priority when security auditors finally manually analyze and confirm the root cause of the IoT firmware failure, thereby reducing the time cost of manual analysis and improving fault repair efficiency.

[0050] Based on the same inventive concept, the embodiment also proposes an IoT firmware fault root cause screening system based on instruction behavior. Figure 3 As shown, it includes an execution log collection module, a backward taint analysis module, an instruction behavior analysis module and a fault root cause analysis module.

[0051] The execution log collection module is used to run the IoT firmware, collect the status information of the assembly instruction execution and save it in the execution log;

[0052] The backward taint analysis module is used to perform backward taint analysis on the execution log, associate the definition nodes and use nodes of the upstream and downstream of the execution flow, so as to build a definition-use chain, and determine the tainted instruction set based on the definition-use chain;

[0053] The instruction behavior analysis module is used to perform disassembly analysis on the IoT firmware to obtain instruction behavior information, further obtain loop execution structure and instruction reading and writing fault data information, comprehensively calculate the execution flow suspicion value and data flow suspicion value, and calculate the comprehensive instruction suspicion value based on the execution flow suspicion value and data flow suspicion value;

[0054] The fault root cause analysis module is used to preliminarily sort the contaminated instruction set according to the reverse order of assembly instruction execution, and re-sort the preliminary sorting result to obtain the preferred instruction sequence related to the root cause of the IoT firmware fault. Regarding the system in the above embodiment, the specific way in which each unit or module performs the operation has been described in detail in the embodiment of the method, and will not be elaborated here.

[0055] As for the system embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The system embodiment described above is merely illustrative, and the various modules described therein may or may not be physically separated. In addition, the various functional modules in the present invention may be integrated into a processing unit, or each module may exist physically separately, or two or more modules may be integrated into one unit. The above-mentioned integrated modules or units may be implemented in the form of hardware or in the form of software functional units, so as to select some or all of the modules according to actual needs to achieve the purpose of the present application scheme.

[0056] The embodiments described above provide a detailed description of the technical solutions and beneficial effects of the present invention. It should be understood that the above are only specific embodiments of the present invention and are not intended to limit the present invention. Any modifications, supplements and equivalent substitutions made within the scope of the principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for screening root causes of IoT firmware failures based on instruction behavior, characterized in that: The following steps are involved: S1: Run the IoT firmware based on the crash test sample simulation. During the operation, the assembly instructions in the IoT firmware are executed, and the state information of the assembly instruction execution is collected. The state information includes the assembly instruction execution, the register information when the fault occurs, and the specific data value, data register information and memory address used for memory reading and writing; S2: Perform backward taint analysis based on the collected state information to obtain a set of tainted instructions; S3: Perform disassembly analysis on the IoT firmware to obtain instruction behavior information of the IoT firmware, and calculate the comprehensive suspicion value of each contaminated instruction in the contaminated instruction set based on the instruction behavior information; The comprehensive suspicion value of each polluted instruction in the calculation polluted instruction set is specifically: According to the register information when the assembly instruction is executed in the status information of the assembly instruction execution and the address jump information in the instruction behavior information, the loop execution structure contained in the IoT firmware is analyzed, and the execution flow suspicion values ​​of the assembly instructions constituting the loop execution structure are all set to equal values ​​less than 0, and the execution flow suspicion values ​​of the remaining assembly instructions are all 0; at the same time, for the assembly instructions containing explicit register read and write information and / or implicit register read and write information, the specific data values ​​used for the corresponding memory read and write in the status information of the assembly instruction execution are compared and analyzed with the register information when the fault occurs. If any register read and written contains the same data as any register or memory when the fault occurs, the data flow suspicion value of the assembly instruction is set to an equal value greater than 0, and the data flow suspicion values ​​of the remaining assembly instructions are all 0; for all polluted instructions in the polluted instruction set, the comprehensive suspicion value of each polluted instruction is calculated in combination with the execution flow suspicion value and data flow suspicion value of the polluted instruction; The comprehensive suspicion value of each polluted instruction is calculated by combining the execution flow suspicion value and the data flow suspicion value of the polluted instruction. The calculation method is: Their e+d =N×Sus e +Theirs d Among them, Sus e+d is the comprehensive suspicion value of the current pollution instruction, Sus e Sus is the execution flow suspicion value of the current polluted instruction, d is the data flow suspicion value of the current polluted instruction, and N is the number of times the current polluted instruction is executed; S4: reordering the contaminated instruction set according to the reverse order of assembly instruction execution and the size of the comprehensive suspicion value, and obtaining a preferred instruction sequence after sorting. In the preferred instruction sequence, the higher the ranking of the instruction, the greater the probability that it is the root cause of the IoT firmware failure.

2. The method for screening root causes of IoT firmware faults based on instruction behavior according to claim 1, characterized in that: In step S1, the simulation operation adopts the Internet of Things firmware simulator.

3. The method for screening root causes of IoT firmware faults based on instruction behavior according to claim 1, characterized in that: In step S1, the status information of the assembly instruction execution specifically includes: 1) instruction register information used when the assembly instruction is executed; 2) specific data values, data register information and memory addresses used when reading or writing memory; 3) data register information and instruction register information used when a failure occurs after the assembly instruction is executed.

4. The method for screening root causes of IoT firmware faults based on instruction behavior according to claim 1, characterized in that: In step S2, the backward taint analysis is performed based on the collected state information to obtain a set of tainted instructions, specifically: S2.1: construct a use node and a definition node for each assembly instruction, wherein the use node is composed of a data register and a memory address used for memory reading in the assembly instruction, and the definition node is composed of a data register and a memory address used for memory writing in the assembly instruction; S2.2: If there is an upstream-downstream relationship between two instructions in the assembly instruction, and the source operand of the downstream instruction is assigned to the destination operand of the upstream instruction, then the use node of the downstream instruction is associated with the definition node of the upstream instruction, and all associated use nodes and definition nodes and their associated information constitute a use-definition chain; S2.3: According to the register information when the fault occurs in the status information of the instruction execution, the use node of the assembly instruction executed at the time of the fault occurrence is determined as the taint sink, and backward taint analysis is performed based on the taint sink and the use-definition chain to determine the polluted instruction set.

5. The method for screening root causes of IoT firmware faults based on instruction behavior according to claim 4, characterized in that: In step S2.3, the backward taint analysis is performed based on the taint sink and the use-definition chain to determine the set of tainted instructions, specifically: (a) obtaining a definition node associated with the taint sink upstream of the taint sink, and marking the assembly instruction where the definition node is located as a tainted instruction; (b) according to the use node of the marked tainted instruction, obtaining a definition node associated with the use node upstream of the use node, and marking the assembly instruction where the obtained definition node is located as a tainted instruction; (c) Repeat step (b) until no more associated definition nodes can be obtained, and all polluted instructions constitute a polluted instruction set.

6. The method for screening root causes of IoT firmware faults based on instruction behavior according to claim 1, characterized in that: In step S3, the instruction behavior information of the IoT firmware includes explicit register read and write information, implicit register read and write information, and address jump information.

7. The method for screening root causes of IoT firmware faults based on instruction behavior according to claim 1, characterized in that: In step S4, the reordering of the polluted instruction set according to the reverse order of assembly instruction execution and the size of the comprehensive suspicion value is specifically as follows: The polluted instruction set is first preliminarily sorted according to the reverse order of assembly instruction execution, and the preliminary sorting result is then re-sorted from large to small according to the comprehensive suspicion value, and the re-sorted instruction sequence is the preferred instruction sequence.

8. A system for screening root causes of Internet of Things firmware faults based on instruction behavior, used to implement the method for screening root causes of Internet of Things firmware faults according to claim 1, characterized in that: The system comprises: An execution log collection module is used to simulate the running firmware and collect the status information of the assembly instruction execution; A backward taint analysis module, used to perform backward taint analysis based on the collected state information to obtain a set of tainted instructions; An instruction behavior analysis module is used to perform disassembly analysis on IoT firmware, obtain instruction behavior information, and calculate the comprehensive suspicion value of each contaminated instruction in the contaminated instruction set based on the instruction behavior information; The fault root cause analysis module is used to reorder the polluted instruction set according to the reverse execution order of the assembly instructions and the comprehensive suspicion value to obtain the optimal instruction sequence.