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
Don't crash on a root DS query when the root has NS but no SOA
Summary:
A single `. IN DS` query could crash fbdns when the served data has NS records for the root name but no root SOA. For a DS query, `ServeDNSWithRCODE` pops one label to look up the parent zone. The root name has no label to pop, so that lookup got an empty name, which both readers index (`zoneCut[0]` in `db/answer.go`, `reverseZoneNameToBuffer` in `db/answer_sorted.go`). Nothing on the serving path recovers the panic, so the process exited.
The DS branch now skips the parent lookup for the root name. The query gets a referral to the root NS (NOERROR, AA clear), the same answer fbdns gives for other names it has NS records for but is not authoritative for. DS queries for other names are unchanged.
The test compiles its own small database with the new `testaid.CompileTestDBs`, because root NS records in the shared fixture would turn other tests' REFUSED answers into referrals.
Reviewed By: avasylev
Differential Revision: D132480160
fbshipit-source-id: 8ee456a523272901b0c52d25d18ec56c5ac9460c