Scalable incremental analysis using caller and callee profiling
By generating forward and reverse summaries for each component in the code base and performing incremental analysis, it solves the problem of low analysis efficiency after code base modifications, achieves efficient security vulnerability detection for large code bases, and improves analysis efficiency.
Patent Information
- Application Number
- CN201980089095.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-01-22
- Filing Date
- 2019-12-31
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2039-12-31
AI Technical Summary
After the existing technology is modified in the code base, the efficiency of analyzing the entire code base is low. Especially when detecting security vulnerabilities, reverse profiling of the changed code and its callers is required, resulting in a waste of resources and low efficiency.
By generating forward and reverse summaries for each component of the code, incremental analysis is performed on the modified components, and forward and reverse flows are used to generate local flows to detect defects in the code, reduce the scope of analysis, and improve efficiency.
Enables efficient security vulnerability analysis of large code bases, reducing summary size and improving analysis efficiency, enabling rapid identification of new security vulnerabilities and determination of whether existing vulnerabilities have been corrected.
Smart Images

Figure CN113330437B_ABST
Abstract
Description
Background Art
[0001] Typically, only a small portion of the code base will be modified. Therefore, it is inefficient to analyze the entire code base for each code change. For example, the analysis can be a security analysis (e.g., pollution or escape analysis) for detecting security vulnerabilities in web applications and services. Standard methods typically use backward summaries that describe the data flow between the changed code and the components called by the changed code. Using standard methods, in response to the change, the changed code is analyzed, including all callers of the changed code. Summary of the invention
[0002] This Summary is provided to introduce a selection of concepts that are further described below in the Detailed Description. This Summary is not intended to identify key or essential features of the claimed subject matter, nor is it intended to be used as an aid in limiting the scope of the claimed subject matter.
[0003] In general, in one aspect, one or more embodiments relate to a method comprising: performing a full analysis of code and generating a summary for each component of the code, including: (i) a forward summary including a forward flow and (ii) a reverse summary including a reverse flow; obtaining a modification to a modified component; determining that one of the summaries of the modified component is invalid; and in response to determining that one of the summaries of the modified component is invalid: obtaining a forward flow from the forward summary of the modified component, obtaining a reverse flow from a reverse summary of the modified component, generating a local flow by performing incremental analysis on the modified component using the forward flow of the modified component and the reverse flow of the modified component, and detecting defects in the code using the forward flow of the modified component, the local flow, and the reverse flow of the modified component.
[0004] In general, in one aspect, one or more embodiments relate to a system comprising: a memory coupled to a computer processor; a repository configured to store original source code of code including components, each component including a summary, including (i) a forward summary including a forward flow and (ii) a reverse summary including a reverse flow; and a code analyzer, which executes on the computer processor and uses the memory, and is configured to: generate a summary for each component of the code by fully analyzing the code; obtain modifications to the modified component; determine that one of the summaries of the modified component is invalid; and in response to determining that one of the summaries of the modified component is invalid: obtain a forward flow from the forward summary of the modified component, obtain a reverse flow from the reverse summary of the modified component, generate a local flow by performing incremental analysis on the modified component using the forward flow of the modified component and the reverse flow of the modified component, and detect defects in the code using the forward flow of the modified component, the local flow, and the reverse flow of the modified component.
[0005] In general, in one aspect, one or more embodiments relate to a non-transitory computer-readable medium including instructions that, when executed by a computer processor, perform: by performing a full analysis of code and generating a summary for each component of the code, including: (i) a forward summary including a forward flow and (ii) a reverse summary including a reverse flow; obtaining modifications to a modified component; determining that one of the summaries of the modified component is invalid; and in response to determining that one of the summaries of the modified component is invalid: obtaining a forward flow from the forward summary of the modified component, obtaining a reverse flow from a reverse summary of the modified component, generating a local flow by performing incremental analysis on the modified component using the forward flow of the modified component and the reverse flow of the modified component, and detecting defects in the code using the forward flow of the modified component, the local flow, and the reverse flow of the modified component.
[0006] Other aspects of the invention will be apparent from the following description and the appended claims. BRIEF DESCRIPTION OF THE DRAWINGS
[0007] Figure 1A and Figure 1B A system in accordance with one or more embodiments of the invention is shown.
[0008] Figure 2 A flow chart according to one or more embodiments of the invention is shown.
[0009] Figure 3 and Figure 4 Examples according to one or more embodiments of the invention are shown.
[0010] Figure 5A and Figure 5B A computing system in accordance with one or more embodiments of the invention is shown. DETAILED DESCRIPTION
[0011] Now, specific embodiments of the present invention will be described in detail with reference to the accompanying drawings. For consistency, the same elements in various drawings are represented by the same reference numerals.
[0012] In the following detailed description of embodiments of the invention, various specific details are set forth in order to provide a more thorough understanding of the invention. However, it will be apparent to one of ordinary skill in the art that the invention can be practiced without these specific details. In other cases, well-known features are not described in detail to avoid unnecessarily complicating the description.
[0013] Throughout the application, ordinal numbers (e.g., first, second, third, etc.) may be used as adjectives of elements (i.e., any noun in the application). The use of ordinal numbers does not imply or create any particular ordering of elements, nor does it limit any element to only a single element, unless explicitly disclosed, such as by using the terms "before," "after," "single," and other such terms. Instead, the use of ordinal numbers is to distinguish elements. As an example, a first element is different from a second element, and a first element may encompass more than one element and be after (or before) a second element in the ordering of elements.
[0014] In general, embodiments of the present invention relate to methods, systems, and computer-readable media for incremental analysis of code. In one or more embodiments, when performing a full analysis of the code to identify security vulnerabilities, forward and reverse profiles of each component of the code (e.g., a method or function) are generated. The forward profile describes the data flow between the component and its caller, and the reverse profile describes the data flow between the component and its callee. In one or more embodiments, incremental analysis identifies new security vulnerabilities by analyzing local data flows within a modified component of the code using the forward and reverse profiles of the modified component. Incremental analysis can also determine whether existing security vulnerabilities identified by the full analysis are corrected by the modified component. Since incremental analysis focuses on data flows related to security analysis (e.g., contamination flows, escape flows, etc.), incremental analysis is scalable to large code bases, thereby reducing the size of the profile.
[0015] Figure 1A A computer system (100) according to one or more embodiments of the present invention is shown. Figure 1A As shown in FIG. 1 , a computer system (100) includes a repository (102), a code analyzer (104), and one or more computer processors (106). In one or more embodiments, the computer system (100) uses Figure 5A and the following accompanying description of the computing system (500), or in the form of Figure 5B In one or more embodiments, the computer processor (106) uses the Figure 5A and the accompanying description below in the form of a computer processor (502).
[0016] In one or more embodiments, the repository (102) may be any type of storage unit and / or device for storing data (e.g., a file system, a database, a collection of tables, or any other storage mechanism). Additionally, the repository (102) may include multiple different storage units and / or devices. The multiple different storage units and / or devices may or may not be of the same type or located at the same physical site.
[0017] In one or more embodiments, the repository (102) includes code (110), a summary (114), a target predicate (122), and a target flow (124). In one or more embodiments, the code (110) is a collection of source code. The code (110) may include a collection of computer instructions written in a programming language or an intermediate representation (e.g., bytecode). In one or more embodiments, the collection of computer instructions may construct and / or reference various objects.
[0018] In one or more embodiments, the code (110) includes components (112A, 112N). In one or more embodiments, the component (112A) is a source code unit. The programming entities defined in the component (112A) can be imported by other components. For example, the programming entities can be files, packages, classes, functions, etc.
[0019] In one or more embodiments, the summary (114) includes a forward summary (116A, 116N) and a reverse summary (118A, 118N) of the components (112A, 112N). Each component (112A) can be associated with a forward summary (116A) and a reverse summary (118A). The component (112A) can be referred to as the "owner" of the associated forward summary (116A) and reverse summary (118A). In one or more embodiments, the forward summary (116A, 116N) and reverse summary (118A, 118N) summarize the parameter flow between two components, one of which is the owner of the associated summary.
[0020] Go to Figure 1BIn one or more embodiments, the forward summary (116) includes one or more forward flows (152A, 152N). The forward flow (152A) can describe a flow between an external parameter (154) and a local parameter (156). The forward flow (152A) can occur in either direction, from the external parameter (154) to the local parameter (156), or vice versa. In one or more embodiments, the external parameter (154) is associated with an external component (158) that is different from an owner component that owns the forward summary (116). The external parameter (154) can satisfy a target predicate (122). For example, when the analysis of the code (110) is a taint analysis, the target predicate (122) can indicate whether the parameter receives a tainted value. Continuing with this example, the tainted value can correspond to a user-provided or externally generated value (e.g., an unknown value potentially controlled by an attacker). The external parameter (154) can receive the tainted value directly from an external source. Alternatively, the external parameter (154) may receive the tainted value via a taint flow (e.g., via a series of function calls that transmit the tainted value from an external source). In one or more embodiments, when the analysis of the code (110) is an escape analysis, the target predicate (122) may indicate whether the parameter is an escape point corresponding to the release of sensitive (e.g., confidential) data.
[0021] In one or more embodiments, the local parameter (156) is a variable associated with the owner component that owns the forward summary (116). For example, the local parameter (156) can be a formal parameter or a local variable of the owner component.
[0022] In one or more embodiments, the external component (158) can be a component that provides the external parameter (154) to the owner component. For example, the external component (158) can provide the value of the external parameter (154) as a return value or side effect. In one or more embodiments, the external component (158) is omitted because the forward flow (152A) occurs within a single component (e.g., the owner component can be a file or package that both provides and receives the external parameter (154)).
[0023] In one or more embodiments, the reverse profile (118) includes one or more reverse flows (172A, 172N). The reverse flow (172A) can describe the flow between the local parameter (156) and the external parameter (154). The reverse flow (172A) can occur in either direction, from the local parameter (156) to the external parameter (154), or vice versa. In one or more embodiments, the external parameter (154) is associated with an external component (158) that is different from an owner component that owns the reverse profile (118). In one or more embodiments, the local parameter (156) is a variable associated with the owner component that owns the reverse profile (118).
[0024] In one or more embodiments, the external component (158) can be a component that receives a local parameter (156) (e.g., corresponding to a potentially tainted value) from an owner component. For example, the external component (158) can be a component that accesses a security-sensitive resource of the computer system (100). Alternatively, the external component (158) can transmit the tainted value to another component that accesses the security-sensitive resource via a taint flow.
[0025] The external component (158) can receive local parameters (156) corresponding to potentially tainted values from an owner component (e.g., as function arguments), which can represent security flaws relevant to taint analysis. Alternatively, the external component (158) can be a component that provides external parameters (154) (e.g., corresponding to potentially sensitive, confidential values) to the owner component. In one or more embodiments, the external component (158) is omitted because the reverse flow (172A) occurs within a single component (e.g., the owner component can be a file or package that both provides and receives the external parameters (154)).
[0026] In one or more embodiments, the target predicate (122) is a predicate that, when satisfied, indicates that a condition of interest for the analysis of the code (110) exists. For example, in the context of security analysis, the target predicate (122) may indicate whether a parameter is tainted (e.g., in the context of taint analysis), or whether it represents sensitive data (e.g., in the context of escape analysis). Continuing with this example, the taint analysis may specify a list of source functions that receive potentially tainted data (e.g., from a user or external source). Similarly, the escape analysis may specify a list of source functions that receive potentially sensitive data (e.g., with elevated access permissions). In addition, the taint analysis may specify a list of sink functions that access security-sensitive resources of the computer system (100). Similarly, the escape analysis may specify a list of sink functions that allow unrestricted (e.g., unprivileged) access to data and therefore represent information leakage points. The taint analysis may also specify a list of modifier functions that purify tainted data to render the tainted data harmless. Similarly, an escape analysis may specify a list of modifier functions that decrypt (eg, redact) sensitive data.
[0027] Back to Figure 1A In one or more embodiments, the target flow (124) indicates the flow of data associated with the target predicate (122). For example, in the context of security analysis, the target flow (124) can indicate how a parameter is tainted or releases sensitive data. Thus, the target flow (124) can correspond to a defect in the code (110). Return to Figure 1BIn one or more embodiments, the target flow (180) includes a forward flow (152), a local flow (182), and a reverse flow (172). The local flow (182) can describe the flow between the local parameters (156A, 156N) of the owner component. The local flow (182) can be used as a bridge to connect the forward flow (152) to the reverse flow (172). In other words, the local flow (182) can indicate how the flow of values occurs between the external (e.g., contaminated) parameters of the forward flow (152) and the external parameters of the reverse flow (172).
[0028] In one or more embodiments, the parameter (190) includes a target predicate satisfied flag (192) indicating that the parameter (190) satisfies the target predicate ( Figure 1A For example, the meet target predicate flag (192) may be true or false depending on whether the parameter (190) satisfies the target predicate.
[0029] Return to Figure 1A In one or more embodiments, the code analyzer (104) can be implemented in hardware (e.g., circuitry), software, firmware, and / or any combination thereof. In one or more embodiments, the code analyzer (104) includes functionality to perform static analysis of the code (110). In one or more embodiments, static analysis is a method of analyzing the code (110) without executing the code (110). For example, the goal of static analysis can be to identify potential coding flaws, security flaws, and / or malicious code.
[0030] In one or more embodiments, the code analyzer (104) includes functionality to generate a forward summary (116A, 116N) and a backward summary (118A, 118N) of the component (112A, 112N). The code analyzer (104) may include functionality to perform incremental analysis of the effects of modifications to the component (112A). The code analyzer (104) may include functionality to detect defects in the code (110) using the forward summary (116A), the backward summary (118A), and the incremental analysis of the modified component (112A).
[0031] In one or more embodiments, the computer processor (106) includes functionality to execute the code (110). In one or more embodiments, the computer processor (106) includes functionality to execute the code analyzer (104).
[0032] Although Figure 1A Configurations of components are shown, but other configurations may be used without departing from the scope of the present invention. For example, various components may be combined to create a single component. As another example, the functions performed by a single component may be performed by two or more components.
[0033] Figure 2 A flow chart according to one or more embodiments of the present invention is shown. The flow chart describes a process for incremental analysis. Figure 2 One or more of the steps in the above reference Figure 1A In one or more embodiments of the invention, Figure 2 One or more of the steps shown in the figure may be omitted, repeated and / or performed in parallel, or in a similar manner. Figure 2 Therefore, the scope of the present invention should not be considered to be limited to Figure 2 The specific arrangement of the steps shown in .
[0034] Initially, in step 200, code is obtained. The code may be obtained from a repository such as a source code version control system (e.g., GitHub). The code may include multiple components.
[0035] In step 202, forward and reverse summaries are generated for each component by performing a complete analysis of the code. The complete analysis of the code can be a static analysis of each component. In one or more embodiments, the static analysis generates a forward summary of the component by identifying a forward flow that includes external parameters and local parameters of the component. Similarly, the static analysis can generate a reverse summary of the component by identifying a reverse flow that includes external parameters and local parameters of the component. Focusing the generation of the forward summary on flows whose parameters satisfy the target predicate both reduces the size of the forward summary and improves the efficiency of the forward summary generation, thereby allowing the forward summary generation to be extended to large code bases.
[0036] Each summary may be stored in a repository.In one or more embodiments, the summary is indexed by the name of the corresponding component(s).
[0037] In one or more embodiments, the complete analysis generates results including the target flow. The code analyzer can report each target flow as a potential defect in the code. In one or more embodiments, the report includes each parameter included in the target flow. However, if the target flow includes a parameter modified by a decorator function (e.g., a purifier or a decryptor), the code analyzer can determine that the target flow does not correspond to a defect due to the influence of the decorator.
[0038] In step 204, modifications to the modified component are obtained. For example, the modifications may add, delete, or modify one or more statements in the component. In one or more embodiments, the modifications may be obtained by comparing a new version of the component to a previous version of the component. For example, the modifications may be received from a source code version control system that maintains multiple versions of code. Continuing with this example, the source code version control system may provide a list of changes for the component that was modified in a commit operation that created a new version of the code.
[0039] In step 206, if it is determined that the summary of the modified component is invalid, then the following step 208 is performed. In one or more embodiments, the summary is determined to be invalid when the modification modifies the target flow included in the complete analysis results of step 202 above. For example, if the modification modifies a statement that accesses a parameter included in the target flow, then the target flow may no longer be valid. Continuing with this example, the modification may change the target predicate state of the parameter to indicate that the parameter no longer satisfies the target predicate, so the defect detected during the complete analysis may no longer exist. In addition, the summary may be invalid because the summary does not reflect the new target flow resulting from the modification.
[0040] Otherwise, if it is determined in step 206 that all of the profiles of the modified component are valid, then the process ends.
[0041] In step 208, the forward flow is obtained from the forward summary of the modified component. For example, the forward summary can be obtained from the repository using the name of the modified component.
[0042] In step 210, the reverse flow is obtained from the reverse summary of the modified component. For example, the reverse summary can be obtained from the repository using the name of the modified component.
[0043] In step 212, local flows are generated by performing incremental analysis of the modified component using the forward flow of the modified component and the reverse flow of the modified component. The modified component can be the only component to be analyzed by the incremental analysis. In one or more embodiments, the incremental analysis generates local flows between local parameters of the modified component. The local flows can start with the forward flow of the modified component and end with the reverse flow of the modified component.
[0044] In step 214, defects in the code are detected using the forward flow, the local flow, and the reverse flow of the modified component. In one or more embodiments, the defect corresponds to a new target flow corresponding to the forward flow, the local flow, and the reverse flow of the modified component. The local flow within the modified component generated in step 212 above can connect the forward flow to the reverse flow to form a new target flow.
[0045] The code analyzer may report the new target flow as a new potential defect in the code (e.g., a new potential defect that was not present in the result of the complete analysis of step 202 above). In addition, as described in step 206 above, the target flow included in the complete analysis result may no longer be valid due to modification, in which case the code analyzer may report an invalid target flow. For example, a defect corresponding to an invalid target flow may have been corrected by adding a decorator function to the modified component (e.g., to sanitize or decrypt parameters).
[0046] Benchmarks have shown that the cost of generating forward and backward profiles during a full analysis can be recovered by performing approximately two incremental analyses. Furthermore, incremental analysis using forward and backward profiles is several times faster than standard incremental analysis using only backward profiles, since standard incremental analysis needs to analyze the callers of the modified component in addition to the modified component.
[0047] The following examples are for illustrative purposes only and are not intended to limit the scope of the present invention. Figure 3 and Figure 4 An implementation example according to one or more embodiments of the present invention is shown. Figure 3 In the code snippet (300)( Figure 1A (110)) includes several components (302, 304, 306, 308) as methods ( Figure 1A (112A, 112N) in ). Since the source method (302) receives the value from the user, it is a source of pollution, and the securitySensitive method (308) accesses the computer system ( Figure 1A (100)) in security-sensitive resources.
[0048] Initially, the code analyzer ( Figure 1A (104)) in the forward and backward summary of the generation method. Figure 3 The start method (310) is shown ( Figure 1A and Figure 1B The forward summary of (116) in includes the flow from the tainted return value (314) of the source method to the local parameter x (316) of the start method. The start method (312) ( Figure 1A and Figure 1B The reverse summary of (118) in includes a flow from the local parameter x (316) of the start method to the local (eg, formal) parameter param (318) of the propagate method.
[0049] Figure 3It is further shown that the forward summary of the propagate method (320) includes a flow from the local parameter x (316) of the start method to the local parameter param (318) of the propagate method. The reverse summary of the propagate method (322) includes a flow from the local parameter param (318) of the propagate method to the local parameter val (324) of the securitySensitive method.
[0050] Figure 3 Further shown is the target flow (330) formed by combining the forward and reverse summaries of the start method (310, 312) with the forward and reverse summaries of the propagate method (320, 322) ( Figure 1B ). The target flow (330) corresponds to a defect related to taint analysis because the tainted return value (314) of the source method flows to the local parameter val (324) of the securitySensitive method.
[0051] Next, the code analyzer obtains modifications to the propagate method (352), such as Figure 4 As shown in the modified code snippet (350) of . Since the validate method (354) purifies the parameter param (318) of the propagate method, the code analyzer determines that the reverse summary of the modified propagate method (352) is invalid. Therefore, the parameter param (318) of the propagate method is no longer tainted, which makes Figure 3 The target flow (330) of the modified propagate method (352) is invalid, so the defect corresponding to the target flow (330) no longer exists. However, the code analyzer identifies a new target flow (370) including new local flows (local flow A 360, local flow B 362) in the modified propagate method (352).
[0052] Figure 4 It is shown that the local flow A (360) of the propagate method includes flow from the globalUnsafe parameter (364) to the unnamed local parameter (366) of the propagate method. The globalUnsafe parameter (364) is a potential source of pollution. Figure 4It is also shown that the local flow B (362) of the propagate method includes a flow from the local parameter (366) of the propagate method to the local parameter attribute (368) of the anotherSecurityCall method. Because the anotherSecurityCall method (356) accesses security-sensitive resources of the computer system, the local flow A (360) and the local flow B (362) form a target flow due to the tainted globalUnsafe parameter (364) flowing to the local parameter attribute (368) of the anotherSecurityCall method.
[0053] The embodiments disclosed herein may be implemented on a computing system. Any combination of mobile devices, desktops, servers, routers, switches, embedded devices, or other types of hardware may be used. For example, Figure 5A As shown in , the computing system (500) may include one or more computer processors (502), non-persistent storage devices (504) (e.g., volatile memory, such as random access memory (RAM), cache memory), persistent storage devices (506) (e.g., hard disk, optical drive such as compact disk (CD) drive or digital versatile disk (DVD) drive, flash memory, etc.), communication interface (512) (e.g., Bluetooth interface, infrared interface, network interface, optical interface, etc.), and many other elements and functions.
[0054] The computer processor(s) (502) may be an integrated circuit for processing instructions. For example, the computer processor(s) may be one or more cores or microcores of a processor. The computing system (500) may also include one or more input devices (510), such as a touch screen, keyboard, mouse, microphone, touchpad, electronic pen, or any other type of input device.
[0055] Communications interface (512) may include interfaces for connecting computing system (500) to a network (not shown) (e.g., a local area network (LAN), a wide area network (WAN) such as the Internet, a mobile network, or any other type of network) and / or another device (such as another computing device).
[0056] In addition, the computing system (500) may include one or more output devices (508), such as a screen (e.g., a liquid crystal display (LCD), a plasma display, a touch screen, a cathode ray tube (CRT), a monitor, a projector, or other display device), a printer, an external storage device, or any other output device. One or more of the output devices may be the same as or different from the input device(s). The input and output device(s) may be connected locally or remotely to the computer processor(s) (502), the non-persistent storage device(s) (504), and the persistent storage device(s) (506). There are many different types of computing systems, and the aforementioned input and output device(s) may take other forms.
[0057] The software instructions in the form of computer-readable program code that execute the embodiments disclosed herein may be stored in whole or in part, temporarily or permanently, on a non-transitory computer-readable medium, such as a CD, DVD, storage device, floppy disk, tape, flash memory, physical memory, or any other computer-readable storage medium. Specifically, the software instructions may correspond to a computer-readable program code that, when executed by (one or more) processors, is configured to execute one or more embodiments disclosed herein.
[0058] Figure 5A The computing system (500) in the embodiment may be connected to or be part of a network. Figure 5B As shown in FIG. 5 , a network (520) may include multiple nodes (eg, node X (522), node Y (524)). Each node may be connected to a computing system (such as Figure 5A ) corresponds to, or a group of nodes combined with Figure 5A . For example, the embodiments disclosed herein may be implemented on a node of a distributed system connected to other nodes. By way of another example, the embodiments disclosed herein may be implemented on a distributed computing system having multiple nodes, wherein each part disclosed herein may be located on a different node within the distributed computing system. In addition, one or more elements of the aforementioned computing system (500) may be located at a remote location and connected to other elements via a network.
[0059] Although in Figure 5B Not shown, but a node may correspond to a blade in a server chassis that is connected to other nodes via a backplane. By another example, a node may correspond to a server in a data center. By another example, a node may correspond to a computer processor or a micro-core of a computer processor with shared memory and / or resources.
[0060] The nodes in the network (520) (e.g., node X (522), node Y (524)) can be configured to provide services to the client device (526). For example, the node can be part of a cloud computing system. The node can include the following functions: receiving requests from the client device (526) and transmitting responses to the client device (526). The client device (526) can be a computing system (such as Figure 5A In addition, the client device (526) may include and / or execute all or part of one or more embodiments disclosed herein.
[0061] Figure 5A and Figure 5B The computing system or computing system group described in the may include the functionality to perform the various operations disclosed herein. For example, (one or more) computing systems may perform communications between processes on the same or different systems. Various mechanisms that employ some form of active or passive communication may facilitate data exchange between processes on the same device. Examples representing these inter-process communications include, but are not limited to, implementations of files, signals, sockets, message queues, pipes, semaphores, shared memory, message passing, and memory mapped files. Further details related to several of these non-limiting examples are provided below.
[0062] Based on the client-server networking model, a socket can be used as an interface or communication channel endpoint, thereby enabling bidirectional data transmission between processes on the same device. First, following the client-server networking model, a server process (e.g., a process providing data) can create a first socket object. Next, the server process binds the first socket object, thereby associating the first socket object with a unique name and / or address. After creating and binding the first socket object, the server process then waits and listens for incoming connection requests from one or more client processes (e.g., processes looking for data). At this point, when the client process wants to obtain data from the server process, the client process will start by creating a second socket object. The client process then continues to generate a connection request, which includes at least a second socket object and a unique name and / or address associated with the first socket object. Then, the client process transmits the connection request to the server process. Depending on availability, the server process can accept the connection request, establish a communication channel with the client process, or the server process, which is busy handling other operations, can queue the connection request in a buffer until the server process is ready. The established connection notifies the client process that communication can begin. In response, the client process may generate a data request specifying the data that the client process wishes to obtain. The data request is then transmitted to the server process. Upon receiving the data request, the server process analyzes the request and collects the requested data. Finally, the server process then generates a reply including at least the requested data and transmits the reply to the client process. The data may more typically be transmitted as a datagram or a stream of characters (e.g., bytes).
[0063] Shared memory refers to the allocation of virtual memory space so as to verify a mechanism by which data can be communicated and / or accessed by multiple processes. When implementing shared memory, the initialization process first creates a shareable segment in a persistent or non-persistent storage device. After creation, the initialization process installs the shareable segment and then maps the shareable segment to the address space associated with the initialization process. After installation, the initialization process continues to identify and grant access permissions to one or more authorized processes, which can also write data to or read data from the shareable segment. Changes made by one process to the data in the shareable segment can immediately affect other processes that are also linked to the shareable segment. In addition, when one of the authorized processes accesses the shareable segment, the shareable segment is mapped to the address space of that authorized process. Often, only one authorized process other than the initialization process can install the shareable segment at any given time.
[0064] Without departing from the scope of the present invention, other techniques may be used to share data (such as the various data described in this application) between processes. These processes may be part of the same or different applications and may be executed on the same or different computing systems.
[0065] Figure 5A The computing system in may implement and / or be connected to a data repository. For example, one type of data repository is a database. A database is a collection of information configured to simplify data retrieval, modification, reorganization, and deletion. A database management system (DBMS) is a software application that provides an interface for users to define, create, query, update, or manage a database.
[0066] A user or software application can submit statements or queries to a DBMS. The DBMS then interprets the statements. Statements can be select statements, update statements, create statements, delete statements, etc. that request information. Moreover, statements can include parameters, (one or more) identifiers, conditions (comparison operators), functions (e.g., joins, full joins, counts, averages, etc.), sorts (e.g., ascending, descending), or other parameters that specify data or data containers (databases, tables, records, columns, views, etc.). The DBMS can execute statements. For example, the DBMS can access memory buffers, references to files, or indexes to read, write, delete, or any combination thereof in response to the statement. The DBMS can load data from persistent or non-persistent storage devices and perform calculations in response to queries. The DBMS can return (one or more) results to the user or software application.
[0067] The above description of the function only presents the Figure 5A computing systems and Figure 5B Several examples of functions performed by nodes and / or client devices in. Other functions can be performed using one or more embodiments disclosed herein.
[0068] While the present invention has been described with respect to a limited number of embodiments, those skilled in the art having benefit of this disclosure will appreciate that other embodiments can be designed which do not depart from the scope of the invention as disclosed herein. Accordingly, the scope of the present invention should be limited only by the claims appended hereto.
Claims
1. A method for performing code analysis, comprising: A full analysis of the code is performed using a target predicate and for each of a plurality of components of the code, a plurality of summaries are generated, including: (i) a forward summary including a forward flow, the forward flow including a forward extrinsic parameter and a forward local parameter, and (ii) a reverse summary including a reverse flow, the reverse flow including a reverse local parameter and a reverse extrinsic parameter, wherein: The complete analysis is a contamination analysis, Forward external parameters flow to forward local parameters during the execution of the code. Reverse local parameters flow to reverse external parameters during execution of the code, and Reversing the external parameter flow to a function that accesses a security-sensitive resource of a computer system; obtaining a first modification to a modified component of the plurality of components; determining that one of the plurality of profiles of the modified component is invalid by determining a first modification statement that modifies a first parameter of the access profile, wherein the first parameter includes a target predicate state indicating whether the first parameter satisfies a target predicate; and In response to determining that one of the plurality of profiles of the modified component is invalid: Get the forward flow from the forward summary of the modified component; Get the reverse flow from the reverse summary of the modified component; generating a local flow by performing incremental analysis on the modified component using a forward flow of the modified component and a reverse flow of the modified component; and Detect defects in the code using the forward flow of the modified component, the local flow, and the reverse flow of the modified component.
2. The method according to claim 1, wherein the target predicate status indicates that the first parameter satisfies the target predicate after performing a complete analysis, and Wherein the target predicate status indicates that the first parameter does not satisfy the target predicate after performing the incremental analysis.
3. The method of claim 1, further comprising: generating a target flow including a forward flow of the modified component, a local flow, and a reverse flow of the modified component; obtaining a second modification to the modified component; as well as It is determined that the second modification corrects the defect by invalidating the target stream.
4. The method according to claim 1, The complete analysis also includes escape analysis. The forward local parameters flow to the forward external parameters during the execution of the code. where reverse external parameters flow to reverse local parameters during execution of the code, and The reverse external parameter receives sensitive data from a function with elevated access rights.
5. A system for performing code analysis, comprising: a memory coupled to the computer processor; A repository configured to store code including a plurality of components, each component including a plurality of profiles including (i) a forward profile including a forward flow, the forward flow including forward extrinsic parameters and forward local parameters, and (ii) a reverse profile including a reverse flow, the reverse flow including reverse local parameters and reverse extrinsic parameters, wherein: The complete analysis is a contamination analysis, Forward external parameters flow to forward local parameters during the execution of the code. Reverse local parameters flow to reverse external parameters during execution of the code, and Reverse external parameter flow to functions that access security-sensitive resources of the computer system; and A code analyzer, executing on the computer processor and using the memory, is configured to: generating the plurality of summaries for each of the plurality of components by performing a full analysis of the code using a target predicate, obtaining a first modification to a modified component of the plurality of components, determining that one of the plurality of profiles of the modified component is invalid by determining a first modification statement that modifies a first parameter of the access profile, wherein the first parameter includes a target predicate state indicating whether the first parameter satisfies a target predicate, and In response to determining that one of the plurality of profiles of the modified component is invalid: Get the forward flow from the forward summary of the modified component, Get the reverse flow from the reverse summary of the modified component, generating a local flow by performing incremental analysis on the modified component using a forward flow of the modified component and a reverse flow of the modified component, and Detect defects in the code using the forward flow of the modified component, the local flow, and the reverse flow of the modified component.
6. The system according to claim 5, wherein the target predicate status indicates that the first parameter satisfies the target predicate after performing a complete analysis, and Wherein the target predicate status indicates that the first parameter does not satisfy the target predicate after performing the incremental analysis.
7. The system of claim 5, wherein the code analyzer is further configured to: generating a target flow including a forward flow of the modified component, a local flow, and a reverse flow of the modified component; obtaining a second modification to the modified component; and It is determined that the second modification corrects the defect by invalidating the target stream.
8. The system according to claim 5, The complete analysis also includes escape analysis. The forward local parameters flow to the forward external parameters during the execution of the code. where reverse external parameters flow to reverse local parameters during execution of the code, and The reverse external parameter receives sensitive data from a function with elevated access rights.
9. A non-transitory computer readable medium comprising instructions which, when executed by a computer processor, perform: By performing a complete analysis of the code using targeted predicates and for each of multiple components of the code, multiple profiles are generated, including: (i) a forward summary comprising a forward flow, the forward flow comprising forward extrinsic parameters and forward local parameters, and (ii) a reverse summary comprising a reverse flow, the reverse flow comprising reverse local parameters and reverse extrinsic parameters, wherein: The complete analysis is a contamination analysis, Forward external parameters flow to forward local parameters during the execution of the code. Reverse local parameters flow to reverse external parameters during execution of the code, and Reversing the external parameter flow to a function that accesses a security-sensitive resource of a computer system; obtaining a first modification to a modified component of the plurality of components; determining that one of the plurality of profiles of the modified component is invalid by determining a first modification statement that modifies a first parameter of the access profile, wherein the first parameter includes a target predicate state indicating whether the first parameter satisfies a target predicate; and In response to determining that one of the plurality of profiles of the modified component is invalid: Get the forward flow from the forward summary of the modified component; Get the reverse flow from the reverse summary of the modified component; generating a local flow by performing incremental analysis on the modified component using a forward flow of the modified component and a reverse flow of the modified component; and Detect defects in the code using the forward flow of the modified component, the local flow, and the reverse flow of the modified component.
10. The non-transitory computer readable medium of claim 9, wherein the target predicate status indicates that the first parameter satisfies the target predicate after performing a complete analysis, and Wherein the target predicate status indicates that the first parameter does not satisfy the target predicate after performing the incremental analysis.
11. The non-transitory computer readable medium of claim 9, further comprising instructions to: generating a target flow including a forward flow of the modified component, a local flow, and a reverse flow of the modified component; obtaining a second modification to the modified component; and It is determined that the second modification corrects the defect by invalidating the target stream.
