Resource decoupling-oriented domain name system authority engine automatic verification method

By generating the control flow graph and effect tree of the DNS authoritative engine, splitting the function digest into individual state values, and performing real-time function digest optimization and verification, the problem of excessive manual operation in the automated verification of the DNS authoritative engine is solved, and efficient automated verification is achieved.

CN120950418BActive Publication Date: 2026-01-27PEKING UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511492445.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-20
Publication Date
2026-01-27
Estimated Expiration
2045-10-20

AI Technical Summary

Technical Problem

Existing technologies for automated verification of DNS authoritative engines require the design of layered schemes, the development of numerous manual specifications, and the execution of layered verification, resulting in low verification efficiency.

Method used

By acquiring the target code and top-level specification of the DNS authoritative engine, a control flow graph is generated and the tree of the effect is obtained. The function digest is divided into multiple individual specific state values, and the state value verification, symbolic region processing and redundant information processing of the instantaneous function digest are performed. The top-level specification is used for automated verification.

Benefits of technology

It improves the automation level of DNS authoritative engine automated verification, reduces manual operation, and improves verification efficiency and accuracy, making it suitable for production practice.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120950418B_ABST
    Figure CN120950418B_ABST
Patent Text Reader

Abstract

The application discloses a resource decoupling-oriented DNS authority engine automatic verification method, relates to the technical field of software testing, and comprises the following steps: obtaining target code of a DNS authority engine and a top specification; generating a control flow graph according to an execution path of the target code; obtaining a tree of effects corresponding to the target code according to the control flow graph; obtaining a function summary corresponding to the target code according to the tree of effects; dividing a merge state in the function summary into a plurality of single specific state values; obtaining an instant function summary; optimizing the instant function summary; and automatically verifying the instant function summary obtained through optimization by using the top specification, so as to capture program invariants caused by dependence of the DNS authority engine on domain name region configuration through the instant function summary, improve the automation degree of layered verification, decouple the specific implementation of the DNS authority engine, and have high usability and can be widely used in production practice.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of software testing technology, and more specifically, to an automated verification method for a domain name system authority engine oriented towards resource decoupling. Background Technology

[0002] The application scale of distributed machine learning is increasing daily, and its functions are becoming more complex. Many applications adopt resource-decoupled architectures, placing higher demands on the security and reliability of the underlying network. Among these applications, DNS (Domain Name System) plays a crucial role in the normal operation of the network. It provides domain name resolution services, converting readable domain names into IP (Internet Protocol) addresses, thereby enabling access to online services. The core of the DNS system is the authoritative engine, which is responsible for matching received DNS queries with locally configured authoritative DNS zone records and generating corresponding DNS responses. For cloud service providers and network operators that need to maintain different authoritative engine implementations, ensuring the correctness of the authoritative engine is crucial; given a zone configuration, the authoritative engine should be able to generate the correct response for any query.

[0003] However, ensuring the correctness of the authoritative DNS engine is an extremely challenging task, requiring comprehensive analysis at the code implementation level. Any form of such analysis is hampered by the complex logic of the authoritative engine handling multiple DNS record types, the highly optimized and customized code implementation, and the sheer size of the codebase (for example, in Bind 9 (Berkeley Internet Name Domain 9, the 9th version of the Berkeley Domain Name System), approximately 10,000 lines of code are related to domain name resolution).

[0004] In related technologies, automated verification-based schemes have been proven effective for ensuring the correctness of complex software. This approach decomposes the target software into smaller layers and performs overall correctness verification by verifying each layer's conformity to the corresponding specifications. However, this method is often highly reliant on manual intervention because scaling verification to large-scale real-world software often requires introducing additional specifications, a process that consumes significant manpower and necessitates expert involvement.

[0005] In automated verification schemes, manual specification for some layers is replaced with function summarization. However, this method still relies heavily on manual specification. Specifically, users first need to design refinement layers, dividing code modules into different layers, defining abstraction domains for each layer, and deciding which layers to handle manually (because function summarization cannot provide sufficiently concise representations for these layers). Then, users need to develop manual specifications for these manually processed layers to provide sufficient abstraction for further verification. Finally, users run automated verification tools (such as symbolic executors) to complete the proofs in a bottom-up order. It is worth noting that the function summaries for each layer are generated ahead of time. Therefore, users need to pre-design the proof method before actually running the verification tool, providing appropriate specifications for that layer to assist in logical abstraction, or the verifier can generate complete function summaries directly without making any assumptions.

[0006] Therefore, the related technologies require the design of layered schemes, the development of a large number of manual specifications, and the execution of layered verification during the automated verification process, which involves a lot of manual operations and results in low verification efficiency. Summary of the Invention

[0007] This application aims to provide an automated verification method for authoritative domain name systems oriented towards resource decoupling. It seeks to address the problem that related technologies require designing layered schemes, developing numerous manual specifications, and performing layered verification during the automated verification process, resulting in a large amount of manual operation and thus low verification efficiency.

[0008] This application provides an automated verification method for a domain name system authority engine oriented towards resource decoupling, including:

[0009] Obtain the target code and the top-level specification; wherein, the target code represents the Domain Name System (DNS) authority engine code, and the top-level specification represents the expected correct implementation of the DNS authority engine;

[0010] Based on the execution path of the target code, a control flow graph is generated, and a tree of the effects corresponding to the target code is obtained based on the control flow graph;

[0011] Based on the tree of the effects corresponding to the target code, obtain the function summary corresponding to the target code, and divide the merged state in the function summary into multiple individual specific state values ​​to obtain an instantaneous function summary; wherein, the merged state represents the state in which the variable has multiple values;

[0012] The instantaneous function digest is subjected to state value verification, symbolic region processing, and redundant information processing to obtain an optimized instantaneous function digest.

[0013] Based on the aforementioned top-level specification, the optimized instantaneous function digest is automatically verified to obtain the automated verification result corresponding to the Domain Name System authoritative engine.

[0014] In one possible implementation, the step of generating a control flow graph based on the execution path of the target code, and obtaining a tree of the effects corresponding to the target code based on the control flow graph, includes:

[0015] Based on the control flow graph, the root node corresponding to the target code is determined;

[0016] Based on the root node corresponding to the target code, the control flow graph is traversed using depth-first search symbolic execution to generate other effect nodes, thus obtaining the tree of effects corresponding to the target code.

