Information processing apparatus, information processing method, and program
Patent Information
- Application Number
- JP2023142860
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-09-04
- Publication Date
- 2025-03-14
AI Technical Summary
【0012】 本開示に係る情報処理装置、情報処理方法、及びプログラムは、ユーザに、特定の条件をトリガとして実行される機能の有無を容易に検査させることを可能にできる。
Smart Images

Figure 2025035658000001_ABST
Abstract
Description
[Technical field]
[0001] The present disclosure relates to an information processing device, an information processing method, and a program. [Background technology]
[0002] As a related technique, Patent Document 1 discloses a verification device that performs data flow analysis on the source code of a program. Here, data flow analysis refers to analysis that focuses on data within a program, such as variables and objects, and tracks the flow of processing related to that data. In data flow analysis, the verification device described in Patent Document 1 extracts, from the source code, input point nodes that input data and output point nodes that output data. The verification device generates a directed graph that indicates the data flow including nodes from the input point nodes to the output point nodes.
[0003] In Patent Document 1, the verification device extracts from the source code, in addition to the input point node and output point node, a sanitization node corresponding to a process for sanitizing special characters contained in the data and causing vulnerabilities. The verification device extracts, from among the nodes contained in the generated directed graph, nodes on a path that does not pass through the sanitization node as tainted nodes. In addition, the verification device extracts, from among the nodes contained in the generated directed graph, nodes arranged downstream of the sanitization node as downstream nodes. Furthermore, the verification device extracts, from among the nodes contained in the generated directed graph, nodes arranged upstream of the sanitization node as upstream nodes.
[0004] The verification device extracts candidate nodes indicating candidates for nodes in which a neutralization process is to be placed, based on the extracted tainted nodes, downstream nodes, and upstream nodes. For example, the verification device extracts, as candidate nodes, nodes included in a candidate set obtained by excluding a set of downstream nodes and a set of upstream nodes from a set of tainted nodes. The verification device causes an output unit to output information indicating a position in the source code corresponding to the extracted candidate nodes. [Prior art documents] [Patent documents]
[0005] [Patent Document 1] Patent No. 5941859 Summary of the Invention [Problem to be solved by the invention]
[0006] When an organization uses software internally or provides software to other organizations, it is often required to ensure the quality of the software. In addition to confirming that the software has been sufficiently free of bugs, it is also required to confirm that the software does not contain undocumented features that allow access to the computer system or internal data. Such undocumented features are also called backdoors.
[0007] In general, functions such as backdoors are often triggered when data meets a specific condition. The verification device described in Patent Document 1 can perform data flow analysis and verify whether a sanitization node is placed between an input node and an output node. However, the verification device in Patent Document 1 is not suitable for verifying the presence or absence of a specific function that is executed when a specific condition is met.
[0008] In view of the above circumstances, one objective of the present disclosure is to provide an information processing device, an information processing method, and a program that enable a user to easily check whether or not a function that is executed when a specific condition is triggered is present. [Means for solving the problem]
[0009] An information processing device according to a first aspect of the present disclosure includes a dependency analysis unit that performs flow analysis on a program to be tested and analyzes dependencies between variables in a processing flow included in the program to be tested, the dependencies including data dependencies and control dependencies, and a directed graph generation unit that generates a directed graph for the processing flow based on a result of the dependency analysis, in which parts that generate the control dependencies in the program to be tested are nodes.
[0010] An information processing method according to a second aspect of the present disclosure includes performing flow analysis on a program to be tested, analyzing dependencies between variables in a processing flow included in the program to be tested, the dependencies including data dependencies and control dependencies, and generating a directed graph for the processing flow based on the results of the analysis of the dependencies, with parts in the program to be tested that generate the control dependencies as nodes.
[0011] A program according to a third aspect of the present disclosure is for causing a computer to perform processing including performing flow analysis on a program to be tested, analyzing dependencies between variables in a processing flow included in the program to be tested, the dependencies including data dependencies and control dependencies, and generating a directed graph for the processing flow based on the results of the analysis of the dependencies, with parts in the program to be tested that generate the control dependencies as nodes. Effect of the Invention
[0012] An information processing device, an information processing method, and a program according to the present disclosure can enable a user to easily check whether or not a function is executed when a specific condition is triggered. [Brief description of the drawings]
[0013] [Figure 1] 1 is a block diagram showing an example of a schematic configuration of an information processing device according to the present disclosure. [Diagram 2]1 is a block diagram showing an example of a configuration of a first information processing device according to the present disclosure. [Diagram 3] FIG. 2 is a diagram illustrating an example of a process flow included in a program to be checked. [Figure 4] FIG. 2 is a diagram illustrating an example of source code of a program to be inspected. [Diagram 5] 13A and 13B are diagrams illustrating an example of a list of source functions and a list of sink functions. [Figure 6] FIG. 13 is a diagram illustrating an example of a table showing a result of an analysis of dependency relationships. [Figure 7] FIG. 13 is a diagram illustrating an example of a directed graph generated from a result of dependency analysis. [Figure 8] FIG. 13 is a diagram illustrating another example of a generated directed graph. [Figure 9] 4 is a flowchart showing an operation procedure in the information processing device. [Figure 10] FIG. 2 is a block diagram showing an example of a configuration of a second information processing device according to the present disclosure. [Figure 11] FIG. 13 is a diagram illustrating an example of a directed graph in which nodes are converted into units for each function. [Figure 12] FIG. 13 is a block diagram showing an example of a configuration of a third information processing device according to the present disclosure. [Figure 13] FIG. 13 is a diagram illustrating an example of a graph showing function call relationships. [Figure 14] 13 is a diagram illustrating an example of a directed graph generated by a graph integration unit; [Figure 15] 13 is a diagram illustrating another example of a directed graph generated by the graph integration unit. FIG. [Figure 16] FIG. 13 is a diagram showing yet another example of a directed graph generated by the graph integration unit. [Figure 17] FIG. 13 is a diagram showing a modified example of a directed graph. [Figure 18] FIG. 2 is a block diagram showing an example of a hardware configuration of a computer device. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0014] Prior to describing the embodiments of the present disclosure, an overview of the present disclosure will be described. Fig. 1 shows an example of a schematic configuration of an information processing device according to the present disclosure. The information processing device 10 includes a dependency analysis unit 11 and a directed graph generation unit 12.
[0015] The dependency analysis unit 11 performs flow analysis on the program to be inspected. In the flow analysis, the dependency analysis unit 11 analyzes dependencies between variables in a process flow included in the program to be inspected. The dependencies to be analyzed include data dependencies and control dependencies. Based on the result of the dependency analysis, the directed graph generation unit 12 generates a directed graph for the process flow in which parts that cause control dependencies in the program to be inspected are nodes.
[0016] In the present disclosure, the digraph generation unit 12 generates a digraph in which the nodes are parts related to the control dependency among the dependencies analyzed by the dependency analysis unit 11. The digraph shows the dependency of the nodes related to the control dependency. By referring to such a digraph, the user can understand under what conditions the process in the process flow is executed. Therefore, the user can easily check whether or not a function that is executed when a specific condition is triggered exists in the program to be inspected. In this way, the information processing device 10 can enable the user to easily check whether or not a function that is executed when a specific condition is triggered exists.
[0017] Hereinafter, the embodiments of the present disclosure will be described in detail with reference to the drawings. Note that the following description and drawings are omitted and simplified as appropriate for clarity of explanation. In addition, in each drawing, the same elements and similar elements are given the same reference numerals, and duplicate explanations are omitted as necessary.
[0018] A first embodiment of the present disclosure will be described. FIG. 2 shows an example of the configuration of a first information processing device according to the present disclosure. The information processing device 100 has an input unit 101, a dependency analysis unit 102, a directed graph generation unit 103, and an output unit 104. The information processing device 100 can be physically configured as a device having one or more processors and one or more memories. In the information processing device 100, the one or more processors execute processing according to instructions read from the one or more memories, thereby realizing at least a part of the function of each unit in the information processing device 100. The information processing device 100 can also be called a program inspection device. The information processing device 100 corresponds to the information processing device 10 shown in FIG. 1.
[0019] The input unit 101 acquires a program to be inspected. The input unit 101 acquires, for example, a source code of the program to be inspected. The input unit 101 also acquires a list of functions that are the starting point of the analysis and a list of functions that are the end point of the analysis. The function that is the starting point of the analysis is also called a source function. The function that is the end point of the analysis is also called a sync function. In this embodiment, the source function is a function that receives data from the outside, such as a function that receives data from a network. The sync function is a function that executes a predetermined process that may have a significant impact on the security of a system in which the program runs, such as a function that executes a shell command.
[0020] Here, an undocumented function that may cause an operation unintended by a user is often implemented to be activated when data input from outside meets a specific condition. An undocumented function includes a backdoor that a malicious person has mixed into a program. An undocumented function may also include a function that was supposed to be deleted after the program was developed and was incorporated into the program for debugging. When checking whether an undocumented function exists in a program to be inspected, it is important to pay particular attention to an external input, and to a portion where data dependent on the external input is used for a conditional branch. In this embodiment, the information processing device 100 may be used to assist a user in inspecting whether externally input data is used to trigger the execution of a dangerous function.
[0021] The dependency analysis unit 102 performs flow analysis on the program to be inspected. In the flow analysis, the dependency analysis unit 102 analyzes a process flow starting from any function (first function) included in the list of source functions and ending at any function (second function) included in the risk of the sync function. The dependency analysis unit 102 also analyzes the dependency between variables linked to the process flow. The dependency between variables includes data dependency and control dependency. Data dependency indicates a relationship in which the value of the variable at the dependency destination is derived from the variable at the dependency source by assignment, copying, or processing. Data dependency does not generally involve branching of processing. On the other hand, control dependency indicates a relationship in which the value of the variable at the dependency destination is changed or generated as a result of branching of processing depending on the variable at the dependency source. The analysis result of the dependency includes the type of dependency, the variable at the dependency source, and the variable at the dependency destination.
[0022] For example, in flow analysis, the dependency analysis unit 102 analyzes variables, i.e., data, that have direct or indirect data dependency or control dependency on variables, i.e., data, handled in source functions. In dependency analysis, functions may be handled as a type of variable. The dependency analysis unit 102 extracts parts that generate data dependency and control dependency in the program to be inspected. For example, the dependency analysis unit 102 extracts lines of code that generate data dependency and control dependency from the source code of the program to be inspected. The dependency analysis unit 102 corresponds to the dependency analysis unit 11 shown in FIG. 1.
[0023] FIG. 3 shows an example of a processing flow included in a program to be inspected. The processing flow shown in FIG. 3 will be explained. In this processing flow, the program receives data 1 from outside (F1). F1 corresponds to a source function. After that, the program processes data 1 to create data 1a (F2). The program also processes data 1a to create data 1b (F3). The program determines whether data 1b satisfies a predetermined condition (F4). If the program determines that data 1b does not satisfy the predetermined condition, it ends the processing of this processing flow.
[0024] If the program determines in F4 that data 1b satisfies the predetermined condition, it creates data 2 (F5). After that, the program creates data 2a from data 2 (F6). The program determines whether data 2a satisfies the predetermined condition (F7). If the program determines that data 2a does not satisfy the predetermined condition, it ends the processing of this processing flow. If the program determines that data 2a satisfies the predetermined condition, it executes sensitive processing (F8). F8 corresponds to a sync function.
[0025] 3, the dependency analysis unit 102 analyzes data 1 handled in F1 where the source function is executed, and data that has a data dependency and a control dependency. Data 1a created in F2 is data created by processing data 1 received in F1. Therefore, the dependency analysis unit 102 analyzes that data 1a and data 1 have a data dependency. Furthermore, data 1b created in F3 is data generated by processing data 1a created in F2. Therefore, the dependency analysis unit 102 analyzes that data 1b and data 1a have a data dependency.
[0026] Furthermore, if it is determined in F4 that data 1b satisfies a predetermined condition, data 2 is created in F5. Data 2 is data that is created as a result of processing branching with data 1b as the branching condition. For this reason, the dependency analysis unit 102 analyzes that data 2 and data 1b have a control dependency relationship. Furthermore, data 2a created in F6 is data that is created by processing data 2 created in F5. For this reason, the dependency analysis unit 102 analyzes that data 2a and data 2 have a data dependency relationship.
[0027] If it is determined in F7 that data 2a satisfies a predetermined condition, sensitive processing is executed in F8. In other words, the sensitive processing is executed as a result of processing branching using data 2a as a branching condition. In this case, the dependency analysis unit 102 analyzes that the sensitive processing and data 2a have a control dependency. By tracing the data dependency and the control dependency, it is found that data 2a used as a branching condition to the sensitive processing has a dependency on data 1 received in F1. In this case, data 1 may be used to trigger an unintended function such as a backdoor that executes the sensitive processing.
[0028] Note that the data dependency is not necessarily limited to a dependency that does not involve a conditional branch. For example, when a conditional branch is used in the process of processing data, the dependency analysis unit 102 may determine that there is a data dependency between data before and after processing. For example, consider data processing in which it is determined whether or not data that is a character string contains lowercase alphabetic characters, and if lowercase characters are included, the lowercase characters are converted to uppercase characters. In this case, the conditional branch, i.e., whether or not the characters are lowercase alphabetic characters, is used in the process of processing the data. In such a case, the dependency analysis unit 102 may determine that there is a data dependency between the data before processing and the data in which the lowercase characters have been converted to uppercase characters.
[0029] When data having a dependency relationship with data handled by a source function is used as a branching condition for a branch to a sync function, the dependency analysis unit 102 stores the analyzed data dependency relationship and control dependency relationship in a storage device (not shown) as analysis results. The dependency analysis unit 102 also stores in the storage device a part that generates a data dependency relationship or a control dependency relationship, extracted from the program to be inspected. When data that depends on data handled by a source function is not used as a branching condition for a sync function in a processing flow, the dependency analysis unit 102 does not need to store in the storage device the dependency relationship and control dependency relationship analyzed for that processing flow.
[0030] The digraph generating unit 103 regards as nodes parts of the program to be inspected that cause control dependencies among the dependencies analyzed by the dependency analyzing unit 102, and generates a digraph in which the nodes are connected based on the dependencies. For example, the digraph generating unit 103 regards as nodes lines that cause control dependencies extracted from the source code of the program to be inspected, and generates a digraph in which the nodes are connected according to the dependencies. The digraph generating unit 103 may add a node indicating a source function and a node indicating a sink function to the digraph. The output unit 104 displays the digraph generated by the digraph generating unit 103 on a screen of a display device (not shown). The digraph generating unit 103 corresponds to the digraph generating unit 12 shown in FIG. 1.
[0031] A concrete example will be used below for explanation. FIG. 4 shows an example of source code of a program to be inspected. The source code is written, for example, in a predetermined language. FIG. 5 shows an example of a list of source functions and a list of sync functions. It is assumed that the list of source functions and the list of sync functions have been input in advance to the input unit 101 by, for example, an administrator. A user inputs the source code of the program to be inspected to the input unit 101. The dependency analysis unit 102 analyzes the source code, and analyzes data dependency and control dependency between variables that are linked to a process flow starting from a source function and ending at a sync function.
[0032] 6 shows an example of a table showing the dependency analysis result. For example, the dependency analysis unit 102 finds fgets included in the source function list shown in FIG. 5 on line 14 of the source code shown in FIG. 4. On line 14 of the source code, a character string input from a standard input is stored in the variable buf using the fgets function. The dependency analysis unit 102 records a dependency in which the dependency type is data dependency, the dependency source is fgets, and the dependency destination is buf in a table showing the dependency analysis result. The dependency analysis unit 102 also records the line number of the source code causing the data dependency and the code of that line in the table.
[0033] The dependency analysis unit 102 finds that the variable buf is used in a conditional branch in the 15th line of the source code. The dependency analysis unit 102 records in the table a dependency relationship in which the dependency type is control dependency, the dependency source is buf, and the dependency destination is the return value of funcB. The dependency analysis unit 102 also records in the table the line number of the source code that generates the control dependency relationship and the code of that line. The dependency analysis unit 102 also records in the table information on the control dependency relationship for the 18th line of the source code. The dependency analysis unit 102 records in the table information on the dependency type being data dependency for the 3rd line of the source code where the return value of funcB is assigned to x. The dependency analysis unit records in the table information on the dependency type being data dependency for the location where a function is called with the variable x as an argument.
[0034] Dependency analysis unit 102 discovers that, on line 33 of the source code, variable x, which is the first argument of funcE, is used as a branch condition to system, which is included in the list of sync functions shown in Fig. 5. Dependency analysis unit 102 records a dependency relationship in which the dependency type is control dependency, the dependency source is the first argument of funcE, and the dependency destination is system, in a table indicating the dependency analysis results. Dependency analysis unit 102 also records in the table the line number of the source code that causes the control dependency relationship, and the code of that line. Through these operations, the table shown in Fig. 6 is created.
[0035] Fig. 7 shows an example of a directed graph generated from the dependency analysis result shown in Fig. 6. The directed graph generation unit 103 acquires code whose dependency type is control dependency from the table shown in Fig. 6. In the example of Fig. 6, the directed graph generation unit 103 acquires the code in lines 15, 18, and 33 of the source code as code causing a control dependency. The directed graph generation unit 103 regards each of the code in lines 15, 18, and 33 of the source code as a node, and generates a directed graph in which these nodes are connected based on the dependency relationship between the nodes.
[0036] Furthermore, the directed graph generating unit 103 obtains the code on the 14th line of the source code corresponding to the source function. The directed graph generating unit 103 obtains the code on the 34th line of the source code corresponding to the sync function. The directed graph generating unit 103 may add the code on the 14th line of the source code as a start node and add the code on the 34th line of the source code as an end node to the directed graph, as shown in FIG.
[0037] Fig. 8 shows another example of a generated directed graph. In the example shown in Fig. 7, the node on the 15th line of the source code and the node on the 18th line of the source code are connected to the same node. The directed graph generating unit 103 may develop the directed graph indicating the dependency relationship into a tree format as shown in Fig. 8. In this case, it becomes easier to recognize a path from the node on the 15th line of the source code to the 34th line of the source code via the code on the 33rd line of the source code and a path from the node on the 18th line of the source code to the 34th line of the source code via the code on the 33rd line of the source code as different paths.
[0038] Next, the operation procedure will be described. FIG. 9 shows the operation procedure in the information processing device 100. The operation procedure of the information processing device 100 corresponds to an information processing method or a program inspection method. The input unit 101 acquires an inspection target program (step S1). In step S1, the input unit 101 acquires, for example, the source code of the inspection target program. The dependency analysis unit 102 performs flow analysis on the inspection target program and extracts dependencies between variables linked to the processing flow (step S2). The extracted dependencies include data dependencies and control dependencies. Furthermore, the dependency analysis unit 102 extracts parts that cause dependencies in the inspection target program (step S3).
[0039] The directed graph generating unit 103 generates a directed graph in which the part generating the control dependency is a node based on the extracted dependency (step S4). The output unit 104 outputs the generated directed graph to a user (step S5). The output unit 104 displays the directed graph on, for example, a screen of a display device. By checking the displayed node indicating the part generating the control dependency, the user can check whether or not the data received by the source function from outside is being used as a trigger for an unintended function such as a backdoor.
[0040] In this embodiment, the dependency analysis unit 102 analyzes the dependency between variables in the process flow. In particular, when a function that receives data from the outside is registered in the list of source functions, the dependency analysis unit 102 analyzes variables or data that have a dependency on the data received from the outside by the source function. The directed graph generation unit 103 generates a directed graph in which a part that generates a control dependency among parts that generate a dependency in the process flow is a node. In this way, only the processes related to the control dependency and their dependencies can be selectively displayed in the directed graph. In this case, the points where the process branches depending on the input data can be selectively displayed in the directed graph. For this reason, the user can relatively easily check whether or not there is a backdoor of a type that is activated when an external input satisfies a specific condition.
[0041] Next, a second embodiment of the present disclosure will be described. Fig. 10 shows an example of the configuration of a second information processing device according to the present disclosure. The second information processing device 100a has a function integration processing unit 105 in addition to the configuration of the information processing device 100 shown in Fig. 2.
[0042] In this embodiment, in addition to the operation described in the first embodiment, the dependency analysis unit 102 extracts information on the function to which the code of the part generating the control dependency belongs as belonging function information. Furthermore, the digraph generation unit 103 uses the belonging function information extracted by the dependency analysis unit 102 to generate a digraph in which the function to which the part generating the control dependency belongs is a node. In other words, the digraph generation unit 103 converts the nodes in the digraph from code units to function units. When two or more nodes belong to the same function, the function integration processing unit 105 integrates two or more nodes belonging to the same function into one node.
[0043] Fig. 11 shows an example of a directed graph in which nodes are converted into units for each function. For example, the dependency analysis unit 102 extracts information indicating that the 15th line of the source code shown in Fig. 4 belongs to funcB. The dependency analysis unit 102 also extracts information indicating that the 18th line of the source code shown in Fig. 4, which generates a control dependency, belongs to funcB. The dependency analysis unit 102 extracts information indicating that the 33rd line of the source code shown in Fig. 4, which generates a control dependency, belongs to funcE.
[0044] The directed graph generating unit 103 generates a directed graph in which the function to which the code generating the control dependency belongs is a node. At this time, since the code on the 15th line and the code on the 18th line of the source code each belong to funcB, the function integration processing unit 105 integrates these codes into one node indicating funcB. The output unit 104 displays the directed graph in which the nodes have been converted into units for each function on the screen of the display device.
[0045] In the directed graph shown in Fig. 7 displayed in the first embodiment, the code that generates the control dependency is displayed at each node. On the other hand, in the directed graph shown in Fig. 11, the function to which the code that generates the control dependency belongs is displayed at each node. Therefore, in this embodiment, it is possible to selectively display functions related to the control dependency and their relationships. Other effects are similar to those described in the first embodiment.
[0046] A third embodiment of the present disclosure will be described. Fig. 12 shows an example of the configuration of a third information processing device according to the present disclosure. The third information processing device 100b has a function call relationship extraction unit 106 and a graph integration unit 107 in addition to the configuration of the second information processing device 100a shown in Fig. 10.
[0047] The function call relationship extraction unit 106 extracts the call relationships of functions in the program to be inspected. The function call relationship extraction unit 106 analyzes the source code of the program to be inspected acquired by the input unit 101, for example, and extracts the call relationships of functions including source functions and sink functions. The function call relationship extraction unit 106 outputs a graph indicating the call relationships of the extracted functions to the graph integration unit 107.
[0048] The graph integration unit 107 obtains a directed graph in which nodes are converted into function units from the function integration processing unit 105. This directed graph indicates control dependency relationships. The graph integration unit 107 also obtains a graph indicating function call relationships from the function call relationship extraction unit 106. The graph integration unit 107 integrates the directed graph indicating the control dependency relationships and the graph indicating the function call relationships to generate a directed graph indicating the control dependency relationships and the function call relationships.
[0049] In this embodiment, the dependency analysis unit 102 may also extract function information that belongs to a code that generates a data dependency. The graph integration unit 107 may omit, from the integrated graph, nodes of functions that are not related to either data dependency or control dependency among the functions included in the program to be inspected. The output unit 104 displays the directed graph generated by the graph integration unit 107 on the screen of a display device.
[0050] Fig. 13 shows an example of a graph showing function call relationships. The function call relationship extraction unit 106 analyzes, for example, the source code shown in Fig. 4, and analyzes which function calls each function. The graph shown in Fig. 13 shows that funcB, funcC, and funcD are each called from funcA. The graph shown in Fig. 13 also shows that funcE is called from funcC and funcD. The graph shown in Fig. 13 also shows that fgets, which is a source function, is called from funcB. The graph shown in Fig. 13 also shows that system, which is a sink function, is called from funcE.
[0051] Fig. 14 shows an example of a directed graph generated by the graph integration unit 107. The graph integration unit 107 generates the directed graph shown in Fig. 14 by integrating, for example, the directed graph shown in Fig. 11 with the graph showing the function call relationships shown in Fig. 13. The graph integration unit 107 generates the directed graph shown in Fig. 14 by adding arrows showing the dependency relationships shown in the directed graph shown in Fig. 11 to the graph showing the function call relationships shown in Fig. 13. In this case, the user can easily grasp the function call relationships and the control dependency relationships in the program to be inspected.
[0052] FIG. 15 shows another example of a directed graph generated by the graph integration unit 107. The graph integration unit 107 may display arrows indicating control dependency relationships according to the call relationships of functions. For example, as shown in FIG. 13, funcB is a function called from funcA. Also, funcE is a function called from funcC or funcD called from funcA. In this case, as shown in FIG. 15, the graph integration unit 107 may generate a directed graph having an arrow extending from funcB to funcA, arrows extending from funcA to funcC and funcD, and arrows extending from funcC and funcD to funcE. In this case, the graph integration unit 107 may display nodes indicating functions generating control dependency relationships by highlighting them with, for example, double lines.
[0053] Fig. 16 shows yet another example of a directed graph generated by the graph integration unit 107. The function call relationship extraction unit 106 may expand a node indicating a function called from a plurality of functions in a graph indicating the call relationships of functions into a tree format, similar to the example of the directed graph shown in Fig. 8. The graph integration unit 107 may generate the directed graph shown in Fig. 16 by integrating the graph indicating the call relationships of functions expanded into a tree format with a directed graph indicating control dependencies. Alternatively, the graph integration unit 107 may display arrows indicating control dependencies according to the call relationships of functions in the graph indicating the call relationships of functions expanded into a tree format, similar to the example of the directed graph shown in Fig. 15.
[0054] In this embodiment, the call relationship of functions, the functions related to the control dependency, and the relationship between them can be displayed in the directed graph. In this case, the user can check not only the functions related to the control dependency but also the call relationship of the functions in the directed graph. Other effects are the same as those described in the first embodiment.
[0055] In the above embodiment, an example in which the input unit 101 acquires the source code of the program to be inspected has been described. However, the present disclosure is not limited to this. Instead of acquiring the source code, the input unit 101 may acquire the execution binary or intermediate code of the program to be inspected. In addition, in the above embodiment, an example in which the dependency analysis unit 102 extracts a line in the source code that generates a dependency between variables has been described. However, the present disclosure is not limited to this. For example, the dependency analysis unit 102 may extract a code block, a statement, an intermediate code, or an assembly instruction of a part that generates a dependency. In this case, the directed graph may display a code block, a statement, an intermediate code, or an assembly instruction of a part that generates a control dependency. Alternatively, the directed graph may display a result of disassembling or decompiling the part that generates a control dependency.
[0056] Each of the above embodiments can be appropriately combined with other embodiments. For example, in the first embodiment, the dependency analysis unit 102 may extract a function to which the code generating the control dependency belongs by the same operation as the dependency analysis unit 102 in the second embodiment. In that case, the directed graph generation unit 103 may display which function each node belongs to in the directed graph shown in FIG. 7. An example of the directed graph in that case is shown in FIG. 17. In FIG. 17, the nodes corresponding to the code on the 15th and 18th lines of the source code are surrounded by a predetermined frame such as a dotted line, and the label funcB is attached to the predetermined frame. In addition, the node corresponding to the code on the 33rd line of the source code is surrounded by a predetermined frame such as a dotted line, and the label funcE is attached to the predetermined frame. In this case, the user can easily grasp the code generating the control dependency and the function to which the code belongs. In addition to the function name, the namespace and class name information of the function, and the source file name in which the function is implemented may be displayed.
[0057] Next, a hardware configuration of the information processing device 100 will be described. Fig. 18 shows an example of a hardware configuration of a computer device that can be used as the information processing device 100. The computer device 300 has one or more processors 301 and one or more memories 302. The processor 301 may be, for example, a microprocessor, a micro processing unit (MPU), or a central processing unit (CPU).
[0058] The memory 302 stores a program executed by the processor 301. The memory 302 is configured by a combination of a volatile memory and a non-volatile memory. The memory 302 may include a storage device disposed away from the processor 301. In that case, the processor 301 may access the memory 302 via an I / O (Input / Output) interface or a network, not shown.
[0059] The program includes instructions or software codes that, when loaded into a computer, cause the computer to perform one or more functions described in the embodiments. The program may be stored in a non-transitory computer-readable medium or a tangible storage medium and provided to the computer device 300. By way of example and not limitation, the computer-readable medium or tangible storage medium includes random-access memory (RAM), read-only memory (ROM), flash memory, solid-state drive (SSD) or other memory technology, Compact Disc (CD), digital versatile disc (DVD), Blu-ray (registered trademark) disk or other optical disk storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage device. The program may be transmitted on a transitory computer-readable medium or communication medium. By way of example and not limitation, the transitory computer-readable medium or communication medium includes electrical, optical, acoustic, or other form of propagated signal.
[0060] In the present disclosure, the information processing device 100 does not necessarily have to be a single device. The information processing device 100 may be configured using multiple devices that are physically separated. For example, the information processing device 100 may be configured using a server that provides the function of the dependency analysis unit 102 and a server that provides the function of the directed graph generation unit. At least a part of the function of each unit of the information processing device 100 may be provided by one or more cloud servers each performing a predetermined process.
[0061] Although the present disclosure has been described above with reference to the embodiments, the present disclosure is not limited to the above-described embodiments. Various modifications that can be understood by a person skilled in the art can be made to the configuration and details of the present disclosure within the scope of the present disclosure.
[0062] Each drawing is merely an example for describing one or more embodiments. Each drawing may relate not only to one particular embodiment, but to one or more other embodiments. As can be understood by those skilled in the art, various features or steps described with reference to any one drawing may be combined with features or steps shown in one or more other drawings to create an embodiment not explicitly shown or described, for example. Not all features or steps shown in any one drawing are necessary to describe an exemplary embodiment, and some features or steps may be omitted. The order of steps described in any drawing may be changed as appropriate.
[0063] A part or all of the above-described embodiments can be described as, but is not limited to, the following supplementary notes.
[0064] [Appendix 1] a dependency analysis unit that performs flow analysis on a program to be inspected and analyzes dependencies between variables in a process flow included in the program to be inspected, the dependencies including data dependencies and control dependencies; and a directed graph generation unit that generates, for the process flow, a directed graph in which parts that cause the control dependence in the program to be tested are nodes based on a result of the dependence relationship analysis.
[0065] [Appendix 2] The information processing device according to claim 1, wherein the directed graph generation unit generates a directed graph including a node indicating a part that generates the control dependency, as well as a node indicating a start point of the process flow and a node indicating an end point of the process flow.
[0066] [Appendix 3] 3. The information processing device according to claim 1, wherein the directed graph generation unit generates a directed graph in which a code of a portion that generates the control dependency in the program to be checked is a node.
[0067] [Appendix 4] The information processing device according to claim 3, wherein the directed graph generation unit generates a directed graph having, as nodes, code of a portion that generates the dependency relationship and is written in a source code of the program to be inspected.
[0068] [Appendix 5] 3. The information processing device according to claim 1, wherein the directed graph generation unit generates a directed graph in which a function to which a part that generates the control dependency belongs, the function being included in the program to be checked, is a node.
[0069] [Appendix 6] The information processing device described in Appendix 5, further comprising a function integration processing unit that integrates parts that generate two or more of the control dependencies belonging to the same function into one node when the parts that generate two or more of the control dependencies belong to the same function.
[0070] [Appendix 7] a function call relationship extraction unit that extracts call relationships between a plurality of functions included in the program to be inspected; 7. The information processing device according to claim 5, further comprising a graph integration unit that integrates the directed graph with a graph indicating a call relationship of the functions.
[0071] [Appendix 8] The information processing device described in Appendix 7, wherein the graph integration unit highlights a node indicating a function to which a part that generates the control dependency belongs in a graph integrating the directed graph and a graph indicating the call relationship of the functions.
[0072] [Appendix 9] 9. The information processing device according to claim 7, wherein the graph integration unit omits, from the integrated graph, nodes of functions included in the program to be tested that are not related to the data dependency relationship and the control dependency relationship.
[0073] [Appendix 10] 10. The information processing device according to claim 1, wherein the dependency analysis unit analyzes a processing flow starting from a first function that receives data from an external source and ending at a second function that executes a specified processing.
[0074] [Appendix 11] The information processing device according to claim 10, wherein the dependency analysis unit analyzes variables that have a data dependency or a control dependency relationship with data input by the first function.
[0075] [Appendix 12] An information processing device as described in any one of Appendix 1 to 11, wherein the data dependency indicates a relationship in which the value of a dependent variable is derived from a dependent variable, and the control dependency indicates a relationship in which the value of a dependent variable changes or is generated as a result of processing branching depending on the dependent variable.
[0076] [Appendix 13] performing a flow analysis on a program to be inspected, and analyzing dependencies between variables in a process flow included in the program to be inspected, the dependencies including data dependencies and control dependencies; generating a directed graph for the process flow based on a result of the dependency relationship analysis, the directed graph having nodes as parts that cause the control dependency relationship in the program to be tested.
[0077] [Appendix 14] performing a flow analysis on a program to be inspected, and analyzing dependencies between variables in a process flow included in the program to be inspected, the dependencies including data dependencies and control dependencies; A program for causing a computer to execute a process including generating a directed graph for the processing flow based on the results of the dependency analysis, the directed graph having nodes as parts in the program being tested that cause the control dependency.
[0078] In addition, some or all of the elements, for example, configurations and functions, described in Supplementary Notes 2 to 12 that are dependent on Supplementary Note 1 may also be dependent on Supplementary Notes 13 and 14 in the same dependent relationship as Supplementary Notes 2 to 12. Some or all of the elements described in any Supplementary Note may be applied to various hardware, software, recording means for recording software, systems, and methods. [Explanation of symbols]
[0079] 10: Information processing device 11: Dependency analysis part 12: Directed graph generation unit 100, 100a, 100b: information processing device 101: Input section 102: Dependency analysis part 103: Directed graph generation unit 104: Output section 105: Function integration processing unit 106: Function call relationship extraction unit 107: Graph integration unit 300: Computer equipment 301: Processor 302: Memory
Claims
1. a dependency analysis unit that performs flow analysis on a program to be inspected and analyzes dependencies between variables in a process flow included in the program to be inspected, the dependencies including data dependencies and control dependencies; and a directed graph generation unit that generates, for the process flow, a directed graph in which parts that cause the control dependence in the program to be tested are nodes based on a result of the dependence relationship analysis.
2. The information processing device according to claim 1 , wherein the directed graph generating unit generates a directed graph including a node indicating a starting point of the process flow and a node indicating an end point of the process flow in addition to a node indicating a part that generates the control dependency.
3. The information processing apparatus according to claim 1 , wherein the directed graph generating unit generates a directed graph having a node corresponding to a code portion that generates the control dependency in the program to be checked.
4. The information processing device according to claim 3 , wherein the directed graph generating unit generates a directed graph having, as nodes, code of a portion that generates the dependency relationship and is described in the source code of the program to be checked.
5. The information processing apparatus according to claim 1 , wherein the directed graph generating unit generates a directed graph having functions, which are included in the program to be checked and to which parts causing the control dependence belong, as nodes.
6. 6. The information processing device according to claim 5, further comprising a function integration processing unit that integrates, when two or more parts generating the control dependency relationship belong to the same function, two or more parts generating the control dependency relationship that belong to the same function into one node.
7. a function call relationship extraction unit that extracts call relationships between a plurality of functions included in the program to be inspected; The information processing apparatus according to claim 5 , further comprising a graph integration unit that integrates the directed graph with a graph indicating a call relationship of the functions.
8. The information processing device according to claim 7 , wherein the graph integration unit highlights a node indicating a function to which a part generating the control dependency belongs in a graph obtained by integrating the directed graph and the graph indicating the function call relationships.
9. The information processing device according to claim 7 , wherein the graph integration unit omits, from the integrated graph, nodes of functions not related to the data dependency and the control dependency among functions included in the program under test.
10. 3 . The information processing apparatus according to claim 1 , wherein the dependency analysis unit analyzes a process flow starting from a first function that receives data from an external source and ending at a second function that executes a predetermined process.
11. The information processing apparatus according to claim 10 , wherein the dependency analysis unit analyzes variables that have a data dependency or a control dependency relationship with data input by the first function.
12. 3. The information processing device according to claim 1 or 2, wherein the data dependency indicates a relationship in which a value of a dependent variable is derived from a dependent variable, and the control dependency indicates a relationship in which a value of a dependent variable is changed or generated as a result of processing branching depending on the dependent variable.
13. performing a flow analysis on a program to be inspected, and analyzing dependencies between variables in a process flow included in the program to be inspected, the dependencies including data dependencies and control dependencies; generating a directed graph for the process flow based on a result of the dependency relationship analysis, the directed graph having nodes as parts that cause the control dependency relationship in the program to be tested.
14. performing a flow analysis on a program to be inspected, and analyzing dependencies between variables in a process flow included in the program to be inspected, the dependencies including data dependencies and control dependencies; A program for causing a computer to execute a process including generating a directed graph for the processing flow based on the results of the dependency analysis, the directed graph having nodes as parts in the program being tested that cause the control dependency.
Citation Information
Patent Citations
Brazing method for lead pin
JP1984041859A