Skip to content

Add CBMC target platform support#1200

Closed
tob-joe wants to merge 2 commits into
mainfrom
ptp/cbmc-target-platforms-v2
Closed

Add CBMC target platform support#1200
tob-joe wants to merge 2 commits into
mainfrom
ptp/cbmc-target-platforms-v2

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, 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 riscv32 and aarch64_be cross shells, but this PR does not expose them as CBMC targets. riscv32 is not supported by this CBMC target-model set, and this CBMC toolchain exposes arm64 rather than a separate big-endian Arm64 model for aarch64_be. The compiler and CBMC target model should agree before adding either 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|ppc64le-linux|riscv32-linux|native|ilp32'
  • canary proof dry-runs for i386-linux, x86_64-linux, aarch64-linux, riscv64-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:30
Remove riscv32-linux from the CBMC target platform list because this CBMC toolchain does not support that architecture model.

Keep the regular repository cross-riscv32 shell untouched; only the CBMC target interface and cbmc32 proof shell are narrowed.

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, 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 commented Jun 26, 2026

Copy link
Copy Markdown
Author

Superseded by #1201, which removes the unsupported riscv32 CBMC target and keeps a single commit with parseable 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