Hotpatching Running Software Without Service Interruption

Resolve Bottlenecks,
Find Innovative Solutions
Generate 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

VSEngineering 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

Engineering Contradiction:
Improvesecurity fix applicationVSAvoidservice availability
Core Design Contradiction:
ReliabilityVSProductivity

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

Inventive Principle:
Principle #1Segmentation

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

Inventive Principle:
Principle #10Preliminary action

2Productivity

If component replacement is performed while code is in use, then service continuity is maintained, but addresses in running code become invalid

Engineering Contradiction:
Improveservice continuityVSAvoidcode execution safety
Core Design Contradiction:
ProductivityVSReliability

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

Inventive Principle:
Principle #24Intermediary (Mediator)

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

Inventive Principle:
Principle #26Copying

3Reliability

If processes are shut down to unload components for patching, then the patch can be safely applied, but service interruption occurs

Engineering Contradiction:
Improvesafe patch applicationVSAvoidservice availability
Core Design Contradiction:
ReliabilityVSProductivity

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

Inventive Principle:
Principle #10Preliminary action

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

Inventive Principle:
Principle #2Taking out (Extraction)

Data Source

PatentUS7784044B2Patching of in-use functions on a running computer system
Publication Date: 2010.08.24 MICROSOFT TECHNOLOGY LICENSING LLC
  • US7784044B2 patent drawing
  • US7784044B2 patent drawing
  • US7784044B2 patent drawing

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.