]> git.ipfire.org Git - thirdparty/suricata.git/commit
dns: don't parse a full request during probe if not enough data
authorJason Ish <jason.ish@oisf.net>
Mon, 28 Feb 2022 22:48:34 +0000 (16:48 -0600)
committerVictor Julien <vjulien@oisf.net>
Thu, 21 Apr 2022 05:37:54 +0000 (07:37 +0200)
commit3f7a69dbb8025711f9d2887f6754e8674a360a60
treeea263fe32da06571a1c77c0553482e1fb31b9d01
parentbf0813d9f07c30cf3f8541c10561ffd6f17ef0bf
dns: don't parse a full request during probe if not enough data

If there is more data than a header, but not enough for a complete DNS
message, the hostname parser could return an error causing the probe to
fail on valid DNS messages.

So only parse the complete message if we have enough input data. This is
reliable for TCP as DNS messages are prefixed, but for UDP its just
going to be the size of the input buffer presented to the parser, so
incomplete could still happen.

Ticket #5034

(cherry picked from commit 27679a12aa4e03e960112f387640419d29780e5a)
rust/src/dns/dns.rs