Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 62 additions & 31 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,57 +1,69 @@
[workspace]
resolver = "2"
members = [
"crates/libafl",
"crates/build_id2",
"crates/core_affinity2",
"crates/exceptional",
"crates/fast_rands",
"crates/libafl_asan",
"crates/libafl_asan/libafl_asan_fuzz",
"crates/libafl_asan/libafl_asan_libc",
"crates/libafl_bolts",
"crates/libafl_cc",
"crates/libafl_concolic/symcc_runtime",
"crates/libafl_concolic/symcc_libafl",
"crates/libafl_concolic/symcc_runtime",
"crates/libafl_concolic/test/dump_constraints",
"crates/libafl_concolic/test/runtime_test",
"crates/libafl_core",
"crates/libafl_derive",
"crates/libafl_frida",
"crates/libafl_intelpt",
"crates/libafl_libfuzzer",
"crates/libafl_nyx",
"crates/libafl_unicorn",
"crates/libafl_targets",
"crates/libafl_tinyinst",
"crates/libafl_qemu",
"crates/libafl_qemu/libafl_qemu_build",
"crates/libafl_qemu/libafl_qemu_runner",
"crates/libafl_qemu/libafl_qemu_sys",
"crates/libafl_sugar",
"crates/libafl_concolic/test/dump_constraints",
"crates/libafl_concolic/test/runtime_test",
"crates/libafl_targets",
"crates/libafl_tinyinst",
"crates/libafl_unicorn",
"crates/libafl",
"crates/ll_mp",
"crates/minibsod",
"crates/no_std_time",
"crates/ownedref",
"crates/serde_anymap",
"crates/shmem_providers",
"crates/tuple_list_ex",
"utils/build_and_test_fuzzers",
"utils/ci_runner",
"utils/ci_splitter",
"utils/deexit",
"utils/drcov_utils",
"utils/gramatron/construct_automata",
"utils/libafl_benches",
"utils/libafl_jumper",
"utils/ci_runner",
"utils/ci_splitter",
]

default-members = [
"crates/libafl",
"crates/libafl_bolts",
"crates/libafl_cc",
"crates/libafl_derive",
"crates/libafl_targets",
"crates/libafl",
]

exclude = [
"bindings/pylibafl",
"crates/libafl_libfuzzer_runtime",
"docs",
"fuzzers",
"crates/libafl_libfuzzer_runtime",
"utils/noaslr",
"scripts",
"utils/gdb_qemu",
"utils/libafl_repo_tools",
"utils/multi_machine_generator",
"scripts",
"utils/noaslr",
# additional crates
"crates/libafl_concolic/test/symcc/util/symcc_fuzzing_helper",
]
Expand All @@ -64,28 +76,44 @@ readme = "./README.md"

[workspace.dependencies]
# Internal deps
build_id2 = { path = "./crates/build_id2", version = "0.15.3", default-features = false }
core_affinity2 = { path = "./crates/core_affinity2", version = "0.15.3", default-features = false }
exceptional = { path = "./crates/exceptional", version = "0.15.3", default-features = false }
fast_rands = { path = "./crates/fast_rands", version = "0.15.3", default-features = false }
libafl = { path = "./crates/libafl", version = "0.15.3", default-features = false }
libafl_bolts = { path = "./crates/libafl_bolts", version = "0.15.3", default-features = false }
libafl_cc = { path = "./crates/libafl_cc", version = "0.15.3", default-features = false }
symcc_runtime = { path = "./crates/libafl_concolic/symcc_runtime", version = "0.15.2", default-features = false }
symcc_libafl = { path = "./crates/libafl_concolic/symcc_libafl", version = "0.15.3", default-features = false }
libafl_core = { path = "./crates/libafl_core", version = "0.15.3", default-features = false }
libafl_derive = { path = "./crates/libafl_derive", version = "0.15.3", default-features = false }
libafl_frida = { path = "./crates/libafl_frida", version = "0.15.3", default-features = false }
libafl_intelpt = { path = "./crates/libafl_intelpt", version = "0.15.3", default-features = false }
libafl_libfuzzer = { path = "./crates/libafl_libfuzzer", version = "0.15.3", default-features = false }
libafl_nyx = { path = "./crates/libafl_nyx", version = "0.15.3", default-features = false }
libafl_targets = { path = "./crates/libafl_targets", version = "0.15.3", default-features = false }
libafl_tinyinst = { path = "./crates/libafl_tinyinst", version = "0.15.3", default-features = false }
libafl_qemu = { path = "./crates/libafl_qemu", version = "0.15.3", default-features = false }
libafl_qemu_build = { path = "./crates/libafl_qemu/libafl_qemu_build", version = "0.15.3", default-features = false }
libafl_qemu_sys = { path = "./crates/libafl_qemu/libafl_qemu_sys", version = "0.15.3", default-features = false }
libafl_sugar = { path = "./crates/libafl_sugar", version = "0.15.3", default-features = false }
libafl_targets = { path = "./crates/libafl_targets", version = "0.15.3", default-features = false }
libafl_tinyinst = { path = "./crates/libafl_tinyinst", version = "0.15.3", default-features = false }
ll_mp = { path = "./crates/ll_mp", version = "0.15.3", default-features = false }
minibsod = { path = "./crates/minibsod", version = "0.15.3", default-features = false }
no_std_time = { path = "./crates/no_std_time", version = "0.15.3", default-features = false }
ownedref = { path = "./crates/ownedref", version = "0.15.3", default-features = false }
serde_anymap = { path = "./crates/serde_anymap", version = "0.15.3", default-features = false }
shmem_providers = { path = "./crates/shmem_providers", version = "0.15.3", default-features = false }
tuple_list_ex = { path = "./crates/tuple_list_ex", version = "0.15.2", default-features = false }

