Deep Dive Into Linux Kernel Livepatch
summary
Explains that kernel livepatching redirects execution with ftrace code redirection and compares three implementations: kpatch (stop-the-world stack-scan), kgraft (per-task trampoline), and mainline livepatch (hybrid, livepatch in mainline since 4.0). Demonstrates building a patch for Linux 5.4 using kpatch-build diff-and-compile which compiles unstripped kernels, generates ELF relocation sections, produces a module, and insmod installs it; rdmesg shows the meminfo fix applied. Notes limits: only small isolated functions, cannot safely change data structures, and requires debug symbols and extensive testing.
AI-written summary · about
chapters (10)
- 0:00Introduction and agenda
- 1:01Understanding live patching
- 3:40Code redirection with ftrace
- 4:34K-patch consistency models
- 6:37K-graph and trampoline usage
- 10:10Mainline live patch features
- 12:06Driver structure and building
- 15:18ELF sections and requirements
- 18:25K-patch build and workflow
- 26:27Limitations and conclusion
related talks
38mDeep Dive Into Linux Kernel Livepatch
33mLinux Kernel Live Patching
39mLet's meet the kernel livepatch feature
39mThe Life of a Kernel Bugfix
09mLinux Kernel Bug Fixing Project
43mGetting to Know the Linux Kernel: A Beginner's Guide
53mAn engineer's guide to Linux Kernel upgrades
52mLinux Kernel Debugging: Going Beyond Printk Messages