[0017] In one possible implementation, obtaining the function summary corresponding to the target code based on the tree of effects corresponding to the target code includes:

[0018] Based on the tree of the described effect, each path from root to leaf is used as the target path for constructing the function summary;

[0019] For any target path, execution starts from the root node, and the data related to the preset unified state model for each function on the target path is obtained to obtain the function summary corresponding to the target path.

[0020] Traverse all target paths to obtain the function digest corresponding to the target code. The function digest corresponding to the target code includes the function digests corresponding to all target paths.

[0021] In one possible implementation, it also includes:

[0022] If the target code contains recursive functions, the control flow graph of the recursive functions is merged into the control flow graph corresponding to the caller to obtain a merged control flow graph, and the tree of the effect corresponding to the target code is obtained based on the merged control flow graph;

[0023] Based on the tree of effects corresponding to the target code, obtain the function summary corresponding to the target code, including:

[0024] Based on the tree of the effects corresponding to the target code obtained from the merged control flow graph, a function summary corresponding to the target code is obtained; the function summary corresponding to the target code includes the function summary corresponding to the recursive function.

[0025] In one possible implementation, the process of executing from the root node for any target path, obtaining data related to a preset unified state model for each function on the target path, and obtaining a function summary corresponding to the target path includes:

[0026] When a function call is encountered, the digest construction status of the called function is determined; wherein, the digest construction status includes a constructed digest and a non-constructed digest;

[0027] If the digest construction status of the called function is that a digest has been constructed, the function digest of the called function is invoked, and the function digest corresponding to the target path is obtained based on the function digest of the called function.

[0028] If the function summary of the called function is not constructed, a function summary of the called function is constructed, and the function summary corresponding to the target path is obtained based on the function summary of the called function.

[0029] In one possible implementation, the step of dividing the merged state in the function digest into multiple individual specific state values ​​to obtain an instantaneous function digest includes:

[0030] The merged state in the function summary is divided into multiple individual specific state values;

[0031] For each specific state value, the merged state in the corresponding function digest is replaced with the specific state value to obtain the instantaneous function digest;

[0032] For the unsegmented function digest, the original function digest is used as the instantaneous function digest.

[0033] In one possible implementation, the step of performing state value verification, symbolic region processing, and redundant information processing on the instantaneous function digest to obtain an optimized instantaneous function digest includes:

[0034] The instantaneous function digest is subjected to state value verification to determine the instantaneous function digest verification result; wherein, the instantaneous function digest verification result includes verification success or verification failure;

[0035] If the instantaneous function digest verification fails, the instantaneous function digest will be regenerated.

[0036] If the instantaneous function digest verification result is successful, the instantaneous function digest is subjected to symbolic region processing to obtain a symbolic instantaneous function digest; wherein, the symbolic region processing represents the memory state in the program by symbolic representation.

[0037] The symbolized instantaneous function digest is subjected to digest encoding optimization processing to obtain an optimized instantaneous function digest; wherein, the digest encoding optimization processing represents the processing of removing useless nodes and removing duplicate data.

[0038] In one possible implementation, the symbolic region processing of the instantaneous function digest to obtain a symbolicated instantaneous function digest includes:

[0039] The symbolic regions are replaced with symbolic regions to obtain the symbolic instantaneous function digest.

[0040] In one possible implementation, the step of performing digest encoding optimization processing on the symbolized instantaneous function digest to obtain an optimized instantaneous function digest includes:

[0041] Remove the hypothetical nodes that have no feasible sibling nodes from the symbolized instantaneous function summary to obtain the instantaneous function summary after the first processing;

[0042] Recursively compare identical subtrees in the initial instantaneous function digest after the first processing and merge the identical subtrees to obtain the optimized instantaneous function digest.

[0043] In one possible implementation, it also includes:

[0044] Execute the stub function set before the target function in the target code, and interpret the return value of the stub function as the additional path constraint corresponding to the target function to obtain the target code with added constraints;

[0045] Based on the target code after adding constraints, the merged state in the function summary is divided into multiple individual specific state values ​​to obtain the instantaneous function summary.

[0046] Beneficial effects:

[0047] This application provides a resource-decoupled automated verification method for DNS authority engines. The method includes: first, obtaining the target code and top-level specification of the DNS authority engine; then, generating a control flow graph based on the execution path of the target code; obtaining a tree of the effects corresponding to the target code based on the control flow graph; next, obtaining a function digest corresponding to the target code based on the effect tree; dividing the merged state in the function digest into multiple individual specific state values; obtaining an instantaneous function digest; optimizing the instantaneous function digest; and then automatically verifying the optimized instantaneous function digest using the top-level specification. This method captures program invariants resulting from the DNS authority engine's dependency on domain zone configuration through the instantaneous function digest, improving the automation level of layered verification, decoupling from the specific implementation of the DNS authority engine, and exhibiting strong usability, making it widely applicable in production practice. Attached Figure Description

[0048] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application 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.

[0049] Figure 1 This is a flowchart of an automated verification method for a domain name system authority engine based on resource decoupling, as proposed in one embodiment of this application;

[0050] Figure 2 This is a flowchart illustrating the process of obtaining a function summary corresponding to the target code according to an embodiment of this application;

[0051] Figure 3 This is a schematic diagram of a unified state model proposed in an embodiment of this application;

[0052] Figure 4 This is a flowchart of real-time state segmentation proposed in an embodiment of this application;

[0053] Figure 5 This is a flowchart illustrating the optimization of an instantaneous function summary according to an embodiment of this application;

[0054] Figure 6 This is a schematic diagram of the structure of an automated verification device for a domain name system authority engine that is oriented towards resource decoupling, according to an embodiment of this application.

[0055] Figure 7 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application;

[0056] Explanation of reference numerals in the attached diagram: 601-Front end, 602-Middle end, 603-Back end, 701-Memory, 702-Processor, 703-Communication bus. Detailed Implementation

[0057] 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, 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.

[0058] In related technologies, the layered verification process for authoritative DNS engines typically involves replacing manual specifications for some layers with function summarization. However, this method still relies heavily on manual specifications. Specifically, users first need to design refinement layers, dividing code modules into different layers, defining abstract domains for each layer, and deciding which layers to handle manually (because function summarization cannot provide a sufficiently concise representation for these layers). Subsequently, users need to develop manual specifications for these manually processed layers to provide sufficient abstraction for further verification. Finally, users run automated verification tools (such as symbolic executors) to complete the proofs in a bottom-up order. It is worth noting that the function summaries for each layer are generated ahead of time; that is, users need to pre-design the proof method before actually running the verification tools—either providing appropriate specifications for that layer to assist in logical abstraction, or the verifier generating a complete function summary without making any assumptions.

