You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add fuzzing of FBDNS over UDP, TCP and TLS
Summary:
Adds native Go fuzz tests (`testing.F`) for the FBDNS server.
Each fuzz target starts a full in-process server (CDB test DB, DNSSEC, NSID, whoami, throttle, cache, CNAME chasing) and sends the fuzzed bytes over a real socket:
- `FuzzUDP`: one fuzzed datagram.
- `FuzzTCP`: a fuzzed raw TCP byte stream, so length framing and pipelining are fuzzed too.
- `FuzzTLS`: a fuzzed raw byte stream inside a DoT session.
After every input, the server must answer a valid probe query on the same transport. A panic anywhere in the serving path crashes the process (miekg/dns does not recover handler panics), and a hang or jammed throttle shows up as a probe timeout.
The seed corpus is added with `f.Add`, so the seeds also run as regular unit tests in `fbserver_test`.
`testaid.MkTestCert` now takes `testing.TB` and includes localhost SANs, so the TLS fuzzer can verify the server certificate instead of using `InsecureSkipVerify`.
Fuzzing a corrupted database is not covered here.
___
landed-with-radar-review
Differential Revision: D125733961
fbshipit-source-id: d82f22a50b6596a52cdaf3726aaf9712f54d01b3