bind9/bin
Michał Kępień 170b869294 Fix updating summary RPZ DB for mixed-case RPZs
Each dns_rpz_zone_t structure keeps a hash table of the names this RPZ
database contains.  Here is what happens when an RPZ is updated:

  - a new hash table is prepared for the new version of the RPZ by
    iterating over it; each name found is added to the summary RPZ
    database,

  - every name added to the new hash table is searched for in the old
    hash table; if found, it is removed from the old hash table,

  - the old hash table is iterated over; all names found in it are
    removed from the summary RPZ database (because at that point the old
    hash table should only contain names which are not present in the
    new version of the RPZ),

  - the new hash table replaces the old hash table.

When the new version of the RPZ is iterated over, if a given name is
spelled using a different letter case than in the old version of the
RPZ, the new variant will hash to a different value than the old
variant, which means it will not be removed from the old hash table.
When the old hash table is subsequently iterated over to remove
seemingly deleted names, the old variant of the name will still be
there, causing the name to be deleted from the summary RPZ database
(which effectively causes a given rule to be ignored).

The issue can be triggered not just by altering the case of existing
names in an RPZ, but also by adding sibling names spelled with a
different letter case.  This is because RBT code preserves case when
node splitting occurs.  The end result is that when the RPZ is iterated
over, a given name may be using a different case than in the zone file
(or XFR contents).

Fix by downcasing all names found in the RPZ database before adding them
to the summary RPZ database.

(cherry picked from commit dc8a7791bd)
2020-09-21 09:32:21 +02:00
..
check update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
confgen update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
delv update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
dig update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
dnssec update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
named Lock access to control->symtab to prevent data race 2020-09-17 19:31:41 +10:00
nsupdate update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
pkcs11 update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
plugins update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
python update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
rndc update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
tests Fix updating summary RPZ DB for mixed-case RPZs 2020-09-21 09:32:21 +02:00
tools update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
win32/BINDInstall update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
Makefile.in name change from "hook modules" to "plugins" 2018-12-06 10:36:50 -08:00