[0059] While related technologies have achieved a certain degree of automation in tiered proofs, advance summarization still requires significant manual input in practical applications and is highly dependent on expert participation, specifically in the following three aspects:

[0060] (1) Designing a layered scheme: The mapping from code modules to the verification layer, as well as the specification of the manual layer and its abstract domain, all require professional knowledge of formal verification. For non-professionals, it is difficult to judge the specific impact of the complex logic exposed in a function on the efficiency of the early function summary. In addition, if it is determined that manual specifications need to be written, how to design its abstract domain is not intuitive, especially for the processing of data structures. For example, for the representation of DNS domain names, if a list of strings is used, it may help the development of subsequent verification layers, but additional manual specification constraints need to be written for the domain name-related operations to ensure that the operations of the data structure are well-formed. On the other hand, if a representation with a lower level of abstraction is chosen, although it may be easier to complete the proof of the current layer, it may hinder the subsequent verification process.

[0061] (2) Development of manual specifications: The main human burden in related technologies also comes from the size of the code that needs to be developed manually. Table 1 roughly estimates the proportion of functions that may need to be manually processed in different DNS authority engine implementations. In particular, for Bind 9 implemented in C, its code style focuses on performance and has many low-level details, resulting in a high proportion of manual processing of up to 64%, which indicates that the potential workload for specification development is very large.

[0062] Table 1 Estimation of Function Proportions Requiring Manual Processing

[0063]

[0064] CoreDNS is a high-performance DNS server written in Go, supporting various DNS functions, including forward lookup, reverse lookup, service discovery, and load balancing. PowerDNS is an open-source DNS (Domain Name System) server software developed and maintained by PowerDNS Corporation. It is renowned for its high performance, flexibility, and scalability, supporting multiple backend data storage methods and suitable for both authoritative name server and recursive name server modes.

[0065] (3) Performing layered verification: In the bottom-up verification process, the verification of each layer may fail for the following reasons: implementation has vulnerabilities, the specification is not well written, or path explosion occurs in the summary process. For the latter two cases (which are dominant in real applications), it is necessary to make fine adjustments to the division of layers, the design of abstract domains, and manual specifications, thereby introducing more manual input.

[0066] In view of this, this application proposes an automated verification method for a DNS authority engine with resource decoupling. The method includes: first, obtaining the target code and top-level specification of the DNS authority engine; then, generating a control flow graph based on the execution path of the target code; obtaining the tree of the effects corresponding to the target code based on the control flow graph; then, obtaining the function digest corresponding to the target code based on the tree of effects; dividing the merged state in the function digest into multiple individual specific state values; obtaining an instantaneous function digest; optimizing the instantaneous function digest; and then automatically verifying the optimized instantaneous function digest using the top-level specification. By using the instantaneous function digest to capture the program invariants brought about by the DNS authority engine's dependence on domain name zone configuration, the automation level of layered verification is improved. This method is decoupled from the specific implementation of the DNS authority engine, has strong usability, and can be widely used in production practice.

[0067] The core idea of ​​instantaneous function digests (IFDs) is to encode only the logic relevant to verification, rather than blindly collecting all code paths in advance. This is based on two observations: First, DNS authoritative engines rely on pre-configured DNS zones during runtime. These zones provide rich invariants during operation, specifically fixed function parameters, constant memory, and well-structured data structures. Second, DNS's domain-specific semantics typically benefit from these invariants, enabling streamlined execution paths and simplifying function digest generation. For example, when comparing domain names using the DNS specification's domain name representation, if one of the domain names is a fixed constant, the function digest encoding of the comparison logic can be significantly simplified. Therefore, IFDs are particularly suitable for verifying the correctness of DNS authoritative engines. The IFD technology proposed in this application makes digest generation more efficient, allowing function digests to be applied to the entire process of hierarchical verification, achieving hierarchical verification with high accuracy while reducing manual input.

[0068] Please refer to Figure 1 The flowchart illustrates an automated verification method for a domain name system authority engine oriented towards resource decoupling, as provided in this application embodiment. The method includes:

[0069] S101. Obtain the target code and top-level specification. The target code represents the DNS authority engine code, and the top-level specification represents the expected correct implementation of the DNS authority engine.

[0070] Both the target code and the top-level specification can be pre-stored data or data input by the user through human-computer interaction. To facilitate subsequent data processing, the target code is provided in LLVM (Low Level Virtual Machine) intermediate representation, and the top-level specification is provided in spec language.

[0071] After obtaining the target code and top-level specification, you can also check the target code and top-level specification to ensure that the target code is provided in LLVM intermediate representation and the top-level specification is provided in spec language. If the formal requirements are not met, feedback information that does not meet the formal requirements can be generated so that the user can re-enter the target code and top-level specification.

[0072] S102. Generate a control flow graph (CFG) based on the execution path of the target code, and obtain the tree of the effect corresponding to the target code based on the control flow graph.

[0073] A control flow graph (CFB) is a graphical representation used to describe the execution path of instructions in a program. In a CFB, nodes typically represent basic blocks of code—a series of continuous, uninterrupted instructions. Edges represent control transfers between these basic blocks, such as jumps, calls, or return statements. CFB clearly shows the program's execution path, helping developers understand code structure and perform program analysis, optimization, and debugging. Therefore, a control flow graph can be generated based on the execution path of the target code.

[0074] Building upon the control flow graph, an effect tree can be further constructed. The effect tree is a tree-structured model used to illustrate the causal relationship between the goal and the implementation path. This decomposes complex problems into multi-level, multi-node causal chains, facilitating the extraction of immediate function summaries.

[0075] S103. Based on the tree of effects corresponding to the target code, obtain the function summary corresponding to the target code, and divide the merged state in the function summary into multiple individual specific state values ​​to obtain the instantaneous function summary. The merged state represents the state where a variable has multiple values.

[0076] Each path in the tree of the effect corresponding to the target code, from the root to the leaf, represents a possible execution path of a function. We can first take the path from the root to the leaf of the effect tree as the target path, and then perform a summary extraction process on each target path to obtain the function summary corresponding to each target path. During the process of obtaining the function summary, we can perform real-time state segmentation, that is, split the merged state in the function summary into multiple individual specific state values, thereby reducing the amount of data processing and avoiding path explosion.

