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

Query on missing snapshot from runnable corpus generated from fuzzing unicorn(emulator) #6

Open
jafarsarif10 opened this issue Sep 21, 2023 · 1 comment

Comments

@jafarsarif10
Copy link

Hi Silifuzz author,

I am currently using Silifuzz as a part of my research, and during my experiments, I encountered a particular scenario that I'd like to discuss.

I fuzzed the the provided unicorn with the centipede and generated the corpus. While converting result corpus to the runnable corpus, I noticed in the log there are lots of snapshot misbehaving with flags such as

  • Memory state mismatch
  • Unsupported signal-based endpoint
  • Execution misbehaved

The snapshot id was also listed on the logs. However, when I was trying to print the trace for those specific snapshot, they were absent from the runnable corpus.

I would greatly appreciate it if you could address the following queries, as your insights would not only benefit my research but also enhance my understanding of the Silifuzz workflow:

  1. Are the aforementioned snapshot present in the final runnable corpus with say different snapshot id?
  2. If these snapshots are not included in the runnable corpus, is there a way we can execute those snapshots using runner as I fell those could generate interesting scenario in the real hardware?

Thank you for your time and assistance.

@ksteuck
Copy link
Collaborator

ksteuck commented Sep 23, 2023

  1. Are the aforementioned snapshot present in the final runnable corpus with say different snapshot id?

Some of the snapshots will be in the runnable corpus, others won't. simple_fix_tool is used to discover the necessary memory mappings and capture the expected end state for the snapshots produced by fuzzing the proxy. The kinds of errors you described may or may not be fixable. For example, "Memory state mismatch" is typically fixable by capturing the actual memory state but a SIGFPE execution misbehave is not.

To give a concrete example, consider the following code

mov rax, 0x10000
mov [rax], 0

this snapshot can be fixed by mapping a page at 0x10000. Replace 0x10000 with 0x0 and this is not fixable b/c 0x0 isn't mappable in a typical scenario.
Take a different example

rdrand rax
mov 0x10000, rax

This snapshot isn't fixable b/c the memory contents at 0x10000 will always be different.

  1. If these snapshots are not included in the runnable corpus, is there a way we can execute those snapshots using runner as I fell those could generate interesting scenario in the real hardware?

Currently, no. Silifuzz infrastructure imposes certain limitations on the kind of programs that can be efficiently run using the runner binary. Specifically, the snapshots must be deterministic and not raise any signals. The fix_tool ensures this is the case.
In our real-life setup we use fuzz_filter_tool during fuzzing (--input_filter) to drive the fuzzing process towards maximizing coverage without breaking the limitations on determinism etc.

HTH

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

No branches or pull requests

2 participants