]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
CVE-2023-34968: mdscli: use correct TALLOC memory context when allocating spotlight_blob
authorRalph Boehme <slow@samba.org>
Mon, 19 Jun 2023 15:14:38 +0000 (17:14 +0200)
committerJule Anger <janger@samba.org>
Fri, 14 Jul 2023 13:16:29 +0000 (15:16 +0200)
d is talloc_free()d at the end of the functions and the buffer was later used
after beeing freed in the DCERPC layer when sending the packet.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/rpc_client/cli_mdssvc_util.c

index fe5092c3790a790c7c64f2fb869f8004eee3004e..892a844e71a870b28e6ed20a25603702ae457718 100644 (file)
@@ -209,7 +209,7 @@ NTSTATUS mdscli_blob_search(TALLOC_CTX *mem_ctx,
                return NT_STATUS_NO_MEMORY;
        }
 
-       blob->spotlight_blob = talloc_array(d,
+       blob->spotlight_blob = talloc_array(mem_ctx,
                                            uint8_t,
                                            ctx->max_fragment_size);
        if (blob->spotlight_blob == NULL) {
@@ -293,7 +293,7 @@ NTSTATUS mdscli_blob_get_results(TALLOC_CTX *mem_ctx,
                return NT_STATUS_NO_MEMORY;
        }
 
-       blob->spotlight_blob = talloc_array(d,
+       blob->spotlight_blob = talloc_array(mem_ctx,
                                            uint8_t,
                                            ctx->max_fragment_size);
        if (blob->spotlight_blob == NULL) {
@@ -426,7 +426,7 @@ NTSTATUS mdscli_blob_get_path(TALLOC_CTX *mem_ctx,
                return NT_STATUS_NO_MEMORY;
        }
 
-       blob->spotlight_blob = talloc_array(d,
+       blob->spotlight_blob = talloc_array(mem_ctx,
                                            uint8_t,
                                            ctx->max_fragment_size);
        if (blob->spotlight_blob == NULL) {
@@ -510,7 +510,7 @@ NTSTATUS mdscli_blob_close_search(TALLOC_CTX *mem_ctx,
                return NT_STATUS_NO_MEMORY;
        }
 
-       blob->spotlight_blob = talloc_array(d,
+       blob->spotlight_blob = talloc_array(mem_ctx,
                                            uint8_t,
                                            ctx->max_fragment_size);
        if (blob->spotlight_blob == NULL) {