Source: https://patents.google.com/patent/US9141408B2/en
Timestamp: 2018-11-17 10:11:21
Document Index: 90772733

Matched Legal Cases: ['application No. 13', 'application No. 13', 'application No. 13', 'application No. 13', 'application No. 13', 'application No. 13', 'application No. 14', 'application No. 13']

US9141408B2 - Method and system for correcting portion of software application - Google Patents
Method and system for correcting portion of software application Download PDF
US9141408B2
US9141408B2 US13554335 US201213554335A US9141408B2 US 9141408 B2 US9141408 B2 US 9141408B2 US 13554335 US13554335 US 13554335 US 201213554335 A US201213554335 A US 201213554335A US 9141408 B2 US9141408 B2 US 9141408B2
US13554335
US20140026121A1 (en )
A computer system, method, or computer-readable medium corrects a broken portion of an application. A fingerprint indicates classes that comprise the application. The classes indicated in the fingerprint are looked up to determine whether any is broken. For a broken class, a fixed class is substituted when the broken class is loaded at class load time for the application; a fixed class method is substituted into the broken class, when the broken class is loaded at class load time; fixed byte code is substituted for broken byte code corresponding to the broken class, when the broken class is loaded at class load time; the broken class is unloaded and the fixed class is loaded instead, when the application is running; or the broken class is replaced inside the static application with the fixed class; all without replacing classes which are not broken.
The technical field relates in general to software development, an more specifically to correcting a portion of a software application.
Today, there frequently are defects and/or security vulnerabilities or the like in pieces of software that make up an application. Often it takes time to move the fixes for the defects/vulnerabilities through the conventional process before the software application is deemed to be fixed. So, typically now if there is a bug, a developer needs to get an updated version of a piece of the software if using open source software, or a developer must pull up the source code and update the version himself, and then run it through the entire process of creating a version of the application with the update.
In practice, a developer may find out that there is a problem with an open source component that is being used in a software application. The developer will research the fix, go back into the development environment, update the component, re-run the integration test to ensure that all is functional, and then progress through the release process to release a new version. There is no way to do this without manually scouring code to find the vulnerability or bug.
In addition, there are situations where the ability to support a legacy custom application is much more problematic due to tack of understanding of the old application.
Consider Microsoft's Patch Tuesday as an example of a conventional way in which patches are released. Patch Tuesday is normally only once a month. Subsequent patches (and hence updates to pieces of software) will not be released until the next Patch Tuesday. During the time after Microsoft releases the patches, the hackers are reverse engineering the fixes and figuring out where the vulnerabilities are and creating corresponding exploits and then launching those.
Furthermore, Microsoft ships out many binary updates, e.g., to Windows, which can be installed, usually requiring a reboot of the Windows workstation.
Accordingly, one or more embodiments provide a computer system. The computer system includes an i/o interface operable to transmit and receive communications over at least a portion of a communication network; and a processor. The processor is configured to facilitate: obtaining a fingerprint that indicates classes that comprise the application; and referring to the classes indicated in the fingerprint, looking up whether any of the classes that comprise the application is a broken class. For each of the classes in the application which is determined to be the broken class: the embodiment can substitute a fixed class for the broken class, when the broken class is loaded at class load time for the application; or substitute a fixed class method into the broken class, when the broken class is loaded at class load time for the application; or substitute fixed byte code For broken byte code corresponding to the broken class, when the broken class is loaded at class load time for the application; or unload the broken class and then loading the fixed class in place of the broken class, when the application is running; or replace the broken class inside the static application with the fixed class, without replacing classes which are not broken, when the application is not running
According to another embodiment, the fingerprint for the application is obtained from a class path of the application.
According to yet another embodiment, the fingerprint for the application is obtained on a just-in-time basis at class load time.
Yet another embodiment includes scanning, at run time with a byte code interpreting virtual machine running the application, the classes before they are being loaded to determine the classes that comprise the application.
Still another embodiment includes inserting an agent that performs the scanning into the byte code interpreting virtual machine before the classes begin loading.
In a further embodiment, the application is run in a context of a byte code interpreting virtual machine.
In an embodiment, the fixed classes to be substituted for the broken classes are served from a database.
In another embodiment, the fingerprint for the application is obtained based on a scan of the application external to a virtual machine on which the application is configured to be executed.
A further embodiment is a computer-implemented method for correcting a portion of an application, according to one or more of the above embodiments.
Still another embodiment is a non-transitory computer-readable medium comprising instructions for execution by a computer, the instructions including a computer-implemented method for correcting a portion of an application, the instructions for implementing the method in a processor.
FIG. 1 is a data flow diagram illustrating a summary of several embodiments for providing a correction to an application;
FIG. 3 is a flow chart illustrating a procedure to correct a portion of an application at class load time;
FIG. 4 is a flow chart illustrating a procedure to correct a portion of an application when the application is running;
FIG. 5 is a flow chart illustrating a procedure to correct a portion of an application when the application is static;
FIG. 6 is a flow chart illustrating a patch providing data services; and
FIG. 7 is a block diagram illustrating a software repository.
The term “byte code” as used herein is defined to mean an intermediate operational code which was generated by translating an input programming language, and then the byte code can be interpreted at the time the byte code is executed by the virtual machine which has its own instruction set independent of the native machine code for the hardware on which the virtual machine executes. Examples of computer languages which use “byte code” include, without limitation, Java, .NET, Scala, groovy, and Pascal
The term “byte code interpreting virtual machine” is defined to mean a virtual machine that has its own instruction set (called herein a “byte code”) which is independent of the native machine code for the hardware on which the byte code interpreting virtual machine executes; the byte code interpreting virtual machine inputs byte code from an application which is executed, interprets the byte code to generate native machine code for the processor on which the virtual machine executes, and then causes the processor to execute the native machine code. On some virtual machines, the byte code can be compiled to native machine code (in Java, this is Just-In-Time—or JIT—compilation).
The term “component” used herein is defined to be a specific version of pre-existing executable software, or a reusable pre-existing self-contained software code building block which is not a complete stand-alone finished product ready for use and which is binary or source code. A component is the subject of a license or a target of a security vulnerability. Less formally, a component which is part of a stand-alone product can be understood to be a self-contained bit of code which a developer does not wish to write himself/herself as part of the stand-alone product, and so the developer uses a previously existing component for which the functionality likely was previously vetted as a part of another stand-alone product,
The term “repository” or “software repository” used herein are defined to mean an electronic storage system that stores software build components (sometimes refined to as an “artifact”) and dependencies for later retrieval, to which artifacts are published in accordance with procedures which are well known to those in the field, so that artifacts made by one software developer are published to be available for further use by other software developers, to be incorporated as building blocks to build software products which can be executed; a repository can include a computer server by which the stored electronic copies of artifacts are made available for use by software developers to be incorporated as building blocks to build software products which can be executed; the repository typically has a unique identifier that indicates the software developer (an individual or a group) that contributed the artifiict. A repository can be remote or local.
In overview, one or more embodiments can directly patch running applications, which (among other things) can eliminate the window of threat or vulnerability that exists today.
As further discussed herein below, various inventive principles and combinations thereof are advantageously employed to short circuit elements of updating applications. In a running application, the goal herein is the ability to replace the smallest portion possible that has a problem with a corrected version. As is known in the software developer community, updates or patches can be provided for classes; the class with the update or patch that supersedes a class is referred to as a “fixed” class and the class which is superseded is referred to as a “broken” class. The system can take the broken class or perhaps the class method or even the byte code level of the broken class, and substitute the fixed class, class method, or byte code for or into the broken class.
Further in accordance with exemplary embodiments, there is provided a method and system that resolve the issues mentioned above relatively quickly. Users can consume from a data service which indicates how to patch things, and/or the patch can flow directly into the application even if the application is running.
Today, in the Java ecosystem, there is no systematic way to notify developers of problems and patches. U.S. application Ser. No. 13/231,162, filed 13 Sep. 2011, titled “Method and system for monitoring a software artifact”, can provide a sophisticated solution to the problem of notification and monitoring. The system discussed herein can make it possible for someone which received such notification to directly patch the application on the operation side without having to go back through development. This can be especially helpful when there is no longer a development team in place to support the application. Needing to patch a vulnerability when there is no development team to track the problem, compile the source, or the like can be particularly troublesome. However, one or more of the embodiments discussed here can solve the problem by, e.g., swapping out some, but not all, of binary files that are used to run the application.
The Microsoft Tuesday discussed above is a brute force approach and avoids a light touch of just updating what needs to be updated. Also, Microsoft simply pushes out patches for their own software (which is very conventional) already incorporated a new version of the application as a whole. By comparison, the system described herein can be used to surgically patch some third party's software which is incorporated into in an application, without a developer revising or even looking at the source code.
Furthermore, in comparison to brute force insertion of a patch at a physical location, this system can solve multiple problems in a non-intrusive way. For example, the inventors observed that it may not be necessary to swap an entire JAR file to solve multiple problems. However, it is not easy for a developer to take somebody else's patch and apply it to third-party open source code which is not code that the developer wrote. Also, conventionally the application with the fix would need to be run through tests and the like before releasing the application with the fix. In comparison, the system and method herein can provide a way to get the patch loaded into the run time in a way in which it is easy to use and is not going to break other code.
As further discussed herein, one can consume these patches at various points within the development process and operational process. On the one extreme, the production systems that are actively running can consume a live data feed and in real time patch a running application. The system can unload the affected classes, load the patched versions and the application continues to run on the virtual machine, maintaining all the space/states that are there in the virtual machine. On the other extreme, the same data feed can be incorporated at the development tooling level, such as the IDE, which can be alerted that there is a vulnerable component and there is an update available; the update can show the difference in source, class method change, etc. The system can push the patch in the data feed through as an update, which can be pushed through as a release, etc. Optionally, an embodiment can be wrapped around secured data services that communicate the information as to how to apply the fixes to the problematic areas of the application.
When the system patches a running application, the application already has the broken class loaded into the memory. So the classes that need to be fixed may need to be unloaded.
One approach is to run a scan of the application and get the list of vulnerable items. From the list of vulnerable items in the application, the recipe for fixing broken items in the application can be developed. From there, an embodiment of the system can assemble the patched classes into an artifact that contains the patched classes. The artifact that contains the patched classes may not necessary be a JAR file. The system can load only the classes that need to be patched.
As an example of another approach, the system running the application can be taken down. Then the scan can be run to fingerprint (that is, to identify, what is broken) the application. (This approach is intermediate between patching a running application, and someone working in an IDE.) The fixed classes to be patched are assembled into an artifact that contains the patched classes. Then, a tool is able to replace the broken classes with the fixed classes, dynamically. This can be a more fine grained approach than using a JAR of the classes.
Yet another approach is to take an analysis of the contents of an application, produce a very specific antidote which is custom tailored to the things the application is infected with, and deliver the antidote to the application in a streamlined way. This is the up-front analysis mode. This can provide a one-time atomic patch update.
A different approach may be taken instead of trying to analyze the application (which can be problematic because all of the JARs composing that application might not be known). This approach can deconstruct how the applications are loaded. An agent can be installed, for example, to monitor class loading activities, and to calculate byte code hashes on the class that is actually loaded, thus providing a signature of the classes. Updates for classes can be requested from a feed. This can use run-time monitoring of classes as they are loaded into the virtual machine. This can use a precise knowledge of what is actually loaded, and furthermore can allow the patch at the point in time that the class is being loaded. If a class is loaded later, it can be patched at that point in time.
As another approach, during runtime, the system can identify the entire class path which is conventionally available at runtime, and all of the artifacts, in their entirety; instead of waiting for the classes to be loaded. The application can later manipulate the class path, and/or the class path can be pulled in at a later point. The term “class path” as used herein is intended to be as understood to one of skill in the arts of software classes, virtual machine arts or Java instead of as interpreted by a more general dictionary. In short, the system can be monitoring what is actually used during runtime, and pulling the fixed patches on an as-needed basis. This can provide a monitoring mode.
Referring now to FIG. 1, a data flow diagram illustrating a summary of several embodiments for providing a correction to an application will be discussed and described. FIG. 1 illustrates an application source code 101 (for example, human-readable programming code, e.g., Java source code), an application byte code 103 for virtual machine (for example, byte code which is executable on the virtual machine, and a virtual machine 105. The application source code 101 is at least preliminarily compiled in accordance with conventional techniques to form the application byte code 103. The application byte code 103 can include class paths as is well understood to one of skill in the art. The application byte code 103 is representative of any number of self-contained application byte codes, which are typically stored as separate files, all in accordance with conventional techniques. In a conventional system, the application byte code 103 is passed to the virtual machine 105 for execution. The virtual machine 105 includes a class loader 109 which can load classes called for by the application byte code. The classes may be loaded when they are called but not before. Then, as is known, the byte code is passed to the byte code interpreter and/or just in time (JIT) compiler 111 within the virtual machine, according to known techniques. The interpreted/compiled code is machine instructions executable on a processor 113 on which the virtual machine 105 is running
FIG. 1 also illustrates a front end 119 that provides a fingerprint of the classes that comprise the application, and a back end 121 that provides fixes (if any) to one or more of the classes that comprise the application. At the front end 119, the classes are checked and a fingerprint/recipe is developed for how to fix any broken classes, for example, for third-party components in an application. At the back end 121, the patches are applied. No conventional technique is known to apply fixes to run time applications and apply security patches for third-party components. This system is looking for bugs in the software which need to be fixed, and then fixing them in real time. This system is not necessarily limited to looking for a maliciously hidden piece of code, but can be looking for a piece of code that is just broken. One or more embodiments is intended to directly fix up the executable.
The front end 119 can obtain the fingerprint in different ways, here exemplified as fingerprint sources A1, A2, A3. As a first fingerprint source A1, the front end 119 can scan the application byte code 103, for example, to review class paths, which indicate the classes. Class paths and how they are structured in application byte code is known and weft-defined. As a second fingerprint source A2, an agent 107 can be installed to scan classes before they are loaded to determine the classes that comprise the application; the front end 119 can obtain an indication of the classes that comprise the application from the agent 107; the classes can be intercepted before they are loaded by examining which classes are called for loading. As a third fingerprint source A3, the front end 119 can obtain an indication of the classes that are being loaded or that have been loaded, from the class loader 109. Although not illustrated, the front end 119 can obtain an indication of the classes that have been loaded from loaded class information 115. The loaded class information 115 is conventional for the virtual machine 105. The loaded class information 115 includes a class method area 117 as is known, which stores information regarding classes methods. Also not illustrated is that the front end 119 can obtain an indication of the classes from the application source code 101. Each of these sources for the fingerprint has its own advantages or disadvantages. For example, some classes refer to other classes which themselves refer to other classes; this can be difficult to determine merely from the application source code 101 or application byte code 103 alone and consequently a fingerprint developed solely from those fingerprint sources might be incomplete though still better than nothing.
The back end 121 receives the fingerprint that indicates the classes which comprise the application, or the broken classes in the application. The broken classes can be determined at the front end 119 or back end 121. A class can be determined to be broken, for example, by receiving information indicating that one of the classes has been superseded by a class, class method or fixed byte code in a database of fixed classes 123, fixed class methods 125 and/or fixed byte code 127. The backend 121 can obtain the fixed class 123, fixed class method 125, or fixed byte 127 which can include an indication of how to apply the fix. A broken class can be fixed by being replaced in its entirety with a fixed class, by replacing one or more class methods in the broken class with a fixed class method, or by replaced pre-defined byte code within the class with fixed byte code. Then, the back end 121 can apply the fix, here exemplified as modes B1, B2, B3 and B4. A first mode B1 to fix a class which is broken is by replacing the class, class method or byte code within the original application byte code 103 before passing to the virtual machine. A second mode B2 to fix a class which is broken is for the agent 107 to intercept the class before it is passed to the class loader 109, and to replace the intercepted broken class with the fixed class, class method or fixed byte code. A third mode B3 is to unload a broken class via the class loader 109, and to load the fixed class instead. A fourth mode B4 is to replace the class information, class method information, or byte code within the loaded class information 115 or the method area 117.
The back end 121 can provide the patches, or extracts the patches, to provide the fix. At the back end, what needs to be fixed is known and the fixed classes, class methods and/or byte code 123, 125, 127 have been retrieved from the database. (The system can provide a database with the patches, or the patches can be extracted from the artifact that has been already fixed. The database of fixed classes, fixed class method and fixed byte code 123, 125, 127 can be manually prepared, to provide the set of fixes for a broken class.) Whenever there is a request for a broken class, the system can instead serve up the fixed class (retrieved from the database of patched classes).
A database can be provided that stores the actual fixed class 123, class methods 125 or byte code 127. The back end 121 can be given the fingerprint/list of things that need to be fixed for the application. The fixed versions are retrieved from the storage 123, 125, 127. In the static version, the fixes are sent to the system that needs the fixes. In another version, the system inserts itself into the class loading hierarchy, so that anytime a class is attempted to be loaded, the system can determine whether it needs to serve up a different (fixed) version than is requested to be loaded. In this regard, not that there is a conventional API in Java that allows the system to be inserted, and/or to serve up a different class than was requested. For example, the system can be the first thing to start before the classes are loaded, which allows the system to know what is being loaded so as to substitute fixed classes for broken classes. The system knows where to go to find the fixed classes.
It will be appreciated that the fingerprint(s) may be obtained for the application by the front end 119 and then can be stored as corresponding to the application. The back end 121 can later use the stored fingerprint that corresponds to the application so as to provide the fix. For example, the front end 119 can obtain the fingerprint via, e.g., the class loader 109; the back end 121 can later provide the fixes to, e.g., the application byte code 103 or via the intercept agent 107 the next time the application is run.
It will also be appreciated that the front end 119 and back end 121 can be run asynchronously or in a loop, for example, so as to apply fixes on an as-needed basis. For example, the front end 119 can determine that a first class that is loaded is broken and the back end 121 can immediately unload the broken class and load the fixed class instead; meanwhile the front end 119 can be working on a next class.
Furthermore, consider an environment with several applications, for example, with a 1 to N configuration. After the first application is patched, a local cache of fixed classes and needed information can be shared amongst the several running applications.
Referring now to FIG. 2, a block diagram illustrating relevant portions of a computer system wilt be discussed and described, a diagram illustrating relevant portions of a computer system will be discussed and described. The computer 201 may include one or more controllers 203, a processor 205, an input/output (i/o) interface 209 for communication such as with a network 207, a memory 211, a display 213 (optional), and/or a user input device such as a keyboard 215. Alternatively, or in addition to the keyboard 215, a user input device may comprise one or more of various known input devices, such as a keypad, a computer mouse, a touchpad, a touch screen, a trackball, and/or a keyboard. The display 213 may present information to the user by way of a conventional liquid crystal display (LCD) or other visual display, and/or by way of a conventional audible device (e.g., a speaker) for playing out audible messages. Portions of the computer 201 are well understood to those of skill in this area and have been omitted to avoid obscuring the discussion.
The processor 205 may comprise one or more microprocessors and/or one or more digital signal processors. The memory 211 may be coupled to the processor 205 and may comprise a read-only memory (ROM), a random-access memory (RAM), a programmable ROM (PROM), and/or an electrically erasable read-only memory (EEPROM). The memory 211 may include multiple memory locations for storing, among other things, an operating system, data and variables 231 for programs executed by the processor 205; a virtual machine 233 including byte code interpreter/JIT compiler, and the like; computer programs for causing the processor to operate in connection with various functions such as to obtain 235 a fingerprint for the application, look up 237 whether any of the classes in the application is broken; substitute 239 a fixed class for the broken class, substitute 241 a fixed class method into the broken class when the broken class is loaded, substitute 243 fixed byte code for broken byte code corresponding to the broken class, unload 245 the broken class and then load the fixed class when the application si running, replace 247 the broken class and leave other classes intact inside a static application when the application is not running, scan 249 the application external to the virtual machine for classes, and insert 251 into the virtual machine an agent that scans for classes; application byte code 253; and a database 255 for other information and/or instructions used by the processor 205. The computer programs may be stored, for example, in ROM or PROM and may direct the processor 205 in controlling the operation of the computer 201. Each of these functions is considered in more detail herein, to the extent that it is not detailed elsewhere in this document.
The user may invoke functions accessible through the user input device such as the keyboard 215. The user input device may comprise one or more of various known input devices, such as a keyboard (215, illustrated) and/or a pointing device, such as a mouse; the keyboard 215 may be supplemented or replaced with a scanner, card reader, or other data input device; and the pointing device may be a mouse, touch pad control device, track ball device, or any other type of pointing device.
The computer 201 can access a software repository 223 on which is stored one or more components, here represented by component(s) 225, which is representative of one or more masters for preparing the library 221 of fingerprints of known components. Although the components 225 are illustrated as accessed over the network 207, the components 225 may be remotely and/or locally accessible from the computer 201, over a wired and/or wireless connection; the components 225 do not need to be limited to a database or a software repository 223. Techniques are known for accessing components located in a software repository 223, and the like.
The processor 205 may be programmed with a virtual machine 233 including byte code interpreter/JIT compiler, and the like. A Java virtual machine is an example virtual machine, which runs the application by (among other things) receiving and interpreting byte code 253 into machine language code which is appropriate for the operating system 231 and computer 201. The Java virtual machine in effect runs the application code. The Java virtual machine provides more nuances than executing machine language code, and supports dynamic redirection capability. The actual memory locations can be supported directly by the Java platform. Other virtual machines are also known.
The processor 205 may be programmed to obtain 235 a fingerprint that indicates the classes comprising the application. The processor 205 can be programmed to monitor the class loading activity on the fly, or statically checking the class path, to feed into the fingerprinting. The fingerprinting is described, for example, in U.S. patent application Ser. No. 13/476,160, filed 21 May 2012, titled “Method and system for matching unknown software component to known software component”. For a static check of the application, the application, e.g., byte code 253 is provided when not running and the classes are discovered. The monitoring can be done from inside the Java virtual machine 233. The class lists can be provided to the fingerprinting module. Techniques are known for taking a piece of executable code and determining what the classes are, whether by running the executable code or just looking at the executable code. For example, the class loader identifies classes by name and the class path format is well-known; this can be a look-up in that path to find that first file; the class path is ordered, and can include named files. The class path can be scanned for the named files. The source code or byte code can be scanned for references to the classes inside the byte code. Alternatively, the JVM conventionally provides some hooks that allow a class lookup to always call something, so that the system can make a decision that a class load request will be passed through or so that a different class will be served up instead (so as to serve up the fixed class instead of the broken class). This allows for both fingerprinting as well as the redirection of the class load.
The processor 205 may be programmed to look up 237 whether any of the classes in the application is broken. The fingerprints can be used to understand what appropriate fixes need to be loaded to resolve any issues in the fingerprinted classes. The output of the fingerprinting can indicate the content of the input application. Then, we do the lookup and figure out what broken classes are in the application. This will then provide a list of what needs to be patched specific to that application. The next step is to fetch the fixes for those things that need to be patched. Now, the system can pull from the new services the patches.
The processor 205 may be programmed to substitute 239 a fixed class for the broken class when the broken class is loaded at class load time. When the virtual machine attempts to load the broken class, the broken class can be intercepted and the fixed class is substituted by replacing the information of the broken class with the information of the fixed class. The fixed class is then loaded in accordance with the usual techniques.
The processor 205 may be programmed to substitute 241 a fixed class method into the broken class when the broken class is loaded at class load time. When the virtual machine 233 attempts to load the broken class, the class being broken due to a broken class method, the broken class can be intercepted and the fixed class method is substituted into the broken class for the broken class method by replacing the information of the broken class method with the information of the fixed class method. Then the class which is now fixed is loaded as usual.
The processor 205 may be programmed to substitute 243 fixed byte code for broken byte code corresponding to the broken class, when the broken class is loaded at class load time. When ate virtual machine 233 attempts to toad the broken class, the class being fixable by patching certain pre-defined byte code, the broken class is intercepted and the pre-defined byte code fix is substituted into the broken class. Then the class with the fixed byte code is loaded as usual.
The processor 205 may be programmed to unload 245 the broken class and then load the fixed class when the application is running. This can be considered asynchronous patching. When a class is loaded, the class which happens to be broken is loaded; meanwhile a background process can be started to fetch the known patch. Then, the broken class is unloaded and the fixed class is loaded (according to known techniques for unloading and loading classes), after the known patch has been successfully fetched. Note, the broken classes for an application might not be known until the second time this system is run (that is, after the fingerprint has been created). The fixed classes can be pre-fetched.
The processor 205 may be programmed to replace 247 the broken class and leave other classes intact inside a static application when the application is not running. This is described below in more detail.
The processor 205 may be programmed to scan 249 the application external to the virtual machine for classes. That is, the application byte code 253 or source code (not illustrated) stored in memory 211 or other storage, can be scanned for classes in accordance with known techniques, prior to attempting to run the application on the virtual machine 233.
The processor 205 may be programmed to insert 251 into the virtual machine 223 an agent that scans for classes. For example, the Java virtual machine context can be running on the computer 201. The processor 205 can create an agent that interacts with the standard conventional class loader. When the application starts up and the VM 233 starts to load classes, the agent can intercept the load requests and scans the information coming through. The system thus can sense that a class is being loaded. The scan can be done right at the time the class load is initiated, so as to determine that the requested class matches a broken class with a known problem (for example, by a comparison of class paths). A storage for fixed class, fixed class method, or fixed byte code 217 is either local (for better performance) or remote (for expanded storage). The agent can then serve up the fixed class instead of the requested class to the virtual machine loader. Note that an embodiment can be provided where the patch functionality discussed herein can execute entirely on the computer 201 that is running the application byte code 253.
The processor 205 may be programmed with application byte code 253. Source code can be turned into application byte code 253 in accordance with known techniques. The virtual machine 233 then interprets the application byte code 253 down to the machine level code. In theory, a virtual machine such as provided by the JVM allows the byte code 253 to be run on any given platform. It will be noted that the present solution concerns rewriting byte code instructions usable by the virtual machine, as opposed to patching bits in machine level code. The byte code is the instructions provided into the JVM. The byte code that can be run on the JVM is what can be fixed.
As will be understood in this field, besides the functions discussed above, the memory 211 can include other miscellaneous information in a misc. database 255, along with the usual temporary storage and other instructions for other programs not considered herein.
It should be understood that FIG. 2 is described in connection with logical groupings of functions or resources. One or more of these logical groupings may be omitted from one or more embodiments, for example, the functionality of looking up 237 whether any of the classes in the application is a broken class, and scanning 249 the application external to the virtual machine can be omitted and/or performed on a different processor. Likewise, functions may be grouped differently, combined, or augmented without parting from the scope. Similarly the present description may describe various databases or collections of data and information. One or more groupings of the data or information may be omitted, distributed, combined, or augmented, or provided locally and/or remotely without departing from the scope.
FIG. 3 to FIG. 6 are flow charts that illustrate different procedures for patching a broken class in an application when the application is in different situations. FIG. 3 relates to correction of the application at class load time, FIG. 4 relates to correction when the application is running, and FIG. 5 relates to correction of the application when the application is static. FIG. 6 relates to a complementary patch providing data services. Any or all of the illustrated procedures can advantageously be implemented on, for example, a processor of a controller, described in connection with FIG. 2 or other apparatus appropriately arranged.
Referring now to FIG. 3, flow chart illustrating a procedure 301 to correct a portion of an application at class load time will be discussed and described. In this regard, the “portion” of an application which is corrected is one of plural pre-defined self-contained parts which together comprise the application, which are combined by being loaded into the virtual machine in order to run the application. In overview, the procedure 301 to correct a portion of the application at class load time will obtain 303 a fingerprint that indicates classes that comprise the application, refer 305 to classes indicated in the fingerprint for the application, look up 307 whether any of the classes that comprise the application is broken. If 309 this class is broken, will substitute fixed byte code 311, 317, a fixed class method 313, 319, or a fixed class 315, 321; load 323 the class (the unbroken class or the fixed class); and if not done 325 with each class, will check whether the next class is broken 309, etc. When done processing the classes being currently in the application, 325, the process 301 can end 327. Each of these is described in more detail, although some description that is provided elsewhere is not repeated below.
At class load time, the procedure 301 will obtain 303 a fingerprint(s) that indicates classes that comprise the application. A simple fingerprint of a class can be created by using any conventional hashing technique, such as hashing the class path or a pre-defined portion of the class file. A subsequent section includes a detailed discussion of creating a fingerprint of a class in a manner which mitigates differences which are created as a by-product of the usual course of implementing software. The fingerprint(s) of the classes that comprise the application can be obtained from a local or remote storage, when the application was previously fingerprinted and the fingerprint(s) stored.
The procedure 301 can refer 305 to classes indicated in the fingerprint(s) for the application, so as to determine whether any class is broken.
The procedure 301 can look up 307 whether any of the classes that comprise the application is broken. To determine whether any class is broken, the procedure 301 can check whether the class is listed as broken (or whether a fix for the class is listed) in a table, database, or similar, or in response to a query for broken/fixed classes, or the like. In other words, if the fingerprint of the class in the application matches a fingerprint listed as broken, then the class in the application is determined to be broken. A subsequent section includes a detailed discussion of determining whether fingerprints match.
Then, the procedure 301 can handle the broken classes in the application. If 309 a particular class is broken, the procedure 301 can substitute in fixed byte code 311, 317, fixed class method 313, 319, or a fixed class 315, 321. The process 301 can check whether 311 fixed byte code is available for the broken class, whether 313 a fixed class method is available for the broken class, or whether 315 a fixed class is available for the broken class. This can allow the procedure to replace the smallest portion possible of the class. Whether the fixed byte code, fixed class method, or fixed class is available can be determined, for example, by checking a database for the fixed class, etc., by checking a table for the fixed class, etc., by receiving an update such as from a patch providing data service that lists the fixed class, etc. or the like. A preliminary explanation of different ways to patch a broken class wilt be instructive. In Java, as is known, a class is composed of member variables, class methods, and/or inner classes. The process 301 can patch an individual class that is broken at any number of levels, down to byte code level, without affecting non-broken classes in the same application. To patch the byte code 317 within a class method: as the methods are being loaded, the system substitutes pre-determined byte code (or a section of byte code) within the flawed class method of the broken class at the time the method is being loaded. To patch the class method 319: within the class are zero-to-many methods; any of those methods can be replaced individually; in this situation, the methods are loaded except for the flawed method(s), and the fixed method is substituted in. To replace the entire class 321: the fixed class is substituted for the broken class; instead of loading any element for the flawed class, the broken class is entirely discarded and the elements of the fixed class are substituted.
The procedure 301 can load 323 the class in accordance with the usual techniques. At this point, the class is either the original class which is not broken class or the fixed class,
If not done 325 with each class, the procedure 301 can check whether the next class is broken 309, and proceed to handle the next class.
When done processing the current classes in the application, 325, the process 301 can end 327. The procedure 301 can be repeated when other classes are subsequently loaded, since it is likely that classes are not all loaded at the same time particularly when a JIT (just in time) virtual machine is used. In Java, all class loading is just-in-time. In just-in-time loading, a class is loaded, and then after it is determined that the loaded class has dependencies on other classes, those other classes are loaded.
Referring now to FIG. 4, a flow chart illustrating a procedure to correct a portion of an application when the application is running in the virtual machine will be discussed and described. In overview, the procedure 401 to correct a portion of the application when the application is already running will obtain 403 a fingerprint that indicates classes that comprise the application, can refer 405 to classes indicated in the fingerprint for the application, can receive 407 updated patches while the application is already running, and can look up 409 whether any of the classes that comprise the application is broken. If 411 this class is already loaded into the running application and is broken, the procedure 401 can unload 411 the broken class in the running application and load 415 the fixed class in place of the broken class. If not done 417 handling each class, the procedure 401 can check whether the next class that is already loaded is broken 411, etc. When done processing the classes currently in the application 417, the process 401 can end 419. Each of these is described in more detail, although some description that was provided above is not repeated below.
The procedure 401 can obtain 403 a fingerprint that indicates classes that comprise the application which is already running in the virtual machine. Various methods to obtain fingerprints are described elsewhere herein in more detail.
The procedure 401 can refer 405 to classes indicated in the fingerprint for the application, so as to determine whether any class in the running application is broken.
In the illustrated procedure 401, updated patches are received 407 while the application is already running such as from a patch providing data services. If updated patches are received while the application is already running, this can provide a means to promptly update broken classes upon receiving the update without waiting for the application to terminate. Alternatively, the updated patches might be received in response to a query regarding the classes indicated in the fingerprint.
The procedure 401 can took up 409 whether any of the classes that comprise the application is broken. Various methods to took up this information are described elsewhere herein in more detail.
Upon determining 411 that this class is both already loaded into the running application and is broken, the procedure 401 can unload 411 the broken class in the running application. The procedure 401 can then obtain and load 415 the fixed class in place of the broken class. Those in the art will be familiar with techniques for unloading and loading classes in a running application.
If not done 417 handling each class in the already-running application, the procedure 401 can check whether the next class that is already loaded is broken 411, and perform the loading and unloading as discussed above.
When done 417 processing the classes currently in the application, the process 401 can end 419. The procedure 401 can be repeated later, for example periodically or after other classes are subsequently loaded.
Referring now to FIG. 5, a flow chart illustrating a procedure to correct a portion of an application when the application is static will be discussed and described. A static application is one that is not running on the virtual machine, for example, an application in byte code or an application in source code. In overview, the procedure 501 to correct a portion of the application when the application is static will obtain 503 a fingerprint that indicates classes that comprise the application, can refer 505 to classes indicated in the fingerprint for the application, can receive 507 updated patches while the application is already running, and can look up 509 whether any of the classes that comprise the application is broken. If 511 this class in the static application is determined to be broken, the procedure 501 can retrieve 513 the fixed class and can then replace 515 the broken class in the static application with the fixed class. If not done 517 handling each class in the static application, the procedure 501 can check whether the next class in the static application is broken 511, etc. When done processing the classes in the static application 517, the process 501 can store the static application with the fixed classes 519 so that the next time the static application is run it will have no broken classes. After storing the static application, the process 501 can end 519. Each of these is described in more detail, although some description that was provided above is not repeated below.
The procedure 501 can obtain 503 a fingerprint that indicates classes that comprise the application which is already running in the virtual machine. Various methods to obtain fingerprints are described elsewhere herein in more detail.
The procedure 501 can refer 505 to classes indicated in the fingerprint for the application, so as to determine whether any class in the static application is broken. This is also described elsewhere
Also described elsewhere, updated patches can be received 507 while the application is static such as from a patch providing data services.
The procedure 501 can look up 509 whether any of the classes that comprise the application is broken, as described elsewhere in more detail.
Upon determining 511 that this class in the static application is broken, the procedure 501 can retrieve 513 the fixed class that corresponds to the broken class. The procedure 501 can then replace 515 the broken class in the static application with the fixed class, such as by replacing the byte code of the static application.
If not done 517 handling each class in the already-running application, the procedure 501 can check whether the next class in the static application is broken 511.
When done 517 processing the classes currently in the application, the process 501 can store 519 the repaired static application in which the broken classes have been replaced with fixed classes, and then can end 521. The procedure 501 can be repeated later, for example periodically or for other static applications.
Referring now to FIG. 6, a flow chart illustrating a patch providing data service will be discussed and described. In overview, the patch providing data service 601 can receive 603 a fingerprint(s) with an indication of classes to be evaluated from a requestor, can determine whether 605 there is a broken class indicated in the fingerprint. If there is no broken class in the fingerprint, the data service 601 can notify 611 the requestor that there is no broken class and can then end 613. However, if it is determined that there is a broken class indicated in the fingerprint, the data service 601 can construct 607 an artifact that includes the patch(es) for the broken class(es) indicated in the fingerprint, and can provide 609 notification to the requestor of the broken class(es). Each of these is discussed in more detail below.
The patch providing data service 601 can receive 603 a fingerprint(s) with an indication of classes to be evaluated from a requestor. As a practical matter, each fingerprint uniquely identifies a particular class. The patch providing data service 601 can then determine whether 605 any of the classes indicated in the fingerprint is a broken class, such as by comparing the received fingerprint(s) with tables or listings of known broken fingerprints.
If none of the classes indicated in the fingerprint is determined to be broken, the data service 601 can notify 611 the requestor that there is no broken class and can then end 613.
However, if it is determined that there is one or more of the classes indicated in the fingerprint is broken, the data service 601 can construct 607 an artifact that includes the patch(es) for the broken class(es) indicated in the fingerprint. The artifact which is constructed can include, for example, an identification of the broken class(es), a location of the fixed class which can be retrieved to fix the broken class, and further information as to how to apply the fixed class so as to fix the broken class. For example, the further information can indicate a granularity of the fix: where to substitute fixed byte code into a broken class, a fixed class method to be substituted into a broken class, or a fixed class to be substituted for an entire broken class (whether loaded or not). Also, the further information can indicate whether the fix is to proceed differently for a loaded class, a running application, a static application, or similar.
The patch providing data service 601 can provide 609 notification to the requestor of the broken class(es), as well as providing the requestor with the artifact that indicates how to fix the broken class(es).
For class files, the system can look at individual members of the class and apply the following approach. The file can be normalized and hashes of individual members inside the file are calculated, and those hashes can be compared to a database of known hashes that were previously collected.
Any hash function technique can be used. Well known hash techniques include SHA-1, MD5, and many others that will map an input data set of variable length and output a small data set, sometimes referred as a hash value, hash code, hash sum, check sum, or hash. The particular hash function is not important as long as the same technique is used to hash the file being evaluated and the known file to which it is compared. The file that is input to the hash function can be normalized so that the input is the same despite differences, some of which are subtle, that are injected as part of the process of developing code.
On a source file, some normalization can be done to omit, e.g., end-of-line characters that may be different (depending on the editor implementation) in the bit file that otherwise would be hashed but do not affect the semantics of the file contents. In a compiled application that is being evaluated, the system is trying to compare two components which have been modified by, e.g., a compiler and trace them back to determine that these two apparently different components likely originated from the same source code.
With regard to compilers, running a compiler at a different time or with a slightly different set of parameters or running a different compiler or a compiler with a different set of parameters, on the same source code, can yield a slightly different set of byte code. Also, the compiled code might include a portion of byte code that is random and essentially different every time the code is compiled. A compiler is obliged to generate exactly the same code for the same input, but even different versions of the same compiler can generate slightly different code for identical input.
Two components can be different while being the same semantically, for example, the same source has been through different compiler versions or the same compiler with different options. That two components are “semantically” the same means that the byte codes, although different, were compiled from exactly the same source or using same compiler or with different options, or different versions of the same compiler, and/or using the same or different build tools. To this point, the mere fact of re-compiling changes an outer archive's hash due to the changed time stamp. One question to be answered in matching fingerprints is whether the two components being compared are different compiles of the same source. The normalizing process is intended to mitigate such differences which are created as a by-product of the usual course of implementing software.
One or more normalization techniques can look for cases where the individual class files and contents themselves are slightly altered, and/or where the bulk of an archive itself is the same with some subtle changes such as when a file was patched or a manifest is added. The system can say with some confidence that these different outer files are the same, when every other component in the respective files is identical.
The normalization process which is performed can be dependent on the detected content of the file. For example, to normalize text files, the system can remove the white space, line endings, etc. For Java files, a number of specialized things can be done to normalize the bytecode. The system can normalize other types of components, e.g., .net components. The approach can be similar, i.e., to ascertain and remove information added by the .NET compilers to the semantically functional parts of the code.
A variation is to compile known source code to provide compiled source code, and then compare the resulting output of the known compiled source code to the unknown compiled component.
The system can determine which kind of normalization to do based on the file type (e.g., the file extension as confirmed by the file contents) of the subcomponent. In normalization, a first step is identifying the type of file and a next step can be to normalize the file. The system knows what types of components represent archives. If a component is determined to be an archive, then it contains other components; the component that is an archive is opened up and the process is performed on the components contained in the archive. If the component is a Java class file, a bytecode normalization for Java or for a Java class file is applied. If the component is a text file, the system performs a text file normalization. The system walks down the tree until it has files which are not archive files and then the system handles the individual files. An “Archive file” is defined herein as a file type that is known to contain other files. Examples of an “Archive file” are a zip file, a JAR file, and the like.
One or more normalization processes can be used on a component, to generate respective one or more hashes for a single component.
The normalization procedure for the Java component can generate a universal fingerprint for a Java component. By “universal”, it is intended to indicate that any data introduced into the Java component by software programmers while the semantic function is retained, have been reduced by the normalization process, so that two Java components with the same provenance will match, regardless of subsequent compiles, packaging, etc.
Thus, one or more embodiments provides, for a Java component, normalizing the Java component according to a Java normalization process to provide a normalized Java component; and generating, in a processor, the fingerprint for the normalized Java component, as a universal fingerprint in this embodiment, the fingerprint is a hash value; and the Java normalization process performs the following on the Java component: setting class version to 0, resetting synthetic class access flags, setting outer class name to null, setting constant pool and inner class list in alphabetical order, resetting final access flag of Java enumerations #values method, removing all synthetic member fields and Java methods, and removing all package names.
A hash function can performed on each normalized component, including the file to be evaluated as a whole, each component within the file to be evaluated, each component within one of the components, and so on (each, a “subcomponent”). The hash function can generate fingerprints.
Thus, one or more embodiments provides, for a Java component such as a class, normalizing the Java component according to a Java normalization process to provide a normalized Java component; and generating, in the processor, the fingerprint for the normalized Java component, as a universal fingerprint.
The system can check whether there is an exact match between fingerprint of any known component (such as a class) and the fingerprint of the unknown, possibly broken component (or subcomponent). Even if the unknown component as a whole has a matching fingerprint, the system can evaluate the interior components of the unknown component for matching fingerprints. There is a small possibility of a false positive match of just the unknown component as a whole, and moreover there may be security implications of the internal component that may not have been noted with respect to, e.g., the executable component package.
A known component can have a provenance because it may have been retrieved from storage, such as a software repository, or other structured storage that associates the component with its license(s), build settings and environment, contributor, and/or which may be able to associate the component with vulnerabilities, security updates and the like. Once the unknown, possibly broken component (or its subcomponents) is matched to a known component, the unknown component can be associated with the provenance of the known component (and its subcomponents) and hence the issues related to provenance (e.g., broken/fixed, security, etc.) can be addressed in the unknown component.
Even if there is a perfect match at the outer file level, there may be matches at the subelement which are relevant as well (e.g., archive or class file, etc.). So, fingerprints can be generated and matches can be determined for the unknown component at all of these levels (innermost file subelements, all file sub-elements, and the unknown component overall).
Any known or to-be-developed techniques can be used for comparing hash values and attempting to locate a matching hashed value.
Referring now to FIG. 7, a block diagram illustrating a software repository will be discussed and described. FIG. 7 discloses a project object model (“POM”). The project, e.g., project X 755 includes one or more components (here represented by Components A and B 751, 753), the project log 743 for Project X, and metadata for the project X (here represented by POM X 701) that identifies project information such as contributors 733 and licenses 735. The illustrated example is a known Maven software project object model, which provides a highly structured handling of projects and components, sometimes referred to therein as “artifacts”. Maven is a build management tool that comprises a project object model (“POM”), a set of standards, a project lifecycle, a dependency management system, and logic for executing plugin goals at defined phases in a lifecycle.
A “Project Object Model” (POM), POM X 701 is a file provided for a project 755 that describes, configures and customizes an application and is associated with one or more components by being included in the same directory as one or more components. In different build tools or project management tools, the POM 701 is a file included in a project, e,g., project X 755, which includes one or more components (represented by component A and component B 751, 753); the POM can be a file with a pre-determined name: a Maven pom.xml file, a GNU Makefile, or an Ant build.xml file. The POM file is typically targeted to Java applications, building JAR components, C# sources, or the like. A software component can be associated with a POM in alternative ways, for example, by including a link or identification of the associated POM.
The POM 701 can contain description data and configuration data: POM relationships 703, build setting 705, general project information 707, and build environment 709. General project information 707 includes general data 431 (project's name, the URL for a project, the sponsoring organization), a list of developers and contributors 733, and/or the license (or identifiers of licenses) for the project 755,
The build settings 705 for the project 755 can customize the behavior of a build 719 by specifying location of directories 721, extensions 723, resources 725 and plugins 727. Also, the build settings 705 can specify reporting 729 to be used for the POM 701.
The build environment 709 can include settings and profiles that can be activated when the software comprising the components 751 is built for use in different environments. For example, during development the built software is deployed to a development server, whereas in production developers the built software is deployed to a production server. This example provides build environment information 737, Maven environment information 739, and profiles 741 to be used in different builds. Techniques for executing a build of software are known.
The POM relationships 703 include POM coordinates 411 that specify a group ID, an artifact ID, and a version number for the project 755 and for the POM 701. In the conventional Maven system, group ID, artifact ID and version (GAV) uniquely identify each component. The group ID is meant to identify the individual or organization that published the component. The artifact ID uniquely identities a component for the Group, and in accordance with known techniques indicates what functionality the component is addressed to; artifact IDs need not be unique for different groups. The version is the temporal axis for how a component changes in accordance with known techniques, e.g., Version 1.0 is least mature, and Version 8.2.3 is more mature. Collectively, the group ID, artifact ID and version number are sometimes referred to herein as the “GAV”, “Maven coordinate” or “GAV coordinate”. The GAV uniquely identifies a component and allows its dependencies and relationship to other components to be tracked. The use of the GAV disambiguates amongst components across various domains of different groups.
The POM as used in Maven is discussed in “MAVEN: The Complete Reference Guide”, Edition 8 (2010), In a well-written POM, there is a block for “description,” “project”, “URL”, “License”, “Issue tracking”, “author list” and the like. Known techniques can be used to construct a POM.
A project, e,g., project X 755 can have a parent, e.g., project Y 757. Project Y 757 is illustrated to include representative component C 759 and a POM 761. Values which are not specified in the POM in a child project can inherit values from the POM of a parent project, e.g., when general project information 707 is not specified in the POM X 701 of Project X 455, the project X 755 can inherit the general project information specified in the POM Y 761 of the parent project Y 757.
Also included in a project 755 is a project log 743. The project log 443 can perform known functions, such as recording source code check-in, check-out, update of a component, download of a component from the project, bugs and related fixes, and similar.
A different project, e.g., project Y 757 includes other components (here represented by Component C 759), the project log (not illustrated) for Project Y, and metadata for the project Y (here represented by POM Y 761) that identifies project information such as contributors and licenses.
It is not necessary to use a POM structure according to Maven; alternative implementations of a software repository as a database which includes components, their associated licenses and/or build information and the like will be understood,
The system used in connection herewith may rely on the integration of various components including, as appropriate and/or if desired, hardware and software servers, applications software, database engines, server area networks, firewall and SSL security, production back-up systems, and/or applications interface software,
The Java computer programming language and the Java virtual machine are sometimes mentioned herein, and in this connection reference may be made to a non-exhaustive list of various specifications for Java Language such as JSR 901 The Java Language Specification, Java SE 7 Edition, The Java Language Specification, Third Edition, The Java Language Specification, Second Edition, The Java Virtual Machine Specification, Java SE 7 Edition, The Java Virtual Machine Specification, Second Edition (JVM), JSR 924, and variations and evolutions thereof. In this regard, it can be noted that various computer programming languages can be used to produce byte code that runs on a Java Virtual Machine include, for example, Java, Groovy, Scala, Kollin, JavaRX Script, JRuby, Jython, Rhino, CLforJava, Flow Java, and/or numerous others.
Furthermore, the networks of interest for communicating between computers onto which some embodiments may be distributed include those that transmit information in packets, for example, those known as packet switching networks that transmit data in the form of packets, where messages can be divided into packets before transmission, the packets are transmitted, and the packets are routed over network infrastructure devices to a destination where the packets are recompiled into the message. Such networks include, by way of example, the Internet, intranets, local area networks (LAN), wireless LANs (WLAN), wide area networks (WAN), and others. Protocols supporting communication networks that utilize packets include one or more of various networking protocols, such as TCP/IP (Transmission Control Protocol/Internet Protocol), Ethernet, X.25, Frame Relay, ATM (Asynchronous Transfer Mode), IEEE 802.11, UDP/UP (Universal Datagram Protocol/Universal Protocol), IPX/SPX (Inter-Packet Exchange/Sequential Packet Exchange), Net BIOS (Network Basic input Output System), GPRS (general packet radio service), I-mode and other wireless application protocols, and/or other protocol structures, and variants and evolutions thereof. Such networks can provide wireless communications capability and/or utilize wireline connections such as cable and/or a connector, or similar.
1. A method for correcting a portion of an application, comprising:
determining, in a computer, a fingerprint, which is a single fingerprint that indicates plural different classes that collectively comprise the application, the fingerprint being a universal fingerprint from a component normalized to reduce the data introduced by a programmer and to retain a semantic character of component content;
referring, in the computer, to the plural different classes, indicated in the fingerprint, that collectively comprise the application, and looking up whether any of the plural different classes that comprise the application is a broken class;
for each of the plural different classes in the application which is determined to be the broken class:
substituting a fixed class for the broken class, when the broken class is loaded at class load time for the application, or
substituting a fixed class method into the broken class, when the broken class is loaded in the computer at class load time for the application, or
substituting fixed byte code for broken byte code corresponding to the broken class, when the broken class is loaded in the computer at class load time for the application, or
replacing the broken class inside the static application with the fixed class, without replacing classes which are not broken, when the application is not running;
wherein the fingerprint for the application is obtained on a just-in-time basis at class load time; and
scanning, at run time with a byte code interpreting virtual machine running the application, classes before they are being loaded to determine the classes that comprise the application.
2. The method of claim 1, wherein the fingerprint for the application is obtained from a class path of the application.
3. The method of claim 1, further comprising inserting an agent that performs the scanning into the byte code interpreting virtual machine before the classes begin loading, wherein the agent performs the looking up whether the class is one of the broken classes before they are loaded, and the agent serves up the fixed class instead of the broken class to the virtual machine which loads the class for the application.
4. The method of claim 1, wherein the application is run in a context of the byte code interpreting virtual machine.
5. The method of claim 1, wherein the fixed classes to be substituted for the broken classes are served from a database.
6. The method of claim 1, wherein the fingerprint for the application is obtained based on a scan of the application external to a virtual machine on which the application is configured to be executed.
7. A computer that corrects a portion of an application, comprising:
an i/o interface operable to transmit and receive communications over at least a portion of a communication network; and
a processor cooperatively operable with the i/o interface, and configured to facilitate:
determining a fingerprint, which is a single fingerprint that indicates plural different classes that collectively comprise the application, the fingerprint being a universal fingerprint from a component normalized to reduce the data introduced by a programmer and to retain a semantic character of component content;
referring to the plural different classes, indicated in the fingerprint, which collectively comprise the application, and looking up whether any of the plural different classes that comprise the application is a broken class;
substituting a fixed class method into the broken class, when the broken class is loaded at class load time for the application, or
substituting fixed byte code for broken byte code corresponding to the broken class, when the broken class is loaded at class load time for the application, or
scanning, at run time with a byte code interpreting virtual machine running the application in the processor, classes before they are being loaded to determine the classes that comprise the application.
8. The computer of claim 7, wherein the fingerprint for the application is obtained from a class path of the application.
9. The computer of claim 7, wherein the processor is configured to insert an agent that performs the scanning into the byte code interpreting virtual machine before the classes begin loading, wherein the agent in the processor performs the looking up whether the class is one of the broken classes before they are loaded, and the agent in the processor serves up the fixed class instead of the broken class to the virtual machine which loads the class for the application.
10. The computer of claim 7, wherein the application is run on the processor in a context of the byte code interpreting virtual machine.
11. The computer of claim 7, wherein the fixed classes to be substituted for the broken classes are served from a database.
12. The computer of claim 7, wherein the fingerprint for the application is obtained based on a scan of the application external to a virtual machine on which the application is configured to be executed.
13. A non-transitory computer-readable medium comprising instructions for execution by a computer, the instructions including a computer-implemented method for correcting a portion of an application, the instructions for implementing:
determining, in a computer, a fingerprint which is a fingerprint that indicates plural different classes that collectively comprise the application, the fingerprint being a universal fingerprint from a component normalized to reduce the data introduced by a programmer and to retain a semantic character of component content;
14. The non-transitory computer-readable medium of claim 13, wherein the fingerprint for the application is obtained from a class path of the application.
15. The non-transitory computer-readable medium of claim 13, further comprising inserting an agent that performs the scanning into the byte code interpreting virtual machine before the classes begin loading, wherein the agent performs the looking up whether the class is one of the broken classes before they are loaded, and the agent serves up the fixed class instead of the broken class to the virtual machine which loads the class for the application.
16. The non-transitory computer-readable medium of claim 13, wherein the application is run in a context of the byte code interpreting virtual machine.
17. The non-transitory computer-readable medium of claim 13, wherein the fixed classes to be substituted for the broken classes are served from a database.
18. The non-transitory computer-readable medium of claim 13, wherein the fingerprint for the application is obtained based on a scan of the application external to a virtual machine on which the application is configured to be executed.
19. The method of claim 1, further comprising unloading the broken class and then loading the fixed class in place of the broken class, while the application is running, when it is determined that the application is running.
20. The computer of claim 7, further comprising unloading the broken class and then loading the fixed class in place of the broken class, while the application is running, when it is determined that the application is running.
21. The non-transitory computer-readable medium of claim 13, further comprising unloading the broken class and then loading the fixed class in place of the broken class, while the application is running, when it is determined that the application is running.
US13554335 2012-07-20 2012-07-20 Method and system for correcting portion of software application Active US9141408B2 (en)
US13554335 US9141408B2 (en) 2012-07-20 2012-07-20 Method and system for correcting portion of software application
US20140026121A1 true US20140026121A1 (en) 2014-01-23
US9141408B2 true US9141408B2 (en) 2015-09-22
ID=49947664
US13554335 Active US9141408B2 (en) 2012-07-20 2012-07-20 Method and system for correcting portion of software application
US (1) US9141408B2 (en)
US20170090900A1 (en) * 2015-09-30 2017-03-30 International Business Machines Cororation Determining patch applicability on running systems
US20120011496A1 (en) * 2009-03-30 2012-01-12 Nec Corporation Service providing apparatus, service providing system, method of processing data in service providing apparatus, and computer program
US20140207753A1 (en) 2013-01-18 2014-07-24 Sonatype, Inc. Method and system that routes requests for electronic files
Fitzpatrick et al., "CVS Integration with Notification and Chat: Lightweight Software Team Collaboration," CSCW'06, Nov.4-8, 2006, pp. 49-58.
Gacek, "Exploiting Domain Architectures in Software Reuse", 1992, ACM 0-89791-739- 1/95/0004, pp. 229-232.
Goldberg, "A specification of Java loading and bytecode verification," 1998, Proceedings of the 5th ACM conference on Computer and communications security, pp. 49-58. *
Google, "classpath-explorer Library which allows discovering classes at runtime," 2008, p. 1, downloaded from the Wayback Machine Internet Archive Sep. 25, 2013. *
Liang et al., "Dynamic class loading in the Java virtual machine," 1998, Proceedings of the 13th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, pp. 36-44. *
Malabarba et al., "Runtime Support for Type-Safe Dynamic Java Classes," 2000, ECOOP 2000-Object-Oriented Programming Lecture Notes in Computer Sciencevol. 1850, pp. 337-361. *
Notice of Allowance issued by the U.S. Patent Office on Jan. 22, 2013 in connection with related application No. 13/089,751.
Notice of Allowance issued by the U.S. Patent Office on Mar. 15, 2013 in connection with related application No. 13/483,412.
Notice of Allowance issued by the U.S. Patent Office on May 15, 2015 in related U.S. Appl. No. 13/744,542.
Office Action issued by the U.S. Patent Office on Apr. 8, 2013 in connection with related application No. 13/151,816.
Office Action issued by the U.S. Patent Office on Apr. 9, 2013 in connection with related application No. 13/231,162.
Office Action issued by the U.S. Patent Office on Mar. 10, 2014 in connection with related application No. 13/233,265.
Office Action issued by the U.S. Patent Office on Oct. 22, 2014 in connection with related application No. 13/962,122.
Office Action issued by the U.S. Patent Office on Oct. 7, 2014 in connection with related application No. 14/078,151.
Office Action issued by the U.S. Patent Office on Sep. 24, 2013 in connection with related application No. 13/476,160.
US20140026121A1 (en) 2014-01-23 application
Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:JACKSON, WAYNE;FOX, BRIAN EDWARD;HANSEN, MIKE;AND OTHERS;SIGNING DATES FROM 20120902 TO 20120905;REEL/FRAME:028961/0299