Repository navigation
Releases
hvpatch 0.2.1
From an independent review of the whole code base. It found no way to get
unverified code loaded, but three faults in failure handling that made each
other worse; they are fixed here.
Fixed
- Kernel log check could be triggered by tenants. Any line containing
"general protection fault" or "BUG:" backed a patch out, including a
crashing user process ("traps: …", info level) or a process named "BUG:".
Only records the kernel itself logged at warning level or worse count
now, and only if the message starts with a known marker; taint flags stay
the primary signal. - Failed levels were retried every hour, and a level that crashed the
host would have been loaded again after every reboot. Loads are recorded
before they start; a level that fails or whose load is interrupted is
quarantined by module hash. The timer and the boot reload skip it (the
boot reload falls back to the highest cached level below it); an
explicitapplyretries it. - Restoring the previous level left the node without a livepatch for
up to the transition timeout. The previous level is now loaded again
while the failed one is still active, which replaces it atomically. - A run interrupted after a completed transition is recognised and
recorded as active instead of reporting "in progress" forever. - Every error after a manifest was accepted (download, disk full, …) is
recorded asfailedwith its reason. - Hooks: run like run-parts (no
*.dpkg-old, no dotfiles), with a timeout
(hook_timeout, killed with their process group), only if owned by root
and not writable by others, withHVPATCH_MODE= apply, boot or restore. - The boot unit is no longer restarted by package upgrades, has the same
sandbox as the timer unit, and waits for a running timer instead of
failing (boot_lock_wait). - A livepatch being freed by the kernel (sysfs gone, reference not yet
dropped) is no longer mistaken for a forced one. - Read errors in sysfs other than "not found" are errors, not a finished
transition. Transition timeouts count wall-clock time. - A node clock behind the build time no longer blocks the boot reload
(warning instead). - One damaged file in
trusted.dis skipped with a warning instead of
stopping every command. A damagedstate.jsonnames the way out. - State writes fsync the directory; the module size limit is 32 MiB; the
cache keeps three levels per kernel and forgets old kernels;
setup --key https://refuses redirects to http; repositories answering
403 for missing files (S3) count as "not published"; a manifest whose
signature does not match is fetched once more before failing (publish
race). - Manifests must be bound to a kernel build-id;
hvpatch-tool manifest
requires--build-id.
Added
- Cluster-wide lock in pmxcfs: in a Proxmox VE cluster only one node loads
a livepatch at a time; without quorum nothing is loaded
(cluster_lock). - Timer policy:
delay_hours(delayed channel) andpin_level. /run/hvpatch/effective_versionandfixed_cvesfor vulnerability
scanners.- Warning (or refusal with
refuse_on_trace_conflict) when kprobes or BPF
programs are attached to a function the livepatch replaces. statuslists quarantined levels; metrichvpatch_quarantined.
Changed
- Catalog review: one approval is required while the project has a single
maintainer (was two). Documented in CONTRIBUTING.md and
catalog/README.md; it goes back to two with a second maintainer.
Install
wget https://github.com/prepaid-host/hvpatch/releases/download/v0.2.1/hvpatch_amd64.deb
apt install ./hvpatch_amd64.deb
hvpatch setup --repository <your repository> --key <manifest key>Verify
sha256sum -c SHA256SUMS --ignore-missing
gh attestation verify hvpatch_amd64.deb --repo prepaid-host/hvpatchhvpatch 0.2.0
Changed
-
Renamed from pve-klp to hvpatch. "pve" is the prefix of Proxmox's own
packages, and a third-party tool should not look like one. Everything
follows the new name:Before Now pve-klp,pve-klp-toolhvpatch,hvpatch-tool/etc/pve-klp/pve-klp.toml/etc/hvpatch/hvpatch.toml/var/lib/pve-klp/var/lib/hvpatchpve-klp-boot.service,pve-klp-auto.timerhvpatch-boot.service,hvpatch-auto.timerPVE_KLP_*(hooks,PVE_KLP_CONFIG)HVPATCH_*metrics pve_klp_*,pve_klp.promhvpatch_*,hvpatch.prommodules klp_pve_<kernel>_p<N>klp_hvp_<kernel>_p<N>builder image pve-klp-builderhvpatch-buildergithub.com/prepaid-host/pve-klp github.com/prepaid-host/hvpatch (old URLs redirect)
Upgrading from pve-klp
- The
hvpatchpackage conflicts with and replacespve-klp. Installing it
removespve-klpand copies, once, the configuration (paths rewritten),
trusted keys, hooks, module certificate, state (including the
anti-rollback history) and module cache. An enabled auto timer stays
enabled. CI runs this takeover on every change. - A livepatch loaded by pve-klp (
klp_pve_*) stays active and counts as
hvpatch's own:statusshows it, and the next level replaces it without
--replace-foreign. - Manifest keys generated by
pve-klp-tool keygenkeep working. - Update monitoring (metric names, textfile name) and Ansible (package,
command and unit names). - The builder's build identity changes to
hvpatch@hvpatch-builder, so the
first build per kernel rebuilds the cached original once.
Install
wget https://github.com/prepaid-host/hvpatch/releases/download/v0.2.0/hvpatch_amd64.deb
apt install ./hvpatch_amd64.deb
hvpatch setup --repository <your repository> --key <manifest key>Verify
sha256sum -c SHA256SUMS --ignore-missing
gh attestation verify hvpatch_amd64.deb --repo prepaid-host/hvpatchpve-klp 0.1.6
Build-side fixes from the sixth real-host round, which confirmed 0.1.5 and
ran resolve --tree with the first real catalog entries (PR #4) against the
Proxmox 7.3.4-1 and 7.3.5-1 trees. The agent is unchanged.
Fixed
resolve --treewith a relative--catalog(including the default
catalog) reported every patch as "does not apply": git resolved the
patch path against the tree. Catalog paths are now absolute.- The in-order check wrote into the tree's
.gitand failed on read-only
trees (:romounts, shared caches), reported as an ordering conflict.
Index and new objects now go to a temporary directory and the tree's
objects are only read; I/O problems are reported as such, not as
conflicts.
Docs
--allow-conflictsonly covers patches that do not fit the kernel.
Patches that conflict with each other are a catalog defect and always
fail (help text andcatalog/README.md).
Install
wget https://github.com/prepaid-host/pve-klp/releases/download/v0.1.6/pve-klp_amd64.deb
apt install ./pve-klp_amd64.deb
pve-klp setup --repository <your repository> --key <manifest key>Verify
sha256sum -c SHA256SUMS --ignore-missing
gh attestation verify pve-klp_amd64.deb --repo prepaid-host/pve-klppve-klp 0.1.5
The fifth real-host round confirmed 0.1.4: a non-interactive upgrade from
0.1.3 on a node that ran setup, the pending MOK state, and a full kernel
build with the 0.1.4 image whose module is bit-identical to the 0.1.2-era
build of the same catalog.
Fixed
- A failed module load quoted every kernel log line since the load, e.g.
an unrelated softdog message after a Secure Boot rejection. Only lines
about the module, livepatch, signatures and lockdown are kept.
Added
resolvealso checks that the catalog patches apply together, one after
another in catalog order (on a throwaway git index), not only each on its
own. Two fixes in the same function could otherwise first fail inside
klp-build.builder/run.shchecks free space before it starts (60 GB, 15 GB with a
cached tree;MIN_FREE_GBoverrides) instead of failing after an hour.
Docs
- Obsolete conffile on nodes installed with 0.1.3 or earlier, and the
leftoverpve-klp.toml.dpkg-distfrom nodes that hung at the prompt.
Install
wget https://github.com/prepaid-host/pve-klp/releases/download/v0.1.5/pve-klp_amd64.deb
apt install ./pve-klp_amd64.deb
pve-klp setup --repository <your repository> --key <manifest key>Verify
sha256sum -c SHA256SUMS --ignore-missing
gh attestation verify pve-klp_amd64.deb --repo prepaid-host/pve-klppve-klp 0.1.4
Fourth round from the real-host test, which also ran a guest VM under load
during 10 revert/apply cycles, a patched module object that is loaded only
after the boot reload, and anti-rollback across kernel releases and wrong
build-ids.
Upgrade note
Nodes that ran pve-klp setup on 0.1.3 or earlier may be stuck in a
half-configured state ("iU") after a non-interactive upgrade to 0.1.3. Run
once:
dpkg --force-confold --configure pve-klp
and then upgrade to 0.1.4. From 0.1.4 on, upgrades never prompt.
Fixed
- Upgrades prompted (and failed without a TTY) on every node that ran
setup, because/etc/pve-klp/pve-klp.tomlwas a dpkg conffile that
setupedits. The package now ships the template as
/usr/share/pve-klp/pve-klp.tomland creates the config only when it is
missing; existing configs are kept. CI installs 0.1.3, runssetupand
upgrades without a TTY on every change. - Running
setupagain without--ringreset the ring tostable. Options
that are not given now keep the configured value;setupprints each
value and whether it changed.--repositoryis only required the first
time.
Changed
checkandmok enrollrecognize a pending MOK enrollment ("confirm in
MokManager on the next boot") instead of saying "not enrolled".statusonly asks for a reboot when a transition could neither complete
nor be reversed. After a cleanly backed-out apply it suggests running
pve-klp applyagain; the exit code stays 20.sign-manifest.shruns the newpve-klp-tool check-manifest, which
compares the manifest with the module, the resolved catalog and
qemu.ok(kernel, module hash, build-id) and refuses to sign an edited
manifest.
Install
wget https://github.com/prepaid-host/pve-klp/releases/download/v0.1.4/pve-klp_amd64.deb
apt install ./pve-klp_amd64.deb
pve-klp setup --repository <your repository> --key <manifest key>Verify
sha256sum -c SHA256SUMS --ignore-missing
gh attestation verify pve-klp_amd64.deb --repo prepaid-host/pve-klppve-klp 0.1.3
Third round from the real-host test, which added a stalled transition
(apply and revert), Secure Boot with MOK enrollment under OVMF, legacy BIOS,
and three backported CVE fixes on 7.3.4-1-pve (in vmlinux and in the
overlay module) verified with a reproducer before, during and after the
livepatch.
Fixed
checknever detected Secure Boot: the EFI global variable GUID was
wrong (…-e098032b8c4cinstead of…-00e098032b8c). It now reports
Secure Boot and fails when the module certificate is not enrolled, so
setupno longer says "all checks passed" on such hosts.- An
applywhose stalled transition was reversed automatically was stored
asrevertedandstatusreturned 0. It is nowfailed(exit 20), like
other failed applies;revertedstays reserved for the operator's
revert. - Builder image:
rustfmtfrom trixie-backports (matching rustc 1.94.1),
so the kernel build no longer warns about it.
Added
statusnotes a livepatch module of ours that is still loaded but unused
(e.g. after a stalled revert that the kernel finished later) and how to
remove it.
Changed
make builder-imageadds the musl target with rustup; documented in
docs/self-hosting.md.- Docs:
mok enrollneeds a terminal; hooks timing in the config template;
7.3.4-1-pveindocs/toolchains.md.
Install
wget https://github.com/prepaid-host/pve-klp/releases/download/v0.1.3/pve-klp_amd64.deb
apt install ./pve-klp_amd64.deb
pve-klp setup --repository <your repository> --key <manifest key>Verify
sha256sum -c SHA256SUMS --ignore-missing
gh attestation verify pve-klp_amd64.deb --repo prepaid-host/pve-klppve-klp 0.1.2
Second round from the real-host test (PVE 9.2, 7.3.5-1-pve). That test
confirmed the 0.1.1 fixes, the QEMU stage (7 s with KVM, including the
replacement of the previous level), atomic replace of level 1 by level 2,
restore of level 1 after a failing hook, anti-rollback after revert,
hooks, and 10 revert/apply cycles under full CPU load without kernel
warnings.
Fixed
build.sh: a level-2 build reusing the cached original build failed with
"changed data: linux_banner", because the banner contains the random
container host name. Build user and host are now fixed
(pve-klp@pve-klp-builder), and the cache carries a stamp of config,
toolchain and build identity; a cache without a matching stamp is rebuilt
once.build.sh: fetches the shipped packages again when any artifact the later
stages need is missing, not only the config (workdirs from 0.1.0 lacked
vmlinuz).status: right after a reboot, before the boot unit has reloaded the
livepatch, the phase ispendinginstead of the storedactive.
Changed
- On hold after
revert, the timer returns immediately without contacting
the repository. An explicitapplystill evaluates it. - Docs: hooks run after
applyand the boot reload, not afterrevert;
systemd's LSB names for the exit codes; the module's ownOtaint.
Install
wget https://github.com/prepaid-host/pve-klp/releases/download/v0.1.2/pve-klp_amd64.deb
apt install ./pve-klp_amd64.deb
pve-klp setup --repository <your repository> --key <manifest key>Verify
sha256sum -c SHA256SUMS --ignore-missing
gh attestation verify pve-klp_amd64.deb --repo prepaid-host/pve-klppve-klp 0.1.1
Fixes from the first run on a real Proxmox VE 9.2 host with kernel
7.3.5-1-pve. There, build, Gate A, signing, setup, apply, revert and
the reload after a reboot worked after manual workarounds; this release
removes the need for them. The new QEMU stage has not run on real hardware
yet.
Fixed
- Agent: the first
applyafter boot failed with "kernel gained taint flags
O" on hosts without ZFS loaded. klp-build modules are out-of-tree, so the
module's ownO(withKandE) is now expected; other new flags still
fail. - Agent:
statusreturns 20 while the boot reload is in progress (it
returned 0). Text and--jsonoutput share one exit code, covered by
tests for every state. - Builder image: real base image digest,
httpsnapshot sources (no CA
certificates yet at that point), the Debian security snapshot,
trixie-backports on its own snapshot for the kernel's rustc/LLVM pair,
the Proxmox repository for the shipped kernel packages, andgawkfor
klp-build. build.sh: no more doubled release suffix (7.3.5-1-pve-1-pve+); a stale
localversion-pvefrom 0.1.0 is removed.build.sh: the patched functions are read from klp-build'sdiff.log
(they were always empty before, so Gate A skipped the check silently). An
empty list stops the build.lint: an emptypsa,mitigationorfixed_in_pvemeans "none".
Added
- Gate A and
manifestrequire the module's patched functions to equal the
reviewedfunctionsof the catalog entries, in both directions.
functionsis now required for livepatchable entries. builder/qemu-test.sh: boots the shipped kernel in QEMU, loads, replaces,
unloads and reloads the module, compares functions and build-id, and
writesqemu.ok.sign-manifest.shrefuses to sign without it.builder/run.shandmake builder-image: build and test a module with one
command; the builder image id is recorded in the manifest.docs/toolchains.md: compiler and snapshot values per kernel release.- Release workflow dry run (
workflow_dispatch).
Install
wget https://github.com/prepaid-host/pve-klp/releases/download/v0.1.1/pve-klp_amd64.deb
apt install ./pve-klp_amd64.deb
pve-klp setup --repository <your repository> --key <manifest key>Verify
sha256sum -c SHA256SUMS --ignore-missing
gh attestation verify pve-klp_amd64.deb --repo prepaid-host/pve-klppve-klp 0.1.0
First public preview. The agent and the build tooling are complete and
tested against an emulated kernel; loading a module on a real Proxmox 7.3
kernel is the next milestone, and no livepatch modules are published yet.
Use on test hosts only.
Added
- Node agent
pve-klpwithsetup,check,status,apply,boot,
revert,autoandmok.- Verifies manifest signature (minisign), kernel release, vmlinux
build-id, ring, expiry and module hash before loading. - Anti-rollback across
revert; hold afterrevertuntil the next
explicitapply. - Loads via
finit_module, watches the transition per thread, reverses a
stalled transition and never usesforce. - Post-checks for kernel log, taint, patched functions and hook scripts;
on failure the previous level is restored from cache. - Refuses to run next to foreign or force-transitioned livepatches.
status --json, Prometheus textfile metrics and stable exit codes.
- Verifies manifest signature (minisign), kernel release, vmlinux
- Build tool
pve-klp-tool: config and toolchain gate, catalog lint (with
git patch-idcomparison) and resolution, Gate A against the shipped
kernel, manifest creation, ring promotion, minisign-compatible signing. - Builder container and pipeline scripts for the proxmox-kernel 7.3 series.
- Debian package with systemd units, man page and bash completion.
- Release workflow with static binaries, SHA256SUMS and build provenance
attestations.
Install
wget https://github.com/prepaid-host/pve-klp/releases/download/v0.1.0/pve-klp_amd64.deb
apt install ./pve-klp_amd64.deb
pve-klp setup --repository <your repository> --key <manifest key>Verify
sha256sum -c SHA256SUMS --ignore-missing
gh attestation verify pve-klp_amd64.deb --repo prepaid-host/pve-klp