Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Fuzz execution of a single instruction with afl-fuzz #37

Merged
merged 21 commits into from
May 29, 2024

Conversation

joonazan
Copy link
Contributor

@joonazan joonazan commented May 25, 2024

Replaces stack, program and heap with mocks that just contain one value and crash if multiple addresses are accessed. Fuzzes the execution of a single instruction.

The default settings of libFuzzer don't work for me and it doesn't tell what is going wrong, so I wrote this for afl-fuzz instead.

Afl explores lots of instructions in a matter of seconds, though the crashes it finds are not real ones yet because the test is still missing a state validity check.

The validity check should check that fat pointers are well-formed etc. The test should not be run if the initial state is invalid. The test should panic if the state is no longer valid after running an instruction.

@joonazan joonazan force-pushed the symbolic-execution branch from 172cc0f to 5ce1dde Compare May 25, 2024 16:07
@joonazan joonazan marked this pull request as ready for review May 25, 2024 21:37
afl-fuzz/Cargo.toml Show resolved Hide resolved
src/addressing_modes.rs Show resolved Hide resolved
src/single_instruction_test/callframe.rs Outdated Show resolved Hide resolved
src/single_instruction_test/print_mock_info.rs Outdated Show resolved Hide resolved
afl-fuzz/Cargo.toml Outdated Show resolved Hide resolved
src/addressing_modes.rs Show resolved Hide resolved
src/single_instruction_test/stack.rs Show resolved Hide resolved
src/single_instruction_test/callframe.rs Show resolved Hide resolved
src/single_instruction_test/vm.rs Show resolved Hide resolved
@joonazan joonazan force-pushed the symbolic-execution branch from 1e53af6 to db8e97a Compare May 27, 2024 15:30
@joonazan joonazan enabled auto-merge (squash) May 29, 2024 10:48
@joonazan joonazan merged commit 4dd0671 into master May 29, 2024
7 checks passed
@joonazan joonazan deleted the symbolic-execution branch May 29, 2024 12:47
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.

2 participants