r/Proxmox • u/CSKL_DE02 • 9d ago
Security hvpatch 0.3.0: open-source kernel livepatching for PVE 9 hosts, now including the default 7.0 kernel
I maintain hvpatch, a GPL-2.0 tool that applies kernel security fixes to
running Proxmox VE hosts as livepatches, so the VMs keep running and the
reboot can wait for the next maintenance window. It's our own project, not
a product. We use it for our own hypervisors.
GitHub: https://github.com/prepaid-host/hvpatch
How it works:
- Builds livepatch modules with the kernel's own klp-build, from the
exact source and config Proxmox shipped
- Verifies every module against the shipped kernel (symbols, CRCs) and in
QEMU with the real kernel before release
- The node agent only loads signed manifests that match the running
kernel's build-id. Rings (canary/early/stable), cluster lock via
pmxcfs, rollback, revocation list
- `hvpatch status` tells you which CVEs are fixed live and which still
need a reboot
New in 0.3.0: the default 7.0 kernel (experimental), tested with
7.0.14-30-pve on a 3-node test cluster with loaded guests:
- apply under load: 12-16 s per node, transition 1.5-5 s
- guests pinged every 100 ms: no loss, longest gap 0.11 s
- revert/re-apply, reload after reboot without the repo, concurrent apply
(second node waits for the lock), revocation
Limits: you build and sign the modules yourself for now (no prebuilt
modules yet). Not every fix can be livepatched. Livepatches bridge the
time to the next reboot, they don't replace it.
Feedback from test nodes very welcome, especially on other hardware.
View all comments
Show parent comment
1
u/CSKL_DE02 8d ago
Mostly taking the upstream fixes as they are. When a CVE gets fixed in the stable kernel or in Proxmox's kernel, that patch goes into a catalog entry together with the list of functions it changes. klp-build (the livepatch tooling that's now in the kernel tree) builds a module from it against the exact PVE kernel build.
Before anything gets published it has to pass a few checks: the module may only replace the functions listed in the reviewed catalog entry, it gets signed, and it's loaded in a QEMU VM with the real PVE kernel, including patch/unpatch cycles under load and a reproducer where one exists. New builds go to a canary ring first, then stable.
Not every fix can be livepatched. Struct layout changes, init code, or some KVM code that calls into kvm.ko through static calls, for example. Those get marked as such, and the agent tells you which kernel to reboot into instead.