-
Notifications
You must be signed in to change notification settings - Fork 168
Open
Labels
A-coreArea: Core tierArea: Core tierfuzzingCrashs and other bugs found by fuzzingCrashs and other bugs found by fuzzing
Description
Provide arbitrary::Arbitrary (derive or manual impl) for a first batch of PDUs so structured fuzzing can start.
Approach
- Prefer
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]for simple types - Use manual
impl Arbitraryfor types with invariants (length fields, constraints, dependent fields) - Bias toward “mostly valid” generation so fuzzing reaches deeper logic
- Add a
generators::AnyPdu(or similar) enum used by fuzz targets which can produce a curated set of PDUs
Add Arbitrary derivations (or manual impls)
For most “plain data” structs/enums:
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct SomePdu { /* … */ }Handle invariants (manual Arbitrary where needed)
Some PDUs have constraints that derive(Arbitrary) can’t express well (length fields, restricted enums, “must be non-empty”, etc.). In those cases:
- either implement
Arbitrarymanually and reject invalid values by returningErr(arbitrary::Error::IncorrectFormat), - or generate a “raw” value and then sanitize it (clamp lengths, fix flags, etc.).
The goal is: generated PDUs should be “mostly valid”, so we reach deeper code paths (not fail immediately on trivial validation).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-coreArea: Core tierArea: Core tierfuzzingCrashs and other bugs found by fuzzingCrashs and other bugs found by fuzzing