AlmaLinux Kernel Live Patching with kpatch: Zero-Downtime Updates Without Reboot
AlmaLinux's kpatch live patching lets you apply Critical kernel CVE fixes without rebooting. This blog covers installation, automatic DNF integration, Secure Boot considerations, and the practical limits—driver updates and minor-version upgrades still require downtime.
20 Aug 2025, 09:50 UTC

The Problem: Security Updates Without Maintenance Windows
Production Linux servers accumulate kernel vulnerabilities faster than most teams can schedule reboots. A Critical CVE in the kernel's networking stack or memory manager might land on Tuesday, but your change advisory board only approves downtime on Sunday. AlmaLinux addresses this gap with kpatch—a live patching framework that applies binary patches to a running kernel, letting you remediate high-severity flaws without a restart.
How AlmaLinux Packages and Delivers kpatch
AlmaLinux builds kpatch modules against the exact kernel ABI of each minor release (for example, 4.18.0-553.el8 on AlmaLinux 8 or 5.14.0-427.el9 on AlmaLinux 9). Each patch package contains a .kpatch binary blob plus metadata describing the target kernel version. Patches are signed with the AlmaLinux GPG key and shipped through the standard baseos and appstream repositories—no third-party repos required.
The distribution mirrors Red Hat's errata cadence: when RHEL releases an RHSA for an Important or Critical kernel CVE, AlmaLinux typically publishes a corresponding kpatch package within days. Not every CVE is patchable; architectural changes or data-structure modifications still require a full kernel replacement and reboot.
Installation and Automatic Operation
On a registered AlmaLinux 8 or 9 system (subscription or public mirror access required), enable live patching with a single dnf transaction:
# Run as root on the target server
dnf install kpatch kpatch-dnf
This pulls two components:
- kpatch – the runtime that loads/unloads patch modules via the kernel's
livepatchsubsystem. - kpatch-dnf – a DNF plugin that automatically installs matching kpatch packages whenever
dnf update kernelruns, then triggerskpatch loadfor the new patches.
After installation, the kpatch.service systemd unit loads all installed patches at boot. You can inspect active patches anytime:
kpatch list
Output shows each patch's status (loaded or not loaded), the kernel version it targets, and a short description (often the CVE identifier).
Worked Example: Patching CVE-2024-XXXX on AlmaLinux 9
Assume you're running AlmaLinux 9.4 with kernel 5.14.0-427.13.1.el9_4.x86_64. An Important CVE affects the net/ipv4/tcp.c module. The workflow:
- Check available patches for your exact kernel:
dnf list kpatch-patch-* --showduplicates | grep 5.14.0-427 - Install the specific patch (replace with actual package name):
dnf install kpatch-patch-5_14_0-427.13.1.el9_4.x86_64-1.0-1.el9 - Load it immediately without waiting for reboot:
kpatch load kpatch-patch-5_14_0-427.13.1.el9_4.x86_64-1.0-1.el9 - Verify the patch appears in
/proc/kpatchandkpatch listshowsloaded.
Permissions: All commands require root. Risk: If the patch targets a different kernel NEVRA (Name-Epoch-Version-Release-Architecture), kpatch load will fail with a version mismatch error—no kernel state is modified.
Limitations and Trade-offs
- Kernel modules loaded after boot (e.g., proprietary drivers, out-of-tree filesystem modules) are not patched. Driver updates still need a reboot or manual
modprobe -r && modprobecycle. - Patch stacking is avoided by design: each new kpatch for a given kernel minor version automatically unloads the previous one. You never accumulate multiple patches on the same kernel.
- Memory overhead is roughly 2–4 MB per loaded patch. Heavily patched systems may see measurable kernel memory growth.
- Secure Boot requires the AlmaLinux shim and MOK (Machine Owner Key) enrollment for the kpatch module signing key. Unsigned modules will fail to load with
Required key not availableindmesg. - Minor version upgrades invalidate patches: running
dnf update kernelto a new minor release (e.g.,5.14.0-427→5.14.0-428) removes existing kpatch packages. New patches must be published for the new NEVRA before live patching resumes.
Verification Checklist
After enabling kpatch, confirm it's working:
kpatch listshowsloadedfor installed patches.rpm -qi kpatch-patch-<version> | grep Signaturereturns the AlmaLinux signing key fingerprint.- Reboot the test VM;
kpatch listshould still showloaded(systemd service persistence). - Cross-reference errata.almalinux.org announcements with RHEL RHSA dates to ensure patch availability meets your SLA.
Closing: When to Use It
kpatch shines for environments where reboot scheduling lags behind vulnerability disclosure by days or weeks—PCI-DSS scopes, 24/7 databases, or any fleet with coordinated maintenance windows. It doesn't replace kernel updates; it buys you time to apply them on your terms. Enable kpatch-dnf, monitor errata, and treat live patches as a bridge, not a destination.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.