Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/patches/6de9b4ad215bc726 # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers ## GitHub aien-dev/aienux#284 (code only) closed derived `6de9b4ad215bc726` #284 Imported from GitHub aien-dev/aienux#284 (code only) GitHub's metadata for this pull request is unavailable: its state is DERIVED from the commits (merged: the head is reachable from this project's main; open: GitHub kept a merge ref; else closed). Base `827e20f441f861b08aa4ae32b4f2144ad6fa499a` · Head `7956b988b878e8ee1ca9a96085b161e36b98376e` ### Apply it ``` git checkout -b patch-6de9b4ad215bc726 827e20f441f861b08aa4ae32b4f2144ad6fa499a curl -fsSL https://interplane.io/drakestapleton/aienux/patches/6de9b4ad215bc726.patch | git am ``` Raw patch (mbox) · Diff ### Provenance This proposal is imported from GitHub; it is not signed by its author. Its import statement and source record: ``` github-import 1 aien-dev/aienux 284 7956b988b878e8ee1ca9a96085b161e36b98376e ``` ``` {"kind":"github-import","owner":"aien-dev","repo":"aienux","number":284,"url":"https://github.com/aien-dev/aienux/pull/284","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:36:07Z","metadata":"unavailable","state_derived":true} ``` ### Changes ``` diff --git a/.crumb b/.crumb index d33237e8..64bacc4a 100644 --- a/.crumb +++ b/.crumb @@ -28,32 +28,32 @@ }, { "digest": "3337a47e3776a3c4a11e1b1d54403261f7fd4bccbdd70a4b61528b8a9e389a43", - "last_commit": "f4c8d8d", + "last_commit": "827e20f", "name": "docs", "purpose": "Directory docs. Purpose not yet described by a human." }, { - "digest": "d541968b3f618a0abccebffc9b2c5d8500cf7449cc274a1787583b0e13f729d4", - "last_commit": "9b759de", + "digest": "6ec8efdee4ce06964bc8260d9199d85baccf82526ea453cd0f945638c3aa8002", + "last_commit": "d4cbc58", "name": "native", "purpose": "Directory native. Purpose not yet described by a human." }, { - "digest": "6a8bd5f9f008c9388ba829899949836325b9dee35482324ae0ad5159334806e2", - "last_commit": "4b0e3db", + "digest": "7d70831f94533a1e6384ecc1b1ea8a2bf7bed6944aed041203cf0e0e844c0a5c", + "last_commit": "a4d6244", "name": "scripts", "purpose": "Directory scripts. Purpose not yet described by a human." } ], - "children_root": "sha256:e60582e62ccdfb58ae53484f5e6b39516c08b54758c9d97ac7f4daa675bc5cd1", - "compiled_at": "2026-10-08T13:03:27Z", + "children_root": "sha256:94195cffe609c59a4895231f1afa128a9416268b37515c180facdf28a17c55f8", + "compiled_at": "2026-10-08T13:56:48Z", "compiler": "crumb-compile/1", - "digest": "sha256:ce114d472fa32d50d7a74c26ee35cd573f8a7669362f54463ab86bb8b2b639c5", + "digest": "sha256:9d3b84e59ac7e27ebd14fd18fe252056b9f97bd437f1227f1227eaf7a927a987", "evidence_files": 153, "evidence_root": "sha256:29aa8775feb12d9e0e64b41fc1fc48b97e32dc16bf9176562cbe9fe1ea934f00", "files": 2970, - "generated_at_commit": "4b0e3dbcc3ea6eae9000be3953a5121763f34d8c", - "source_tree": "sha256:84a4ccee747e7071ba3915d60c1e7ea0895d7203b3ade97105363ed209f5fbbd" + "generated_at_commit": "d4cbc5836faa71ab3d6e35de2d060e8af3351c4c", + "source_tree": "sha256:f157220af64ea91cb18f4470ab1601977c4c3b3030af22c891287317c3ed0854" }, "owner_lane": "", "provenance": { diff --git a/native/.crumb b/native/.crumb index a88b0c33..25ace181 100644 --- a/native/.crumb +++ b/native/.crumb @@ -79,8 +79,8 @@ "purpose": "Directory native/disk. Purpose not yet described by a human." }, { - "digest": "68428fe30e4288db519473766287af05b2c4e84a4dfab6f501b1037e2ed1c105", - "last_commit": "9b759de", + "digest": "9655e0fbddf688697d1438e00eff77058c9f2cc7699a377a48b45706a6e5685b", + "last_commit": "d4cbc58", "name": "kernel", "purpose": "Directory native/kernel. Purpose not yet described by a human." }, @@ -109,15 +109,15 @@ "purpose": "Directory native/store. Purpose not yet described by a human." } ], - "children_root": "sha256:ef14904f89b154b2f19af5273d6d225a72641d22f9fd619c747ec2a6209706d2", - "compiled_at": "2026-10-08T12:24:36Z", + "children_root": "sha256:f78926f0bf48546e7a5932813850821fda1dee10d4ad34e73ffd0ed04455a58b", + "compiled_at": "2026-10-08T13:56:48Z", "compiler": "crumb-compile/1", - "digest": "sha256:d541968b3f618a0abccebffc9b2c5d8500cf7449cc274a1787583b0e13f729d4", + "digest": "sha256:6ec8efdee4ce06964bc8260d9199d85baccf82526ea453cd0f945638c3aa8002", "evidence_files": 4, "evidence_root": "sha256:e410b845507e00568e15b51a5797af32a97e0e4b8ab4e8487bb7c98e7e0cf335", "files": 400, - "generated_at_commit": "9b759de6e9c8ed316bfe012011bac39831deb10b", - "source_tree": "sha256:c3bbb2b61c77333b3914592a66be03ffa5bd5f852b3fd6a04eb1e430e53b0a30" + "generated_at_commit": "d4cbc5836faa71ab3d6e35de2d060e8af3351c4c", + "source_tree": "sha256:cf9a43be7086a17768edf379c2317c85e8a8bb6959a0ee2fa882a413491b386b" }, "owner_lane": "", "provenance": { diff --git a/native/kernel/.crumb b/native/kernel/.crumb index 20f0e632..5dbdaace 100644 --- a/native/kernel/.crumb +++ b/native/kernel/.crumb @@ -52,13 +52,13 @@ }, { "digest": "90a737e620d9c654ae347aae26b4635b55477d4ef45c68ac10e983019f6af11c", - "last_commit": "f4c8d8d", + "last_commit": "827e20f", "name": "artifact", "purpose": "Directory native/kernel/artifact. Purpose not yet described by a human." }, { "digest": "a4a7b49093c9c40aaa7238ec33f45790d68e3a52613720c6ba73609c1b3cefab", - "last_commit": "f4c8d8d", + "last_commit": "827e20f", "name": "core", "purpose": "Directory native/kernel/core. Purpose not yet described by a human." }, @@ -88,7 +88,7 @@ }, { "digest": "e2fcb936b8b24ceb35368fafc1065d042999862da4b9938bb0b708bbd327f018", - "last_commit": "9b759de", + "last_commit": "827e20f", "name": "tests", "purpose": "Directory native/kernel/tests. Purpose not yet described by a human." }, @@ -100,14 +100,14 @@ } ], "children_root": "sha256:9e22840d1313e585199be50e51e6c8c29ec5440502b8b03c57e216aee9730877", - "compiled_at": "2026-10-08T12:24:36Z", + "compiled_at": "2026-10-08T13:56:48Z", "compiler": "crumb-compile/1", - "digest": "sha256:68428fe30e4288db519473766287af05b2c4e84a4dfab6f501b1037e2ed1c105", + "digest": "sha256:9655e0fbddf688697d1438e00eff77058c9f2cc7699a377a48b45706a6e5685b", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 236, - "generated_at_commit": "9b759de6e9c8ed316bfe012011bac39831deb10b", - "source_tree": "sha256:a31ea27a8ece70c950d99365ee6b948b0f3b48d08280950862ac31af15eb7be8" + "generated_at_commit": "d4cbc5836faa71ab3d6e35de2d060e8af3351c4c", + "source_tree": "sha256:30e745e4826385f4cd22837a9b93fb81749dfa731b6e4d6c75185ec5aeaa5fb1" }, "owner_lane": "", "provenance": { diff --git a/native/kernel/GATES.md b/native/kernel/GATES.md index c5bd32ef..46ac97a0 100644 --- a/native/kernel/GATES.md +++ b/native/kernel/GATES.md @@ -686,13 +686,15 @@ section 8.4 code scan with the decoder round trip), `native/kernel/core/osc_admi Candidates reach it through the same boot-disk Store path as the P2 artifacts; a candidate that begins with the magic `OSCUNIT\0` is judged by this module instead of the Binary Artifact v0 path. -- Host conformance: `tests/test_osc_unit.c` runs every line of the frozen `expected.txt` (52), `lookups.txt` (6) +- Host conformance: `tests/test_osc_unit.c` runs every line of the frozen `expected.txt` (57), `lookups.txt` (6) and `state.txt` (3) from `tests/fixtures/osc_unit` (provenance there) and requires the stated verdict; also every single-byte flip and every truncation of the valid vector is refused. Part of `make test` and `make sanitize`. -- QEMU gate: two boots (TEST-anchor qualification build; ordinary release build) of four vectors staged in the +- QEMU gate: two boots (TEST-anchor qualification build; ordinary release build) of five vectors staged in the sealed Store. Qualification: valid TEST unit ACCEPT with the frozen UnitDigest; OWNER unit UNTRUSTED_SIGNER; - bad signature; SVC word. Release: TEST unit TEST_SIGNER_IN_RELEASE (also for the bad-signature vector: class is + bad signature; SVC word; a02 (one domain-1 request pinning generation 7, staged as `a02_valid_caps_kernel.unit` + because Store names are at most 32 bytes) CAP_GENERATION_STALE, which runs the kernel's own generation lookup. + Release: TEST units TEST_SIGNER_IN_RELEASE (also for the bad-signature and a02 vectors: class is checked first); OWNER unit UNTRUSTED_SIGNER; SVC word CODE_INSTRUCTION; nothing accepted. The release image is checked not to carry the TEST public key. - Labels: QEMU (aarch64 virt), TEST signer, not physical. Admission only: nothing is mapped, launched or diff --git a/scripts/.crumb b/scripts/.crumb index 5de53809..46f23fca 100644 --- a/scripts/.crumb +++ b/scripts/.crumb @@ -7,14 +7,14 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-08T13:03:27Z", + "compiled_at": "2026-10-08T13:56:48Z", "compiler": "crumb-compile/1", - "digest": "sha256:6a8bd5f9f008c9388ba829899949836325b9dee35482324ae0ad5159334806e2", + "digest": "sha256:7d70831f94533a1e6384ecc1b1ea8a2bf7bed6944aed041203cf0e0e844c0a5c", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 74, - "generated_at_commit": "4b0e3dbcc3ea6eae9000be3953a5121763f34d8c", - "source_tree": "sha256:69d946b32f1edb43353d8ef660bb29c0f72262ddb5438b684482753fe0de03da" + "generated_at_commit": "d4cbc5836faa71ab3d6e35de2d060e8af3351c4c", + "source_tree": "sha256:6b8a1f9d73f905b89e91c3108f7d9221ccbb665d431acda291104cca60b04c10" }, "owner_lane": "", "provenance": { diff --git a/scripts/qemu_ck_osc_unit_test.sh b/scripts/qemu_ck_osc_unit_test.sh index 6048b478..368d54c3 100755 --- a/scripts/qemu_ck_osc_unit_test.sh +++ b/scripts/qemu_ck_osc_unit_test.sh @@ -7,18 +7,26 @@ # OWNER anchor exists (TRUST-1 has not provisioned one). Admission only: no # unit is mapped, launched or scheduled. # -# Four conformance vectors (tests/fixtures/osc_unit/vectors) are written into +# Five conformance vectors (tests/fixtures/osc_unit/vectors) are written into # the sealed C Store of a GPT boot disk image at build time and read back by the # kernel's store stage, the same path as the P2 artifacts (svc/artifact_store.h): # a01_valid_min.unit TEST-signed, valid +# a02_valid_caps_kernel.unit vector a02_valid_caps_kernel_domain.unit, staged +# under a shorter Store name (names are at most 32 +# bytes, CK_ART_NAME_MAX; same bytes, checked). +# TEST-signed, valid, one domain-1 request +# pinning generation 7 (object 1) # a04_valid_owner_class.unit OWNER class, valid signature, no OWNER anchor # r14_bad_signature.unit TEST-signed, signature byte flipped # r37_code_svc.unit code contains an SVC word # Two boots of the full image, each with QEMU iommu=smmuv3 and the NVMe image: # 1. qualification build (CK_SEED0B_TEST_ANCHOR=1, TEST ONLY): a01 ACCEPT with # the UnitDigest and program id of the frozen expected.txt; a04 -# UNTRUSTED_SIGNER; r14 BAD_SIGNATURE; r37 CODE_INSTRUCTION. -# 2. ordinary (release) build, no anchors: a01 TEST_SIGNER_IN_RELEASE; a04 +# UNTRUSTED_SIGNER; r14 BAD_SIGNATURE; r37 CODE_INSTRUCTION; a02 +# CAP_GENERATION_STALE (29): the kernel's own generation lookup knows no +# resource, so every nonzero pin is refused (ADR 0014 amendment point 5; +# the host test checks the same rule only with a test lookup). +# 2. ordinary (release) build, no anchors: a01 and a02 TEST_SIGNER_IN_RELEASE; a04 # UNTRUSTED_SIGNER; r14 TEST_SIGNER_IN_RELEASE (the class check precedes the # signature); r37 CODE_INSTRUCTION; nothing accepted. # Static: the release image carries the TEST public key nowhere. @@ -64,9 +72,18 @@ make -s -C native/kernel OUT="${out_prod}" store-image gpt-image >/dev/null simg="${out_prod}/host/ck_store_image" fix="native/kernel/tests/fixtures/osc_unit" -units=(a01_valid_min.unit a04_valid_owner_class.unit r14_bad_signature.unit r37_code_svc.unit) +units=(a01_valid_min.unit a02_valid_caps_kernel.unit a04_valid_owner_class.unit r14_bad_signature.unit r37_code_svc.unit) +# Store names are at most 32 bytes (CK_ART_NAME_MAX); the a02 vector file name is 33, so a02 is +# staged under a shorter name. The bytes are the vector's, checked here. +stage="${work}/stage" +mkdir -p "${stage}" +cp "${fix}/vectors/a02_valid_caps_kernel_domain.unit" "${stage}/a02_valid_caps_kernel.unit" +cmp -s "${fix}/vectors/a02_valid_caps_kernel_domain.unit" "${stage}/a02_valid_caps_kernel.unit" \ + && pass "a02 staged as a02_valid_caps_kernel.unit, bytes identical to the vector" || fail "a02 staged copy differs from the vector" files=() -for u in "${units[@]}"; do files+=("${fix}/vectors/${u}"); done +for u in "${units[@]}"; do + if [[ -f "${stage}/${u}" ]]; then files+=("${stage}/${u}"); else files+=("${fix}/vectors/${u}"); fi +done a01_line=$(grep -E '^a01_valid_min\.unit ' "${fix}/vectors/expected.txt") a01_digest=$(sed -E 's/.* unit_digest=([0-9a-f]{64}) .*/\1/' <<<"${a01_line}") a01_prog=$(sed -E 's/.* program_id=([0-9a-f]{64})$/\1/' <<<"${a01_line}") @@ -150,10 +167,12 @@ check "${qual}" "policy line: qualification mode, one TEST anchor, no OWNER anch unit_line "${qual}" a01_valid_min.unit \ "ACCEPT unit_digest=${a01_digest} program_id=${a01_prog} funcs=2 caps=0 signer=TEST" \ "ACCEPT, UnitDigest and program id equal the frozen expected.txt" +unit_line "${qual}" a02_valid_caps_kernel.unit "REFUSED code=29 name=CAP_GENERATION_STALE" \ + "REFUSED CAP_GENERATION_STALE (pinned generation 7; the kernel lookup knows no resource)" unit_line "${qual}" a04_valid_owner_class.unit "REFUSED code=25 name=UNTRUSTED_SIGNER" "REFUSED UNTRUSTED_SIGNER (OWNER, no OWNER anchor)" unit_line "${qual}" r14_bad_signature.unit "REFUSED code=26 name=BAD_SIGNATURE" "REFUSED BAD_SIGNATURE" unit_line "${qual}" r37_code_svc.unit "REFUSED code=34 name=CODE_INSTRUCTION" "REFUSED CODE_INSTRUCTION (SVC word)" -check "${qual}" "qualification totals: 1 accepted, 3 refused" "^osc_units: seen=4 accepted=1 refused=3 " +check "${qual}" "qualification totals: 1 accepted, 4 refused" "^osc_units: seen=5 accepted=1 refused=4 " # ---- boot 2: ordinary (release) build, no anchors ---------------------------- prod="${work}/release.txt" @@ -165,10 +184,11 @@ check "${prod}" "policy line: release mode, no anchors at all" \ "^osc_policy: mode=release test_anchors=0 owner_anchors=0 \(none provisioned\) domains=1 gen_width=32; QEMU, not physical$" if has "${prod}" "seed0b-test qualification build"; then fail "release build carries the qualification label"; fi unit_line "${prod}" a01_valid_min.unit "REFUSED code=24 name=TEST_SIGNER_IN_RELEASE" "REFUSED TEST_SIGNER_IN_RELEASE (a valid TEST-signed unit)" +unit_line "${prod}" a02_valid_caps_kernel.unit "REFUSED code=24 name=TEST_SIGNER_IN_RELEASE" "REFUSED TEST_SIGNER_IN_RELEASE (class is checked before capability policy)" unit_line "${prod}" a04_valid_owner_class.unit "REFUSED code=25 name=UNTRUSTED_SIGNER" "REFUSED UNTRUSTED_SIGNER (OWNER, no anchor)" unit_line "${prod}" r14_bad_signature.unit "REFUSED code=24 name=TEST_SIGNER_IN_RELEASE" "REFUSED TEST_SIGNER_IN_RELEASE (class is checked before the signature)" unit_line "${prod}" r37_code_svc.unit "REFUSED code=34 name=CODE_INSTRUCTION" "REFUSED CODE_INSTRUCTION" -check "${prod}" "release totals: nothing accepted" "^osc_units: seen=4 accepted=0 refused=4 " +check "${prod}" "release totals: nothing accepted" "^osc_units: seen=5 accepted=0 refused=5 " if [[ -n "${AIENOS_LOG_DIR:-}" ]]; then cp "${qual}" "${AIENOS_LOG_DIR}/qemu_ck_osc_unit_qualification_serial.log" ```