[0077] S104. Perform state value verification, symbolic region processing, and redundant information processing on the instantaneous function digest to obtain the optimized instantaneous function digest.

[0078] Although an instantaneous function digest has been obtained, it may still contain some redundant information or fail to meet the requirements, which may cause the subsequent instantaneous function digest to fail to accurately reflect the correctness of the target code. Therefore, state value verification, symbolic region processing, and redundant information processing can be performed on the instantaneous function digest to improve its accuracy.

[0079] State value verification can be performed as follows: if the state value at the time of application digest matches the state value at the time of digest generation, the verification is considered successful, and symbolic region processing and redundant information processing can continue. If the verification fails, the instantaneous function digest can be regenerated. Symbolic region processing involves representing the memory state in the program using symbols, enabling more efficient instantaneous function digest processing. Redundant information processing involves removing duplicate and redundant data from the instantaneous function digest and converting it into an encoding form more conducive to verification.

[0080] S105. Based on the top-level specifications, perform automated verification on the optimized instantaneous function digest to obtain the automated verification results corresponding to the domain name system authoritative engine.

[0081] Top-level specifications refer to artificial specifications that can be used to verify the optimized instantaneous function summary, thereby determining the correctness of the optimized instantaneous function summary.

[0082] For example, the top-level specification describes the ideal behavior of the DNS authority engine. The immediate function digest of the top-level specification can be obtained, and then the optimized immediate function digest is compared with the immediate function digest of the top-level specification to determine whether the actual output of the target code meets the ideal behavior. If the optimized immediate function digest does not meet the ideal behavior, it will be considered to have a vulnerability. That is, the vulnerability will manifest as branches with unequal results, thus achieving automated verification of the target code.

[0083] This application provides an automated verification method for a domain name system (DNS) authority engine based on resource decoupling. This method enables automated acquisition of instantaneous function digests without requiring manual layering of the target code, significantly improving automation and efficiency. Furthermore, it performs state value verification, symbolic region processing, and redundant information processing on the instantaneous function digest, effectively reducing data processing volume, avoiding path explosion and the impact of redundant information on verification results, and improving the accuracy of automated verification.

[0084] In one possible implementation, a control flow graph is generated based on the execution path of the target code, and a tree representing the effect corresponding to the target code is obtained based on the control flow graph, including:

[0085] Based on the control flow graph, the root node corresponding to the target code is determined.

[0086] Based on the root node corresponding to the target code, symbolic execution using depth-first search is used to traverse the control flow graph, generating other effect nodes to obtain the tree of effects corresponding to the target code.

[0087] The tree of effects constructed in this application has one possible execution path for each path from the root to the leaf.

[0088] During symbolic execution, which performs a depth-first search of the control flow graph, other effect nodes gradually grow on the summary tree: An Assume node is generated when any branch instruction is executed. A Return node is generated when a function returns, recording the newly allocated heap region Malloc, the freed heap region Free, the memory write operation Store, and the function return value. A Panic node is generated when an illegal operation (such as out-of-bounds access) occurs.

[0089] When executing any branch instruction, during the generation of the Assume node, the constraints of the function summary are updated based on the constraints of the branch node, that is, the constraints of the branch node are added to the constraints of the function summary.

[0090] Please refer to Figure 2 This is a flowchart illustrating the process of obtaining a function summary corresponding to the target code, as provided in an embodiment of this application. Figure 2 As shown, based on the tree of effects corresponding to the target code, a function summary corresponding to the target code is obtained, including:

[0091] S201. Based on the tree of effects, use each path from the root to the leaf as the target path for constructing the function summary.

[0092] S202. For any target path, execute from the root node to obtain the data related to the preset unified state model for each function on the target path, and obtain the function summary corresponding to the target path.

[0093] For example, embodiments of this application provide the following: Figure 3The unified state model shown uses two types of states: ValueState and MemoryState. ValueState represents the value state and can take the following forms: %ident represents a local symbol used to identify identifiers in local scopes (such as function variable names, local variable names, etc.); @ident represents a global symbol used to identify identifiers in global scopes (such as function names, global variable names, etc.). MemoryState represents the memory state, represented by Region::int; where Region represents a region and int represents the offset within that region. Regions can take the following forms: Stack region, in the form @func_ident (identifier of the function belonging to the stack); Global region, in the form @ident (global region identifier); Constant region, in the form %ident (constant region identifier); Heap region, in the form %ident (heap region identifier).

[0094] The unified state model provided in this application is used to maintain the abstract domain of all layers throughout the verification process and provides a unified interface for function summaries. Unlike existing related technologies, the function summaries provided in this application are applied to all layers in the verification process. Therefore, this application adopts a unified state model instead of temporary abstract domains designed layer by layer, thereby reducing the complexity of the verification layer design. Unlike existing related technologies, this application tracks the layout of memory regions with precision down to the scalar level. This layout information is calculated using LLVM's data layout string. This method has lower overhead than byte-based addressing and is more flexible than existing related technologies (such as DNS-V) typed memory, which often cannot correctly handle LLVM memory alias access and untyped memory access. In addition, this application also distinguishes between stack, heap, global, and constant memory regions and tracks the lifecycle of each region to accurately model complex memory management behaviors such as memory leaks.

[0095] Compared with existing related technologies, the embodiments of this application only require verification using the top-level specification, eliminating the need to write manual specifications for each layer of function summaries, thus greatly reducing manual input. The embodiments of this application perform top-down symbolic execution on the target code (provided in LLVM intermediate representation form), and aggregate the path constraints and side effects obtained during execution into the target function summary. A unified state model is used as the abstract domain for all function summaries and manual specifications. After obtaining the target function summary, the need for additional expert knowledge in the layered verification design can be eliminated.

[0096] S203. Traverse all target paths to obtain the function summary corresponding to the target code. The function summary corresponding to the target code includes the function summaries corresponding to all target paths.

[0097] In one possible implementation, the process of obtaining the function summary corresponding to the target path further includes:

[0098] When the target code contains recursive functions, the control flow graph of the recursive functions is merged into the control flow graph of the caller to obtain a merged control flow graph. The tree of the effect corresponding to the target code is then obtained based on the merged control flow graph.

[0099] Based on the tree of effects corresponding to the target code, obtain the function summary corresponding to the target code, including:

