]> git.ipfire.org Git - thirdparty/bind9.git/commit
Use a keyed hash for the RRL bucket table
authorOndřej Surý <ondrej@isc.org>
Wed, 29 Apr 2026 16:20:03 +0000 (18:20 +0200)
committerOndřej Surý <ondrej@sury.org>
Mon, 4 May 2026 14:15:58 +0000 (16:15 +0200)
commit0f821104e0a7fddaa3f79eaf01f0dbd456edf295
treefefdfbf00b743707f47b896753a07ee7c5d6a884
parent93cfd196db094ac94481b411abd7b29c1a60747f
Use a keyed hash for the RRL bucket table

The previous hash_key() was a deterministic, unkeyed (<<1) + add over the
key words.  An off-path attacker could invert it offline and submit
queries whose source /24, qname hash, and qtype map to a single bucket;
under chaining this turns every lookup into an O(N) walk under
rrl->lock and starves legitimate query processing on the very feature
deployed to mitigate DoS.

Replace it with isc_hash32(), which is HalfSipHash-2-4 keyed by a
per-process random seed, so collision sets cannot be precomputed.

Assisted-by: Claude:claude-opus-4-7
(cherry picked from commit a6b7ce29c4cfab2ab1d46f48f21f531d5ffde942)
lib/dns/rrl.c