Identifying indirect function call targets in software
By employing explicit data dependency analysis and graph neural networks to generate feature embeddings and cluster similar functions, the method addresses the inaccuracy of current indirect function call target identification, enhancing program security and analysis precision.
Patent Information
- Application Number
- JP2024534772
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2021-12-13
- Filing Date
- 2022-11-03
- Publication Date
- 2024-12-05
- Estimated Expiration
- 2042-11-03
AI Technical Summary
Current methods for identifying indirect function call targets in software are inaccurate, leading to high false positive and false negative rates, especially in large programs like operating system level software, which affects program analysis and security.
Utilizing explicit data dependency analysis and graph neural networks to generate feature embeddings, expanding the ground truth dataset of indirect function call targets, and employing clustering algorithms to identify similar functions, thereby improving the precision of target identification.
Reduces false positive and false negative rates in identifying indirect function call targets, enabling precise interprocedural analysis and enhancing program security through improved fuzz testing and vulnerability detection.
Smart Images

Figure 2024545197000001_ABST
Abstract
Description
[Technical field]
[0001] The present disclosure relates generally to function calls, and more particularly to identifying indirect function call targets within software source code. [Background technology]
[0002] A function call is a call that passes control of a program to a subroutine. After the subroutine is executed, control returns to the next instruction in the program. A function call is formed by an expression that evaluates to a function followed by a function call operator. The arguments to the function call operator come from a comma-separated list of expressions. The values of these expressions are passed as arguments to the function. Whenever a function call is encountered, program control is transferred to this called function. Summary of the Invention
[0003] According to one illustrative embodiment, a computer-implemented method is provided for indirect function call target identification in software. An explicit data dependency analysis is used to determine a set of explicit data flows that pass function addresses between software modules of a program. A set of indirect function call targets is generated from the results of the explicit data dependency analysis and the dynamic execution analysis of the program. The set of indirect function call targets is expanded by identifying similar target functions based on feature embeddings generated by a graph neural network. According to another illustrative embodiment, a computer system and computer program product are provided for indirect function call target identification in software. [Brief description of the drawings]
[0004] [Figure 1] 1 is a pictorial representation of a network of data processing systems in which illustrative embodiments may be implemented; [Diagram 2] FIG. 1 is a diagram of a data processing system in which illustrative embodiments may be implemented. [Diagram 3] FIG. 11 illustrates an example of a function similarity identification process in accordance with an illustrative embodiment. [Figure 4] FIG. 11 illustrates an example of an indirect function call target expansion process in accordance with an illustrative embodiment. [Diagram 5] 11 is a flowchart illustrating a process for identifying indirect function call targets in software in accordance with an illustrative embodiment. [Figure 6] 11 is a flowchart illustrating a process for expanding a set of ground truth indirect function call targets in accordance with an illustrative embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0005] The present invention may be a system, method, or computer program product, or combination thereof, at any possible level of technical detail of integration. The computer program product may include a computer-readable storage medium (or media) having computer-readable program instructions for causing a processor to carry out aspects of the present invention.
[0006] A computer readable storage medium can be a tangible device capable of holding and storing instructions for use in an instruction execution device. A computer readable storage medium can be, for example, but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. A non-exhaustive list of more specific examples of computer readable storage media includes portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD), memory sticks, floppy disks, mechanically encoded devices such as punch cards or ridge-in-groove structures having instructions recorded thereon, and any suitable combination of the foregoing. Computer-readable storage media, as used herein, should not be interpreted as being signals that are transitory in nature, such as electric waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., light pulses passing through a fiber optic cable), or electrical signals transmitted through wires.
[0007] The computer readable program instructions described herein may be downloaded from a computer readable storage medium to each computing / processing device or to an external computer or storage device over a network, such as the Internet, a local area network, a wide area network, or a wireless network, or a combination thereof. The network may comprise copper transmission cables, optical transmission fiber, wireless transmission, routers, firewalls, switches, gateway computers, or edge servers, or a combination thereof. A network adapter card or network interface in each computing / processing device receives the computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium in the respective computing / processing device.
[0008] The computer readable program instructions for carrying out the operations of the present invention may be either assembler instructions, instruction set architecture (ISA) instructions, machine language instructions, machine dependent instructions, microcode, firmware instructions, state setting data, configuration data for integrated circuit devices, or source or object code written in any combination of one or more programming languages, including object oriented programming languages such as Smalltalk®, C++, or the like, and procedural programming languages such as the “C” programming language or similar programming languages. The computer readable program instructions may be executed entirely on the user's computer, or partially on the user's computer, as a stand-alone software package, or partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be made to an external computer (e.g., through the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, a programmable logic device, a field programmable gate array (FPGA), or a programmable logic array (PLA) can execute computer readable program instructions by utilizing state information of the computer readable program instructions to individualize the electronic circuitry to perform aspects of the present invention.
[0009] Aspects of the present invention are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will 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 readable program instructions.
[0010] These computer readable program instructions may be provided to a computer processor or other programmable data processing apparatus to produce a machine, the instructions for execution by the computer processor or other programmable data processing apparatus to produce means for performing the functions / acts specified in one or more blocks of the flowcharts and / or block diagrams. These computer readable program instructions may also be stored on a computer readable storage medium such that the computer readable storage medium having stored thereon instructions comprises an article of manufacture including instructions for performing aspects of the functions / acts specified in one or more blocks of the flowcharts and / or block diagrams, and may instruct a computer, programmable data processing apparatus, or other device, or combination thereof, to function in a particular manner.
[0011] The computer readable program instructions may also be loaded into a computer, other programmable data processing apparatus, or other device to cause the computer, other programmable apparatus, or other device to perform a series of operational steps such that the instructions executing on the computer, other programmable apparatus, or other device produce a computer-executed process to perform the functions / acts specified in one or more blocks of the flowcharts and / or block diagrams.
[0012] The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowcharts or block diagrams may represent a module, segment, or portion of instructions that includes one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions noted in the blocks may occur in a different order than that noted in the figures. For example, two blocks shown in succession may actually be implemented as a single step that is executed simultaneously, substantially simultaneously, partially or fully overlapping in time, or the blocks may sometimes be executed in the reverse order depending on the functionality involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or acts or executes a combination of dedicated hardware and computer instructions.
[0013] Referring now to the figures, and in particular to Figures 1 and 2, diagrams of data processing environments are provided in which illustrative embodiments may be implemented. It should be understood that Figures 1 and 2 are intended to be merely examples and are not intended to assert or imply any limitation with respect to the environments in which different embodiments may be implemented. Many modifications may be made to the depicted environments.
[0014] 1 depicts a diagrammatic representation of a network of data processing systems in which illustrative embodiments may be implemented. Network data processing system 100 is a network of computers, data processing systems, and other devices in which illustrative embodiments may be implemented. Network data processing system 100 includes network 102, which is the medium used to provide communications links between the computers, data processing systems, and other devices connected together in network data processing system 100. Network 102 may include connections such as, for example, wired communications links, wireless communications links, fiber optic cables, and the like.
[0015] In the depicted example, server 104 and server 106 connect to network 102 along with storage 108. Server 104 and server 106 may be, for example, server computers with high speed connections to network 102. Additionally, server 104 and server 106 may each represent a cluster of servers in one or more data centers. Alternatively, server 104 and server 106 may each represent multiple computing nodes in one or more cloud environments.
[0016] Additionally, the server 104 and the server 106 provide an indirect function call target identification service to the registered client devices. An indirect function call refers to a function invocation in a program via a function pointer. Dereferencing the function pointer at run time results in the referenced target function. The referenced target function is indirectly called through a variable, rather than through a fixed address as in a normal (i.e., direct) function call. The server 104 and the server 106 provide the indirect function call target identification service by first generating a function call graph of the program based on a static analysis of the program's source code by a compiler or other program analysis tool. The program may be, for example, an operating system level software with multiple modules. The server 104 and the server 106 also use a graph neural network trained on the function call graph and the function features to generate feature embeddings corresponding to the features of the functions of the program. It should be noted that different functions may be implemented by different modules of the program.
[0017] Further, the server 104 and the server 106 utilize a clustering algorithm to cluster together functions having similar characteristics based on the generated feature embeddings to form clusters of similar functions. Further, the server 104 and the server 106 perform an explicit data dependency analysis on the function call graph to identify data dependencies between software modules of the program with respect to the indirect function call targets, and perform a dynamic execution analysis of the program to identify the indirect function call targets. Further, the server 104 and the server 106 generate a ground truth dataset of the indirect function call targets based on the explicit data dependency and the dynamic execution analysis. Moreover, the server 104 and the server 106 expand the ground truth dataset of the indirect function call targets with functions in the clusters of similar functions that have similar characteristics to these functions in the ground truth dataset of the indirect function call targets. The server 104 and the server 106 utilize the expanded ground truth dataset of the indirect function call targets to perform at least one of fuzz testing, vulnerability detection, exploitation discovery, or program behavior analysis on the program.
[0018] Ground truth is information that is known to be real or true, provided by direct observation and measurement (i.e., empirical evidence) rather than information provided by inference. As used herein, a ground truth dataset of indirect function call targets means that indirect function call targets are accurately identifiable by explicit data dependency analysis and dynamic execution analysis. These identified indirect function call targets in the ground truth dataset are always correct. The ground truth indirect function call targets are a subset of the entire indirect function call targets in a program. Most indirect function call targets are not identifiable until late in the execution. As a result, illustrative embodiments utilize a graph neural network to infer potential indirect function call targets based on the ground truth dataset of indirect function call targets.
[0019] Client 110, client 112, and client 114 also connect to network 102. Clients 110, 112, and 114 are registered client devices of server 104 and server 106. In this example, clients 110, 112, and 114 are shown as desktop or personal computers with wired communication links to network 102. However, it should be noted that clients 110, 112, and 114 are merely examples and may represent other types of data processing systems, such as, for example, network computers, laptop computers, handheld computers, smart phones, smart televisions, smart vehicles, and the like, with wired or wireless communication links to network 102. Users of clients 110, 112, and 114 may utilize clients 110, 112, and 114 to request indirect function call target identification services provided by server 104 and server 106, which will be implemented in clients 110, 112, and 114.
[0020] Storage 108 is a network storage device capable of storing any type of data in a structured or unstructured format. Additionally, storage 108 may represent multiple network storage devices. Additionally, storage 108 may store identifiers and network addresses of multiple registered client devices, identifiers of multiple programs (e.g., operating system level software) corresponding to the multiple registered client devices, source code corresponding to the multiple programs, function call graphs corresponding to the multiple programs, software module data dependency graphs corresponding to the multiple programs, listings of functions corresponding to the multiple programs including the characteristics of the functions, and the like. Additionally, storage 108 may store other types of data, such as authentication or credential data, which may include, for example, usernames, passwords, and the like associated with program developers, system administrators, and client device users.
[0021] Additionally, it should be noted that network data processing system 100 may include any number of additional servers, clients, storage devices, and other devices not shown. The program code present within network data processing system 100 may be stored on a computer readable storage medium or set of computer readable storage media and downloaded to a computer or other data processing device for use. For example, the program code may be stored on a computer readable storage medium of server 104 and downloaded to client 110 via network 102 for use by client 110.
[0022] In the depicted example, network data processing system 100 may be implemented as a number of different types of communications networks, such as, for example, the Internet, an intranet, a wide area network, a local area network, a telecommunications network, or any combination thereof. Figure 1 is intended as an example only, and is not intended to imply architectural limitations for different illustrative embodiments.
[0023] As used herein, when used in reference to an item, "some" means one or more of the items. For example, "several different types of communication networks" are one or more different types of communication networks. Similarly, "a set of" when used in reference to an item means one or more of the items.
[0024] Furthermore, the term "at least one of," when used with a list of items, means that one or more different combinations of the listed items may be used, and that only one of each item in the list may be required. In other words, "at least one of" means that any combination of items and any number of items from the list may be used, but not all of the items in the list are required. An item may be a particular object, thing, or category.
[0025] For example, without limitation, "at least one of item A, item B, or item C" may include item A, item A and item B, or item B. This example may also include item A, item B, and item C, or item B and item C. Of course, any combination of these items may be present. In some illustrative examples, "at least one of" may be, for example, without limitation, two of item A, one of item B, and ten of item C, or four of item B and seven of item C, or other suitable combinations.
[0026] Referring now to Figure 2, a diagram of a data processing system according to an illustrative embodiment is depicted. Data processing system 200 is an example of a computer, such as server 104 of Figure 1, in which computer readable program code or instructions may be located that execute the indirect function call target identification process of the illustrative embodiment. In this example, data processing system 200 includes a communications fabric 202 that provides communications between a processor unit 204, a memory 206, persistent storage 208, a communications unit 210, an input / output (I / O) unit 212, and a display 214.
[0027] The processor unit 204 functions to execute instructions for software applications and programs that may be loaded into the memory 206. The processor unit 204 may be a set of one or more hardware processor devices or may be a multi-core processor, depending on the particular implementation.
[0028] Memory 206 and persistent storage 208 are examples of storage devices 216. As used herein, a computer-readable storage device or computer-readable storage medium is any piece of hardware that can store information, such as, for example, without limitation, data, computer-readable program code in a functional form, or other suitable information, or a combination thereof, either temporarily or permanently. Additionally, computer-readable storage device or computer-readable storage medium excludes propagating media, such as transitory signals. Additionally, a computer-readable storage device or computer-readable storage medium may represent a set of computer-readable storage devices or a set of computer-readable storage media. Memory 206, in these examples, may be, for example, random access memory (RAM), or any other suitable volatile or non-volatile storage device, such as flash memory. Persistent storage 208 may take various forms, depending on the particular implementation. For example, persistent storage 208 may contain one or more devices. For example, persistent storage 208 may be a disk drive, a solid state drive, a rewritable optical disk, a rewritable magnetic tape, or some combination of the above. The medium used by persistent storage 208 may be removable. For example, a removable hard drive may be used for persistent storage 208.
[0029] In this example, persistent storage 208 stores indirect function call target identifier 218. However, it should be noted that although indirect function call target identifier 218 is shown as residing in persistent storage 208, in alternative illustrative embodiments, indirect function call target identifier 218 may be a separate component of data processing system 200. For example, indirect function call target identifier 218 may be a hardware component coupled to communications fabric 202, or a combination of hardware and software components. In another alternative illustrative embodiment, a first set of components of indirect function call target identifier 218 may be located within data processing system 200 and a second set of components of indirect function call target identifier 218 may be located within a second data processing system, such as, for example, server 106 of FIG. 1 .
[0030] The indirect function call target identifier 218 controls the process of indirect function call target identification in software, such as operating system kernels, operating system level software, and the like, located on registered client devices. As a result, the data processing system 200 operates as a special-purpose computer system in which the indirect function call target identifier 218 of the data processing system 200 enables accurate identification of indirect function call targets for improved fuzz testing, vulnerability detection, and exploit discovery to improve software security. In particular, the indirect function call target identifier 218 transforms the data processing system 200 into a special-purpose computer system comparable to currently available general computer systems that do not have the indirect function call target identifier 218.
[0031] The communications unit 210 provides for communication with other computers, data processing systems, and client devices over a network, such as the network 102 of FIG. 1 in this example. The communications unit 210 may provide for communication through the use of both physical and wireless communications links. The physical communications links may utilize, for example, wires, cables, universal serial buses, or any other physical technology to establish a physical communications link for the data processing system 200. The wireless communications links may utilize, for example, short wave, radio frequency, very high frequency, microwave, Wireless Fidelity (WiFi), Bluetooth technology, Global System for Mobile Communications (GSM), Code Division Multiple Access (CDMA), second generation (2G), third generation (3G), fourth generation (4G), 4G Long Term Evolution (LTE), LTE Advanced, fifth generation (5G), or any other wireless communications technology or standard to establish a wireless communications link for the data processing system 200.
[0032] Input / output unit 212 allows for the input and output of data with other devices that may be connected to data processing system 200. For example, input / output unit 212 may provide a connection for user input through a keypad, keyboard, mouse, microphone, or some other suitable input device, or combination thereof. Display 214 provides a mechanism for displaying information to a user and may include touch screen capabilities, for example, to allow a user to make on-screen selections through the user interface or input data.
[0033] Instructions for the operating system, applications, and / or programs may be located in storage device 216, which is in communication with processor unit 204 through communications fabric 202. In this illustrative example, the instructions are in functional form on persistent storage 208. These instructions may be loaded into memory 206 for execution by processor unit 204. The processes of the different embodiments may be performed by processor unit 204 using computer-implemented instructions, which may be located in a memory, such as memory 206. These program instructions may be referred to as program code, computer usable program code, or computer readable program code, and may be read and executed by a processor of processor unit 204. The program instructions may be contained in different physical computer readable storage devices, such as memory 206 or persistent storage 208, in different embodiments.
[0034] The program code 220 may be placed in a functional form on a selectively removable computer readable medium 222 and loaded or transferred to the data processing system 200 for execution by the processor unit 204. The program code 220 and the computer readable medium 222 form a computer program product 224. In one example, the computer readable medium 222 may be a computer readable storage medium 226 or a computer readable signal medium 228.
[0035] In these illustrative examples, computer readable storage medium 226 is not a medium for propagating or transmitting program code 220, but rather a physical or tangible storage device used to store program code 220. Computer readable storage medium 226 may include, for example, an optical or magnetic disk inserted or placed into a drive or other device that is part of persistent storage 208 for transfer to a storage device, such as a hard drive that is part of persistent storage 208. Computer readable storage medium 226 may also be a form of persistent storage, such as a hard drive, thumb drive, or flash memory connected to data processing system 200.
[0036] Alternatively, program code 220 may be transferred to data processing system 200 using computer readable signal media 228. Computer readable signal media 228 may be, for example, a propagated data signal carrying program code 220. For example, computer readable signal media 228 may be an electromagnetic signal, an optical signal, or any other suitable type of signal. These signals may be transmitted over communications links, such as wireless communications links, fiber optic cable, coaxial cable, a wire, or any other suitable type of communications link.
[0037] Additionally, as used herein, "computer readable medium 222" may be singular or plural. For example, program code 220 may be located on computer readable medium 222 in the form of a single storage device or system. In another example, program code 220 may be located on computer readable medium 222 distributed among multiple data processing systems. In other words, some instructions in program code 220 may be located in one data processing system, while other instructions in program code 220 may be located in one or more other data processing systems. For example, a portion of program code 220 may be located on computer readable medium 222 of a server computer, while another portion of program code 220 may be located on computer readable medium 222 in a set of client computers.
[0038] The different components illustrated for data processing system 200 are not intended to provide architectural limitations to the manner in which different embodiments may be implemented. In some illustrative examples, one or more of the components may be incorporated into or otherwise form a part of another component. For example, in some illustrative examples, memory 206, or portions thereof, may be incorporated within processor unit 204. The different illustrative embodiments may be implemented in a data processing system including other or alternative components than those illustrated for data processing system 200. Other components illustrated in FIG. 2 may vary from the illustrated illustrative examples. The different embodiments may be implemented using any hardware device or system capable of executing program code 220.
[0039] In another example, a bus system may be used to implement communications fabric 202 and may be comprised of one or more buses, such as a system bus or an input / output bus. Of course, the bus system may be implemented using any suitable type of architecture that provides for a transfer of data between different components or devices attached to the bus system.
[0040] Indirect function calls, represented as function pointers, are often used in large C / C++ programs, e.g., operating system kernels, browsers, or similar, to allow dynamic function selection based on execution value. An indirect function call uses a call instruction with a target function address that is determined only at runtime.
[0041] Precise identification of indirect function call targets is necessary to build accurate control flow graphs, which are the basis of program analysis. Precise identification of indirect function call targets is especially important for program fuzz testing, program vulnerability detection, program exploit discovery, program behavior analysis, and the like. However, current compilers cannot precisely identify indirect function call targets statically at compile time, because indirect function call target addresses can only be determined by values calculated at run time.
[0042] There are currently solutions that roughly correspond to potential target functions of an indirect call. One current solution utilizes point-to analysis to identify indirect function call targets. Point-to analysis is a part of pointer analysis and is a common approach that matches function pointers to their corresponding function addresses. However, due to aliasing of function pointers, traditional point-to analysis is not precise, especially when used to analyze large programs. Another current solution utilizes type analysis to identify indirect function call targets. Type analysis is also used in indirect function call target identification, since this may be appropriate in most cases. In other words, type analysis identifies indirect function call targets by matching type information (e.g., characteristics) of potential target functions with call site instructions. The call site instructions in a program binary can be for direct or indirect function calls. Yet another current solution for identifying indirect function call targets is dynamic execution analysis of a program, recording executed direct and indirect function call targets.
[0043] Each of these current solutions attempts to identify indirect function call targets, but all of these current solutions have problems with accuracy or precision. The results of these current solutions are not precise enough to be used for program analysis of large programs, such as operating system level software. For example, even if dynamic execution analysis does not introduce false positive results, the code coverage rate of dynamic execution analysis is usually low (e.g., 0-20%) for large programs. This can lead to a high false negative function target rate because most function call addresses are not covered during dynamic execution tracing and only one function call target may be mapped per function call address. Conversely, type analysis and point-to analysis are adequate, which means that type analysis and point-to analysis do not introduce many false negative function target results, but type analysis due to common function characteristics and point-to analysis due to function pointer aliasing may still generate many false positive function target results.
[0044] The illustrative embodiments reduce the false positive and false negative function call target rates generated by current solutions. Note that the illustrative embodiments can be integrated with type analysis and point-to-point analysis approaches to significantly reduce the false positive function target rates generated by these approaches. Specifically, the illustrative embodiments identify indirect function call targets by analyzing explicit data dependencies between a program's function call site module and a function address obtainment module. The function call site module is where the function call site instruction is located. The function address obtainment module is where the address of the function being called is located.
[0045] Illustrative embodiments utilize explicit data dependencies between the retrieved function addresses and specific function call site instructions to generate a set of ground truth indirect function call targets. The set of ground truth indirect function call targets is a relatively small set of indirect function call targets that are always called. Additionally, illustrative embodiments utilize function similarity based on feature embeddings generated by a graph neural network to expand the ground truth dataset of indirect function call targets and identify indirect function call targets with more complex data dependencies. Feature embeddings are vector representations of the features of a function. These complex data dependencies typically involve implicit data flows that are not found during explicit data dependency analysis and are missing in a module dependency graph. A module dependency graph shows data dependencies between modules (e.g., function call site modules and function address retrieval modules) in a program (e.g., operating system level software). Data dependencies between modules mean that data in one module depends on or is required by data in another module.
[0046] The results of current solutions are not accurate enough to be used for static analysis, e.g., rigorous interprocedural analysis of a program or function call graph construction. In contrast, the illustrative embodiments achieve both lower false negative and lower false positive function call target rates by making the final function call target results informative for static analysis. Furthermore, the illustrative embodiments can be used independently or integrated with current solutions to improve the accuracy of indirect function call target identification.
[0047] To improve the accuracy of indirect function call target identification, illustrative embodiments utilize explicit data dependency analysis and similar indirect function call target augmentation. Illustrative embodiments utilize explicit data dependency analysis to determine whether there is any explicit data flow of the program that allows function addresses to be passed between modules, and therefore can weed out invalid target functions by providing function call sites that provide the location of the call instructions. Explicit data flow means that the data flow in the program can be precisely modeled and traced using explicit data dependency analysis. Function addresses can only be passed between modules by sharing global variables or through function calls. Thus, for two program modules, if one module calls a function or uses a global variable defined in another module, then these two modules have a data dependency. Furthermore, if a function call or global variable allows the target function address to be passed, then the call site of an indirect function call target in one module can use a function defined in another module as the target function. Illustrative embodiments use this explicit data dependency analysis to generate an initial set of ground truth indirect function call targets.
[0048] Illustrative embodiments expand the initial set of ground truth indirect function call targets to include data flows passing implicit function addresses of the program that are missing from the module dependency graph. Illustrative embodiments rank potential indirect function call targets using function similarity as a metric. Function similarity is based on the observation that target functions mapped to the same indirect function call site are typically similar in, for example, function type, local variable data types, function calls, intraprocedural control flow, etc. Illustrative embodiments utilize a graph neural network to generate feature embeddings that represent features of the program's functions as vectors. To generate these feature embeddings, illustrative embodiments first construct a function call graph of the program that needs to be analyzed. Moreover, illustrative embodiments utilize the function call graph of the program to train the graph neural network. Illustrative embodiments then utilize the trained graph neural network to generate feature embeddings for all functions of the program. Graph neural networks are a deep learning technique that extends existing neural networks to process data on graphs. Using a graph neural network, the nodes in the graph neural network structure add the information collected from the neighboring nodes. The last layer of the graph neural network combines all this added information collected from the neighboring nodes to the node and outputs a prediction or classification of the node features.
[0049] During training of the graph neural network, illustrative embodiments may further include other function features, such as data types of local variables, as node features for each function. Based on the feature embedding, illustrative embodiments search for similarities between different program functions. Exemplary embodiments may select functions having a similarity score above a predefined minimum function similarity threshold as similar functions. As a result, illustrative embodiments may automatically determine a target function for any indirect function call. Furthermore, this identification of indirect function call targets is an iterative process, involving multiple iterations until a similar target function termination is identified.
[0050] As a result, illustrative embodiments can generate accurate function call graphs corresponding to a program with precise indirect function call target identification with reduced false positive rates, reducing the search space for program security analysis. Exemplary embodiments utilize the accurate function call graphs to generate training data for a graph neural network to learn function features and distinguish between legitimate and anomalous execution paths in a program. Exemplary embodiments utilize both dynamic execution analysis and explicit data dependency analysis of the program to generate a ground truth dataset of indirect function call targets. Exemplary embodiments further expand the ground truth dataset of indirect function call targets to include a set of similar indirect function call targets using a graph neural network trained on the program's function call graph.
[0051] Accordingly, illustrative embodiments provide one or more technical solutions that overcome technical problems associated with generating false positive and false negative function call target rates with current solutions. As a result, these one or more technical solutions provide a technical effect and practical application in the field of program security analysis by accurately identifying indirect function call targets within a program.
[0052] 3, a diagram illustrating an example of a function similarity identification process in accordance with an illustrative embodiment is depicted. The function similarity identification process 300 may be implemented on a computer, such as the server 104 of FIG. 1 or the data processing system 200 of FIG.
[0053] In this example, the function similarity identification process 300 includes a compiler 302, a graph neural network 304, and a clustering algorithm 306. The computer utilizes the compiler 302 to perform a static analysis of program source code 308. The program source code 308 represents the source code of a particular program, such as an operating system kernel or operating system level software, that is to be analyzed for security vulnerabilities.
[0054] Based on the static analysis of the program source code 308, the compiler generates a program function call graph 310. The program function call graph 310 is a graph structure that depicts the functions of the program as nodes and the function calls corresponding to the functions as edges between the nodes in the graph structure. Furthermore, each respective node corresponding to a particular function includes a list of characteristics of this particular function.
[0055] The computer uses the information contained in the program function call graph 310 as training data to train the graph neural network 304 to identify features of each respective function of the program. Once the graph neural network 304 is trained, the computer uses the graph neural network 304 to generate feature embeddings 312 of the functions. The feature embeddings 312 of the functions include a set of feature embeddings for each respective function of the program. Each feature embedding is a vector representation of a particular feature of the corresponding function.
[0056] After the graph neural network 304 generates the feature embeddings 312 of the functions, the computer utilizes a clustering algorithm 306 to generate clusters 314 of similar functions based on the feature embeddings 312 of the functions. The clustering algorithm 306 may be any type of clustering algorithm, such as, for example, a K-means clustering algorithm, a density-based clustering algorithm, a variance-based clustering algorithm, a centroid-based clustering algorithm, or the like. The clusters of similar functions 314 represent multiple different clusters of functions (e.g., cluster 1, cluster 2, and cluster 3), each cluster having similar function characteristics. Note that functions having similar characteristics will be called by the same call site instruction. When executed, the call site instruction transfers control to the target function.
[0057] 4, a diagram illustrating an example of an indirect function call target augmentation process is depicted in accordance with an illustrative embodiment. The indirect function call target augmentation process 400 may be implemented on a computer, such as the server 104 of FIG. 1 or the data processing system 200 of FIG. 2.
[0058] In this example, the indirect function call target augmentation process 400 includes a cluster of similar functions 402, a set of ground truth indirect function call targets 404, and an expanded set of indirect function call targets 406. The cluster of similar functions 402 may be, for example, the cluster of similar functions 314 of FIG. 3. The computer generates the set of ground truth indirect function call targets 404 based on the computer performing an explicit data dependency analysis on a function call graph corresponding to the program that identifies data dependencies between software modules of the program with respect to the indirect function call targets, and the computer performing a dynamic execution analysis on the binary of the program that identifies the indirect function call target addresses. The set of ground truth indirect function call targets 404 represents a number of indirect function call targets, where each target function in the set is guaranteed to be called by an indirect function call.
[0059] The computer searches the cluster of similar functions 402 to identify functions having characteristics similar to those of the set of ground truth indirect function call targets 404. The computer expands the set of ground truth indirect function call targets 404 with one or more functions identified in the search that have characteristics similar to those of the set of ground truth indirect function call targets 404 because functions with similar characteristics are typically called by the same call site instructions. By combining the set of ground truth indirect function call targets 404 with one or more functions having characteristics similar to those of the set of ground truth indirect function call targets 404, the computer generates an expanded set of indirect function call targets 406. The computer utilizes the expanded set of indirect function call targets 406 to perform, for example, fuzz testing, vulnerability detection, exploit discovery, program behavior analysis, and the like, on the program to identify security vulnerabilities and other security gaps in the program and improve program security.
[0060] Referring now to Figure 5, a flowchart illustrating a process for identifying indirect function call targets in software is shown in accordance with an illustrative embodiment. The process illustrated in Figure 5 may be implemented in a computer such as, for example, server 104 of Figure 1 or data processing system 200 of Figure 2. For example, the process illustrated in Figure 5 may be implemented in indirect function call target identifier 218 of Figure 2.
[0061] The process begins when the computer receives input to identify an indirect function call target of a program (step 502). The program may be operating system level software that includes multiple software modules, such as, for example, a function call site module and a function address obtainment module. In response to receiving the input, the computer retrieves source code for the program (step 504). The computer may retrieve the source code from a storage device, such as, for example, storage 108 of FIG. 1.
[0062] The computer performs static analysis on the source code of the program (step 506). The computer may perform the static analysis of the source code using, for example, a compiler. Alternatively, the computer may perform the static analysis of the source code using a program analysis tool or the like. The computer uses a compiler for explicit data dependency discovery between software modules of the program. The computer generates a function call graph corresponding to the program including characteristics of the functions of the program based on the static analysis of the source code of the program (step 508).
[0063] The computer trains the graph neural network to identify features of the functions of the program using the function call graph of the program to form a trained graph neural network (step 510). In other words, the computer trains the graph neural network based on the function call graph and the function features to search for similar functions by including similar function call targets. The computer uses the trained graph neural network to generate feature embeddings corresponding to the features of the functions of the program (step 512). The computer generates a set of feature embeddings for each respective function of the program.
[0064] The computer uses a clustering algorithm to form clusters of similar functions, placing similar functions of the program with similar characteristics based on the feature embedding corresponding to the characteristics of the functions of the program in the same cluster (step 514). The computer utilizes a clustering algorithm to determine functional similarity between the functions of the program.
[0065] Additionally, the computer performs an explicit data dependency analysis on the source code of the program to identify data dependencies between modules of the program that correspond to the indirect function call targets (step 516). Additionally, the computer performs a dynamic execution analysis on the binary code of the program to identify the indirect function call targets (step 518). The computer generates a set of ground truth indirect function call targets based on the explicit data dependency analysis of the source code and the dynamic execution analysis of the binary code of the program (step 520). It should be noted that the computer may perform steps 510-514 and steps 516-520 simultaneously or substantially simultaneously.
[0066] The computer then performs a search of clusters of similar functions to identify one or more clusters of similar functions having similar characteristics as the set of ground truth indirect function call targets (step 522). The computer then expands the set of ground truth indirect function call targets to include one or more clusters of similar functions based on the search to form an expanded set of indirect function call targets (step 524). Further, the computer performs at least one of fuzz testing, vulnerability detection, or exploit discovery of the program using the expanded set of indirect function call targets (step 526). The process then ends.
[0067] Referring now to Figure 6, a flow chart illustrating a process for expanding a set of ground truth indirect function call targets is shown in accordance with an illustrative embodiment. The process illustrated in Figure 6 may be implemented in a computer, such as, for example, server 104 of Figure 1 or data processing system 200 of Figure 2. For example, the process illustrated in Figure 6 may be implemented in indirect function call target identifier 218 of Figure 2.
[0068] The process begins when the computer uses explicit data dependency analysis to determine a set of explicit data flows that pass function addresses between software modules of the program (step 602). Additionally, the computer generates a set of ground truth indirect function call targets from the results of the explicit data dependency analysis and the dynamic execution analysis of the program (step 604). Additionally, the computer expands the set of ground truth indirect function call targets by identifying similar target functions based on the feature embeddings generated by the graph neural network (step 606). In this manner, the computer identifies these target functions that were overlooked in the explicit data dependency analysis and the dynamic execution analysis due to their complex data flows by using the graph neural network to identify target functions with similar feature embeddings to functions identified in the ground truth dataset. Thereafter, the process ends.
[0069] Thus, illustrative embodiments of the present invention provide a computer-implemented method, computer system, and computer program product for identifying indirect function call targets in software. The description of various embodiments of the present invention has been presented for illustrative purposes, but is not intended to be exhaustive or limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope of the described embodiments. The terminology used herein has been selected to best explain the principles of the embodiments, practical applications, or technical improvements over techniques found in the marketplace, or to enable those skilled in the art to understand the embodiments disclosed herein.
Claims
1. 1. A method for indirect function call target identification in software, comprising: determining a set of explicit data flows that pass function addresses between software modules of the program using explicit data dependency analysis; generating a set of indirect function call targets from results of the explicit data dependency analysis and the dynamic execution analysis of the program; expanding the set of indirect function call targets by identifying similar target functions based on feature embeddings generated by a graph neural network; A method comprising:
2. generating a function call graph corresponding to the program including characteristics of functions of the program based on a static analysis of a source code of the program; training a graph neural network to identify the characteristics of the functions of the program using the function call graph of the program; The method of claim 1 further comprising:
3. generating said feature embeddings corresponding to functional features of said program using a trained graph neural network; placing similar functions of the program with similar features based on the feature embedding that correspond to the features of the functions of the program in the same cluster; The method of claim 1 further comprising:
4. performing the explicit data dependency analysis on source code of the program to identify data dependencies between modules of the program that correspond to indirect function call targets; performing said dynamic execution analysis on said program binary to identify indirect function call targets; generating a set of ground truth indirect function call targets based on the explicit data dependency analysis of the source code and the dynamic execution analysis of the binary of the program; The method of claim 1 further comprising:
5. conducting a search of clusters of similar functions to identify one or more clusters of similar functions having similar characteristics involving the set of ground truth indirect function call targets; expanding the set of ground truth indirect function call targets to include the one or more clusters of similar functions based on the search to form an expanded set of indirect function call targets. The method of claim 4 further comprising:
6. performing at least one of fuzz testing, vulnerability detection, or exploit discovery for the program using the expanded set of indirect function call targets. The method of claim 5 further comprising:
7. The method of claim 1 , wherein the functional similarity is determined by a clustering algorithm.
8. The method of claim 1 , wherein a set of function embeddings is generated for each respective function of the program.
9. 2. The method of claim 1, wherein one of a compiler or a program analysis tool is used for the explicit data dependency analysis, and the graph neural network trained based on the function call graph and function characteristics of the program is used to search for similar functions by including similar target functions.
10. 1. A computer system for indirect function call target identification in software, comprising: A bus system; a storage device connected to the bus system, the storage device storing program instructions; a processor connected to the bus system, determining a set of explicit data flows that pass function addresses between software modules of the program using explicit data dependency analysis; generating a set of indirect function call targets from results of the explicit data dependency analysis and the dynamic execution analysis of the program; and and expanding the set of indirect function call targets by identifying similar target functions based on feature embeddings generated by a graph neural network. a processor that executes the program instructions to A computer system comprising:
11. The processor, generating a function call graph corresponding to the program that includes characteristics of functions of the program based on a static analysis of a source code of the program; and training a graph neural network to identify the characteristics of the functions of the program using the function call graph of the program; 11. The computer system of claim 10, further executing the program instructions for:
12. The processor, generating said feature embeddings corresponding to functional features of said program using a trained graph neural network; and placing similar functions of the program with similar features based on the feature embedding that correspond to the features of the functions of the program in the same cluster; 11. The computer system of claim 10, further executing the program instructions for:
13. The processor, performing the explicit data dependency analysis on source code of the program to identify data dependencies between modules of the program that correspond to indirect function call targets; performing said dynamic execution analysis on said program binary to identify indirect function call targets; and generating a set of ground truth indirect function call targets based on the explicit data dependency analysis of the source code and the dynamic execution analysis of the binary of the program.
11. The computer system of claim 10, further executing the program instructions for:
14. The processor, conducting a search of clusters of similar functions to identify one or more clusters of similar functions having similar characteristics with said set of ground truth indirect function call targets; and expanding the set of ground truth indirect function call targets to include the one or more clusters of similar functions based on the search to form an expanded set of indirect function call targets.
14. The computer system of claim 13, further executing the program instructions for:
15. 1. A computer program product for indirect function call target identification in software, comprising: a computer readable storage medium having program instructions embodied therein, the program instructions comprising: determining a set of explicit data flows that pass function addresses between software modules of the program using explicit data dependency analysis; generating a set of indirect function call targets from results of the explicit data dependency analysis and the dynamic execution analysis of the program; and and expanding the set of indirect function call targets by identifying similar target functions based on feature embeddings generated by a graph neural network. A computer program product executable by a computer to cause said computer to perform the method.
16. generating a function call graph corresponding to the program that includes characteristics of functions of the program based on a static analysis of a source code of the program; and training a graph neural network to identify the characteristics of the functions of the program using the function call graph of the program; 16. The computer program product of claim 15, further comprising:
17. generating said feature embeddings corresponding to functional features of said program using a trained graph neural network; and placing similar functions of the program with similar features based on the feature embedding that correspond to the features of the functions of the program in the same cluster; 16. The computer program product of claim 15, further comprising:
18. performing the explicit data dependency analysis on source code of the program to identify data dependencies between modules of the program that correspond to indirect function call targets; performing said dynamic execution analysis on said program binary to identify indirect function call targets; and generating a set of ground truth indirect function call targets based on the explicit data dependency analysis of the source code and the dynamic execution analysis of the binary of the program.
16. The computer program product of claim 15, further comprising:
19. conducting a search of clusters of similar functions to identify one or more clusters of similar functions having similar characteristics with said set of ground truth indirect function call targets; and expanding the set of ground truth indirect function call targets to include the one or more clusters of similar functions based on the search to form an expanded set of indirect function call targets.
20. The computer program product of claim 18, further comprising:
20. performing at least one of fuzz testing, vulnerability detection, or exploit discovery for the program using the expanded set of indirect function call targets.
20. The computer program product of claim 19, further comprising:
Citation Information
Patent Citations
Systems and methods for software analytics
JP2017519300A
Automatic code change identification
JP2022534181A
Dynamic call tracking method based on CPU interrupt instructions to improve disassembly quality of indirect calls
US20150363198A1
