roadmap REFUSED

821. portable_executable: an ELF-to-PE converter, proven, then released on its own

Status REFUSED: calef ruled on 2026-10-21 (UTC), answering milestone 784 (reuse what the tree wrote)'s item (g) on #2490 with "B". portable_executable is to read the ELF and write the PE through object 0.40.0, keep its conversion policy, and stay unpublished. Its input is nife's own build product, so the proofs below would protect no known user. The text below is the proposal's.

(From calef's rulings on pull request #1806; the title and slug are drafts. Milestone 813 (a proven FAT crate released on its own) is the shape this follows.)

calef's rulings, quoted from the maintainer comments on #1806 of 2026-10-07 (UTC):

What exists, checked 2026-10-07 (UTC)

Reuse: the alternatives were surveyed in #1806's other-implementations.md appendix (looked up 2026-10-07), and none is taken, because calef ruled this crate "publish ours". No ELF-to-PE converter crate exists on crates.io. systemd's tools/elf2efi.py (LGPL-2.1+, Python) takes the same approach and is the prior art. gimli-rs's object 0.40.0 has a PE writer but no converter. Building on it would put a large dependency inside a crate whose point is that a model checker can reach all of it, which §46 (thin primitives or whole subsystems; we write everything in between) refuses. goblin parses both formats and converts neither.

What is proven

Nothing yet. The crate has no Kani harnesses today, so closing the audit's holes and writing all five proofs is this milestone's scope, not a step before it. Each row is a property this crate must prove before it publishes. The harness cell reads as in milestone 813's table. Each patch sits at crates/portable_executable/falsifications/<module.path>.<harness>.patch, as §134 (a harness carries a machine-replayable falsification record) and script/falsifications require. The first four rows are the audit's holes, closed.

property harness
No panic and no overflow on any input: each structure read (file header, program header, dynamic entry, Elf64_Rela) takes symbolic bytes and returns a value or an error, with every offset sum checked none yet
The image size is capped: no accepted ELF sizes the output beyond a stated limit, whatever memsz says none yet
The relocation walk terminates: a zero or odd DT_RELAENT is refused, and the walk visits at most DT_RELASZ / DT_RELAENT entries none yet
Every fixup lands inside the image: each .reloc entry names an 8-byte word inside a section, and the word holds the relocation's addend none yet
The layout is the ELF's: each section's RVA equals its segment's virtual address and its raw bytes are the segment's file bytes, zero-filled to memsz none yet

Kani bounds its inputs, so whole-file coverage comes from composing per-structure proofs, with script/fuzz over whole files as the backstop. Not proven: that firmware boots the result, which the riscv64 UEFI gate shows for this tree's own loader and nothing shows in general.

Release, by #1806's rulings

  1. The name is settled before anything leaves (857's Fork 5 as calef amended it on 2026-10-11 UTC). script/names portable_executable reports it ratified, crates.io answers 404 for it (or it is already ours), and nifeos/portable_executable does not exist yet. script/crate-standalone checks the first.
  2. Close the four holes in BUGS, write the five proofs above with their falsification patches, and rewrite BUGS to say what the crate now refuses.
  3. In the tree, script/verify proves the harnesses and Cargo.toml says publish = false.
  4. The package meets Fork 3 of milestone 857 (crates released on their own). cargo package --list shows its harnesses and falsification patches.
  5. Ready means proofs passing and the API stable. Milestone 814 (proven NVMe queue logic) says how each is measured; here the soak is step 6. When the soak exits, calef adds it to the lint-checked publish allowlist. The nifeos/portable_executable repository is created when the crate moves, on the shared CI template (milestone 887), through reusable workflows: Kani through kani-github-action, lint, release. Its release workflow refuses to publish unless the proof job is green. Nothing here reads target_arch; the ELF's machine is data, not the build target. So stock Kani serves. §218 (carry a Kani patch so riscv64 is proved) applies only if a harness comes to need riscv64. Milestone 589 (Kani can prove riscv64 from the hosts we already have) built it.
  6. Soak, as its own repository, until the soak's five end conditions in the runbook hold.
  7. Publish and consume the release by version, by the runbook's publication steps.

Parity

A host tool in nife, but no_std with alloc, so it builds anywhere. This lane built it on 2026-10-07 with the pinned nightly for aarch64-unknown-none-softfloat, riscv64imac-unknown-none-elf, x86_64-unknown-none and the host, all exit 0. The release workflow builds the same four. Its tests convert riscv64 PIEs; an aarch64 or x86_64 PIE is outside the first release, since rustc emits PE for those directly.

Standalone, measured 2026-10-11 (UTC)

script/crate-standalone portable_executable fails today, at base ae6b91e79. The manifest and files fail as for all nine crates in milestone 814 (proven NVMe queue logic). Builds and tests on stable for the host and the three bare-metal targets, and has no harness for Kani to run. Beyond manifest and files, 8 lines cite this tree: 3 tree paths, 2 milestone N, 1 §N, 1 naming calef and 1 provenance block.

Name: portable_executable is ratified today (script/names, checked 2026-10-11).

Review before release

Exit

A check proves it. script/verify proves the five properties, script/falsifications reports every harness replayable, and each of the four ELFs the audit described is refused with an error by a host test. In nife, cargo tree --locked -i portable_executable resolves to v0.1.x from crates.io with a checksum in Cargo.lock, crates/portable_executable no longer exists, and the riscv64 stick still boots in EDK2 under the existing UEFI gate. In nifeos/portable_executable, the run that published 0.1.0 shows the Kani job green ahead of the publish job. The five soak criteria of release step 6 hold before it publishes.

The name check of release step 1 passes first, by Fork 5 of milestone 857. Before the move, script/crate-standalone portable_executable exits 0 in nife, and every row of What is proven names a harness that stock Kani proves in the copy and whose falsification patch makes it fail. No crate publishes without the proofs milestone 857 (crates released on their own) requires.

BUGS

Revisit

Index row

nife's ELF-to-PE/COFF converter, the only one on crates.io, hardened against a hostile ELF and given its first Kani proofs, then published as portable_executable 0.1 from its own nifeos repository and consumed back by cargo xtask from that release.