From 667431d1a058e14cf65548bed2846bec2ac2edce Mon Sep 17 00:00:00 2001 From: wcampbell Date: Tue, 27 Feb 2024 20:29:51 -0500 Subject: [PATCH] Use libafl as libfuzzer for fuzzing --- fuzz/Cargo.lock | 44 ++++++++++++++++++++++++++++++++++++++------ fuzz/Cargo.toml | 3 ++- 2 files changed, 40 insertions(+), 7 deletions(-) diff --git a/fuzz/Cargo.lock b/fuzz/Cargo.lock index 4cd5464f..99cc18b8 100644 --- a/fuzz/Cargo.lock +++ b/fuzz/Cargo.lock @@ -22,7 +22,7 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backhand" -version = "0.14.0" +version = "0.14.2" dependencies = [ "deku", "flate2", @@ -38,7 +38,7 @@ name = "backhand-fuzz" version = "0.0.0" dependencies = [ "backhand", - "libfuzzer-sys", + "libafl_libfuzzer", ] [[package]] @@ -135,6 +135,15 @@ dependencies = [ "syn 1.0.107", ] +[[package]] +name = "document-features" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95" +dependencies = [ + "litrs", +] + [[package]] name = "flate2" version = "1.0.28" @@ -188,6 +197,17 @@ dependencies = [ "libc", ] +[[package]] +name = "libafl_libfuzzer" +version = "0.11.2" +source = "git+https://github.com/AFLplusplus/LibAFL.git?branch=libfuzzer-best#07f9a9d06a1897f8ba01f6b36e1b237afdeaf365" +dependencies = [ + "cc", + "document-features", + "libfuzzer-sys", + "rustversion", +] + [[package]] name = "libc" version = "0.2.144" @@ -205,6 +225,12 @@ dependencies = [ "once_cell", ] +[[package]] +name = "litrs" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" + [[package]] name = "lzma-sys" version = "0.1.20" @@ -298,6 +324,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + [[package]] name = "strsim" version = "0.10.0" @@ -334,18 +366,18 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index 16bd8bc0..974f4d55 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -8,7 +8,8 @@ edition = "2021" cargo-fuzz = true [dependencies] -libfuzzer-sys = "0.4" +# libfuzzer-sys = "0.4" +libfuzzer-sys = { git = "https://github.com/AFLplusplus/LibAFL.git", branch = "libfuzzer-best", package = "libafl_libfuzzer" } [dependencies.backhand] path = "../backhand"