Skip to content

Implement exploration specification support in symbolic execution#36

Open
0verflowme wants to merge 10 commits into
masterfrom
symex-rewrite
Open

Implement exploration specification support in symbolic execution#36
0verflowme wants to merge 10 commits into
masterfrom
symex-rewrite

Conversation

@0verflowme

Copy link
Copy Markdown
Member
  • Introduced a new spec module to define exploration specifications, including predicates, input configurations, and budget constraints.
  • Enhanced the PathExplorer to support running exploration specifications, allowing for more controlled symbolic execution paths.
  • Added functionality to handle symbolic file descriptor inputs, enabling the exploration of paths based on external input streams.
  • Updated tests to validate the new exploration specification features, ensuring correct behavior in symbolic execution scenarios.

This commit enhances the symbolic execution framework by allowing users to define and run detailed exploration strategies.

Checklist

  • Closing issues: #issue
  • Mark this if you consider it ready to merge
  • I've added tests (optional)
  • I wrote some documentation

Description

- Introduced a new `spec` module to define exploration specifications, including predicates, input configurations, and budget constraints.
- Enhanced the `PathExplorer` to support running exploration specifications, allowing for more controlled symbolic execution paths.
- Added functionality to handle symbolic file descriptor inputs, enabling the exploration of paths based on external input streams.
- Updated tests to validate the new exploration specification features, ensuring correct behavior in symbolic execution scenarios.

This commit enhances the symbolic execution framework by allowing users to define and run detailed exploration strategies.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1299784e22

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +980 to +982
let can_zero_extend =
candidate_low == requested_low && candidate.width_bits < requested.width_bits;
if !covers_requested && !can_zero_extend {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restrict x86 alias widening to real zero-ext cases

resolve_alias_register_value currently treats any narrower alias at the same offset as a zero-extension source (AL/AX/SI/... -> R*), but on x86-64 only 32-bit writes (E*/R*d) clear the upper bits. With this logic, a path that writes AL and later reads RAX is incorrectly constrained to RAX[63:8]==0 instead of preserving prior high bits, which can make feasible branches appear unreachable in symbolic exploration.

Useful? React with 👍 / 👎.

Comment thread crates/r2sym/src/sim.rs
Comment on lines +985 to +987
let Some(bytes) = state.read_symbolic_fd_bytes(fd, count) else {
return SummaryEffect::Return(Some(SymValue::concrete(0, call.ret_bits)));
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Return unknown when read() has no configured symbolic stream

ReadSummary::execute returns a concrete 0 whenever the fd is not registered in symbolic_fd_inputs, and with_core now installs this summary for normal a:sym.explore/a:sym.solve runs too. That forces read-gated code down EOF/error paths even when the input should be unconstrained, so targets behind checks like if (read(...) == 1) become spuriously unreachable unless users switch to the new spec flow.

Useful? React with 👍 / 👎.

- Updated dependencies in Cargo.lock, including new packages such as `anes`, `cast`, `ciborium`, and `criterion`, along with their respective versions and checksums.
- Introduced a new benchmark for symbolic execution in `r2sym`, allowing for performance evaluation of hot paths in symbolic execution.
- Enhanced the `ExploreConfig` structure to include a `max_completed_paths` option, providing better control over exploration limits.
- Added tests to validate the new exploration capabilities and ensure correct behavior in symbolic execution scenarios.

This commit improves the dependency management and expands the symbolic execution framework's capabilities, facilitating more efficient exploration strategies.
- Introduced `VmUnaryOp` and `VmBinaryOp` enums to represent unary and binary operations in the symbolic execution context.
- Updated `VmValueExpr` to support new operation types, including rendering logic for unary and binary expressions.
- Enhanced the `evaluate_u64` method to handle new binary operations, improving the evaluation capabilities of symbolic expressions.
- Refactored related code to integrate new operations into the existing symbolic execution framework.

This commit expands the symbolic execution capabilities, allowing for more complex expressions and operations to be evaluated during analysis.
- Added functions to format VM guarded exits and memory conditions, improving the representation of symbolic execution states.
- Updated the Decompiler to include counts for likely and heuristic transfers, enhancing the semantic analysis capabilities.
- Refactored output formatting to include new metrics such as exact exit guards and total memory effects, providing more detailed insights during analysis.

This commit expands the symbolic execution framework, allowing for better tracking and representation of VM states and their associated conditions.
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