[PR #2849] [MERGED] Encapsulate type bit maps, save original encoding, and improve fuzzer #3369

Closed
opened 2026-03-16 11:39:50 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hickory-dns/hickory-dns/pull/2849
Author: @divergentdave
Created: 3/13/2025
Status: Merged
Merged: 3/17/2025
Merged by: @djc

Base: mainHead: david/fuzzing


📝 Commits (8)

  • 82b72a8 Un-ignore CSYNC in fuzzer
  • 61b59bb Move BitMapReadState down
  • f15d4cc Add RecordTypeSet struct
  • fddf16e Store original encoding of type bit maps
  • be528a7 Implement BinEncodable for RecordTypeSet
  • d38f6e8 Implement RecordDataDecodable for RecordTypeSet
  • 86502e7 Enable DNSSEC in fuzzer target
  • 22083d2 Compare records with pretty_assertions in fuzzer

📊 Changes

11 files changed (+705 additions, -242 deletions)

View changed files

📝 crates/proto/src/dnssec/rdata/nsec.rs (+26 -18)
📝 crates/proto/src/dnssec/rdata/nsec3.rs (+37 -18)
📝 crates/proto/src/rr/mod.rs (+2 -1)
📝 crates/proto/src/rr/rdata/csync.rs (+34 -15)
📝 crates/proto/src/rr/type_bit_map.rs (+236 -159)
📝 crates/proto/src/serialize/txt/parse_rdata.rs (+3 -2)
📝 crates/proto/src/serialize/txt/rdata_parsers/csync.rs (+4 -4)
📝 crates/server/src/store/in_memory/authority.rs (+5 -5)
📝 fuzz/Cargo.lock (+354 -3)
📝 fuzz/Cargo.toml (+2 -1)
📝 fuzz/fuzz_targets/message.rs (+2 -16)

📄 Description

This PR encapsulates type bit maps handling in a new struct. This stores record types in a sorted data structure, and saves the original encoding, if available, to be reused when emitting the record again.

In the fuzzer, CSYNC records are no longer ignored, and all DNSSEC records are now included, thanks to enabling the dnssec-aws-lc-rs Cargo feature. I replaced the line-based comparison printed upon failure with the pretty_assertions crate, which also provides context and ANSI color codes.

I've been running the fuzzer for about half an hour with this fix, and so far I haven't found any more round trip issues.

This closes #2815.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hickory-dns/hickory-dns/pull/2849 **Author:** [@divergentdave](https://github.com/divergentdave) **Created:** 3/13/2025 **Status:** ✅ Merged **Merged:** 3/17/2025 **Merged by:** [@djc](https://github.com/djc) **Base:** `main` ← **Head:** `david/fuzzing` --- ### 📝 Commits (8) - [`82b72a8`](https://github.com/hickory-dns/hickory-dns/commit/82b72a85b845a90c25eec87e3e25c58ed70b6b72) Un-ignore CSYNC in fuzzer - [`61b59bb`](https://github.com/hickory-dns/hickory-dns/commit/61b59bb06b12a1f5a6a6e10541bb126cc0e8201f) Move BitMapReadState down - [`f15d4cc`](https://github.com/hickory-dns/hickory-dns/commit/f15d4cc478051c7fdda63ee5a9eefa504b9c61eb) Add RecordTypeSet struct - [`fddf16e`](https://github.com/hickory-dns/hickory-dns/commit/fddf16effe8f51d3fee2999fdf4f091799fb9392) Store original encoding of type bit maps - [`be528a7`](https://github.com/hickory-dns/hickory-dns/commit/be528a7f86936fe526e1759e74c28cb495d4d465) Implement BinEncodable for RecordTypeSet - [`d38f6e8`](https://github.com/hickory-dns/hickory-dns/commit/d38f6e8d51f2a9e4112145fc4da947b732072957) Implement RecordDataDecodable for RecordTypeSet - [`86502e7`](https://github.com/hickory-dns/hickory-dns/commit/86502e78bcec26d1049b4266f5d15c5185e3644b) Enable DNSSEC in fuzzer target - [`22083d2`](https://github.com/hickory-dns/hickory-dns/commit/22083d2c39ffec96f7d15fd293db06c031646732) Compare records with pretty_assertions in fuzzer ### 📊 Changes **11 files changed** (+705 additions, -242 deletions) <details> <summary>View changed files</summary> 📝 `crates/proto/src/dnssec/rdata/nsec.rs` (+26 -18) 📝 `crates/proto/src/dnssec/rdata/nsec3.rs` (+37 -18) 📝 `crates/proto/src/rr/mod.rs` (+2 -1) 📝 `crates/proto/src/rr/rdata/csync.rs` (+34 -15) 📝 `crates/proto/src/rr/type_bit_map.rs` (+236 -159) 📝 `crates/proto/src/serialize/txt/parse_rdata.rs` (+3 -2) 📝 `crates/proto/src/serialize/txt/rdata_parsers/csync.rs` (+4 -4) 📝 `crates/server/src/store/in_memory/authority.rs` (+5 -5) 📝 `fuzz/Cargo.lock` (+354 -3) 📝 `fuzz/Cargo.toml` (+2 -1) 📝 `fuzz/fuzz_targets/message.rs` (+2 -16) </details> ### 📄 Description This PR encapsulates type bit maps handling in a new struct. This stores record types in a sorted data structure, and saves the original encoding, if available, to be reused when emitting the record again. In the fuzzer, `CSYNC` records are no longer ignored, and all DNSSEC records are now included, thanks to enabling the `dnssec-aws-lc-rs` Cargo feature. I replaced the line-based comparison printed upon failure with the `pretty_assertions` crate, which also provides context and ANSI color codes. I've been running the fuzzer for about half an hour with this fix, and so far I haven't found any more round trip issues. This closes #2815. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-16 11:39:50 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#3369
No description provided.