Skip to contentSkip to conversation

samba: fix CVE-2023-34966

PATCH Polampalli, Archana 1 participant 1 message Oct 20, 2023 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Reminder!

-Archana
________________________________
From: [email protected] <[email protected]> on behalf of Polampalli, Archana via lists.openembedded.org <[email protected]>
Sent: 29 September 2023 23:13
To: [email protected] <[email protected]>
Subject: [oe][meta-networking][kirkstone][PATCH V2 1/3] samba: fix CVE-2023-34966

---
 .../samba/samba/CVE-2023-34966_0001.patch     |  78 ++++++++++
 .../samba/samba/CVE-2023-34966_0002.patch     | 140 ++++++++++++++++++
 .../samba/samba_4.14.14.bb                    |   2 +
 3 files changed, 220 insertions(+)
 create mode 100644 meta-networking/recipes-connectivity/samba/samba/CVE-2023-34966_0001.patch
 create mode 100644 meta-networking/recipes-connectivity/samba/samba/CVE-2023-34966_0002.patch
meta-networking/recipes-connectivity/samba/samba/CVE-2023-34966_0001.patch new file +78 -0
new file mode 100644
index 000000000..77a383f09
@@ -0,0 +1,78 @@
+From 38664163fcac985d87e4274d198568e0fe88595e Mon Sep 17 00:00:00 2001
+From: Ralph Boehme <[email protected]>
+Date: Fri, 26 May 2023 13:06:19 +0200
+Subject: [PATCH] CVE-2023-34966: mdssvc: harden sl_unpack_loop()
+
+A malicious client could send a packet where subcount is zero, leading to a busy
+loop because
+
+    count -= subcount
+=>  count -= 0
+=>  while (count > 0)
+
+loops forever.
+
+BUG: https://bugzilla.samba.org/show_bug.cgi?id=15340
+
+Signed-off-by: Ralph Boehme <[email protected]>
+
+Upstream-Status: Backport [https://github.com/samba-team/samba/commit/38664163fcac985d87e4274d198568e0fe88595e]
+
+CVE: CVE-2023-34966
+
+Signed-off-by: Archana Polampalli <[email protected]>
+---
+ source3/rpc_server/mdssvc/marshalling.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/source3/rpc_server/mdssvc/marshalling.c b/source3/rpc_server/mdssvc/marshalling.c
+index 9ba6ef571f2..d794ba15838 100644
+--- a/source3/rpc_server/mdssvc/marshalling.c
++++ b/source3/rpc_server/mdssvc/marshalling.c
+@@ -1119,7 +1119,7 @@ static ssize_t sl_unpack_loop(DALLOC_CTX *query,
+                       sl_nil_t nil = 0;
+
+                       subcount = tag.count;
+-                      if (subcount > count) {
++                      if (subcount < 1 || subcount > count) {
+                               return -1;
+                       }
+                       for (i = 0; i < subcount; i++) {
+@@ -1147,7 +1147,7 @@ static ssize_t sl_unpack_loop(DALLOC_CTX *query,
+
+               case SQ_TYPE_INT64:
+                       subcount = sl_unpack_ints(query, buf, offset, bufsize, encoding);
+-                      if (subcount == -1 || subcount > count) {
++                      if (subcount < 1 || subcount > count) {
+                               return -1;
+                       }
+                       offset += tag.size;
+@@ -1156,7 +1156,7 @@ static ssize_t sl_unpack_loop(DALLOC_CTX *query,
+
+               case SQ_TYPE_UUID:
+                       subcount = sl_unpack_uuid(query, buf, offset, bufsize, encoding);
+-                      if (subcount == -1 || subcount > count) {
++                      if (subcount < 1 || subcount > count) {
+                               return -1;
+                       }
+                       offset += tag.size;
+@@ -1165,7 +1165,7 @@ static ssize_t sl_unpack_loop(DALLOC_CTX *query,
+
+               case SQ_TYPE_FLOAT:
+                       subcount = sl_unpack_floats(query, buf, offset, bufsize, encoding);
+-                      if (subcount == -1 || subcount > count) {
++                      if (subcount < 1 || subcount > count) {
+                               return -1;
+                       }
+                       offset += tag.size;
+@@ -1174,7 +1174,7 @@ static ssize_t sl_unpack_loop(DALLOC_CTX *query,
+
+               case SQ_TYPE_DATE:
+                       subcount = sl_unpack_date(query, buf, offset, bufsize, encoding);
+-                      if (subcount == -1 || subcount > count) {
++                      if (subcount < 1 || subcount > count) {
+                               return -1;
+                       }
+                       offset += tag.size;
+--
+2.40.0
meta-networking/recipes-connectivity/samba/samba/CVE-2023-34966_0002.patch new file +140 -0

140 lines not on this page · raw message

meta-networking/recipes-connectivity/samba/samba_4.14.14.bb +2 -0
index 72021745b..11b6ade40 100644
@@ -33,6 +33,8 @@ SRC_URI = "${SAMBA_MIRROR}/stable/samba-${PV}.tar.gz \
            file://CVE-2022-45142.patch;patchdir=source4/heimdal \
            file://CVE-2022-41916.patch;patchdir=source4/heimdal \
            file://CVE-2021-44758.patch;patchdir=source4/heimdal \
+           file://CVE-2023-34966_0001.patch \
+           file://CVE-2023-34966_0002.patch \
            "
 
 SRC_URI:append:libc-musl = " \

--
2.40.0