Skip to content

hvpatch 0.4.1

Latest

Choose a tag to compare

@github-actions github-actions released this 27 Nov 23:16
· 6 commits to main since this release
4bc77a1

Fixes from an outside review (thanks to @WMP), and the CVE watcher.

UPGRADE NOTE: update the publishing pipeline (rings.sh re-issues
v1/revoked.json) before or together with the agents. Agents refuse new
loads (running patches stay) when the revocation list is older than
revocation_max_age_days (default 14), and nothing else renews the list. Run rings.sh once first if the last list
is old, or set revocation_max_age_days = 0 to switch the check off.

Security

  • A mirror that kept serving the last revocation list could hide a newer
    one, and the agent still loaded a revoked level. Agents now treat a list
    issued more than revocation_max_age_days (default 14, 0 disables) ago
    like a missing one. rings.sh re-issues the list every
    REVOCATIONS_REISSUE_DAYS (default 3) with the new
    hvpatch-tool reissue-revocations. The wire format is unchanged.

Added

  • Gate A checks that every patched function has an ftrace location in the
    original object (--diff-log, --originals). Out-of-line copies of
    inline functions are notrace and failed only in the QEMU stage
    before; docs/writing-fixes.md explains how to patch their callers.
  • The commit lists for cve-scan --contained are filtered to the lines
    it reads (builder/commit-refs.py): same result, about 7 % of the size
    and a fifth of the memory for a full kernel history.
  • CVE watcher (builder/cve-watch.sh, hourly CronJob): scans every served
    kernel against the catalog and opens a draft pull request per new CVE at
    P1 or above, with the mainline fix and a to-do list; the existing backlog
    only for P0.
  • Pull request test builds (PR_TESTS=1): when main has nothing to build,
    the pipeline builds the oldest open catalog pull request from a branch of
    the repository for each kernel, signs it with a throwaway key, runs the
    QEMU stage and reports a commit status and a comment
    (builder/pr-list.sh, builder/github-report.sh); nothing is published.
  • lint rejects the draft placeholder reviewed_by: ["pending-review"].
    --allow-pending-review (set by build.sh when
    HVPATCH_ALLOW_PENDING_REVIEW=1) turns it into a note for test builds of
    draft branches.

Changed

  • KEEP_TREES defaults to the number of served kernels (words in SERIES
    times NEWEST, at least 3; 4 by default) instead of 3, so served kernels
    do not evict each other's build trees. The build volume needs room for
    that many trees (about 55 GB each).

Fixed

  • Package upgrades started hvpatch-boot.service and so loaded kernel
    code; the maintainer scripts no longer start, stop or restart it (#42).
  • After a restore, the active level (below the highest accepted one) was
    treated as a rollback, or loaded a second time by hvpatch boot (#28).
  • prune_cache could delete the cache of the restored active level, so
    nothing was reloaded after a reboot (#30).
  • The kprobe/BPF conflict check missed functions with a compiler suffix
    such as .isra.0 (#32).
  • A cluster lock left by a crashed node never expired: waiters now send
    the pmxcfs unlock request, and the holder refreshes the lock from a
    background thread during hooks and settle time (#36).
  • Gate A looked for the original objects in klp-tmp/1-orig only (#38).
  • run.sh defaulted to a key directory inside the repository, which the
    build container mounts; KEYS is now required and must be outside (#40).
  • After a revocation the planner reused a published level number (#44).
  • cve-scan.sh wrote the full commit history and needed over 2 GB of
    memory (#46); pr-list.sh read only the first 50 pull requests (#50).

Install

wget https://github.com/prepaid-host/hvpatch/releases/download/v0.4.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

hvpatch.cdx.json lists every Rust dependency (CycloneDX SBOM).
hvpatch.intoto.jsonl is the signed build provenance, for offline
verification (gh attestation verify --bundle hvpatch.intoto.jsonl).