摘要 |
A method, a device, and a system for realizing kernel online patching are provided. The method includes loading a pre-generated patch file in an operating system, setting a first breakpoint at an execution start position of the primitive function when a system thread executes the primitive function and a breakpoint exception occurs during the thread execution process due to the first breakpoint, modifying a returning execution address of the first breakpoint into the destination address of the patch function corresponding to the primitive function according to the first corresponding relation, and removing the first breakpoint. The kernel online patching implementation has a small impact on the normal operation of the operating system. The patch function becomes valid without restarting the operating system, thereby satisfying the high reliability requirements of carrier-class products.
|