From 7dad2153e28b412567583334d506e2e099bad09b Mon Sep 17 00:00:00 2001 From: Dominik Maier Date: Fri, 11 Feb 2022 14:34:01 +0100 Subject: [PATCH] Clippy for Cargo (#532) * Clippy for Cargo * clippy fixes * clippy fixes * edition * fix * wrong self hidden * fix * more clippy --- fuzzers/libfuzzer_stb_image_sugar/Cargo.toml | 1 + libafl/Cargo.toml | 3 +- libafl/src/bolts/llmp.rs | 36 +++++++++++++++---- libafl/src/executors/forkserver.rs | 29 ++++++++------- libafl/src/executors/inprocess.rs | 4 +++ libafl/src/feedbacks/concolic.rs | 1 + libafl/src/feedbacks/differential.rs | 3 +- libafl/src/feedbacks/map.rs | 2 ++ libafl/src/feedbacks/mod.rs | 9 +++++ libafl/src/feedbacks/nautilus.rs | 1 + libafl/src/feedbacks/new_hash_feedback.rs | 1 + libafl/src/lib.rs | 3 ++ libafl/src/mutators/token_mutations.rs | 11 +++--- libafl_cc/Cargo.toml | 1 + libafl_cc/src/lib.rs | 1 + libafl_concolic/symcc_libafl/Cargo.toml | 1 + libafl_concolic/symcc_runtime/Cargo.toml | 1 + .../symcc_runtime/src/filter/coverage.rs | 1 + .../test/dump_constraints/Cargo.toml | 7 ++++ .../test/dump_constraints/src/main.rs | 4 +-- libafl_concolic/test/runtime_test/Cargo.toml | 7 ++++ libafl_derive/Cargo.toml | 1 + libafl_derive/src/lib.rs | 1 + libafl_frida/Cargo.toml | 2 +- libafl_frida/src/asan/errors.rs | 1 + libafl_frida/src/lib.rs | 1 + libafl_qemu/Cargo.toml | 1 + libafl_sugar/Cargo.toml | 1 + libafl_sugar/src/lib.rs | 1 + libafl_targets/Cargo.toml | 2 ++ libafl_targets/src/coverage.rs | 1 - libafl_targets/src/lib.rs | 1 + scripts/clippy.ps1 | 1 + scripts/clippy.sh | 1 + utils/deexit/Cargo.toml | 8 +++++ utils/gramatron/construct_automata/Cargo.toml | 9 +++++ utils/libafl_benches/Cargo.toml | 8 +++++ 37 files changed, 138 insertions(+), 29 deletions(-) diff --git a/fuzzers/libfuzzer_stb_image_sugar/Cargo.toml b/fuzzers/libfuzzer_stb_image_sugar/Cargo.toml index ec81feafc3..b81ae8d185 100644 --- a/fuzzers/libfuzzer_stb_image_sugar/Cargo.toml +++ b/fuzzers/libfuzzer_stb_image_sugar/Cargo.toml @@ -4,6 +4,7 @@ version = "0.7.1" authors = ["Andrea Fioraldi ", "Dominik Maier "] edition = "2021" build = "build.rs" +categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"] [features] default = ["std"] diff --git a/libafl/Cargo.toml b/libafl/Cargo.toml index b72859f1b6..123de8f83a 100644 --- a/libafl/Cargo.toml +++ b/libafl/Cargo.toml @@ -9,6 +9,7 @@ readme = "../README.md" license = "MIT OR Apache-2.0" keywords = ["fuzzing", "testing", "security"] edition = "2021" +categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"] [features] 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 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 } 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. diff --git a/libafl/src/bolts/llmp.rs b/libafl/src/bolts/llmp.rs index 2838ac9fd6..6cf7cb4d00 100644 --- a/libafl/src/bolts/llmp.rs +++ b/libafl/src/bolts/llmp.rs @@ -206,6 +206,14 @@ impl TryFrom<&Vec> for TcpRequest { } } +impl TryFrom> for TcpRequest { + type Error = Error; + + fn try_from(bytes: Vec) -> Result { + Ok(postcard::from_bytes(&bytes)?) + } +} + /// Messages for broker 2 broker connection. #[derive(Serialize, Deserialize, Debug, Clone)] pub struct TcpRemoteNewMessage { @@ -227,6 +235,14 @@ impl TryFrom<&Vec> for TcpRemoteNewMessage { } } +impl TryFrom> for TcpRemoteNewMessage { + type Error = Error; + + fn try_from(bytes: Vec) -> Result { + Ok(postcard::from_bytes(&bytes)?) + } +} + /// Responses for requests to the server. #[derive(Serialize, Deserialize, Debug, Clone)] pub enum TcpResponse { @@ -263,6 +279,14 @@ impl TryFrom<&Vec> for TcpResponse { } } +impl TryFrom> for TcpResponse { + type Error = Error; + + fn try_from(bytes: Vec) -> Result { + Ok(postcard::from_bytes(&bytes)?) + } +} + /// Abstraction for listeners #[cfg(feature = "std")] #[derive(Debug)] @@ -1830,7 +1854,7 @@ where let mut stream = TcpStream::connect(addr)?; println!("B2B: Connected to {:?}", stream); - match (&recv_tcp_msg(&mut stream)?).try_into()? { + match recv_tcp_msg(&mut stream)?.try_into()? { TcpResponse::BrokerConnectHello { broker_shmem_description: _, hostname, @@ -1849,7 +1873,7 @@ where 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 } => { println!("B2B: Got Connection Ack, broker_id {}", broker_id); broker_id @@ -2106,7 +2130,7 @@ where // We ignore errors completely as they may be timeout, or stream closings. // Instead, we catch stream close when/if we next try to send. 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.", ); @@ -2267,7 +2291,7 @@ where continue; } }; - let req = match (&buf).try_into() { + let req = match buf.try_into() { Ok(req) => req, Err(e) => { eprintln!("Could not deserialize tcp message: {:?}", e); @@ -2653,7 +2677,7 @@ where let broker_shmem_description = if let TcpResponse::BrokerConnectHello { broker_shmem_description, hostname: _, - } = (&recv_tcp_msg(&mut stream)?).try_into()? + } = recv_tcp_msg(&mut stream)?.try_into()? { broker_shmem_description } else { @@ -2674,7 +2698,7 @@ where send_tcp_msg(&mut stream, &client_hello_req)?; 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 } else { diff --git a/libafl/src/executors/forkserver.rs b/libafl/src/executors/forkserver.rs index 927966c751..aeea0cd44b 100644 --- a/libafl/src/executors/forkserver.rs +++ b/libafl/src/executors/forkserver.rs @@ -621,12 +621,12 @@ impl<'a, SP> ForkserverExecutorBuilder<'a, SP> { if (status & FS_OPT_SHDMEM_FUZZ == FS_OPT_SHDMEM_FUZZ) && map.is_some() { 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() { println!("Using AUTODICT feature"); - send_status = send_status | FS_OPT_AUTODICT; + send_status |= FS_OPT_AUTODICT; } 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( "Dictionary has an illegal size".to_string(), )); @@ -782,8 +782,7 @@ impl<'a> ForkserverExecutorBuilder<'a, StdShMemProvider> { #[must_use] /// Place the input at this position and set the default filename for the input. pub fn arg_input_file_std(self) -> Self { - let moved = self.arg_input_file(OUTFILE_STD); - moved + self.arg_input_file(OUTFILE_STD) } #[must_use] @@ -800,17 +799,15 @@ impl<'a> ForkserverExecutorBuilder<'a, StdShMemProvider> { if item.as_ref() == "@@" && use_stdin { use_stdin = false; res.push(OsString::from(".cur_input")); - } else { - if let Some(name) = &self.out_filename { - if name == item.as_ref() && use_stdin { - use_stdin = false; - res.push(name.clone()); - } else { - res.push(item.as_ref().to_os_string()); - } + } else if let Some(name) = &self.out_filename { + if name == item.as_ref() && use_stdin { + use_stdin = false; + res.push(name.clone()); } else { 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 Executor for ForkserverExecutor where I: Input + HasTargetBytes, diff --git a/libafl/src/executors/inprocess.rs b/libafl/src/executors/inprocess.rs index 07341b7394..aa01a31d9d 100644 --- a/libafl/src/executors/inprocess.rs +++ b/libafl/src/executors/inprocess.rs @@ -1571,6 +1571,10 @@ pub mod child_signal_handlers { } /// 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)] pub unsafe fn child_crash_handler( _signal: Signal, diff --git a/libafl/src/feedbacks/concolic.rs b/libafl/src/feedbacks/concolic.rs index be14d418c0..ce74bafed1 100644 --- a/libafl/src/feedbacks/concolic.rs +++ b/libafl/src/feedbacks/concolic.rs @@ -51,6 +51,7 @@ where I: Input, S: HasClientPerfMonitor, { + #[allow(clippy::wrong_self_convention)] fn is_interesting( &mut self, _state: &mut S, diff --git a/libafl/src/feedbacks/differential.rs b/libafl/src/feedbacks/differential.rs index e7cc96692e..db2c23887c 100644 --- a/libafl/src/feedbacks/differential.rs +++ b/libafl/src/feedbacks/differential.rs @@ -123,6 +123,7 @@ where O1: Observer + PartialEq, O2: Observer, { + #[allow(clippy::wrong_self_convention)] fn is_interesting( &mut self, _state: &mut S, @@ -176,7 +177,7 @@ mod tests { fn new(name: &str, value: bool) -> Self { Self { name: name.to_string(), - value: value, + value, } } } diff --git a/libafl/src/feedbacks/map.rs b/libafl/src/feedbacks/map.rs index c49fc4e388..e519de2e1f 100644 --- a/libafl/src/feedbacks/map.rs +++ b/libafl/src/feedbacks/map.rs @@ -373,6 +373,7 @@ where I: Input, S: HasFeedbackStates + HasClientPerfMonitor + Debug, { + #[allow(clippy::wrong_self_convention)] fn is_interesting( &mut self, state: &mut S, @@ -599,6 +600,7 @@ where O: MapObserver, S: HasClientPerfMonitor, { + #[allow(clippy::wrong_self_convention)] fn is_interesting( &mut self, _state: &mut S, diff --git a/libafl/src/feedbacks/mod.rs b/libafl/src/feedbacks/mod.rs index e60a0fd49e..21c66ec974 100644 --- a/libafl/src/feedbacks/mod.rs +++ b/libafl/src/feedbacks/mod.rs @@ -52,6 +52,7 @@ where S: HasClientPerfMonitor, { /// `is_interesting ` return if an input is worth the addition to the corpus + #[allow(clippy::wrong_self_convention)] fn is_interesting( &mut self, state: &mut S, @@ -68,6 +69,7 @@ where /// It also keeps track of introspection stats. #[cfg(feature = "introspection")] #[allow(clippy::too_many_arguments)] + #[allow(clippy::wrong_self_convention)] fn is_interesting_introspection( &mut self, state: &mut S, @@ -205,6 +207,7 @@ where I: Input, S: HasClientPerfMonitor + Debug, { + #[allow(clippy::wrong_self_convention)] fn is_interesting( &mut self, state: &mut S, @@ -229,6 +232,7 @@ where } #[cfg(feature = "introspection")] + #[allow(clippy::wrong_self_convention)] fn is_interesting_introspection( &mut self, state: &mut S, @@ -592,6 +596,7 @@ where I: Input, S: HasClientPerfMonitor, { + #[allow(clippy::wrong_self_convention)] fn is_interesting( &mut self, state: &mut S, @@ -707,6 +712,7 @@ where I: Input, S: HasClientPerfMonitor, { + #[allow(clippy::wrong_self_convention)] fn is_interesting( &mut self, _state: &mut S, @@ -739,6 +745,7 @@ where I: Input, S: HasClientPerfMonitor, { + #[allow(clippy::wrong_self_convention)] fn is_interesting( &mut self, _state: &mut S, @@ -789,6 +796,7 @@ where I: Input, S: HasClientPerfMonitor, { + #[allow(clippy::wrong_self_convention)] fn is_interesting( &mut self, _state: &mut S, @@ -844,6 +852,7 @@ where I: Input, S: HasClientPerfMonitor, { + #[allow(clippy::wrong_self_convention)] fn is_interesting( &mut self, _state: &mut S, diff --git a/libafl/src/feedbacks/nautilus.rs b/libafl/src/feedbacks/nautilus.rs index 3ec3608bf4..2c189cb94f 100644 --- a/libafl/src/feedbacks/nautilus.rs +++ b/libafl/src/feedbacks/nautilus.rs @@ -78,6 +78,7 @@ impl<'a, S> Feedback for NautilusFeedback<'a> where S: HasMetadata + HasClientPerfMonitor, { + #[allow(clippy::wrong_self_convention)] fn is_interesting( &mut self, _state: &mut S, diff --git a/libafl/src/feedbacks/new_hash_feedback.rs b/libafl/src/feedbacks/new_hash_feedback.rs index ce6c0eae42..253b4ab89c 100644 --- a/libafl/src/feedbacks/new_hash_feedback.rs +++ b/libafl/src/feedbacks/new_hash_feedback.rs @@ -113,6 +113,7 @@ where S: HasClientPerfMonitor + HasFeedbackStates, O: ObserverWithHashField + Named + Debug, { + #[allow(clippy::wrong_self_convention)] fn is_interesting( &mut self, _state: &mut S, diff --git a/libafl/src/lib.rs b/libafl/src/lib.rs index 07151e6a0a..026035a560 100644 --- a/libafl/src/lib.rs +++ b/libafl/src/lib.rs @@ -8,7 +8,10 @@ Welcome to `LibAFL` #![cfg_attr(unstable_feature, feature(specialization))] // For `type_id` and owned things #![cfg_attr(unstable_feature, feature(intrinsics))] +#![warn(clippy::cargo)] +#![deny(clippy::cargo_common_metadata)] #![deny(rustdoc::broken_intra_doc_links)] +#![deny(clippy::all)] #![deny(clippy::pedantic)] #![allow( clippy::unreadable_literal, diff --git a/libafl/src/mutators/token_mutations.rs b/libafl/src/mutators/token_mutations.rs index bf0d8b7ffc..04df38c52e 100644 --- a/libafl/src/mutators/token_mutations.rs +++ b/libafl/src/mutators/token_mutations.rs @@ -5,13 +5,13 @@ use crate::mutators::str_decode; #[cfg(target_os = "linux")] use alloc::string::ToString; use alloc::vec::Vec; +#[cfg(target_os = "linux")] +use core::slice::from_raw_parts; use core::slice::Iter; use core::{ mem::size_of, ops::{Add, AddAssign}, }; -#[cfg(target_os = "linux")] -use core::{ptr::null, slice::from_raw_parts}; use hashbrown::HashSet; use serde::{Deserialize, Serialize}; #[cfg(feature = "std")] @@ -102,11 +102,14 @@ impl Tokens { /// Create a token section from a start and an end pointer /// 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")] pub unsafe fn from_ptrs(token_start: *const u8, token_stop: *const u8) -> Result { 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())); } if token_stop <= token_start { diff --git a/libafl_cc/Cargo.toml b/libafl_cc/Cargo.toml index f106d366c1..baa90358ce 100644 --- a/libafl_cc/Cargo.toml +++ b/libafl_cc/Cargo.toml @@ -9,6 +9,7 @@ readme = "../README.md" license = "MIT OR Apache-2.0" keywords = ["fuzzing", "testing", "compiler"] 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 diff --git a/libafl_cc/src/lib.rs b/libafl_cc/src/lib.rs index 910e9887d3..c7a713736d 100644 --- a/libafl_cc/src/lib.rs +++ b/libafl_cc/src/lib.rs @@ -1,6 +1,7 @@ //! Compiler Wrapper from `LibAFL` #![deny(rustdoc::broken_intra_doc_links)] +#![deny(clippy::all)] #![deny(clippy::pedantic)] #![allow( clippy::unreadable_literal, diff --git a/libafl_concolic/symcc_libafl/Cargo.toml b/libafl_concolic/symcc_libafl/Cargo.toml index 07a08cd776..60adc34d68 100644 --- a/libafl_concolic/symcc_libafl/Cargo.toml +++ b/libafl_concolic/symcc_libafl/Cargo.toml @@ -9,6 +9,7 @@ repository = "https://github.com/AFLplusplus/LibAFL/" readme = "README.md" license = "MIT OR Apache-2.0" 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 diff --git a/libafl_concolic/symcc_runtime/Cargo.toml b/libafl_concolic/symcc_runtime/Cargo.toml index 683c872a0b..7f0a68d784 100644 --- a/libafl_concolic/symcc_runtime/Cargo.toml +++ b/libafl_concolic/symcc_runtime/Cargo.toml @@ -10,6 +10,7 @@ readme = "README.md" license = "MIT OR Apache-2.0" keywords = ["fuzzing", "testing", "security"] 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 diff --git a/libafl_concolic/symcc_runtime/src/filter/coverage.rs b/libafl_concolic/symcc_runtime/src/filter/coverage.rs index 6e478d1353..8089c5ffbe 100644 --- a/libafl_concolic/symcc_runtime/src/filter/coverage.rs +++ b/libafl_concolic/symcc_runtime/src/filter/coverage.rs @@ -70,6 +70,7 @@ impl CallStackCoverage bool { self.is_interesting } diff --git a/libafl_concolic/test/dump_constraints/Cargo.toml b/libafl_concolic/test/dump_constraints/Cargo.toml index 876a7c24bc..1d7a06ce39 100644 --- a/libafl_concolic/test/dump_constraints/Cargo.toml +++ b/libafl_concolic/test/dump_constraints/Cargo.toml @@ -3,6 +3,13 @@ name = "dump_constraints" version = "0.1.0" edition = "2021" authors = ["Julius Hohnerlein "] +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 diff --git a/libafl_concolic/test/dump_constraints/src/main.rs b/libafl_concolic/test/dump_constraints/src/main.rs index 116ea7ad97..17ba3760b7 100644 --- a/libafl_concolic/test/dump_constraints/src/main.rs +++ b/libafl_concolic/test/dump_constraints/src/main.rs @@ -112,7 +112,7 @@ fn main() { .enumerate() .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 { while let Some(message) = reader.next_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"); } else { break; diff --git a/libafl_concolic/test/runtime_test/Cargo.toml b/libafl_concolic/test/runtime_test/Cargo.toml index e35b7a5a90..6ef0bbb516 100644 --- a/libafl_concolic/test/runtime_test/Cargo.toml +++ b/libafl_concolic/test/runtime_test/Cargo.toml @@ -3,6 +3,13 @@ name = "runtime_test" version = "0.1.0" edition = "2021" authors = ["Julius Hohnerlein "] +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] crate-type = ["cdylib"] diff --git a/libafl_derive/Cargo.toml b/libafl_derive/Cargo.toml index 192fc836b6..e196f8703b 100644 --- a/libafl_derive/Cargo.toml +++ b/libafl_derive/Cargo.toml @@ -9,6 +9,7 @@ readme = "../README.md" license = "MIT OR Apache-2.0" keywords = ["fuzzing", "testing"] edition = "2021" +categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"] [lib] proc-macro = true diff --git a/libafl_derive/src/lib.rs b/libafl_derive/src/lib.rs index 758fcecdcf..8c764c5f53 100644 --- a/libafl_derive/src/lib.rs +++ b/libafl_derive/src/lib.rs @@ -1,6 +1,7 @@ //! Derives for `LibAFL` #![deny(rustdoc::broken_intra_doc_links)] +#![deny(clippy::all)] #![deny(clippy::pedantic)] #![allow( clippy::unreadable_literal, diff --git a/libafl_frida/Cargo.toml b/libafl_frida/Cargo.toml index 93be32e45a..805e1d3cc8 100644 --- a/libafl_frida/Cargo.toml +++ b/libafl_frida/Cargo.toml @@ -9,7 +9,7 @@ readme = "../README.md" license = "MIT OR Apache-2.0" keywords = ["fuzzing", "frida", "instrumentation"] edition = "2021" - +categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"] [features] default = [] diff --git a/libafl_frida/src/asan/errors.rs b/libafl_frida/src/asan/errors.rs index 6422c4526e..c32e42af1b 100644 --- a/libafl_frida/src/asan/errors.rs +++ b/libafl_frida/src/asan/errors.rs @@ -615,6 +615,7 @@ where I: Input + HasTargetBytes, S: HasClientPerfMonitor, { + #[allow(clippy::wrong_self_convention)] fn is_interesting( &mut self, _state: &mut S, diff --git a/libafl_frida/src/lib.rs b/libafl_frida/src/lib.rs index 706c4b7c60..36a7caa8f4 100644 --- a/libafl_frida/src/lib.rs +++ b/libafl_frida/src/lib.rs @@ -4,6 +4,7 @@ It can report coverage and, on supported architecutres, even reports memory acce */ #![deny(rustdoc::broken_intra_doc_links)] +#![deny(clippy::all)] #![deny(clippy::pedantic)] #![allow( clippy::unreadable_literal, diff --git a/libafl_qemu/Cargo.toml b/libafl_qemu/Cargo.toml index 488dd4c253..7773c35344 100644 --- a/libafl_qemu/Cargo.toml +++ b/libafl_qemu/Cargo.toml @@ -9,6 +9,7 @@ readme = "../README.md" license = "MIT OR Apache-2.0" keywords = ["fuzzing", "qemu", "instrumentation"] edition = "2021" +categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"] [features] python = ["pyo3", "pyo3-build-config"] diff --git a/libafl_sugar/Cargo.toml b/libafl_sugar/Cargo.toml index 50c63d6937..a58c7a004b 100644 --- a/libafl_sugar/Cargo.toml +++ b/libafl_sugar/Cargo.toml @@ -10,6 +10,7 @@ license = "MIT OR Apache-2.0" keywords = ["fuzzing"] edition = "2021" build = "build.rs" +categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"] [features] python = ["pyo3", "libafl_qemu/python", "pyo3-build-config"] diff --git a/libafl_sugar/src/lib.rs b/libafl_sugar/src/lib.rs index 95ca78811e..30962e69f0 100644 --- a/libafl_sugar/src/lib.rs +++ b/libafl_sugar/src/lib.rs @@ -1,6 +1,7 @@ //! Sugar API to simplify the life of the naive user of `LibAFL` #![deny(rustdoc::broken_intra_doc_links)] +#![deny(clippy::all)] #![deny(clippy::pedantic)] #![allow( clippy::unreadable_literal, diff --git a/libafl_targets/Cargo.toml b/libafl_targets/Cargo.toml index fb206c9f46..c4db74f117 100644 --- a/libafl_targets/Cargo.toml +++ b/libafl_targets/Cargo.toml @@ -9,6 +9,8 @@ readme = "../README.md" license = "MIT OR Apache-2.0" keywords = ["fuzzing", "testing"] edition = "2021" +categories = ["development-tools::testing", "emulators", "embedded", "os", "no-std"] + [features] default = ["std", "sanitizers_flags"] diff --git a/libafl_targets/src/coverage.rs b/libafl_targets/src/coverage.rs index 947eaf8e1a..a83e7c0e2a 100644 --- a/libafl_targets/src/coverage.rs +++ b/libafl_targets/src/coverage.rs @@ -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 #[cfg(target_os = "linux")] -#[must_use] pub fn autotokens() -> Result { unsafe { if __token_start.is_null() || __token_stop.is_null() { diff --git a/libafl_targets/src/lib.rs b/libafl_targets/src/lib.rs index e07a81ef17..e433f58649 100644 --- a/libafl_targets/src/lib.rs +++ b/libafl_targets/src/lib.rs @@ -2,6 +2,7 @@ //! //! #![deny(rustdoc::broken_intra_doc_links)] +#![deny(clippy::all)] #![deny(clippy::pedantic)] #![allow( clippy::unreadable_literal, diff --git a/scripts/clippy.ps1 b/scripts/clippy.ps1 index 1e029136e9..2f832d67d6 100644 --- a/scripts/clippy.ps1 +++ b/scripts/clippy.ps1 @@ -1,4 +1,5 @@ cargo clippy --all --all-features --tests -- ` + -D clippy::all ` -D clippy::pedantic ` -W clippy::similar_names ` -A clippy::type_repetition_in_bounds ` diff --git a/scripts/clippy.sh b/scripts/clippy.sh index 0ae23a5619..ad46516241 100755 --- a/scripts/clippy.sh +++ b/scripts/clippy.sh @@ -9,6 +9,7 @@ if [ "$1" != "--no-clean" ]; then cargo clean -p libafl fi RUST_BACKTRACE=full cargo +nightly clippy --all --all-features --tests -- -Z macro-backtrace \ + -D clippy::all \ -D clippy::pedantic \ -W clippy::similar_names \ -A clippy::type_repetition_in_bounds \ diff --git a/utils/deexit/Cargo.toml b/utils/deexit/Cargo.toml index 29b8ee335b..108ba49a83 100644 --- a/utils/deexit/Cargo.toml +++ b/utils/deexit/Cargo.toml @@ -1,7 +1,15 @@ [package] +authors = ["Andrea Fioraldi ", "Dominik Maier "] name = "deexit" version = "0.1.0" 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 diff --git a/utils/gramatron/construct_automata/Cargo.toml b/utils/gramatron/construct_automata/Cargo.toml index fccd5cf076..c2b1e70852 100644 --- a/utils/gramatron/construct_automata/Cargo.toml +++ b/utils/gramatron/construct_automata/Cargo.toml @@ -2,6 +2,15 @@ name = "construct_automata" version = "0.1.0" edition = "2021" +authors = ["Andrea Fioraldi ", "Dominik Maier "] +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 diff --git a/utils/libafl_benches/Cargo.toml b/utils/libafl_benches/Cargo.toml index a7c317c21a..92162acca0 100644 --- a/utils/libafl_benches/Cargo.toml +++ b/utils/libafl_benches/Cargo.toml @@ -1,7 +1,15 @@ [package] +authors = ["Andrea Fioraldi ", "Dominik Maier "] name = "libafl_benches" version = "0.7.1" 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] criterion = "0.3" # Benchmarking