aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-connectivity/samba/samba/CVE-2023-34968_0003.patch
blob: 42106d82b81dddb00884010cf19b66d6269f74c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
From 56a21b3bc8fb24416ead9061f9305c8122bc7f86 Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow@samba.org>
Date: Mon, 19 Jun 2023 17:14:38 +0200
Subject: [PATCH] CVE-2023-34968: mdscli: use correct TALLOC memory context
 when allocating spotlight_blob

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>

Upstream-Status: Backport [https://github.com/samba-team/samba/commit/56a21b3bc8fb24416ead9061f9305c8122bc7f86]

CVE: CVE-2023-34968

Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
---
 source3/rpc_client/cli_mdssvc_util.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/source3/rpc_client/cli_mdssvc_util.c b/source3/rpc_client/cli_mdssvc_util.c
index fe5092c3790..892a844e71a 100644
--- a/source3/rpc_client/cli_mdssvc_util.c
+++ b/source3/rpc_client/cli_mdssvc_util.c
@@ -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) {
--
2.40.0