# netstack fuzz targets Six cargo-fuzz-style binaries (smoke-testable as plain command-line tools when `cargo fuzz` is unavailable). The same input bytes are fed into the smoltcp parsers that netstack uses for the Ethernet, ARP, IPv4, ICMP, TCP, DHCP, and DNS protocols. Each binary reads the payload from `argv[1]` (base64-decoded by the test harness) and exercises both the `*_new_checked` (validated) and `*_new_unchecked` (raw) parsers. A panic in either path indicates a parser defect. | Binary | Parser | |-------------|--------------------------------------| | `fuzz_ethernet` | `EthernetFrame::new_checked/unchecked` | | `fuzz_arp` | `ArpPacket::new_checked/unchecked` | | `fuzz_icmp` | `Ipv4Packet::new_checked/unchecked` | | `fuzz_tcp` | `TcpPacket::new_checked/unchecked` | | `fuzz_dhcp` | walk Ethernet → IPv4 → UDP | | `fuzz_dns` | `UdpPacket::new_checked/unchecked` | Run with `cargo fuzz` (when the harness is configured) or directly: ```bash cargo run --bin fuzz_tcp -- ``` `[[bin]]` entries are in `netstack/Cargo.toml` so a plain `cargo build` will produce all six executables. They are no-ops for arbitrary input — any panic in this binary is a parser defect that needs a fix in the smoltcp upstream or a Red Bear defensive check.