1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
samba-mirror/source4/rpc_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
..
backupkey s4:rpc_server: Remove gnutls_global_(de)init() 2019-11-14 08:01:44 +00:00
browser werror: replace WERR_UNKNOWN_LEVEL with WERR_INVALID_LEVEL in source4/rpc_server/ 2016-09-28 00:04:35 +02:00
common s4:rpc_server: Remove imessaging_context from dcerpc core structs 2019-10-18 16:07:36 +00:00
dnsserver s4/rpc_server/dnsserver: Allow parsing of dnsProperty to fail gracefully 2020-05-15 07:29:16 +00:00
drsuapi s4:rpc_server: Remove imessaging_context from dcerpc core structs 2019-10-18 16:07:36 +00:00
echo s4:rpc_server: only pass context to op_bind() hooks 2019-01-12 03:13:39 +01:00
epmapper librpc:core: Allocate struct dcesrv_interface with talloc 2019-10-18 16:07:37 +00:00
eventlog s4:rpc_server/eventlog: make use of dcesrv_handle_create() 2019-01-12 03:13:34 +01:00
lsa s4:rpc_server/lsa: remove some useless talloc_reference() calls 2020-02-05 08:46:38 +00:00
netlogon smbdes: convert des_crypt112_16 to use gnutls 2019-12-10 00:30:31 +00:00
remote pidl:NDR/Server: Allow to define endpoint server shutdown functions 2019-12-12 00:35:31 +00:00
samr session: convert sess_crypt_blob to use gnutls 2019-12-10 00:30:31 +00:00
srvsvc smbdotconf: mark "server string" with substitution="1" 2019-11-27 10:25:36 +00:00
tests dnsp.idl: fix dnsp_ip4_array definition 2019-06-21 08:49:19 +00:00
unixinfo wbclient: "ev" is no longer used in wbc_xids_to_sids 2016-09-28 00:04:36 +02:00
winreg s4:rpc_server/winreg: don't cache an ldb connection per presentation context 2019-01-12 03:13:39 +01:00
wkssvc werror: replace WERR_UNKNOWN_LEVEL with WERR_INVALID_LEVEL in source4/rpc_server/ 2016-09-28 00:04:35 +02:00
dcerpc_server.c librpc:core: Allocate struct dcesrv_interface with talloc 2019-10-18 16:07:37 +00:00
dcerpc_server.h s4:rpc_server: Move core structures and prototypes to core library 2019-10-18 16:07:37 +00:00
dcerpc_server.pc.in dcerpc_server: Add 'modulesdir' variable to pkg-config file. 2012-02-23 16:26:25 +01:00
handles.c s4:rpc_server: Cleanup includes 2019-10-18 16:07:36 +00:00
service_rpc.c librpc:core: Split dcesrv context init and endpoint servers init 2019-12-12 00:35:30 +00:00
wscript_build build: Do not build selftest binaries for builds without --enable-selftest 2019-11-22 11:48:59 +00:00