Skip to main content
RunBook Academy

LinuxLXV · Rolling Kernel UpgradesLive patching

Live kernel patching concepts - patching without rebooting

Intermediate⏱ ~10 minkpatchkgraft

What you'll learn

  • Explain live kernel patching
  • Use kpatch or kgraft
  • Recognise the trade-offs
  • Choose live patching vs traditional reboot

Prerequisites

Verified against Ubuntu 24.04 LTS · Debian 12 (Bookworm) · RHEL 9.x · Rocky Linux 9.x · AlmaLinux 9.x · Linux kernel 6.1 LTS / 6.6 LTS · systemd 255+ · OpenSSH 8.7p1 (RHEL 9) / 9.6p1 (Ubuntu 24.04) · nftables 1.0.x · chrony 4.x · Pacemaker 2.1.x · Corosync 3.1.x · 2026-08-09

Not yet marked complete on this device.

Live kernel patching applies security patches to a running kernel without rebooting. This lesson covers how it works, the tools, and the trade-offs.

How live patching works

A live kernel patch is a compiled module that replaces specific functions in the running kernel:

  • The patch module contains the new function code.
  • The kernel redirects calls from the old function to the new one.
  • The old function is kept for rollback.
  • No reboot required.

The kernel continues running with the patched function. The patch is reversible (uninstall the module).

Tools

  • kpatch (RHEL): Red Hat’s live kernel patching. Included in RHEL subscriptions.
  • Livepatch (Ubuntu): Canonical’s live patching for Ubuntu.
  • kgraft (SUSE): SUSE’s live patching.

Each tool has its own command set, but the concept is the same: apply a patch module to the running kernel.

Use kpatch (RHEL)

# Substitute your own values before running:
PATCH_NAME=kpatch-6_8_0-51

# Install kpatch
sudo dnf install kpatch

# List available patches
sudo kpatch list

# Apply a patch
sudo kpatch install "$PATCH_NAME"

# Verify
sudo kpatch list

# Rollback
sudo kpatch uninstall "$PATCH_NAME"

Live patching vs reboot

AspectLive patchingReboot
DowntimeNoneMinutes (reboot time)
RiskPatch may not apply cleanlyFull kernel change
CoverageLimited (security fixes)Full (any change)
Toolskpatch, Livepatch, kgraftStandard package manager

When to use live patching

  • Critical security: CVE with active exploit. Apply within hours without downtime.
  • Highly available workloads: services that cannot tolerate any downtime.
  • Rapid response: for the first hours of a critical patch.

When to use traditional reboot

  • Non-critical updates: batch the reboot with other maintenance.
  • Major changes: live patching does not support major kernel changes.
  • Hardware driver updates: live patching does not change drivers.
  • First 24 hours: the new kernel needs to “settle” with a real reboot to verify.

Knowledge check

Knowledge check · 3 questions

  1. Q1. What is live kernel patching?

  2. Q2. Live kernel patching can apply any kernel change.

  3. Q3. Which of the following are valid uses of live kernel patching? Select all that apply.

Passing score: 75%. Answers are checked in this browser.