Skip to content

LibAFL QEMU update to v10.0.0 #3181

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

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
3 changes: 3 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,9 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/workflows/qemu-fuzzer-tester-prepare
- name: Setup tmate session
if: runner.os == 'Linux'
uses: mxschmitt/action-tmate@v3
- name: Build and run example QEMU fuzzers (Linux)
if: runner.os == 'Linux'
shell: bash
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/qemu-fuzzer-tester-prepare/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,12 @@ runs:
shell: bash
run: |
apt-get update
apt-get autoremove -y rustc*
apt-get install -y qemu-utils sudo python3-msgpack python3-jinja2 curl python3-dev gcc-arm-none-eabi \
gcc-arm-linux-gnueabi g++-arm-linux-gnueabi
- uses: dtolnay/rust-toolchain@stable
- name: enable mult-thread for `make`
shell: bash
run: export MAKEFLAGS="-j$(expr $(nproc) \+ 1)"
- name: install just
uses: extractions/setup-just@v2
with:
just-version: '1.40.0'
- uses: actions/checkout@v4
with:
submodules: true
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/ubuntu-prepare/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ runs:
shell: bash
run: rustup toolchain install nightly --component clippy --allow-downgrade
- name: Install cargo-hack
shell: bash
run: curl -LsSf https://github.com/taiki-e/cargo-hack/releases/latest/download/cargo-hack-x86_64-unknown-linux-gnu.tar.gz | tar xzf - -C ~/.cargo/bin
uses: taiki-e/install-action@cargo-hack
- name: Add nightly
shell: bash
run: rustup toolchain install nightly --allow-downgrade
Expand Down
8 changes: 3 additions & 5 deletions libafl_qemu/libafl_qemu_build/src/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,8 @@ const WRAPPER_HEADER: &str = r#"
#include "migration/savevm.h"
#include "hw/core/sysemu-cpu-ops.h"
#include "exec/address-spaces.h"
#include "sysemu/tcg.h"
#include "sysemu/runstate.h"
#include "sysemu/replay.h"
#include "exec/target_page.h"
#include "system/system.h"

#include "libafl/system.h"
#include "libafl/qemu_snapshot.h"
Expand All @@ -67,11 +66,9 @@ const WRAPPER_HEADER: &str = r#"
#include "exec/cpu-common.h"
#include "exec/cpu-all.h"
#include "exec/exec-all.h"
#include "exec/translate-all.h"
#include "exec/log.h"
#include "trace/trace-root.h"
#include "qemu/accel.h"
#include "hw/core/accel-cpu.h"

#include "tcg/tcg.h"
#include "tcg/tcg-op.h"
Expand Down Expand Up @@ -122,6 +119,7 @@ pub fn generate(
.derive_default(true)
.impl_debug(true)
.generate_comments(true)
.wrap_static_fns(true)
.default_enum_style(bindgen::EnumVariation::NewType {
is_global: true,
is_bitfield: true,
Expand Down
2 changes: 1 addition & 1 deletion libafl_qemu/libafl_qemu_build/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::cargo_add_rpath;

pub const QEMU_URL: &str = "https://github.com/AFLplusplus/qemu-libafl-bridge";
pub const QEMU_DIRNAME: &str = "qemu-libafl-bridge";
pub const QEMU_REVISION: &str = "97bef506eed24ee8d0eda4a07c4419c55dae4acb";
pub const QEMU_REVISION: &str = "0bea78a122b249cbffafdb130af04cc7331c9aee";

pub struct BuildResult {
pub qemu_path: PathBuf,
Expand Down
1 change: 1 addition & 0 deletions libafl_qemu/libafl_qemu_sys/src/bindings/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#![expect(improper_ctypes)]
#![expect(unsafe_op_in_unsafe_fn)]
#![allow(unused_imports)]
#![allow(unnecessary_transmutes)]

#[cfg(all(not(feature = "clippy"), target_os = "linux"))]
#[rustfmt::skip]
Expand Down
Loading
Loading