[0100] Based on the tree of effects corresponding to the target code obtained from the merged control flow graph, obtain the function summary corresponding to the target code. The function summary corresponding to the target code includes the function summary corresponding to the recursive function.

[0101] In one possible implementation, for any target path, execution starts from the root node, and the process of obtaining data related to a preset unified state model for each function on the target path to obtain a function summary corresponding to the target path includes:

[0102] When a function call is encountered, the digest construction status of the called function is determined. The digest construction status includes whether a digest has been constructed or not.

[0103] If the digest of the called function is already constructed, the function digest of the called function is invoked, and the function digest corresponding to the target path is obtained based on the function digest of the called function.

[0104] If the function digest of the called function is not constructed, construct the function digest of the called function and obtain the function digest corresponding to the target path based on the function digest of the called function.

[0105] In the absence of any function calls or recursive functions, a function summary is constructed based on the unified state model.

[0106] Please refer to Figure 4 This is a flowchart of real-time state segmentation provided in an embodiment of this application. Figure 4 As shown, the merged state in the function digest is divided into multiple individual specific state values ​​to obtain the instantaneous function digest, including:

[0107] S401. Divide the merged state in the function summary into multiple individual specific state values.

[0108] S402. For each specific state value, replace the merged state in the corresponding function summary with the specific state value to obtain the instantaneous function summary.

[0109] S403. For unsegmented function summaries, the original function summaries are used as instantaneous function summaries.

[0110] For example, in order to capture the invariants brought about by domain name zone configuration, the instantaneous state segmentation method in this application segmentes the merged state, and instantaneous state segmentation can be performed during the process of obtaining the function digest. Instantaneous state segmentation itself is a commonly used symbolic execution optimization technique, which divides a single execution path into multiple disjoint paths and adds additional constraints to each path, thereby simplifying the state representation of each path. For example, suppose there is a program: if(x<0){x=0;}else{x=5;}, the merged state (true,x=ite(x<0,0,5)) of this program can be split into two states: (x<0,x=0) and (x>=0,x=5). Here, if means if, else means otherwise, x represents a variable, true means logically true, and ite represents a conditional expression.

[0111] Because region invariants have a significant impact on the digest process, DNS authoritative engine verification is particularly well-suited for this technique. This application's embodiments employ a specific form of state segmentation: dividing the state model corresponding to the function digest... The merged state is divided into individual specific values. In this embodiment, state segmentation is performed on-the-spot during digest construction, generating Specialize nodes. These Specialize nodes record the specific values ​​of the corresponding states. For the merged state... The triggering conditions for execution state splitting include: (1) It is used as a pointer offset or array index. (2) It is dereferenced as a pointer. (3) When verifying the state value, The value was compared with the value in the Specialize node. (4) In the stub function, It is marked with the specialize tag by the user.

[0112] Rules (1) and (2) are simple heuristics designed to avoid common path explosion scenarios—memory accesses with symbolic addresses. Rule (3) ensures consistency between immediate digests (see State Value Verification). Rule (4) provides users with the flexibility to fine-grained control over immediate state segmentation behavior.

[0113] To facilitate understanding by those skilled in the art, examples are provided for each node involved in constructing an instantaneous function summary, as shown in Table 2.

[0114] Table 2 Examples of nodes involved in the instantaneous function summary

[0115]

[0116] In Table 2, Effect represents the effect, Definition represents the definition, Example represents an example, Rootplaceholder represents the root placeholder, Path constraint represents the path constraint, JIT state splitting represents JIT state splitting, Runtime error represents runtime error, Binding a return value represents binding a return value, Memory store represents memory storage, Heap allocation represents heap allocation, Heap dealocation represents heap memory release, and the Example column shows specific program examples.

[0117] Please refer to Figure 5 This is a flowchart illustrating the optimization of the instantaneous function summary provided in an embodiment of this application. For example... Figure 5 As shown, the instantaneous function digest (IFD) is processed by state value verification, symbolic region processing, and redundant information processing to obtain an optimized IFD, including:

[0118] S501. Verify the state values ​​of the instantaneous function digest and determine the instantaneous function digest verification result; wherein, the instantaneous function digest verification result includes verification success or verification failure.

[0119] Verifying the state values ​​of an instantaneous function digest essentially refers to the process of performing a specialization check on the instantaneous function digest. Specific checking methods may include:

[0120] During the state value verification process, the corresponding state in the callee's immediate function digest (IFD) is also segmented. Each branch in the IFD protected by a Specialize node is verified successfully only if the context is completely matched (i.e., the state value during the state value verification process is consistent with the state value generated when the IFD was generated). If all Specialize and Assume nodes are successfully passed and the Return node is reached, symbolic execution returns to the caller's control flow graph and execution continues.

[0121] If none of the sibling Specialize nodes match the current state value, it indicates that the current function is being called for the first time in a new context. In this case, this embodiment triggers a process to re-acquire the immediate function digest, then merges the newly acquired immediate function digest with the existing digest, and continues with subsequent steps. The digest merging is achieved by performing a direct depth-first search traversal of the two digest trees and comparing the corresponding nodes.

[0122] By verifying the state value, the callee can be effectively inspected to determine whether an immediate function digest (IFD) corresponding to its current state has been generated. For callees that have not generated an IFD, the process of re-acquiring the IFD is triggered, thereby ensuring the integrity of the IFD.

[0123] By combining instantaneous state segmentation with state value verification, we can not only effectively reduce the amount of data processing and avoid path explosion, but also effectively ensure the integrity of instantaneous function summaries.

[0124] S502. If the instantaneous function digest verification result is a verification failure, regenerate the instantaneous function digest.

[0125] S503. If the instantaneous function digest verification result is successful, perform symbolic region processing on the instantaneous function digest to obtain a symbolic instantaneous function digest. The symbolic region processing represents the memory state in the program using symbols.

[0126] S504. Perform digest encoding optimization on the symbolized instantaneous function digest to obtain an optimized instantaneous function digest. The digest encoding optimization process involves removing useless nodes and duplicate data.

[0127] After verifying the state values ​​of the instantaneous function digest, the generation of the instantaneous function digest is only completed. At this point, there is still a lot of redundant information in the instantaneous function digest. Therefore, symbolic region processing and redundant information processing can be carried out on the instantaneous function digest to improve its accuracy.