# Concolic fuzzing crates
dump_constraints = { path = "./crates/libafl_concolic/test/dump_constraints", version = "0.15.2", default-features = false }
runtime_test = { path = "./crates/libafl_concolic/test/runtime_test", version = "0.15.2", default-features = false }
symcc_libafl = { path = "./crates/libafl_concolic/symcc_libafl", version = "0.15.3", default-features = false }
symcc_runtime = { path = "./crates/libafl_concolic/symcc_runtime", version = "0.15.2", default-features = false }

# Utils
build_and_test_fuzzers = { path = "./utils/build_and_test_fuzzers", version = "0.15.2", default-features = false }
construct_automata = { path = "./utils/gramatron/construct_automata", version = "0.15.2", default-features = false }
deexit = { path = "./utils/deexit", version = "0.15.2", default-features = false }
drcov_utils = { path = "./utils/drcov_utils", version = "0.15.2", default-features = false }
construct_automata = { path = "./utils/gramatron/construct_automata", version = "0.15.2", default-features = false }
libafl_benches = { path = "./utils/libafl_benches", version = "0.15.3", default-features = false }
libafl_jumper = { path = "./utils/libafl_jumper", version = "0.15.3", default-features = false }

Expand All @@ -98,11 +126,14 @@ bindgen = "0.72.0"
# fixme: Change this to 1.3.3 when the issue https://github.com/danlehmann/bitfield/issues/66 is resolved.
bitbybit = "=1.3.2" # bitfields, use this for bit fields and bit enums
capstone = "0.13.0" # Disassembler used in libafl_unicorn to provide disassembly on crash
clap = "4.5.18"
cc = "1.1.21"
clap = "4.5.18"
cmake = "0.1.51"
ctor = "0.4.0"
document-features = "0.2.10"
erased-serde = { version = "0.4.5", default-features = false } # erased serde
fastbloom = { version = "0.12.0", default-features = false }
fs2 = "0.4.3" # Used by OnDisk Corpus for file locking
hashbrown = { version = "0.14.5", default-features = false } # A faster hashmap, nostd compatible
just = "=1.40.0"
libc = "0.2.159" # For (*nix) libc
Expand All @@ -123,21 +154,21 @@ rangemap = "1.5.1"
regex = "1.10.6"
rustversion = "1.0.17"
serde = { version = "1.0.210", default-features = false } # serialization lib
serial_test = { version = "3.2.0", default-features = false }
serde_json = { version = "1.0.128", default-features = false }
serde_yaml = { version = "0.9.34" } # For parsing the injections yaml file
serial_test = { version = "3.2.0", default-features = false }
static_assertions = "1.1.0"
strum = "0.27.0"
strum_macros = "0.27.0"
toml = "0.9.0" # For parsing the injections toml file
tuple_list = { version = "0.1.3" }
typed-builder = "0.21.0" # Implement the builder pattern at compiletime
typeid = "1.0.0" # Safe type_eq that doesn't rely on std specialization
unicorn-engine = "2.0.1" # Used in libafl_unicorn
uuid = { version = "1.10.0", features = ["serde", "v4"] }
which = "8.0.0"
windows = "0.59.0"
z3 = "0.12.1"
fs2 = "0.4.3" # Used by OnDisk Corpus for file locking

