[GH-ISSUE #403] Server hangs on any malformed UDP packet #180

Closed
opened 2026-03-07 22:40:41 +03:00 by kerem · 8 comments
Owner

Originally created by @krant on GitHub (Apr 17, 2018).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/403

Steps to reproduce:

$ cd server
$ ../target/release/named -c ./tests/named_test_configs/example.toml -z ./tests/named_test_configs/ -p 24141

in another console:

$ dig @127.0.0.1 -p 24141 www.example.com
<works>
$ echo "hello" >/dev/udp/127.0.0.1/24141
$ dig @127.0.0.1 -p 24141 www.example.com
<hangs>
Originally created by @krant on GitHub (Apr 17, 2018). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/403 Steps to reproduce: ``` $ cd server $ ../target/release/named -c ./tests/named_test_configs/example.toml -z ./tests/named_test_configs/ -p 24141 ``` in another console: ``` $ dig @127.0.0.1 -p 24141 www.example.com <works> $ echo "hello" >/dev/udp/127.0.0.1/24141 $ dig @127.0.0.1 -p 24141 www.example.com <hangs> ```
kerem 2026-03-07 22:40:41 +03:00
Author
Owner

@bluejekyll commented on GitHub (Apr 17, 2018):

In your Cargo.lock file, can you grep for tokio-core and it’s associated version?

<!-- gh-comment-id:381997439 --> @bluejekyll commented on GitHub (Apr 17, 2018): In your Cargo.lock file, can you grep for tokio-core and it’s associated version?
Author
Owner

@krant commented on GitHub (Apr 17, 2018):

Sure, it is tokio-core 0.1.16.

<!-- gh-comment-id:381998728 --> @krant commented on GitHub (Apr 17, 2018): Sure, it is `tokio-core 0.1.16`.
Author
Owner

@bluejekyll commented on GitHub (Apr 17, 2018):

Cool. Thanks. I’ll take a look at this later. I don’t have a lot of negative tests in the library, so this is great help, thanks for the submission.

I really need to put a fuzzer on the library.

<!-- gh-comment-id:382027096 --> @bluejekyll commented on GitHub (Apr 17, 2018): Cool. Thanks. I’ll take a look at this later. I don’t have a lot of negative tests in the library, so this is great help, thanks for the submission. I really need to put a fuzzer on the library.
Author
Owner

@DemiMarie commented on GitHub (Apr 17, 2018):

@bluejekyll Could AFL be used? My understanding is that there is Rust integration somewhere.

<!-- gh-comment-id:382128133 --> @DemiMarie commented on GitHub (Apr 17, 2018): @bluejekyll Could AFL be used? My understanding is that there is Rust integration somewhere.
Author
Owner

@bluejekyll commented on GitHub (Apr 17, 2018):

There are a few fuzzers available in Rust. I filed this issue for it: https://github.com/bluejekyll/trust-dns/issues/97

it references cargo-fuzz.

<!-- gh-comment-id:382180418 --> @bluejekyll commented on GitHub (Apr 17, 2018): There are a few fuzzers available in Rust. I filed this issue for it: https://github.com/bluejekyll/trust-dns/issues/97 it references `cargo-fuzz`.
Author
Owner

@bluejekyll commented on GitHub (Apr 18, 2018):

Ok, reproduced this with a test in #407 working on a fix

<!-- gh-comment-id:382273862 --> @bluejekyll commented on GitHub (Apr 18, 2018): Ok, reproduced this with a test in #407 working on a fix
Author
Owner

@bluejekyll commented on GitHub (Apr 18, 2018):

Thanks for reporting this. There's now a test case for this. Turned out that the error was escaping the UDP handler, causing the UDP socket to be shutdown.

Thanks again for reporting this.

<!-- gh-comment-id:382284335 --> @bluejekyll commented on GitHub (Apr 18, 2018): Thanks for reporting this. There's now a test case for this. Turned out that the error was escaping the UDP handler, causing the UDP socket to be shutdown. Thanks again for reporting this.
Author
Owner

@krant commented on GitHub (Apr 18, 2018):

Thanks for great software!

<!-- gh-comment-id:382287865 --> @krant commented on GitHub (Apr 18, 2018): Thanks for great software!
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#180
No description provided.