CVE-2015-5370: s4:rpc_server: add some padding to dcesrv_bind_nak() responses
authorStefan Metzmacher <metze@samba.org>
Fri, 26 Jun 2015 06:10:46 +0000 (08:10 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 12 Apr 2016 17:25:30 +0000 (19:25 +0200)
This matches Windows 2012R2.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
source4/rpc_server/dcerpc_server.c

index 1393aa74fa447be2c0c3fb32cd0ed7feb3feed33..8a0df18fe3e4a199a443b9ff5d8a361933fd2ee9 100644 (file)
@@ -462,6 +462,7 @@ static NTSTATUS dcesrv_bind_nak(struct dcesrv_call_state *call, uint32_t reason)
        struct dcerpc_bind_nak_version version;
        struct data_blob_list_item *rep;
        NTSTATUS status;
+       static const uint8_t _pad[3] = { 0, };
 
        /* setup a bind_nak */
        dcesrv_init_hdr(&pkt, lpcfg_rpc_big_endian(call->conn->dce_ctx->lp_ctx));
@@ -474,7 +475,7 @@ static NTSTATUS dcesrv_bind_nak(struct dcesrv_call_state *call, uint32_t reason)
        version.rpc_vers_minor = 0;
        pkt.u.bind_nak.num_versions = 1;
        pkt.u.bind_nak.versions = &version;
-       pkt.u.bind_nak._pad = data_blob_null;
+       pkt.u.bind_nak._pad = data_blob_const(_pad, sizeof(_pad));
 
        rep = talloc_zero(call, struct data_blob_list_item);
        if (!rep) {