Clippy for Cargo (#532)
* Clippy for Cargo * clippy fixes * clippy fixes * edition * fix * wrong self hidden * fix * more clippy
This commit is contained in:
parent
a4c9d2d19e
commit
7dad2153e2
@ -4,6 +4,7 @@ version = "0.7.1"
|
|||||||
authors = ["Andrea Fioraldi <andreafioraldi@gmail.com>", "Dominik Maier <domenukk@gmail.com>"]
|
authors = ["Andrea Fioraldi <andreafioraldi@gmail.com>", "Dominik Maier <domenukk@gmail.com>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
|
categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["std"]
|
default = ["std"]
|
||||||
|
@ -9,6 +9,7 @@ readme = "../README.md"
|
|||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
keywords = ["fuzzing", "testing", "security"]
|
keywords = ["fuzzing", "testing", "security"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["std", "derive", "llmp_compression", "rand_trait", "fork"]
|
default = ["std", "derive", "llmp_compression", "rand_trait", "fork"]
|
||||||
@ -63,7 +64,7 @@ intervaltree = { version = "0.2.7", default-features = false, features = ["serde
|
|||||||
backtrace = {version = "0.3", optional = true} # Used to get the stacktrace in StacktraceObserver
|
backtrace = {version = "0.3", optional = true} # Used to get the stacktrace in StacktraceObserver
|
||||||
|
|
||||||
serde_json = { version = "1.0", optional = true, default-features = false, features = ["alloc"] }
|
serde_json = { version = "1.0", optional = true, default-features = false, features = ["alloc"] }
|
||||||
miniz_oxide = { version = "0.5", optional = true}
|
miniz_oxide = { version = "0.4.4", optional = true}
|
||||||
core_affinity = { version = "0.5", git = "https://github.com/s1341/core_affinity_rs", rev = "6648a7a", optional = true }
|
core_affinity = { version = "0.5", git = "https://github.com/s1341/core_affinity_rs", rev = "6648a7a", optional = true }
|
||||||
hostname = { version = "^0.3", optional = true } # Is there really no gethostname in the stdlib?
|
hostname = { version = "^0.3", optional = true } # Is there really no gethostname in the stdlib?
|
||||||
rand_core = { version = "0.5.1", optional = true } # This dependency allows us to export our RomuRand as rand::Rng. We cannot update to the latest version because it breaks compatibility to microsoft lain.
|
rand_core = { version = "0.5.1", optional = true } # This dependency allows us to export our RomuRand as rand::Rng. We cannot update to the latest version because it breaks compatibility to microsoft lain.
|
||||||
|
@ -206,6 +206,14 @@ impl TryFrom<&Vec<u8>> for TcpRequest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl TryFrom<Vec<u8>> for TcpRequest {
|
||||||
|
type Error = Error;
|
||||||
|
|
||||||
|
fn try_from(bytes: Vec<u8>) -> Result<Self, Error> {
|
||||||
|
Ok(postcard::from_bytes(&bytes)?)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Messages for broker 2 broker connection.
|
/// Messages for broker 2 broker connection.
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
pub struct TcpRemoteNewMessage {
|
pub struct TcpRemoteNewMessage {
|
||||||
@ -227,6 +235,14 @@ impl TryFrom<&Vec<u8>> for TcpRemoteNewMessage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl TryFrom<Vec<u8>> for TcpRemoteNewMessage {
|
||||||
|
type Error = Error;
|
||||||
|
|
||||||
|
fn try_from(bytes: Vec<u8>) -> Result<Self, Error> {
|
||||||
|
Ok(postcard::from_bytes(&bytes)?)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Responses for requests to the server.
|
/// Responses for requests to the server.
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
pub enum TcpResponse {
|
pub enum TcpResponse {
|
||||||
@ -263,6 +279,14 @@ impl TryFrom<&Vec<u8>> for TcpResponse {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl TryFrom<Vec<u8>> for TcpResponse {
|
||||||
|
type Error = Error;
|
||||||
|
|
||||||
|
fn try_from(bytes: Vec<u8>) -> Result<Self, Error> {
|
||||||
|
Ok(postcard::from_bytes(&bytes)?)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Abstraction for listeners
|
/// Abstraction for listeners
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
@ -1830,7 +1854,7 @@ where
|
|||||||
let mut stream = TcpStream::connect(addr)?;
|
let mut stream = TcpStream::connect(addr)?;
|
||||||
println!("B2B: Connected to {:?}", stream);
|
println!("B2B: Connected to {:?}", stream);
|
||||||
|
|
||||||
match (&recv_tcp_msg(&mut stream)?).try_into()? {
|
match recv_tcp_msg(&mut stream)?.try_into()? {
|
||||||
TcpResponse::BrokerConnectHello {
|
TcpResponse::BrokerConnectHello {
|
||||||
broker_shmem_description: _,
|
broker_shmem_description: _,
|
||||||
hostname,
|
hostname,
|
||||||
@ -1849,7 +1873,7 @@ where
|
|||||||
|
|
||||||
send_tcp_msg(&mut stream, &TcpRequest::RemoteBrokerHello { hostname })?;
|
send_tcp_msg(&mut stream, &TcpRequest::RemoteBrokerHello { hostname })?;
|
||||||
|
|
||||||
let broker_id = match (&recv_tcp_msg(&mut stream)?).try_into()? {
|
let broker_id = match recv_tcp_msg(&mut stream)?.try_into()? {
|
||||||
TcpResponse::RemoteBrokerAccepted { broker_id } => {
|
TcpResponse::RemoteBrokerAccepted { broker_id } => {
|
||||||
println!("B2B: Got Connection Ack, broker_id {}", broker_id);
|
println!("B2B: Got Connection Ack, broker_id {}", broker_id);
|
||||||
broker_id
|
broker_id
|
||||||
@ -2106,7 +2130,7 @@ where
|
|||||||
// We ignore errors completely as they may be timeout, or stream closings.
|
// We ignore errors completely as they may be timeout, or stream closings.
|
||||||
// Instead, we catch stream close when/if we next try to send.
|
// Instead, we catch stream close when/if we next try to send.
|
||||||
if let Ok(val) = recv_tcp_msg(&mut stream) {
|
if let Ok(val) = recv_tcp_msg(&mut stream) {
|
||||||
let msg: TcpRemoteNewMessage = (&val).try_into().expect(
|
let msg: TcpRemoteNewMessage = val.try_into().expect(
|
||||||
"Illegal message received from broker 2 broker connection - shutting down.",
|
"Illegal message received from broker 2 broker connection - shutting down.",
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -2267,7 +2291,7 @@ where
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
let req = match (&buf).try_into() {
|
let req = match buf.try_into() {
|
||||||
Ok(req) => req,
|
Ok(req) => req,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
eprintln!("Could not deserialize tcp message: {:?}", e);
|
eprintln!("Could not deserialize tcp message: {:?}", e);
|
||||||
@ -2653,7 +2677,7 @@ where
|
|||||||
let broker_shmem_description = if let TcpResponse::BrokerConnectHello {
|
let broker_shmem_description = if let TcpResponse::BrokerConnectHello {
|
||||||
broker_shmem_description,
|
broker_shmem_description,
|
||||||
hostname: _,
|
hostname: _,
|
||||||
} = (&recv_tcp_msg(&mut stream)?).try_into()?
|
} = recv_tcp_msg(&mut stream)?.try_into()?
|
||||||
{
|
{
|
||||||
broker_shmem_description
|
broker_shmem_description
|
||||||
} else {
|
} else {
|
||||||
@ -2674,7 +2698,7 @@ where
|
|||||||
send_tcp_msg(&mut stream, &client_hello_req)?;
|
send_tcp_msg(&mut stream, &client_hello_req)?;
|
||||||
|
|
||||||
let client_id = if let TcpResponse::LocalClientAccepted { client_id } =
|
let client_id = if let TcpResponse::LocalClientAccepted { client_id } =
|
||||||
(&recv_tcp_msg(&mut stream)?).try_into()?
|
recv_tcp_msg(&mut stream)?.try_into()?
|
||||||
{
|
{
|
||||||
client_id
|
client_id
|
||||||
} else {
|
} else {
|
||||||
|
@ -621,12 +621,12 @@ impl<'a, SP> ForkserverExecutorBuilder<'a, SP> {
|
|||||||
|
|
||||||
if (status & FS_OPT_SHDMEM_FUZZ == FS_OPT_SHDMEM_FUZZ) && map.is_some() {
|
if (status & FS_OPT_SHDMEM_FUZZ == FS_OPT_SHDMEM_FUZZ) && map.is_some() {
|
||||||
println!("Using SHARED MEMORY FUZZING feature.");
|
println!("Using SHARED MEMORY FUZZING feature.");
|
||||||
send_status = send_status | FS_OPT_SHDMEM_FUZZ;
|
send_status |= FS_OPT_SHDMEM_FUZZ;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status & FS_OPT_AUTODICT == FS_OPT_AUTODICT) && self.autotokens.is_some() {
|
if (status & FS_OPT_AUTODICT == FS_OPT_AUTODICT) && self.autotokens.is_some() {
|
||||||
println!("Using AUTODICT feature");
|
println!("Using AUTODICT feature");
|
||||||
send_status = send_status | FS_OPT_AUTODICT;
|
send_status |= FS_OPT_AUTODICT;
|
||||||
}
|
}
|
||||||
|
|
||||||
let send_len = forkserver.write_ctl(send_status)?;
|
let send_len = forkserver.write_ctl(send_status)?;
|
||||||
@ -644,7 +644,7 @@ impl<'a, SP> ForkserverExecutorBuilder<'a, SP> {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
if dict_size < 2 || dict_size > 0xffffff {
|
if !(2..=0xffffff).contains(&dict_size) {
|
||||||
return Err(Error::Forkserver(
|
return Err(Error::Forkserver(
|
||||||
"Dictionary has an illegal size".to_string(),
|
"Dictionary has an illegal size".to_string(),
|
||||||
));
|
));
|
||||||
@ -782,8 +782,7 @@ impl<'a> ForkserverExecutorBuilder<'a, StdShMemProvider> {
|
|||||||
#[must_use]
|
#[must_use]
|
||||||
/// Place the input at this position and set the default filename for the input.
|
/// Place the input at this position and set the default filename for the input.
|
||||||
pub fn arg_input_file_std(self) -> Self {
|
pub fn arg_input_file_std(self) -> Self {
|
||||||
let moved = self.arg_input_file(OUTFILE_STD);
|
self.arg_input_file(OUTFILE_STD)
|
||||||
moved
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[must_use]
|
#[must_use]
|
||||||
@ -800,17 +799,15 @@ impl<'a> ForkserverExecutorBuilder<'a, StdShMemProvider> {
|
|||||||
if item.as_ref() == "@@" && use_stdin {
|
if item.as_ref() == "@@" && use_stdin {
|
||||||
use_stdin = false;
|
use_stdin = false;
|
||||||
res.push(OsString::from(".cur_input"));
|
res.push(OsString::from(".cur_input"));
|
||||||
} else {
|
} else if let Some(name) = &self.out_filename {
|
||||||
if let Some(name) = &self.out_filename {
|
if name == item.as_ref() && use_stdin {
|
||||||
if name == item.as_ref() && use_stdin {
|
use_stdin = false;
|
||||||
use_stdin = false;
|
res.push(name.clone());
|
||||||
res.push(name.clone());
|
|
||||||
} else {
|
|
||||||
res.push(item.as_ref().to_os_string());
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
res.push(item.as_ref().to_os_string());
|
res.push(item.as_ref().to_os_string());
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
res.push(item.as_ref().to_os_string());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -851,6 +848,12 @@ impl<'a> ForkserverExecutorBuilder<'a, StdShMemProvider> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'a> Default for ForkserverExecutorBuilder<'a, StdShMemProvider> {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self::new()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<EM, I, OT, S, SP, Z> Executor<EM, I, S, Z> for ForkserverExecutor<I, OT, S, SP>
|
impl<EM, I, OT, S, SP, Z> Executor<EM, I, S, Z> for ForkserverExecutor<I, OT, S, SP>
|
||||||
where
|
where
|
||||||
I: Input + HasTargetBytes,
|
I: Input + HasTargetBytes,
|
||||||
|
@ -1571,6 +1571,10 @@ pub mod child_signal_handlers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// invokes the `post_exec` hook on all observer in case the child process crashes
|
/// invokes the `post_exec` hook on all observer in case the child process crashes
|
||||||
|
///
|
||||||
|
/// # Safety
|
||||||
|
/// The function should only be called from a child crash handler.
|
||||||
|
/// It will dereference the `data` pointer and assume it's valid.
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
pub unsafe fn child_crash_handler<E, I, OT, S>(
|
pub unsafe fn child_crash_handler<E, I, OT, S>(
|
||||||
_signal: Signal,
|
_signal: Signal,
|
||||||
|
@ -51,6 +51,7 @@ where
|
|||||||
I: Input,
|
I: Input,
|
||||||
S: HasClientPerfMonitor,
|
S: HasClientPerfMonitor,
|
||||||
{
|
{
|
||||||
|
#[allow(clippy::wrong_self_convention)]
|
||||||
fn is_interesting<EM, OT>(
|
fn is_interesting<EM, OT>(
|
||||||
&mut self,
|
&mut self,
|
||||||
_state: &mut S,
|
_state: &mut S,
|
||||||
|
@ -123,6 +123,7 @@ where
|
|||||||
O1: Observer<I, S> + PartialEq<O2>,
|
O1: Observer<I, S> + PartialEq<O2>,
|
||||||
O2: Observer<I, S>,
|
O2: Observer<I, S>,
|
||||||
{
|
{
|
||||||
|
#[allow(clippy::wrong_self_convention)]
|
||||||
fn is_interesting<EM, OT>(
|
fn is_interesting<EM, OT>(
|
||||||
&mut self,
|
&mut self,
|
||||||
_state: &mut S,
|
_state: &mut S,
|
||||||
@ -176,7 +177,7 @@ mod tests {
|
|||||||
fn new(name: &str, value: bool) -> Self {
|
fn new(name: &str, value: bool) -> Self {
|
||||||
Self {
|
Self {
|
||||||
name: name.to_string(),
|
name: name.to_string(),
|
||||||
value: value,
|
value,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -373,6 +373,7 @@ where
|
|||||||
I: Input,
|
I: Input,
|
||||||
S: HasFeedbackStates + HasClientPerfMonitor + Debug,
|
S: HasFeedbackStates + HasClientPerfMonitor + Debug,
|
||||||
{
|
{
|
||||||
|
#[allow(clippy::wrong_self_convention)]
|
||||||
fn is_interesting<EM, OT>(
|
fn is_interesting<EM, OT>(
|
||||||
&mut self,
|
&mut self,
|
||||||
state: &mut S,
|
state: &mut S,
|
||||||
@ -599,6 +600,7 @@ where
|
|||||||
O: MapObserver<Entry = usize>,
|
O: MapObserver<Entry = usize>,
|
||||||
S: HasClientPerfMonitor,
|
S: HasClientPerfMonitor,
|
||||||
{
|
{
|
||||||
|
#[allow(clippy::wrong_self_convention)]
|
||||||
fn is_interesting<EM, OT>(
|
fn is_interesting<EM, OT>(
|
||||||
&mut self,
|
&mut self,
|
||||||
_state: &mut S,
|
_state: &mut S,
|
||||||
|
@ -52,6 +52,7 @@ where
|
|||||||
S: HasClientPerfMonitor,
|
S: HasClientPerfMonitor,
|
||||||
{
|
{
|
||||||
/// `is_interesting ` return if an input is worth the addition to the corpus
|
/// `is_interesting ` return if an input is worth the addition to the corpus
|
||||||
|
#[allow(clippy::wrong_self_convention)]
|
||||||
fn is_interesting<EM, OT>(
|
fn is_interesting<EM, OT>(
|
||||||
&mut self,
|
&mut self,
|
||||||
state: &mut S,
|
state: &mut S,
|
||||||
@ -68,6 +69,7 @@ where
|
|||||||
/// It also keeps track of introspection stats.
|
/// It also keeps track of introspection stats.
|
||||||
#[cfg(feature = "introspection")]
|
#[cfg(feature = "introspection")]
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
|
#[allow(clippy::wrong_self_convention)]
|
||||||
fn is_interesting_introspection<EM, OT>(
|
fn is_interesting_introspection<EM, OT>(
|
||||||
&mut self,
|
&mut self,
|
||||||
state: &mut S,
|
state: &mut S,
|
||||||
@ -205,6 +207,7 @@ where
|
|||||||
I: Input,
|
I: Input,
|
||||||
S: HasClientPerfMonitor + Debug,
|
S: HasClientPerfMonitor + Debug,
|
||||||
{
|
{
|
||||||
|
#[allow(clippy::wrong_self_convention)]
|
||||||
fn is_interesting<EM, OT>(
|
fn is_interesting<EM, OT>(
|
||||||
&mut self,
|
&mut self,
|
||||||
state: &mut S,
|
state: &mut S,
|
||||||
@ -229,6 +232,7 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "introspection")]
|
#[cfg(feature = "introspection")]
|
||||||
|
#[allow(clippy::wrong_self_convention)]
|
||||||
fn is_interesting_introspection<EM, OT>(
|
fn is_interesting_introspection<EM, OT>(
|
||||||
&mut self,
|
&mut self,
|
||||||
state: &mut S,
|
state: &mut S,
|
||||||
@ -592,6 +596,7 @@ where
|
|||||||
I: Input,
|
I: Input,
|
||||||
S: HasClientPerfMonitor,
|
S: HasClientPerfMonitor,
|
||||||
{
|
{
|
||||||
|
#[allow(clippy::wrong_self_convention)]
|
||||||
fn is_interesting<EM, OT>(
|
fn is_interesting<EM, OT>(
|
||||||
&mut self,
|
&mut self,
|
||||||
state: &mut S,
|
state: &mut S,
|
||||||
@ -707,6 +712,7 @@ where
|
|||||||
I: Input,
|
I: Input,
|
||||||
S: HasClientPerfMonitor,
|
S: HasClientPerfMonitor,
|
||||||
{
|
{
|
||||||
|
#[allow(clippy::wrong_self_convention)]
|
||||||
fn is_interesting<EM, OT>(
|
fn is_interesting<EM, OT>(
|
||||||
&mut self,
|
&mut self,
|
||||||
_state: &mut S,
|
_state: &mut S,
|
||||||
@ -739,6 +745,7 @@ where
|
|||||||
I: Input,
|
I: Input,
|
||||||
S: HasClientPerfMonitor,
|
S: HasClientPerfMonitor,
|
||||||
{
|
{
|
||||||
|
#[allow(clippy::wrong_self_convention)]
|
||||||
fn is_interesting<EM, OT>(
|
fn is_interesting<EM, OT>(
|
||||||
&mut self,
|
&mut self,
|
||||||
_state: &mut S,
|
_state: &mut S,
|
||||||
@ -789,6 +796,7 @@ where
|
|||||||
I: Input,
|
I: Input,
|
||||||
S: HasClientPerfMonitor,
|
S: HasClientPerfMonitor,
|
||||||
{
|
{
|
||||||
|
#[allow(clippy::wrong_self_convention)]
|
||||||
fn is_interesting<EM, OT>(
|
fn is_interesting<EM, OT>(
|
||||||
&mut self,
|
&mut self,
|
||||||
_state: &mut S,
|
_state: &mut S,
|
||||||
@ -844,6 +852,7 @@ where
|
|||||||
I: Input,
|
I: Input,
|
||||||
S: HasClientPerfMonitor,
|
S: HasClientPerfMonitor,
|
||||||
{
|
{
|
||||||
|
#[allow(clippy::wrong_self_convention)]
|
||||||
fn is_interesting<EM, OT>(
|
fn is_interesting<EM, OT>(
|
||||||
&mut self,
|
&mut self,
|
||||||
_state: &mut S,
|
_state: &mut S,
|
||||||
|
@ -78,6 +78,7 @@ impl<'a, S> Feedback<NautilusInput, S> for NautilusFeedback<'a>
|
|||||||
where
|
where
|
||||||
S: HasMetadata + HasClientPerfMonitor,
|
S: HasMetadata + HasClientPerfMonitor,
|
||||||
{
|
{
|
||||||
|
#[allow(clippy::wrong_self_convention)]
|
||||||
fn is_interesting<EM, OT>(
|
fn is_interesting<EM, OT>(
|
||||||
&mut self,
|
&mut self,
|
||||||
_state: &mut S,
|
_state: &mut S,
|
||||||
|
@ -113,6 +113,7 @@ where
|
|||||||
S: HasClientPerfMonitor + HasFeedbackStates,
|
S: HasClientPerfMonitor + HasFeedbackStates,
|
||||||
O: ObserverWithHashField + Named + Debug,
|
O: ObserverWithHashField + Named + Debug,
|
||||||
{
|
{
|
||||||
|
#[allow(clippy::wrong_self_convention)]
|
||||||
fn is_interesting<EM, OT>(
|
fn is_interesting<EM, OT>(
|
||||||
&mut self,
|
&mut self,
|
||||||
_state: &mut S,
|
_state: &mut S,
|
||||||
|
@ -8,7 +8,10 @@ Welcome to `LibAFL`
|
|||||||
#![cfg_attr(unstable_feature, feature(specialization))]
|
#![cfg_attr(unstable_feature, feature(specialization))]
|
||||||
// For `type_id` and owned things
|
// For `type_id` and owned things
|
||||||
#![cfg_attr(unstable_feature, feature(intrinsics))]
|
#![cfg_attr(unstable_feature, feature(intrinsics))]
|
||||||
|
#![warn(clippy::cargo)]
|
||||||
|
#![deny(clippy::cargo_common_metadata)]
|
||||||
#![deny(rustdoc::broken_intra_doc_links)]
|
#![deny(rustdoc::broken_intra_doc_links)]
|
||||||
|
#![deny(clippy::all)]
|
||||||
#![deny(clippy::pedantic)]
|
#![deny(clippy::pedantic)]
|
||||||
#![allow(
|
#![allow(
|
||||||
clippy::unreadable_literal,
|
clippy::unreadable_literal,
|
||||||
|
@ -5,13 +5,13 @@ use crate::mutators::str_decode;
|
|||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
use alloc::string::ToString;
|
use alloc::string::ToString;
|
||||||
use alloc::vec::Vec;
|
use alloc::vec::Vec;
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
|
use core::slice::from_raw_parts;
|
||||||
use core::slice::Iter;
|
use core::slice::Iter;
|
||||||
use core::{
|
use core::{
|
||||||
mem::size_of,
|
mem::size_of,
|
||||||
ops::{Add, AddAssign},
|
ops::{Add, AddAssign},
|
||||||
};
|
};
|
||||||
#[cfg(target_os = "linux")]
|
|
||||||
use core::{ptr::null, slice::from_raw_parts};
|
|
||||||
use hashbrown::HashSet;
|
use hashbrown::HashSet;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
@ -102,11 +102,14 @@ impl Tokens {
|
|||||||
|
|
||||||
/// Create a token section from a start and an end pointer
|
/// Create a token section from a start and an end pointer
|
||||||
/// Reads from an autotokens section, returning the count of new entries read
|
/// Reads from an autotokens section, returning the count of new entries read
|
||||||
#[must_use]
|
///
|
||||||
|
/// # Safety
|
||||||
|
/// The caller must ensure that the region between `token_start` and `token_stop`
|
||||||
|
/// is a valid region, containing autotokens in the exepcted format.
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
pub unsafe fn from_ptrs(token_start: *const u8, token_stop: *const u8) -> Result<Self, Error> {
|
pub unsafe fn from_ptrs(token_start: *const u8, token_stop: *const u8) -> Result<Self, Error> {
|
||||||
let mut ret = Self::default();
|
let mut ret = Self::default();
|
||||||
if token_start == null() || token_stop == null() {
|
if token_start.is_null() || token_stop.is_null() {
|
||||||
return Err(Error::IllegalArgument("token_start or token_stop is null. If you are using autotokens() you likely did not build your target with the \"AutoTokens\"-pass".to_string()));
|
return Err(Error::IllegalArgument("token_start or token_stop is null. If you are using autotokens() you likely did not build your target with the \"AutoTokens\"-pass".to_string()));
|
||||||
}
|
}
|
||||||
if token_stop <= token_start {
|
if token_stop <= token_start {
|
||||||
|
@ -9,6 +9,7 @@ readme = "../README.md"
|
|||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
keywords = ["fuzzing", "testing", "compiler"]
|
keywords = ["fuzzing", "testing", "compiler"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"]
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
//! Compiler Wrapper from `LibAFL`
|
//! Compiler Wrapper from `LibAFL`
|
||||||
|
|
||||||
#![deny(rustdoc::broken_intra_doc_links)]
|
#![deny(rustdoc::broken_intra_doc_links)]
|
||||||
|
#![deny(clippy::all)]
|
||||||
#![deny(clippy::pedantic)]
|
#![deny(clippy::pedantic)]
|
||||||
#![allow(
|
#![allow(
|
||||||
clippy::unreadable_literal,
|
clippy::unreadable_literal,
|
||||||
|
@ -9,6 +9,7 @@ repository = "https://github.com/AFLplusplus/LibAFL/"
|
|||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
keywords = ["fuzzing", "testing", "security"]
|
keywords = ["fuzzing", "testing", "security"]
|
||||||
|
categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"]
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ readme = "README.md"
|
|||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
keywords = ["fuzzing", "testing", "security"]
|
keywords = ["fuzzing", "testing", "security"]
|
||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
|
categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"]
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
@ -70,6 +70,7 @@ impl<THasher: Hasher, THashBuilder: BuildHasher> CallStackCoverage<THasher, THas
|
|||||||
self.pending = true;
|
self.pending = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::wrong_self_convention)]
|
||||||
pub fn is_interesting(&self) -> bool {
|
pub fn is_interesting(&self) -> bool {
|
||||||
self.is_interesting
|
self.is_interesting
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,13 @@ name = "dump_constraints"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = ["Julius Hohnerlein <julihoh@users.noreply.github.com>"]
|
authors = ["Julius Hohnerlein <julihoh@users.noreply.github.com>"]
|
||||||
|
description = "Dump Constraints, a lib to see the constraints oof a run"
|
||||||
|
documentation = "https://docs.rs/libafl"
|
||||||
|
repository = "https://github.com/AFLplusplus/LibAFL/"
|
||||||
|
readme = "../README.md"
|
||||||
|
license = "MIT OR Apache-2.0"
|
||||||
|
keywords = ["fuzzing", "libafl", "ldpreload"]
|
||||||
|
categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"]
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ fn main() {
|
|||||||
.enumerate()
|
.enumerate()
|
||||||
.filter(|(_, &v)| v != 0)
|
.filter(|(_, &v)| v != 0)
|
||||||
{
|
{
|
||||||
writeln!(&mut f, "{}\t{}", index, count).expect("failed to write coverage file");
|
writeln!(f, "{}\t{}", index, count).expect("failed to write coverage file");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,7 +125,7 @@ fn main() {
|
|||||||
if opt.plain_text {
|
if opt.plain_text {
|
||||||
while let Some(message) = reader.next_message() {
|
while let Some(message) = reader.next_message() {
|
||||||
if let Ok((id, message)) = message {
|
if let Ok((id, message)) = message {
|
||||||
writeln!(&mut output_file, "{}\t{:?}", id, message)
|
writeln!(output_file, "{}\t{:?}", id, message)
|
||||||
.expect("failed to write to output file");
|
.expect("failed to write to output file");
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
|
@ -3,6 +3,13 @@ name = "runtime_test"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = ["Julius Hohnerlein <julihoh@users.noreply.github.com>"]
|
authors = ["Julius Hohnerlein <julihoh@users.noreply.github.com>"]
|
||||||
|
description = "Runtime test of LibAFL fuzzing with symbolicc execution"
|
||||||
|
documentation = "https://docs.rs/libafl"
|
||||||
|
repository = "https://github.com/AFLplusplus/LibAFL/"
|
||||||
|
readme = "../README.md"
|
||||||
|
license = "MIT OR Apache-2.0"
|
||||||
|
keywords = ["fuzzing", "libafl", "symbolic", "symcc", "symqemu", "fuzzer"]
|
||||||
|
categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"]
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
crate-type = ["cdylib"]
|
crate-type = ["cdylib"]
|
||||||
|
@ -9,6 +9,7 @@ readme = "../README.md"
|
|||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
keywords = ["fuzzing", "testing"]
|
keywords = ["fuzzing", "testing"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"]
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
proc-macro = true
|
proc-macro = true
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
//! Derives for `LibAFL`
|
//! Derives for `LibAFL`
|
||||||
|
|
||||||
#![deny(rustdoc::broken_intra_doc_links)]
|
#![deny(rustdoc::broken_intra_doc_links)]
|
||||||
|
#![deny(clippy::all)]
|
||||||
#![deny(clippy::pedantic)]
|
#![deny(clippy::pedantic)]
|
||||||
#![allow(
|
#![allow(
|
||||||
clippy::unreadable_literal,
|
clippy::unreadable_literal,
|
||||||
|
@ -9,7 +9,7 @@ readme = "../README.md"
|
|||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
keywords = ["fuzzing", "frida", "instrumentation"]
|
keywords = ["fuzzing", "frida", "instrumentation"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
|
@ -615,6 +615,7 @@ where
|
|||||||
I: Input + HasTargetBytes,
|
I: Input + HasTargetBytes,
|
||||||
S: HasClientPerfMonitor,
|
S: HasClientPerfMonitor,
|
||||||
{
|
{
|
||||||
|
#[allow(clippy::wrong_self_convention)]
|
||||||
fn is_interesting<EM, OT>(
|
fn is_interesting<EM, OT>(
|
||||||
&mut self,
|
&mut self,
|
||||||
_state: &mut S,
|
_state: &mut S,
|
||||||
|
@ -4,6 +4,7 @@ It can report coverage and, on supported architecutres, even reports memory acce
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#![deny(rustdoc::broken_intra_doc_links)]
|
#![deny(rustdoc::broken_intra_doc_links)]
|
||||||
|
#![deny(clippy::all)]
|
||||||
#![deny(clippy::pedantic)]
|
#![deny(clippy::pedantic)]
|
||||||
#![allow(
|
#![allow(
|
||||||
clippy::unreadable_literal,
|
clippy::unreadable_literal,
|
||||||
|
@ -9,6 +9,7 @@ readme = "../README.md"
|
|||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
keywords = ["fuzzing", "qemu", "instrumentation"]
|
keywords = ["fuzzing", "qemu", "instrumentation"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
python = ["pyo3", "pyo3-build-config"]
|
python = ["pyo3", "pyo3-build-config"]
|
||||||
|
@ -10,6 +10,7 @@ license = "MIT OR Apache-2.0"
|
|||||||
keywords = ["fuzzing"]
|
keywords = ["fuzzing"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
|
categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
python = ["pyo3", "libafl_qemu/python", "pyo3-build-config"]
|
python = ["pyo3", "libafl_qemu/python", "pyo3-build-config"]
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
//! Sugar API to simplify the life of the naive user of `LibAFL`
|
//! Sugar API to simplify the life of the naive user of `LibAFL`
|
||||||
|
|
||||||
#![deny(rustdoc::broken_intra_doc_links)]
|
#![deny(rustdoc::broken_intra_doc_links)]
|
||||||
|
#![deny(clippy::all)]
|
||||||
#![deny(clippy::pedantic)]
|
#![deny(clippy::pedantic)]
|
||||||
#![allow(
|
#![allow(
|
||||||
clippy::unreadable_literal,
|
clippy::unreadable_literal,
|
||||||
|
@ -9,6 +9,8 @@ readme = "../README.md"
|
|||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
keywords = ["fuzzing", "testing"]
|
keywords = ["fuzzing", "testing"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"]
|
||||||
|
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["std", "sanitizers_flags"]
|
default = ["std", "sanitizers_flags"]
|
||||||
|
@ -43,7 +43,6 @@ pub use __afl_area_ptr as EDGES_MAP_PTR;
|
|||||||
///
|
///
|
||||||
/// This fn is safe to call, as long as the compilation diid not break, previously
|
/// This fn is safe to call, as long as the compilation diid not break, previously
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
#[must_use]
|
|
||||||
pub fn autotokens() -> Result<Tokens, Error> {
|
pub fn autotokens() -> Result<Tokens, Error> {
|
||||||
unsafe {
|
unsafe {
|
||||||
if __token_start.is_null() || __token_stop.is_null() {
|
if __token_start.is_null() || __token_stop.is_null() {
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
//!
|
//!
|
||||||
//!
|
//!
|
||||||
#![deny(rustdoc::broken_intra_doc_links)]
|
#![deny(rustdoc::broken_intra_doc_links)]
|
||||||
|
#![deny(clippy::all)]
|
||||||
#![deny(clippy::pedantic)]
|
#![deny(clippy::pedantic)]
|
||||||
#![allow(
|
#![allow(
|
||||||
clippy::unreadable_literal,
|
clippy::unreadable_literal,
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
cargo clippy --all --all-features --tests -- `
|
cargo clippy --all --all-features --tests -- `
|
||||||
|
-D clippy::all `
|
||||||
-D clippy::pedantic `
|
-D clippy::pedantic `
|
||||||
-W clippy::similar_names `
|
-W clippy::similar_names `
|
||||||
-A clippy::type_repetition_in_bounds `
|
-A clippy::type_repetition_in_bounds `
|
||||||
|
@ -9,6 +9,7 @@ if [ "$1" != "--no-clean" ]; then
|
|||||||
cargo clean -p libafl
|
cargo clean -p libafl
|
||||||
fi
|
fi
|
||||||
RUST_BACKTRACE=full cargo +nightly clippy --all --all-features --tests -- -Z macro-backtrace \
|
RUST_BACKTRACE=full cargo +nightly clippy --all --all-features --tests -- -Z macro-backtrace \
|
||||||
|
-D clippy::all \
|
||||||
-D clippy::pedantic \
|
-D clippy::pedantic \
|
||||||
-W clippy::similar_names \
|
-W clippy::similar_names \
|
||||||
-A clippy::type_repetition_in_bounds \
|
-A clippy::type_repetition_in_bounds \
|
||||||
|
@ -1,7 +1,15 @@
|
|||||||
[package]
|
[package]
|
||||||
|
authors = ["Andrea Fioraldi <andreafioraldi@gmail.com>", "Dominik Maier <domenukk@gmail.com>"]
|
||||||
name = "deexit"
|
name = "deexit"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
description = "DeExit: Replace exits with aborts to catch them during in-process fuzzing"
|
||||||
|
documentation = "https://docs.rs/libafl"
|
||||||
|
repository = "https://github.com/AFLplusplus/LibAFL/"
|
||||||
|
readme = "../../README.md"
|
||||||
|
license = "MIT OR Apache-2.0"
|
||||||
|
keywords = ["fuzzing", "libafl", "ldpreload"]
|
||||||
|
categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"]
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
@ -2,6 +2,15 @@
|
|||||||
name = "construct_automata"
|
name = "construct_automata"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
authors = ["Andrea Fioraldi <andreafioraldi@gmail.com>", "Dominik Maier <domenukk@gmail.com>"]
|
||||||
|
description = "LibAFL Gramatron Gramar Construction"
|
||||||
|
documentation = "https://docs.rs/libafl"
|
||||||
|
repository = "https://github.com/AFLplusplus/LibAFL/"
|
||||||
|
readme = "../../README.md"
|
||||||
|
license = "MIT OR Apache-2.0"
|
||||||
|
keywords = ["fuzzing", "libafl", "gramatron", "grammar"]
|
||||||
|
categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"]
|
||||||
|
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
@ -1,7 +1,15 @@
|
|||||||
[package]
|
[package]
|
||||||
|
authors = ["Andrea Fioraldi <andreafioraldi@gmail.com>", "Dominik Maier <domenukk@gmail.com>"]
|
||||||
name = "libafl_benches"
|
name = "libafl_benches"
|
||||||
version = "0.7.1"
|
version = "0.7.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
description = "LibAFL Benchmarks"
|
||||||
|
documentation = "https://docs.rs/libafl"
|
||||||
|
repository = "https://github.com/AFLplusplus/LibAFL/"
|
||||||
|
readme = "../../README.md"
|
||||||
|
license = "MIT OR Apache-2.0"
|
||||||
|
keywords = ["fuzzing", "libafl", "benchmarks"]
|
||||||
|
categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"]
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
criterion = "0.3" # Benchmarking
|
criterion = "0.3" # Benchmarking
|
||||||
|
Loading…
x
Reference in New Issue
Block a user