What the code-health review found, and what a fuzz target written for it
found in its first seconds.
- A set of attributes with the same attribute twice is refused by the
routing table. Its readers (the selection key, the path, the next hop)
could each take a different one of the two. The decoder never lets one
through; the new fuzz target `attrs` found that the table would.
- bgp_peer_up{peer}, to alert on a peer going away, and bgp_build_info.
Every metric is there from the first scrape. Alerts for a peer down,
hijack attempts and kernel errors are in the README.
- `bgp --check config` validates a configuration without starting, and
`--version` says which build it is. CI runs the first on the example
configuration, which a test now also parses with its commented fields
put in; the example had to learn about the next hop check.
- Path attributes have a module of their own, packet::attributes,
re-exported from packet::message as before.
- policy::From, which shadowed the trait, is RouteSource. The server's
connection, dialer and fsm modules are private. Logging arguments live
in the binary; the server library no longer depends on clap.
- One is_unicast_link_local (the standard library's) instead of two of
our own; SelectionKey::origin(); one place where an Import is made.
- READMEs say what the daemon does today rather than what it did not do
a year ago. Documentation links are checked in CI. Unused dependencies
and bgp_web::serve are gone; the Docker build is --locked and does not
ship the fuzz corpus.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
79 lines
1.4 KiB
TOML
79 lines
1.4 KiB
TOML
# Coverage-guided fuzz targets, run with cargo-fuzz on a nightly toolchain.
|
|
# See README.md in this directory.
|
|
[package]
|
|
name = "bgp-fuzz"
|
|
version = "0.0.0"
|
|
edition = "2024"
|
|
license = "Apache-2.0"
|
|
publish = false
|
|
|
|
[package.metadata]
|
|
cargo-fuzz = true
|
|
|
|
# Not part of the main workspace: libfuzzer needs nightly, the workspace
|
|
# builds on stable.
|
|
[workspace]
|
|
|
|
[dependencies]
|
|
bgp-packet = { path = "../crates/packet" }
|
|
bgp-primitives = { path = "../crates/primitives" }
|
|
bgp-fib = { path = "../crates/fib" }
|
|
bgp-rib = { path = "../crates/rib" }
|
|
bgp-rpki = { path = "../crates/rpki" }
|
|
bgp-server = { path = "../crates/server" }
|
|
bytes = "1.10.1"
|
|
libfuzzer-sys = "0.4"
|
|
protobuf = "3.7.2"
|
|
|
|
[lib]
|
|
path = "src/lib.rs"
|
|
|
|
[[bin]]
|
|
name = "attrs"
|
|
path = "fuzz_targets/attrs.rs"
|
|
test = false
|
|
doc = false
|
|
bench = false
|
|
|
|
[[bin]]
|
|
name = "message"
|
|
path = "fuzz_targets/message.rs"
|
|
test = false
|
|
doc = false
|
|
bench = false
|
|
|
|
[[bin]]
|
|
name = "message_body"
|
|
path = "fuzz_targets/message_body.rs"
|
|
test = false
|
|
doc = false
|
|
bench = false
|
|
|
|
[[bin]]
|
|
name = "prefix_text"
|
|
path = "fuzz_targets/prefix_text.rs"
|
|
test = false
|
|
doc = false
|
|
bench = false
|
|
|
|
[[bin]]
|
|
name = "config"
|
|
path = "fuzz_targets/config.rs"
|
|
test = false
|
|
doc = false
|
|
bench = false
|
|
|
|
[[bin]]
|
|
name = "rtr"
|
|
path = "fuzz_targets/rtr.rs"
|
|
test = false
|
|
doc = false
|
|
bench = false
|
|
|
|
[[bin]]
|
|
name = "netlink"
|
|
path = "fuzz_targets/netlink.rs"
|
|
test = false
|
|
doc = false
|
|
bench = false
|