]> git.ipfire.org Git - thirdparty/bind9.git/commit
Reject oversized RRsets at slab construction 11964/head
authorOndřej Surý <ondrej@sury.org>
Wed, 8 Apr 2026 10:53:16 +0000 (12:53 +0200)
committerOndřej Surý <ondrej@sury.org>
Tue, 5 May 2026 17:24:29 +0000 (19:24 +0200)
commit2bbbd60de35794179c8b8beffd3fd284b198ca34
treed5e304d68ccd2a37e5241db8d2425ad9a150d203
parent99c226576a8e69d222c290d6df327b40f61d3523
Reject oversized RRsets at slab construction

dns_rdataslab_fromrdataset(), dns_rdataslab_merge() and
dns_rdataslab_subtract() summed per-record storage into an
unsigned int with no upper-bound check.  An RRset whose total
encoded size exceeds DNS_RDATA_MAXLENGTH cannot fit in a DNS
message and is unservable; building its in-memory representation
only burns memory on data that will fail at response time, and at
the upper bound the running sum could in theory wrap.

Cap the running total at DNS_RDATA_MAXLENGTH and return ISC_R_NOSPACE
when exceeded.  Update the qpdb cache memory-purge test to use a
record size that fits within the new limit.

Assisted-by: Claude:claude-opus-4-7
(cherry picked from commit f9d24b1b8548363b73a086de9d7038ac2517cd12)
lib/dns/rdataslab.c
tests/dns/qpdb_test.c