Oracle gobbled up a company called KSplice 50 ITYA (IT Years Ago – or July 2011). They then shoe-horned it into their downstream clone of RHEL so people could slip in kernel upgrades without rebooting systems sort of like how magicians yank table cloths out from under dishes on a table. It’s scary on any number of levels.
Now there is a new-ish project called kpatch that has the backing of Red Hat (full disclosure – I work for Shadowman). I’ve only had a little time to look at the incomplete documentation on how it works. That said, it looks to be a huge step forward over ksplice. From it’s Red Hat Blog announcement:
With respect to granularity, kpatch works at the function level; put simply, old functions are replaced with new ones. It has four main components:
- kpatch-build: a collection of tools which convert a source diff patch to a hot patch module. They work by compiling the kernel both with and without the source patch, comparing the binaries, and generating a hot patch module which includes new binary versions of the functions to be replaced.
- hot patch module: a kernel module (.ko file) which includes the replacement functions and metadata about the original functions.
- kpatch core module: a kernel module (.ko file) which provides an interface for the hot patch modules to register new functions for replacement. It uses the kernel ftrace subsystem to hook into the original function’s mcount call instruction, so that a call to the original function is redirected to the replacement function.
- kpatch utility: a command-line tool which allows a user to manage a collection of hot patch modules. One or more hot patch modules may be configured to load at boot time, so that a system can remain patched even after a reboot into the same version of the kernel.
That’s way cooler than just doing some fancy RAM voodoo and slipping new kernels in like ksplice.
But I still don’t see where it has a place on a company’s production server or in their security plans.
I believe that if a system cannot sustain the reboot of a single instance of Linux (physical or virtual) then there is a serious flaw in its architecture. To further that I think something like kpatch could end up being a strong crutch to bad architects out there; allowing them to keep working in this flawed manner.
I know that my crazy idealism doesn’t represent the current reality everywhere (or almost anywhere). But if this is the only justification for its existence then I think we could have and should be using our cycles better somewhere else.
More details as I discover them.