CVE-2019-19344 kcc dns scavenging: Fix use after free in dns_tombstone_records_zone
authorGary Lockyer <gary@catalyst.net.nz>
Mon, 16 Dec 2019 00:57:47 +0000 (13:57 +1300)
committerKarolin Seeger <kseeger@samba.org>
Tue, 21 Jan 2020 11:38:38 +0000 (11:38 +0000)
commit13658324a3ab30213ff50c21308f287ef3a131fd
tree019a162afa57799fea5c527b5c008f8eeb6cfef0
parent34a8cee348d3dfea18e92a4ae829ae797a652192
CVE-2019-19344 kcc dns scavenging: Fix use after free in dns_tombstone_records_zone

ldb_msg_add_empty reallocates the underlying element array, leaving
old_el pointing to freed memory.

This patch takes two defensive copies of the ldb message, and performs
the updates on them rather than the ldb messages in the result.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14050

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(master): Tue Jan 21 11:38:38 UTC 2020 on sn-devel-184
source4/dsdb/kcc/scavenge_dns_records.c