Skip to content
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

Maybe fix CI #2768

Merged
merged 3 commits into from
Dec 15, 2024
Merged
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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ ahash = { version = "0.8.11", default-features = false } # The hash function alr
arbitrary-int = "1.2.7" # arbitrary sized integers, useful in combination with bitfields (bitbybit crate)
backtrace = { version = "0.3.74", default-features = false } # Used to get the stacktrace in StacktraceObserver
bindgen = "0.71.1"
bitbybit = "1.3.2" # bitfields, use this for bit fields and bit enums
bitbybit = "1.3.3" # bitfields, use this for bit fields and bit enums
clap = "4.5.18"
cc = "1.1.21"
cmake = "0.1.51"
Expand Down
77 changes: 41 additions & 36 deletions libafl/src/observers/cmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ use core::{
ops::{Deref, DerefMut},
};

use arbitrary_int::{u1, u4, u5, u6};
use bitbybit::bitfield;
use hashbrown::HashMap;
use libafl_bolts::{ownedref::OwnedRefMut, AsSlice, HasLen, Named};
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -405,40 +403,47 @@ impl AFLppCmpValuesMetadata {
}
}

/// Comparison header, used to describe a set of comparison values efficiently.
///
/// # Bitfields
///
/// - hits: The number of hits of a particular comparison
/// - id: Unused by ``LibAFL``, a unique ID for a particular comparison
/// - shape: Whether a comparison is u8/u8, u16/u16, etc.
/// - type_: Whether the comparison value represents an instruction (like a `cmp`) or function
/// call arguments
/// - attribute: OR-ed bitflags describing whether the comparison is <, >, =, <=, >=, or transform
/// - overflow: Whether the comparison overflows
/// - reserved: Reserved for future use
#[bitfield(u16)]
#[derive(Debug)]
pub struct AFLppCmpLogHeader {
/// The number of hits of a particular comparison
///
/// 6 bits up to 63 entries, we have CMP_MAP_H = 32 (so using half of it)
#[bits(0..=5, r)]
hits: u6,
/// Whether a comparison is u8/u8, u16/u16, etc.
///
/// 31 + 1 bytes max
#[bits(6..=10, r)]
shape: u5,
/// Whether the comparison value represents an instruction (like a `cmp`) or function call
/// arguments
#[allow(missing_docs)] // 2024-12-15: bitfield is leading CI to fail due to missing docs.
mod aflpp_cmplog_header {
use arbitrary_int::{u1, u4, u5, u6};
use bitbybit::bitfield;

/// Comparison header, used to describe a set of comparison values efficiently.
///
/// 2: cmp, rtn
#[bit(11, r)]
type_: u1,
/// OR-ed bitflags describing whether the comparison is <, >, =, <=, >=, or transform
/// # Bitfields
///
/// 16 types for arithmetic comparison types
#[bits(12..=15, r)]
attribute: u4,
/// - hits: The number of hits of a particular comparison
/// - id: Unused by ``LibAFL``, a unique ID for a particular comparison
/// - shape: Whether a comparison is u8/u8, u16/u16, etc.
/// - type_: Whether the comparison value represents an instruction (like a `cmp`) or function
/// call arguments
/// - attribute: OR-ed bitflags describing whether the comparison is <, >, =, <=, >=, or transform
/// - overflow: Whether the comparison overflows
/// - reserved: Reserved for future use
#[bitfield(u16)]
#[derive(Debug)]
pub struct AFLppCmpLogHeader {
/// The number of hits of a particular comparison
///
/// 6 bits up to 63 entries, we have CMP_MAP_H = 32 (so using half of it)
#[bits(0..=5, r)]
hits: u6,
/// Whether a comparison is u8/u8, u16/u16, etc.
///
/// 31 + 1 bytes max
#[bits(6..=10, r)]
shape: u5,
/// Whether the comparison value represents an instruction (like a `cmp`) or function call
/// arguments
///
/// 2: cmp, rtn
#[bit(11, r)]
type_: u1,
/// OR-ed bitflags describing whether the comparison is <, >, =, <=, >=, or transform
///
/// 16 types for arithmetic comparison types
#[bits(12..=15, r)]
attribute: u4,
}
}
pub use aflpp_cmplog_header::AFLppCmpLogHeader;
1 change: 1 addition & 0 deletions libafl_intelpt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,7 @@ impl IntelPTBuilder {
/// Perf event config for `IntelPT`
///
/// (This is almost mapped to `IA32_RTIT_CTL MSR` by perf)
#[allow(missing_docs)] // 2024-12-15: bitfield is leading CI to fail due to missing docs.
#[cfg(target_os = "linux")]
#[bitfield(u64, default = 0)]
struct PtConfig {
Expand Down
Loading