Repository navigation
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/hvpatch