[0128] In one possible implementation, the instantaneous function digest is processed by symbolic region processing to obtain a symbolicated instantaneous function digest, including:

[0129] The symbolic instantaneous function digest is obtained by replacing the specific stack and heap regions in the instantaneous function digest with symbolic regions.

[0130] The aforementioned instantaneous state segmentation method has significant shortcomings when handling pointers. Specifically, for pointers pointing to stack or heap regions, segmenting the state based on the exact pointer value leads to overly specific summaries. The generated instantaneous function summaries will only apply to the specific stack or heap region corresponding to the pointer at the time of summary construction, and cannot be applied to cases where the pointer points to any other memory region. To address this issue, this application introduces symbolic regions, i.e., anonymous memory regions, to replace the specific stack or heap regions in the instantaneous function summaries. During the summary construction phase, this application hides the specific stack and heap regions and assigns an incrementing integer identifier to each encountered stack and heap region. During the summary application phase, when applying the Specialize node, this application binds the integer identifier of the symbolic region to the specific memory region, enabling the instantaneous function summaries to be reused across different memory regions.

[0131] This application ensures that the mapping between the symbolic region and the specific stack or heap region is one-to-one, thus avoiding cross-region pointer comparisons and memory aliasing issues. If the symbolic region binding fails, the above-described process of regenerating the digest is executed as usual. Overall, the symbolic region significantly improves the reusability of the digest across different memory regions.

[0132] In one possible implementation, the symbolized instantaneous function digest is subjected to digest encoding optimization processing to obtain an optimized instantaneous function digest, including:

[0133] The hypothetical nodes with no feasible sibling nodes are removed from the symbolized instantaneous function summary to obtain the instantaneous function summary after the initial processing.

[0134] Recursively compare identical subtrees in the initial instantaneous function digest after the first processing and merge the identical subtrees to obtain the optimized instantaneous function digest.

[0135] This application embodiment represents the instantaneous function summary as a tree structure, which naturally fits the summary construction process. However, dynamically generated instantaneous function summaries are not necessarily optimal when interacting with the backend solver. To this end, this application embodiment provides a set of extensible interfaces that allow users to develop steps for summary encoding optimization. These steps are similar to steps in compiler optimization, converting the summary into an encoding form that is more conducive to verification. This application embodiment includes two built-in optimization steps: (1) MinimizeAssume: This step removes Assume nodes caused by redundant branch conditions during symbolic execution. This application embodiment identifies Assume nodes in the summary tree that have no feasible sibling nodes and deletes them, thereby reducing the number of calls to the solver during summary application. (2) MergeAssume: This step recursively compares identical subtrees in the summary tree corresponding to the instantaneous function summary and merges identical subtrees to completely eliminate their preceding Assume conditions.

[0136] In one possible implementation, it also includes:

[0137] Execute the stub function set before the target function in the target code, and interpret the return value of the stub function as the additional path constraint corresponding to the target function to obtain the target code with added constraints.

[0138] Based on the target code with added constraints, the merged state in the function summary is divided into multiple individual specific state values ​​to obtain the instantaneous function summary.

[0139] This application provides a stub function mechanism for flexible control during top-down verification. These stub functions can be written in the spec language, with parameters defined identically to the target function being stubbed, but with a boolean return value. Before summarizing the target function, this application executes the stub function and interprets its return value as additional path constraints. The stub function can be used to: (1) provide additional invariants during the summarization process; (2) force state splitting through the specialize primitive; and (3) print debug information to the console.

[0140] The resource-decoupled automated verification method for DNS authority engines provided in this application can be widely applied to the verification of multiple implementations. Currently, the method described in this application has been used to verify implementations in open-source DNS engines such as Bind9, CoreDNS, PowerDNS, and HickoryDNS. The method provided in this application offers strong correctness assurance. During the verification process, the method provided in this application discovered a total of 12 new vulnerabilities, including critical errors affecting domain name resolution results and vulnerabilities that testing tools could not detect. The method provided in this application also achieves low manpower overhead, with verification overhead for each implementation less than one person per week, and the required specification and target code ratio (by lines) less than 10%. This application uses immediate function digests to capture program invariants resulting from the DNS authority engine's dependency on domain name zone configuration, improving the automation level of layered verification. This design is decoupled from the specific implementation of the DNS authority engine, has high usability, and can be widely used in production practice.

[0141] Please refer to Figure 6 Based on the same inventive concept, embodiments of this application also provide an automated verification device for a domain name system authority engine oriented towards resource decoupling, the device comprising:

[0142] The front-end 601 redirect is used to retrieve the target code and the top-level specification. The target code represents the DNS authority engine code, and the top-level specification represents the expected correct implementation of the DNS authority engine.

[0143] The front-end 601 is also used to generate a control flow graph based on the execution path of the target code.

[0144] The frontend is responsible for parsing the code files corresponding to the input target code and the code files of the top-level specification, and generating the function control flow graph (CFG). This frontend supports two input formats: the intermediate representation generated by the LLVM toolchain, which corresponds to the target code to be verified; and the format corresponding to the manually written specification in the spec language. The top-level specification describes the ideal behavior of the DNS authority engine and provides a simulated interface for library calls.

[0145] Mid-level 602 is used to generate a control flow graph based on the execution path of the target code, and obtain the tree of the effects corresponding to the target code based on the control flow graph. Based on the tree of the effects corresponding to the target code, a function summary corresponding to the target code is obtained, and the merged states in the function summary are divided into multiple individual specific state values ​​to obtain an instantaneous function summary. The merged states represent the states where variables have multiple values. State value verification, symbolic region processing, and redundant information processing are performed on the instantaneous function summary to obtain an optimized instantaneous function summary. Based on the top-level specification, the optimized instantaneous function summary is automatically verified to obtain the automated verification result corresponding to the domain name system authoritative engine.

[0146] The middleware 602 receives the control flow graph (CFG) generated by the front-end 601 and performs symbolic execution to construct an immediate function digest. The symbolic execution engine starts from a user-defined entry function and constructs the immediate function digest from top to bottom. When a function is called in a new context, a new digest is constructed. If the context of the function call has been explored in the past, the existing digest is applied directly. Furthermore, digest optimization is introduced to further simplify the digest encoding.

