Release 2a: agent 0.174.0 vouched — old kernels removed by the box (11 §5.11.1 built), security profiles refreshed after a kernel change (11 §5.12, spike + build); R-1388, R-1301, R-1391 closed; R-1394, R-1395 filed; D82
gates / gates (push) Successful in 2m1s
gates / gates (push) Successful in 2m1s
This commit is contained in:
1 parent
a2173830c1
commit
8955b4e55f
51 files changed
+1385
-19
No files matched your search
@@ -609,7 +609,7 @@ another kernel), and the kernel step (the newest result, the kernel due, whether
|
||||
7.0.14-20), so a soft lockup turning into a panic is recorded as unmeasured (no tool was built). A true dead freeze
|
||||
needs a person (accepted, decision 172). Evidence and proofs: `audits/kernel-lane-2026-10-07/`.
|
||||
|
||||
### 5.11.1 Removing old kernels `[DESIGN — proven by hand on demo-hp 2026-11-10; not built]`
|
||||
### 5.11.1 Removing old kernels — BUILT 2026-11-14 (agent v0.174.0; R-1368, `09` §3 decision 286) `[FACT — built]`
|
||||
|
||||
**The ruling** (`09` §3 decision 286): the box may remove old kernels by itself, as its own step with its own narrow
|
||||
rule. **Rule R4 does not change**: an update plan that removes a package is still refused. Why a step is needed: the
|
||||
@@ -642,14 +642,107 @@ self-revert into `from`, must be over first. In the night's order it belongs whe
|
||||
whole-guest backup. It needs no reboot and stops no guest. A box that fell back or reverted keeps all its kernels
|
||||
until a later step ends `good`.
|
||||
|
||||
**Proven** on demo-hp by hand: 8 kernels → 2, 6.4 GB gained on the system disk, the default, the pinned file and both
|
||||
**As built** (`felhom-agent` `configs/felhom-os-apply`, layer `kernel`, mode `kernel-cleanup`; the agent's
|
||||
`internal/osupdate/kernel.go`):
|
||||
|
||||
- **The plan names nothing.** The wrapper computes the set from the box; a plan that carries packages, a select, a
|
||||
signed job or an expected kernel is refused (C1). `dry_run: true` is the same code path: it reports the keep set, the
|
||||
removal set and what it would do, and changes nothing (`felhom-agent --selftest=kernel-cleanup-dry-run`).
|
||||
- **Who may:** an appliance (R12, the root-owned install record) with the **root-owned ring-0 mark**
|
||||
(`/etc/felhom/os-trust.json`), read by the wrapper itself — never the agent's config, never the hub's ring. A box
|
||||
without the mark answers „not run". Ring 1 needs an operator ruling first.
|
||||
- **„Not run"** (exit 0, nothing changed, a log line): no ring-0 mark; no kernel step yet (no state file); the newest
|
||||
step ended in another phase than `good` (`fell_back`, `self_reverted`, `revert_failed`, `cancelled`); the box does
|
||||
not run its newest installed kernel; a step was staged, booted or ended within the last 20 hours.
|
||||
- **Refused** (exit 2, nothing changed): the table above, each with its own code; the wrapper repairs dpkg first
|
||||
(§5.4.1), so a purge that a power cut interrupted is made whole and the rule is computed again from the box.
|
||||
- **K1 reads the box a second time.** The removal set is built from the keep set; K1 then reads the running kernel, the
|
||||
step's `from`/`to`/`default_before`, both defaults, the flag and the boot pin again and refuses a name that any of
|
||||
them still needs — also before apt's simulation.
|
||||
- **After the purge** the wrapper proves that the default in `grub.cfg`, the pinned file, both generators and the
|
||||
step's state file did not change, and that every kept kernel is still installed. Anything else is `failed`, said
|
||||
loudly; nothing is repaired in code. A left-over `/lib/modules/<version>` or `/boot` file is reported, never deleted.
|
||||
- **When (the agent):** the night leg's own step, after a healthy host step (and Proxmox step, when one ran), the last
|
||||
call of the night, never in a night with a kernel step (due, staged or reported), never in a debug pass, never on a
|
||||
BYO host. Not retried the same night.
|
||||
- **The sudo rule did not change:** the wrapper is reached by the one `--plan` line.
|
||||
- **What the hub shows (hub v0.181.0, no hub change in this release):** a clean-up that removed kernels arrives as a
|
||||
kernel-layer report with outcome `cleaned`; the System page's „Kernel step" cell then reads „cleaned <time ago>", and
|
||||
the report's text (what was removed, kept and gained) is stored but shown nowhere. A refusal or a failure raises the
|
||||
existing operator event „Kernel step on <box> refused/failed: …". „Nothing to remove" and „not run" are log lines
|
||||
on the box only. The report carries no kernel version on purpose: the hub reads that as a kernel step. What is missing
|
||||
is in R-1383 (release 3).
|
||||
|
||||
**Proven on boxes with the program** (2026-11-14, `audits/release-2a-2026-11-14/D/`): Tester 1 — 3 kernels → 2
|
||||
(`proxmox-kernel-7.0.14-20-pve-signed`), 1.12 GB gained, 8.5 s, nothing else changed, no left-over, the second call
|
||||
removed nothing, one orderly restart back onto the same kernel with a clean stop for the crash guard. **That run was
|
||||
started by hand** with the agent's own command line, and with the ring-0 mark set for the test on the operator's yes
|
||||
(Tester 1 is ring 1; a night cannot be started by day, R-1394). demo-hp — „nothing to remove"; P1, P2 and P3 refused by
|
||||
dry run against states set and put back. Tester 1 without the mark — „not run". The N100 — the dry run names 6 of 8.
|
||||
**Not proven:** the step by the agent at night (the night of 2026-11-15 on the N100 and demo-hp); K1 on a box (it
|
||||
guards a wrong computation — tests only); a box whose running kernel is not its newest, and a self-revert into the
|
||||
kept kernel chosen by the product (tests only); a box that boots with `proxmox-boot-tool`.
|
||||
|
||||
**Proven by hand** on demo-hp (2026-11-10): 8 kernels → 2, 6.4 GB gained on the system disk, the default, the pinned file and both
|
||||
generators unchanged, five refusals by simulation, one orderly reboot back onto the same kernel with a clean stop for
|
||||
the crash guard (§5.9), a second run that removed nothing. The kept old kernel then booted the box to healthy through
|
||||
the one-shot flag (313 s), and the box went back to its newest kernel (324 s); the pinned file, `grub.cfg` and the
|
||||
step's state file did not change. **Not proven:** a box whose running kernel is not its newest; a self-revert into
|
||||
the kept kernel chosen by the product; the step as a program at night; a box that boots with `proxmox-boot-tool`. Evidence, the rule as a read-only script, and the full "not measured" list:
|
||||
step's state file did not change. Evidence, the rule as a read-only script, and the full "not measured" list:
|
||||
`audits/kernel-cleanup-spike-2026-11-10/`.
|
||||
|
||||
### 5.12 Security profiles after a kernel change — BUILT 2026-11-14 (agent v0.174.0; R-1388, R-1301) `[FACT — built]` `[FACT — measured on demo-hp]`
|
||||
|
||||
**The fault** (`audits/n100-clock-2026-11-11/`). AppArmor keeps one cache folder for each kernel feature set. When a
|
||||
package changes a profile while one kernel runs, only that kernel's folder gets the new compiled copy. A box that then
|
||||
starts on another kernel loads the OLD copy from that kernel's folder — the copy's time looks newer than its source.
|
||||
The order „start a new kernel once → go back → a profile is updated → start the new kernel again" is made by a kernel
|
||||
test, and by the kernel lane's own fall-back or self-revert (§5.11). On the N100 it stopped the time service.
|
||||
|
||||
**The mode** (`felhom-os-apply`, layer `host`, mode `profile-refresh`; an appliance only; it changes no package and
|
||||
takes nothing from the plan but `dry_run`, F1):
|
||||
|
||||
1. It runs **once per kernel the box starts on**: the wrapper keeps the kernel of the last refresh in a root-owned
|
||||
record (`/var/lib/felhom-os-apply/profile-refresh.json`) and answers „not needed" for the same kernel. A box with no
|
||||
record counts as changed.
|
||||
2. `apparmor_parser --replace --skip-read-cache --write-cache -- /etc/apparmor.d` — every profile from a fresh
|
||||
compile, the cache ignored and rewritten.
|
||||
3. **The narrow restart rule:** a service in state `failed`, whose `ExecStart` program is the path-name of a profile
|
||||
whose cached copy the rewrite CHANGED, gets one `systemctl restart`. At most 3 a run. Never „whatever failed", never
|
||||
a unit a plan names. A running program needs nothing: the kernel swaps its profile in place.
|
||||
4. A parser failure writes no record; the next start tries again.
|
||||
|
||||
**The agent** asks at every start and after a config bundle was installed (a new wrapper may know the mode the old one
|
||||
refused), under the heavy-op gate (up to 12 tries, 5 minutes apart) and never beside an OS-update pass. Nothing goes to
|
||||
the hub (no field exists for it; R-1383).
|
||||
|
||||
**Measured on demo-hp, both guests running** (`audits/profile-refresh-spike-2026-11-14/`): the fault was reproduced
|
||||
with one planted stale profile (chrony failed with the N100's own error); the refresh took 0.51 s; the same 119
|
||||
profiles stayed loaded in the same modes; no container restarted; no new kernel refusal in 10 minutes (with a positive
|
||||
control — see below); the restart rule brought chrony back.
|
||||
|
||||
**Three facts the spike found, each built into the mode:**
|
||||
|
||||
- A stale copy is told by the **cached file changing at the rewrite**. The kernel's loaded hash is NOT a signal: for a
|
||||
file with several profiles it differs between a cache load and a fresh load of the same policy (17 of 119 profiles).
|
||||
- `lxc-containers` compiles to a different binary every time, so it is „rewritten" at every refresh. It names no
|
||||
program path, so the restart rule never matches it.
|
||||
- A refresh writes about 119 audit lines, and the kernel then **suppresses other audit lines for a few seconds**
|
||||
(a real refusal in those seconds is not in the kernel log). This is the cost that makes „once per kernel" the right
|
||||
trigger and „at every agent start" the wrong one.
|
||||
|
||||
**Proven on boxes by the product's own path** (2026-11-14, `audits/release-2a-2026-11-14/D/`): on Tester 1, demo-hp
|
||||
and the N100 the old wrapper refused the mode at the agent's start (logged), and the refresh ran right after the
|
||||
bundle install — 0.5 s each. Tester 1 and demo-hp: only `lxc-containers` rewritten, nothing restarted. **The N100:**
|
||||
the stale chrony profile was rewritten, `chrony.service` (failed since 2026-10-16) was restarted, the clock stepped
|
||||
+32.717 s; offset to DooPlex −32.55 s → +0.18 s, the same 2.5 hours later. After a restart of Tester 1 the agent
|
||||
answered „not needed" for the same kernel.
|
||||
|
||||
**Seen on the N100, a consequence of the clock step, not of the refresh:** the controller read a new boot and
|
||||
recreated its three drive-backed apps once (R-1395).
|
||||
|
||||
**Not proven:** a restart by this rule of any program but chrony; the refresh after a real fall-back or self-revert of
|
||||
the kernel lane (the trigger is the same: another kernel than at the last refresh); the spike's „Not measured" list.
|
||||
|
||||
## 6. Risks and edge cases
|
||||
|
||||
| # | What can go wrong | What the design does |
|
||||
|
||||
Reference in new issue
Block a user