kpatch 内核补丁解决方案使用 livepatch 内核子系统将旧功能重定向到新功能,详细的过程及说明如下:
The kpatch
kernel patching solution uses the livepatch
kernel subsystem to redirect old functions to new ones. When a live kernel patch is applied to a system, the following things happen:
- The kernel patch module is copied to the
/var/lib/kpatch/
directory and registered for re-application to the kernel bysystemd
on next boot. - The kpatch module is loaded into the running kernel and the new functions are registered to the
ftrace
mechanism with a pointer to the location in memory of the new code. - When the kernel accesses the patched function, it is redirected by the
ftrace
mechanism which bypasses the original functions and redirects the kernel to patched version of the function.
Figure 22.1. How kernel live patching works
标签:kpatch,kernel,patching,How,live,内核,works From: https://www.cnblogs.com/5201351/p/17517889.html