Skip to content

Add CBMC target platform support#1199

Closed
tob-joe wants to merge 1 commit into
mainfrom
ptp/cbmc-target-platforms
Closed

Add CBMC target platform support#1199
tob-joe wants to merge 1 commit into
mainfrom
ptp/cbmc-target-platforms

Conversation

@tob-joe

@tob-joe tob-joe commented Jun 26, 2026

Copy link
Copy Markdown

Summary

  • add explicit CBMC target platform selection for i386-linux, x86_64-linux, aarch64-linux, riscv64-linux, riscv32-linux, and ppc64le-linux
  • add a cbmc32 Nix shell with the matching target compilers
  • use the selected target compiler as the preprocessor/header provider for goto-cc and goto-instrument
  • add a target ABI canary proof for pointer, size_t, long, and uint64_t widths
  • tune the 32-bit ML-DSA proof blockers found during full-suite runs

Target execution model

The CBMC proofs do not execute target binaries. No QEMU or binfmt is involved in these proof runs. The target compiler is used to build the GOTO program with matching headers/preprocessor definitions, and CBMC checks that program on the host under the selected target model.

The repository also has an aarch64_be cross shell, but this PR does not expose it as a CBMC target because this CBMC toolchain exposes arm64 rather than a separate big-endian Arm64 model. The compiler and CBMC target model should agree before adding that lane.

Verification

  • git diff --check
  • python3 -B -m py_compile scripts/tests proofs/cbmc/run-cbmc-proofs.py
  • ./scripts/tests cbmc --help | rg -- '--cbmc-target|i386-linux|x86_64-linux|aarch64-linux|riscv64-linux|riscv32-linux|ppc64le-linux|native|ilp32'
  • canary proof dry-runs for i386-linux, x86_64-linux, aarch64-linux, riscv64-linux, riscv32-linux, and ppc64le-linux
  • nix eval --raw .#devShells.aarch64-linux.cbmc32.drvPath
  • earlier full ML-DSA CBMC evidence for the i386 Linux target: parameter sets 44, 65, and 87 each completed with 206 successes

This work was completed by Trail of Bits as part of the Patch The Planet project in collaboration with OpenAI. The issue was identified primarily by the Codex coding agent, and manually reviewed before submission.

Add explicit CBMC target platform selection for the proof infrastructure, including i386 Linux support with an i686 preprocessor and matching target-model flags.

Add target compiler shims for goto-instrument, a target ABI canary proof, and the solver/proof configuration tweaks needed by the 32-bit ML-DSA suite.

Verification: git diff --check; python3 -B -m py_compile scripts/tests proofs/cbmc/run-cbmc-proofs.py; ./scripts/tests cbmc --help target list; canary dry-runs for i386-linux, x86_64-linux, aarch64-linux, riscv64-linux, riscv32-linux, and ppc64le-linux; nix eval --raw .#devShells.aarch64-linux.cbmc32.drvPath.

Signed-off-by: Joe Doyle <joseph.doyle@trailofbits.com>

Co-authored-by: Codex <codex@openai.com>
@tob-joe tob-joe requested a review from a team as a code owner June 26, 2026 01:27
@tob-joe

tob-joe commented Jun 26, 2026

Copy link
Copy Markdown
Author

Superseded by #1200, which keeps the same patch content but uses contiguous machine-parseable commit trailers.

@tob-joe tob-joe closed this Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant