1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
samba-mirror/source4/dns_server
Andrew Bartlett 004e7a1fee s4/rpc_server/dnsserver: Allow parsing of dnsProperty to fail gracefully
On (eg) the

DC=_msdcs.X.Y,CN=MicrosoftDNS,DC=ForestDnsZones,DC=X,DC=Y

record, in domains that have had a Microsoft Windows DC an attribute:

dNSProperty:: AAAAAAAAAAAAAAAAAQAAAJIAAAAAAAAA

000000 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00  >................<
000010 92 00 00 00 00 00 00 00                          >........<
000018

We, until samba 4.12, would parse this as:

pull returned Success
    dnsp_DnsProperty: struct dnsp_DnsProperty
        wDataLength              : 0x00000000 (0)
        namelength               : 0x00000000 (0)
        flag                     : 0x00000000 (0)
        version                  : 0x00000001 (1)
        id                       : DSPROPERTY_ZONE_NS_SERVERS_DA (146)
        data                     : union dnsPropertyData(case 0)
        name                     : 0x00000000 (0)
dump OK

However, the wDataLength is 0.  There is not anything in
[MS-DNSP] 2.3.2.1 dnsProperty to describe any special behaviour
for when the id suggests that there is a value, but wDataLength is 0.

https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-dnsp/445c7843-e4a1-4222-8c0f-630c230a4c80

We now fail to parse it, because we expect an entry with id DSPROPERTY_ZONE_NS_SERVERS_DA
to therefore have a valid DNS_ADDR_ARRAY (section 2.2.3.2.3).

As context we changed it in our commit fee5c6a424
because of bug https://bugzilla.samba.org/show_bug.cgi?id=14206
which was due to the artificial environment of the fuzzer.

Microsoft advises that Windows also fails to parse this, but
instead of failing the operation, the value is ignored.

Reported by Alex MacCuish.  Many thanks for your assistance in
tracking down the issue.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14310

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri May 15 07:29:17 UTC 2020 on sn-devel-184
2020-05-15 07:29:16 +00:00
..
dlz_bind9.c Fix clang 9 missing-field-initializer warnings 2020-05-08 09:31:31 +00:00
dlz_minimal.h dlz-bind: Add support for BIND 9.12.x 2018-08-10 02:44:36 +02:00
dns_crypto.c s4:dns_crypto: Remove unused include of hmac_md5.h 2019-02-22 21:48:11 +01:00
dns_query.c dns: Always return SOA record for records we should know 2019-11-08 12:31:29 +00:00
dns_server.c source4 smdb: Add a post fork hook to the service API 2018-11-01 23:49:24 +01:00
dns_server.h dns: moving name_equal func into common 2018-07-12 04:31:54 +02:00
dns_update.c dns: static records 2018-07-12 04:31:56 +02:00
dns_utils.c dns_server: Remove unused "dns_generate_options" 2018-01-04 00:37:21 +01:00
dnsserver_common.c s4/rpc_server/dnsserver: Allow parsing of dnsProperty to fail gracefully 2020-05-15 07:29:16 +00:00
dnsserver_common.h s4 dns_server Bind9: Log opertion durations 2019-05-07 05:03:26 +00:00
pydns.c Fix clang 9 missing-field-initializer warnings 2020-05-08 09:31:31 +00:00
TODO dns: Update TODO list 2013-07-29 09:12:17 +02:00
wscript_build build: Remove bld.gen_python_environments() 2019-03-21 04:06:14 +00:00