Skip to content

Commit

Permalink
CVE-2018-16851 ldap_server: Check ret before manipulating blob
Browse files Browse the repository at this point in the history
In the case of hitting the talloc ~256MB limit, this causes a crash in
the server.

Note that you would actually need to load >256MB of data into the LDAP.
Although there is some generated/hidden data which would help you reach that
limit (descriptors and RMD blobs).

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

Signed-off-by: Garming Sam <[email protected]>
Reviewed-by: Andrew Bartlett <[email protected]>
  • Loading branch information
GSam authored and kseeger committed Nov 28, 2018
1 parent c835e27 commit d2c98ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source4/ldap_server/ldap_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -690,13 +690,13 @@ static void ldapsrv_call_writev_start(struct ldapsrv_call *call)
ret = data_blob_append(call, &blob, b.data, b.length);
data_blob_free(&b);

talloc_set_name_const(blob.data, "Outgoing, encoded LDAP packet");

if (!ret) {
ldapsrv_terminate_connection(conn, "data_blob_append failed");
return;
}

talloc_set_name_const(blob.data, "Outgoing, encoded LDAP packet");

DLIST_REMOVE(call->replies, call->replies);
}

Expand Down

0 comments on commit d2c98ab

Please sign in to comment.