[0147] Backend 603 assists the symbolic execution process in the middle stage by interacting with the SMT (Satisfiability Modulo Theories) solver. Currently, this application embodiment uses Z3 as the solver implementation. This application embodiment only uses scalar type (bit vector and pointer) expressions, including literals, variables, symbolic quantities, arithmetic operations, and comparison operations, which can be directly mapped to the existing interface of the SMT solver. Accordingly, this application embodiment system avoids using complex solver features (such as uninterpreted functions and arrays) to reduce the impact on solving performance.

[0148] In one possible implementation, front-end 601 includes an LLVM parser and a specification parser.

[0149] The LLVM parser receives the target code and generates its control flow graph (CFG). The target code is input as an LLVM binary file.

[0150] The specification parser receives the top-level specification and generates its control flow graph (CFG). It should also accept the libraries and stubs used by the top-level specification to ensure correct execution.

[0151] In one possible implementation, mid-end 602 includes a symbolic execution engine, a builder, an applicator, an optimizer, and a unified state model.

[0152] Symbolic execution engine, used for symbolic execution.

[0153] The builder, which relies on the symbolic execution engine's symbolic execution functionality, generates a control flow graph based on the execution path of the target code, and obtains a tree representing the effects of the target code based on the control flow graph. Based on the tree of effects corresponding to the target code, it obtains the function summary corresponding to the target code, and splits the merged states in the function summary into multiple individual specific state values ​​to obtain an immediate function summary. The merged states represent the states where variables have multiple values.

[0154] For example, a control flow graph is generated based on the execution path of the target code, and the tree of effects corresponding to the target code is obtained based on the control flow graph. This includes: determining the root node corresponding to the target code based on the control flow graph; using the root node corresponding to the target code as a basis, traversing the control flow graph using depth-first search symbolic execution to generate other effect nodes, thus obtaining the tree of effects corresponding to the target code.

[0155] For example, based on the tree of effects corresponding to the target code, the function summary corresponding to the target code is obtained, including: using each path from the root to the leaf as the target path for constructing the function summary, according to the effect tree; executing from the root node for any target path, obtaining data related to a preset unified state model for each function on the target path, and obtaining the function summary corresponding to the target path; traversing all target paths to obtain the function summary corresponding to the target code, where the function summary corresponding to the target code includes the function summaries corresponding to all target paths.

[0156] For example, when there are recursive functions in the target code, the control flow graph of the recursive function is merged into the control flow graph of the caller to obtain a merged control flow graph, and the tree of the effect corresponding to the target code is obtained based on the merged control flow graph.

[0157] Based on the tree of the effects corresponding to the target code, obtain the function summary corresponding to the target code, including: obtaining the function summary corresponding to the target code based on the tree of the effects corresponding to the target code obtained from the merged control flow graph. The function summary corresponding to the target code includes the function summary corresponding to the recursive function.

[0158] For example, for any target path, execution starts from the root node. The process of obtaining data related to each function on the target path and a predefined unified state model, and obtaining the function summary corresponding to the target path, includes: when a function call is encountered, determining the summary construction status of the called function. The summary construction status includes both constructed and unconstructed summaries. If the called function's summary construction status is constructed, the function summary of the called function is invoked, and the function summary corresponding to the target path is obtained based on the called function's summary. If the called function's summary construction status is unconstructed, the function summary of the called function is constructed, and the function summary corresponding to the target path is obtained based on the called function's summary.

[0159] For example, to obtain an immediate function digest by dividing the merged state in the function digest into multiple individual specific state values, the process includes: dividing the merged state in the function digest into multiple individual specific state values; replacing the corresponding merged state in the function digest with the specific state value to obtain the immediate function digest; and using the original function digest as the immediate function digest for any undivided function digests.

[0160] A unified state model is used to provide a unified interface in the process of building instantaneous function summaries.

[0161] An applicator used to validate the state values ​​of an instantaneous function digest.

[0162] The optimizer performs symbolic region processing and redundancy removal on the instantaneous function digest (JEM), resulting in an optimized JEM. Based on the top-level specification, the optimized JEM is then automatically verified to obtain the automated verification result corresponding to the authoritative domain name system engine.

[0163] For example, an optimized instantaneous function digest (IFD) is obtained by performing state value verification, symbolic region processing, and redundancy information processing on the IFD. This includes: verifying the state values ​​of the IFD to determine the verification result; where the verification result includes verification success or verification failure. If the verification result is verification failure, the IFD is regenerated. If the verification result is verification success, the IFD is symbolicated to obtain a symbolicated IFD. Symbolic region processing represents the use of symbols to represent the memory state in the program. The symbolicated IFD is then subjected to digest encoding optimization processing to obtain an optimized IFD. Digest encoding optimization processing involves removing useless nodes and duplicate data.

[0164] For example, the instantaneous function digest is processed by symbolic regions to obtain a symbolic instantaneous function digest, including: replacing the specific stack and heap regions in the instantaneous function digest with symbolic regions to obtain a symbolic instantaneous function digest.

[0165] For example, the symbolized instantaneous function digest is subjected to digest encoding optimization processing to obtain an optimized instantaneous function digest, including: removing hypothetical nodes with no feasible sibling nodes from the symbolized instantaneous function digest to obtain the initial processed instantaneous function digest; recursively comparing identical subtrees in the initial processed instantaneous function digest and merging identical subtrees to obtain the optimized instantaneous function digest.

[0166] exist Figure 6 In LLVM, built-in functions and embedded functions provide basic function support for the symbolic execution process. Region invariants are provided through stub functions, which can be executed before the target function in the target code. The return value of the stub function is interpreted as the additional path constraints corresponding to the target function, resulting in the target code with added constraints. Based on the target code with added constraints, the merged state in the function digest is split into multiple individual specific state values ​​to obtain the instantaneous function digest.

[0167] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.

[0168] Please refer to Figure 7 Based on the same inventive concept, another embodiment of this application provides an electronic device, which includes a memory 701 and a processor 702. The memory 701 and the processor 702 communicate with each other via a communication bus 703.

[0169] Memory 701 is used to store code instructions.

[0170] The processor 702 is used to run code instructions, causing the electronic device to execute the resource-decoupled domain name system authority engine automated verification method provided in the embodiments of this application.

[0171] The aforementioned communication bus 703 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus 703 can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is used to represent it in the figure, but this does not indicate that there is only one bus or one type of bus. The communication interface is used for communication between the aforementioned terminal and other devices. The memory 701 can include random access memory (RAM), or it can include non-volatile memory, such as at least one disk storage device. Optionally, the memory 701 can also be at least one storage device located remotely from the aforementioned processor 702.

