Repository navigation
Conversation
kajaaz
changed the base branch from
main
to
feat/zero-lists-domain-overrides
November 12, 2026 16:44
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The plan
This PR is 3 of 8. Together they let Ledger fuzz its device apps on an Absolution state model, with libFuzzer and with KLEE, through one harness.
--no-post-check, harness-only sources--symbolic klee: a KLEE driver on the fuzzer's input layout, so a KLEE test replays on the fuzzerA1 to A3 are stacked and released together as v1.2.0. The SDK and app PRs are in internal Ledger repositories.
This PR is the third and last Absolution step, stacked on A2 (#28): its base is the A2 branch, so the diff shows only this step. Once it is merged, the v1.2.0 tag is the release the SDK pins (step 4), and the SDK's KLEE lane (step 5) builds this driver for each app.
What
--symbolic kleeemits a symbolic-execution driver instead of a libFuzzer harness, andabsolution_add_symbolic_target()builds it into one LLVM bitcode module for KLEE.The buffer has the fuzzer's input layout, so a KLEE test case replays on the libFuzzer build unchanged. Built without
-DABSOLUTION_KLEE, the driver reads the buffer from stdin.Changes
src/cgen/emit.zig,src/cgen/ir.zig: the symbolic driver;src/main.zig:-S/--symbolic klee,-a/--apdu-size,-P/--no-symbolic-pointers.src/type_flatten.zig: pointer leaves are flagged (.is_pointer), so-Pcan leave them NULL; the test goldens gain that field.AbsolutionSymbolic.cmake(ENGINEacceptsklee),BuildSymbolicBitcode.cmake(bitcode, IR-level renames,llvm-link),RunAbsolutionSymbolic.cmake,SummarizeKleeFindings.cmakeandcmake/symbolic/(KLEE job runner, allocator and memcpy models, UBSan stubs).example/protocol_parser: a KLEE target that finds the planted overflow.USAGE.md: "Symbolic execution (KLEE)".The
Engineenum has one value, so other engines can be added later.Tests
zig build test,zig build -Doptimize=ReleaseFastandzig run scripts/integration.zigpass.example/protocol_parser:sym_decodebuilds with clang 13 andsym_decode_kleereports the planted out-of-boundsmemcpy.