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

how to detect segfault of qemu_linux_process #2626

Open
juniorprincewang opened this issue Oct 21, 2024 · 0 comments
Open

how to detect segfault of qemu_linux_process #2626

juniorprincewang opened this issue Oct 21, 2024 · 0 comments

Comments

@juniorprincewang
Copy link

In the qemu_linux_process example, I try to test the segfault, however the fuzzer fails to observe the crash, the qemu instance continues to process.
So how to detect the segfault or timeout of QEMU linux process?

bool FuzzMe(const uint8_t *Data, size_t DataSize) {
  if (DataSize > 3) {
    if (Data[0] == 'F') {
      if (Data[1] == 'U') {
        if (Data[2] == 'Z') {
          if (Data[3] == 'Z') { *(char *)1 = 2; }
        }
      }
    }
  }

  return false;
}

int main() {
  // Prepare some space for the input
  uint8_t Data[10] = {0};

  lqprintf("Fuzzing starts\n");

  // Start fuzzer here
  size_t len = libafl_qemu_start_virt(Data, 10);

  // Call the target
  bool ret = FuzzMe(Data, len);

  libafl_qemu_end(LIBAFL_QEMU_END_OK);
}
@tokatoka tokatoka changed the title how to detect segfault of QEMU linux process how to detect segfault of qemu_linux_process Nov 12, 2024
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

1 participant