Hotpatching Running Software Without Service Interruption
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for updating software components on computer systems often require reboots, leading to service interruptions and downtime, as they cannot safely replace components in use without invalidating addresses stored in running code.
Innovation Solution
The implementation of hotpatching and coldpatching techniques, where a new version of a routine is loaded into memory with an instruction to jump to the patch, and coldpatching applies patches to the binary image on disk for future loads, allowing updates without service interruptions.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If conventional file-level replacement is used to update software components, then the update can be applied, but the system requires a reboot causing service interruption
Solution Approach 1:
The update process is segmented into two independent parts: hotpatching for currently running processes and coldpatching for future process loads. This allows the update to be applied partially without requiring a system-wide reboot, as each segment can be updated independently based on process state
Solution Approach 2:
The coldpatch is applied in advance to the binary image on disk before any processes need to load it. This preliminary action ensures that future process loads will automatically use the patched version without requiring those processes to be restarted, eliminating the need for system-wide service interruption
2Productivity
If component replacement is performed while code is in use, then service continuity is maintained, but addresses in running code become invalid
Solution Approach 1:
The patent introduces an intermediary mechanism that intercepts dynamic link library loading requests. When a process attempts to load a DLL, the intermediary checks if a coldpatch exists and redirects the load to the patched version, allowing updates without interrupting running processes or invalidating their addresses
Solution Approach 2:
The coldpatch creates a copy of the patched binary image on disk that coexists with the original. This copy can be safely loaded by future processes without affecting currently running processes that have their own memory space and valid addresses, thus maintaining both service continuity and execution safety
3Reliability
If processes are shut down to unload components for patching, then the patch can be safely applied, but service interruption occurs
Solution Approach 1:
The coldpatch is applied preliminarily to the binary image on disk before any loading occurs. This advance preparation ensures that when processes are eventually loaded or restarted, they automatically pick up the patched version without requiring manual intervention or causing service interruption
Solution Approach 2:
The patent extracts the patching operation from the running process space and applies it to the binary image on disk instead. This extraction allows the patch to be prepared and validated separately, then automatically integrated when processes load, eliminating the need to shut down services for safe patch application
Data Source
AI summary
A system and method for automatically updating software components on a running computer system without requiring any interruption of service. A software module is hotpatched by loading a patch into memory and modifying an instruction in the original module to jump to the patch. A coldpatching technique places a coldpatch version of the module on disk for subsequent loading by processes, after hotpatching occurred. The coldpatch has the entry points to its functions at the same relative locations within the module as the hotpatch, which facilitates subsequent hotpatching. A hotpatch and coldpatch are automatically generated by deriving differences between changed and original binary files, and establishing the point to insert the jump. Validation is performed to ensure that the hotpatch is applied to the correct version, and that the coldpatch is replacing the correct version. Version management is also provided to control the number of patches via support rules.


