关于Linux内核实时补丁如何工作-How kernel live patching works
Posted on 2023-06-30 21:48 520_1351 阅读(109) 评论(0) 编辑 收藏 举报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
作者:一名卑微的IT民工
出处:https://www.cnblogs.com/5201351
本博客所有文章仅用于学习、研究和交流目的,欢迎非商业性质转载。
由于博主的水平不高,文章没有高度、深度和广度,只是凑字数,不足和错误之处在所难免,希望大家能够批评指出。
博主是利用读书、参考、引用、复制和粘贴等多种方式打造成自己的文章,请原谅博主成为一个卑微的IT民工!