[workspace.lints.rust]
# Deny
Expand Down Expand Up @@ -165,21 +196,21 @@ std_instead_of_core = "deny"
cargo = { level = "warn", priority = -1 }

# Allow
negative_feature_names = "allow" # TODO: turn into 'warn' when working
multiple_crate_versions = "allow" # TODO: turn into `warn` when working
unreadable_literal = "allow"
type_repetition_in_bounds = "allow"
missing_errors_doc = "allow"
cast_possible_truncation = "allow"
used_underscore_binding = "allow"
ptr_as_ptr = "allow"
comparison_chain = "allow" # This lint makes **ZERO** sense
missing_errors_doc = "allow"
missing_panics_doc = "allow"
module_name_repetitions = "allow"
unsafe_derive_deserialize = "allow"
multiple_crate_versions = "allow" # TODO: turn into `warn` when working
negative_feature_names = "allow" # TODO: turn into 'warn' when working
ptr_as_ptr = "allow"
similar_names = "allow"
too_many_lines = "allow"
comparison_chain = "allow" # This lint makes **ZERO** sense
struct_field_names = "allow" # ????
too_many_lines = "allow"
type_repetition_in_bounds = "allow"
unreadable_literal = "allow"
unsafe_derive_deserialize = "allow"
used_underscore_binding = "allow"

[workspace.lints.rustdoc]
# Deny
Expand Down
1 change: 1 addition & 0 deletions crates/LICENSE-APACHE
1 change: 1 addition & 0 deletions crates/LICENSE-MIT
35 changes: 35 additions & 0 deletions crates/build_id2/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[package]
name = "build_id2"
version.workspace = true
authors = [
"Andrea Fioraldi <[email protected]>",
"Dominik Maier <[email protected]>",
]
description = "Updated and maintained build id library"
documentation = "https://docs.rs/libafl"
repository = "https://github.com/AFLplusplus/LibAFL/"
readme = "./README.md"
license = "MIT OR Apache-2.0"
keywords = ["os", "build-id"]
edition = "2024"
rust-version = "1.87"
categories = ["os"]

[package.metadata.docs.rs]
features = ["document-features"]
all-features = true

[features]
default = []

[build-dependencies]
rustversion = { workspace = true }

[dev-dependencies]

[dependencies]
uuid = { workspace = true }
ahash = { workspace = true }

[lints]
workspace = true
1 change: 1 addition & 0 deletions crates/build_id2/LICENSE-APACHE
1 change: 1 addition & 0 deletions crates/build_id2/LICENSE-MIT
58 changes: 58 additions & 0 deletions crates/build_id2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# LibAFL_bolts: OS and Fuzzer Dev's Libary Collection.

<img align="right" src="https://raw.githubusercontent.com/AFLplusplus/Website/main/static/libafl_logo.svg" alt="LibAFL logo" width="250" heigh="250">

The `libafl_bolts` crate exposes a lot of low-level features of LibAFL for projects that are unrelated to fuzzing, or just fuzzers completely different to LibAFL.
Some cross-platform things in bolts include (but are not limited to):

