Phase 8: zuse cert storage moved out of the dictionary (fuse-blow install)
Found that a pinned CONSTANT is not actually tamper-proof: ACL-PIN only blocks redefinition, not a >BODY-then-store on the word's existing data field. Moves the Zuse cert value into C-only VM struct fields (zuse_cert_lo/hi + zuse_cert_installed fuse bit) with a one-time vm_zuse_cert_install() and read-only ZUSE-CERT-LO@/HI@/INSTALLED? FORTH accessors, closing the tamper path structurally instead of by convention. Deletes the now-insecure ZUSE-CERT-LO/HI CONSTANT words from zuse.4th. vm_zuse_cert_install() has no caller yet -- the real mint flow (Milestone 6 CA, the MINT word) is still open; this is storage + accessors only, not a stand-in mint. Documented in FABRIC-3.md. Verified: hosted build clean, mkcapsule --lint clean (31/31), clean boot to ok> on amd64/aarch64/riscv64 with Stadium conservation intact and no panics. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U14ET9CWAtbQMbYqomKgXd
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
4dd1321ea4
commit
6f5605d479
@@ -117,6 +117,31 @@ void vm_set_base(VM* vm, unsigned b)
|
||||
/* vm_init and vm_cleanup moved to vm_bootstrap.c */
|
||||
/* vm_tick* and heartbeat functions moved to vm_time.c */
|
||||
|
||||
/**
|
||||
* @brief One-time write of the Zuse cert value (blows the fuse).
|
||||
*
|
||||
* Deliberately not backed by a dictionary CONSTANT: ACL-PIN only blocks
|
||||
* redefinition (vm_create_word shadowing), not a >BODY-then-store on the
|
||||
* word's data field, so a pinned CONSTANT is not actually immutable against
|
||||
* FORTH-level tampering. Keeping the value in a VM struct field with no
|
||||
* corresponding FORTH store word closes that path entirely -- see
|
||||
* FABRIC-3.md's Milestone 4 mint-then-pin writeup for the finding.
|
||||
*
|
||||
* @param vm VM instance.
|
||||
* @param lo Cert value, low half.
|
||||
* @param hi Cert value, high half.
|
||||
* @return 0 on success; -1 if already installed (fuse already blown).
|
||||
*/
|
||||
int vm_zuse_cert_install(VM* vm, uint64_t lo, uint64_t hi)
|
||||
{
|
||||
if (!vm) return -1;
|
||||
if (vm->zuse_cert_installed) return -1;
|
||||
vm->zuse_cert_lo = lo;
|
||||
vm->zuse_cert_hi = hi;
|
||||
vm->zuse_cert_installed = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ====================== Parser / number ======================= */
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user