[0172] The processor 702 mentioned above can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc. It can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0173] Furthermore, to achieve the above objectives, embodiments of this application also propose a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the resource-decoupled domain name system authority engine automated verification method provided in embodiments of this application.

[0174] Those skilled in the art will understand that embodiments of this application can be provided as methods, devices, or computer program products. Therefore, embodiments of this application can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of this application can take the form of computer program products implemented on one or more computer-usable vehicles (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0175] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (apparatus), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0176] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0177] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0178] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. "" and / or "" indicate that either one or both can be selected. Furthermore, the terms "includes," "contains," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that includes a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the statement "includes a..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes the element.

[0179] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for automated verification of a domain name system authority engine oriented towards resource decoupling, characterized in that, include: Obtain the target code and the top-level specification; wherein, the target code represents the Domain Name System (DNS) authority engine code, and the top-level specification represents the expected correct implementation of the DNS authority engine; Based on the execution path of the target code, a control flow graph is generated, and a tree of the effects corresponding to the target code is obtained based on the control flow graph; Based on the tree of the effects corresponding to the target code, obtain the function summary corresponding to the target code, and divide the merged state in the function summary into multiple individual specific state values ​​to obtain an instantaneous function summary; wherein, the merged state represents the state in which the variable has multiple values; The instantaneous function digest is subjected to state value verification, symbolic region processing, and redundant information processing to obtain an optimized instantaneous function digest. Based on the aforementioned top-level specification, the optimized instantaneous function digest is automatically verified to obtain the automated verification result corresponding to the Domain Name System authoritative engine. The optimized instantaneous function summary includes: The instantaneous function digest is subjected to state value verification to determine the instantaneous function digest verification result; wherein, the instantaneous function digest verification result includes verification success or verification failure; If the instantaneous function digest verification fails, the instantaneous function digest will be regenerated. If the instantaneous function digest verification result is successful, the instantaneous function digest is subjected to symbolic region processing to obtain a symbolic instantaneous function digest; wherein, the symbolic region processing represents the memory state in the program by symbolic representation. The symbolized instantaneous function digest is subjected to digest encoding optimization processing to obtain an optimized instantaneous function digest; wherein, the digest encoding optimization processing represents the removal of useless nodes and the removal of duplicate data.

2. The automated verification method for a domain name system authority engine based on resource decoupling as described in claim 1, characterized in that, The step of generating a control flow graph based on the execution path of the target code, and obtaining a tree representing the effect of the target code based on the control flow graph, includes: Based on the control flow graph, the root node corresponding to the target code is determined; Based on the root node corresponding to the target code, the control flow graph is traversed using depth-first search symbolic execution to generate other effect nodes, thus obtaining the tree of effects corresponding to the target code.

3. The automated verification method for a domain name system authority engine based on resource decoupling as described in claim 1, characterized in that, The step of obtaining the function summary corresponding to the target code based on the tree of effects corresponding to the target code includes: Based on the tree of the described effect, each path from the root to the leaf is used as the target path for constructing the function summary; For any target path, execution starts from the root node, and the data related to the preset unified state model for each function on the target path is obtained to obtain the function summary corresponding to the target path. Traverse all target paths to obtain the function digest corresponding to the target code. The function digest corresponding to the target code includes the function digests corresponding to all target paths.

4. The automated verification method for a domain name system authority engine based on resource decoupling as described in claim 1 or 3, characterized in that, Also includes: If the target code contains recursive functions, the control flow graph of the recursive functions is merged into the control flow graph corresponding to the caller to obtain a merged control flow graph, and the tree of the effect corresponding to the target code is obtained based on the merged control flow graph; Based on the tree of effects corresponding to the target code, obtain the function summary corresponding to the target code, including: Based on the tree of the effects corresponding to the target code obtained from the merged control flow graph, obtain the function summary corresponding to the target code; The function summary corresponding to the target code includes the function summary corresponding to the recursive function.

5. The automated verification method for a domain name system authority engine based on resource decoupling as described in claim 3, characterized in that, The process of executing from the root node for any target path, obtaining data related to the preset unified state model for each function on the target path, and obtaining the function summary corresponding to the target path includes: When a function call is encountered, the digest construction status of the called function is determined; wherein, the digest construction status includes a constructed digest and a non-constructed digest; If the digest construction status of the called function is that a digest has been constructed, the function digest of the called function is invoked, and the function digest corresponding to the target path is obtained based on the function digest of the called function. If the function summary of the called function is not constructed, a function summary of the called function is constructed, and the function summary corresponding to the target path is obtained based on the function summary of the called function.

6. The automated verification method for a domain name system authority engine based on resource decoupling as described in claim 1, characterized in that, The step of dividing the merged state in the function digest into multiple individual specific state values ​​to obtain an instantaneous function digest includes: The merged state in the function summary is divided into multiple individual specific state values; For each specific state value, the merged state in the corresponding function digest is replaced with the specific state value to obtain the instantaneous function digest; For the unsegmented function digest, the original function digest is used as the instantaneous function digest.

7. The automated verification method for a domain name system authority engine based on resource decoupling as described in claim 1, characterized in that, The symbolic region processing of the instantaneous function digest to obtain the symbolicated instantaneous function digest includes: The symbolic regions are replaced with symbolic regions to obtain the symbolic instantaneous function digest.

8. The automated verification method for a domain name system authority engine based on resource decoupling as described in claim 7, characterized in that, The step of performing digest encoding optimization processing on the symbolized instantaneous function digest to obtain an optimized instantaneous function digest includes: Remove the hypothetical nodes that have no feasible sibling nodes from the symbolized instantaneous function summary to obtain the instantaneous function summary after the first processing; Recursively compare identical subtrees in the initial instantaneous function digest after the first processing and merge the identical subtrees to obtain the optimized instantaneous function digest.

9. The automated verification method for a domain name system authority engine based on resource decoupling as described in claim 1, characterized in that, Also includes: Execute the stub function set before the target function in the target code, and interpret the return value of the stub function as the additional path constraint corresponding to the target function to obtain the target code with added constraints; Based on the target code after adding constraints, the merged state in the function summary is divided into multiple individual specific state values ​​to obtain the instantaneous function summary.

Citation Information

Patent Citations

  • Binary code authorization vulnerability detection method

    CN112800423A

  • Equivalence verification method and device

    CN118113587A