* SerdeAnyMap: a map that stores and retrieves elements by type and is serializable and deserializable
* ShMem: A cross-platform (Windows, Linux, Android, MacOS) shared memory implementation
* LLMP: A fast, lock-free IPC mechanism via SharedMap
* Core_affinity: A maintained version of `core_affinity` that can be used to get core information and bind processes to cores
* Rands: Fast random number generators for fuzzing (like [RomuRand](https://www.romu-random.org/))
* MiniBSOD: get and print information about the current process state including important registers.
* Tuples: Haskel-like compile-time tuple lists
* Os: OS specific stuff like signal handling, windows exception handling, pipes, and helpers for `fork`

LibAFL_bolts is written and maintained by

* [Andrea Fioraldi](https://twitter.com/andreafioraldi) <[email protected]>
* [Dominik Maier](https://twitter.com/domenuk) <[email protected]>
* [s1341](https://twitter.com/srubenst1341) <[email protected]>
* [Dongjia Zhang](https://github.com/tokatoka) <[email protected]>
* [Addison Crump](https://github.com/addisoncrump) <[email protected]>

## Contributing

For bugs, feel free to open issues or contact us directly. Thank you for your support. <3

Even though we will gladly assist you in finishing up your PR, try to
- keep all the crates compiling with *stable* rust (hide the eventual non-stable code under [`cfg`s](https://github.com/AFLplusplus/LibAFL/blob/main/libafl/build.rs#L26))

Check failure on line 30 in crates/build_id2/README.md

View workflow job for this annotation

GitHub Actions / Linkspector

[linkspector] crates/build_id2/README.md#L30

Raw output
message:"Cannot reach https://github.com/AFLplusplus/LibAFL/blob/main/libafl/build.rs#L26 Status: 404" location:{path:"crates/build_id2/README.md" range:{start:{line:30 column:93} end:{line:30 column:170}}} severity:ERROR source:{name:"linkspector" url:"https://github.com/UmbrellaDocs/linkspector"}
- run `cargo nightly fmt` on your code before pushing
- check the output of `cargo clippy --all` or `./clippy.sh`
- run `cargo build --no-default-features` to check for `no_std` compatibility (and possibly add `#[cfg(feature = "std")]`) to hide parts of your code.

Some of the parts in this list may be hard, don't be afraid to open a PR if you cannot fix them by yourself, so we can help.

#### License

<sup>
Licensed under either of <a href="../LICENSE-APACHE">Apache License, Version
2.0</a> or <a href="../LICENSE-MIT">MIT license</a> at your option.
</sup>

<br>

<sub>
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in this crate by you, as defined in the Apache-2.0 license, shall
be dual licensed as above, without any additional terms or conditions.
</sub>

<br>

<sub>
Dependencies under more restrictive licenses, such as GPL or AGPL, can be enabled
using the respective feature in each crate when it is present, such as the
'agpl' feature of the libafl crate.
</sub>
Original file line number Diff line number Diff line change
@@ -1,16 +1,59 @@
//! Based on <https://github.com/alecmocatta/build_id>
//! (C) Alec Mocatta <[email protected]> under license MIT or Apache 2
//!
//! Maintained by the `LibAFL` team.
#![doc = include_str!("../../../README.md")]
/*! */
#![cfg_attr(not(test), warn(
missing_debug_implementations,
missing_docs,
//trivial_casts,
trivial_numeric_casts,
unused_extern_crates,
unused_import_braces,
unused_qualifications,
//unused_results
))]
#![cfg_attr(test, deny(
missing_debug_implementations,
missing_docs,
//trivial_casts,
trivial_numeric_casts,
unused_extern_crates,
unused_import_braces,
unused_qualifications,
unused_must_use,
//unused_results
))]
#![cfg_attr(
test,
deny(
bad_style,
dead_code,
improper_ctypes,
non_shorthand_field_patterns,
no_mangle_generic_items,
overflowing_literals,
path_statements,
patterns_in_fns_without_body,
unconditional_recursion,
unused,
unused_allocation,
unused_comparisons,
unused_parens,
while_true
)
)]

use core::{
any::TypeId,
hash::{Hash, Hasher},
};
use std::{env, fs::File, io, sync::OnceLock};
use std::{env, fs::File, hash::BuildHasher, io, sync::OnceLock};

use ahash::RandomState;
use uuid::Uuid;

use crate::hasher_std;

static BUILD_ID: OnceLock<Uuid> = OnceLock::new();

/// Returns a [Uuid] uniquely representing the build of the current binary.
Expand All @@ -29,8 +72,8 @@ static BUILD_ID: OnceLock<Uuid> = OnceLock::new();
/// # Examples
///
/// ```
/// # let remote_build_id = libafl_bolts::build_id::get();
/// let local_build_id = libafl_bolts::build_id::get();
/// # let remote_build_id = build_id2::get();
/// let local_build_id = build_id2::get();
/// if local_build_id == remote_build_id {
/// println!("We're running the same binary as remote!");
/// } else {
Expand Down Expand Up @@ -79,7 +122,7 @@ fn from_type_id<H: Hasher>(mut hasher: H) -> H {
}

fn calculate() -> Uuid {
let hasher = hasher_std();
let hasher = RandomState::with_seeds(0, 0, 0, 0).build_hasher();

let hasher = from_exe(hasher.clone()).unwrap_or(hasher);
let mut hasher = from_type_id(hasher);
Expand Down
Loading
Loading