Skip to contentSkip to conversation

samba: upgrade 4.18.6 -> 4.18.8

PATCH New Yi Zhao 1 participant 4 messages Oct 12, 2023

lore
Share & tools
lore

Yi Zhao

author
#0 lore raw

PATCH 1/4 samba: upgrade 4.18.6 -> 4.18.8

This is a security release in order to address the following defects:

CVE-2023-3961: Unsanitized pipe names allow SMB clients to connect as root to
existing unix domain sockets on the file system.
https://www.samba.org/samba/security/CVE-2023-3961.html

CVE-2023-4091: SMB client can truncate files to 0 bytes by opening files with
OVERWRITE disposition when using the acl_xattr Samba VFS module with the smb.conf setting "acl_xattr:ignore system acls = yes"
https://www.samba.org/samba/security/CVE-2023-4091.html

CVE-2023-4154: An RODC and a user with the GET_CHANGES right can view all
attributes, including secrets and passwords. Additionally, the access check fails open on error conditions.
https://www.samba.org/samba/security/CVE-2023-4154.html

CVE-2023-42669: Calls to the rpcecho server on the AD DC can request that the
server block for a user-defined amount of time, denying service.
https://www.samba.org/samba/security/CVE-2023-42669.html

CVE-2023-42670: Samba can be made to start multiple incompatible RPC
listeners, disrupting service on the AD DC.
https://www.samba.org/samba/security/CVE-2023-42670.html

Release Notes:
https://www.samba.org/samba/history/samba-4.18.8.html

---
 .../samba/{samba_4.18.6.bb => samba_4.18.8.bb}                  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 rename meta-networking/recipes-connectivity/samba/{samba_4.18.6.bb => samba_4.18.8.bb} (99%)
meta-networking/recipes-connectivity/samba/samba_4.18.8.bb renamed from meta-networking/recipes-connectivity/samba/samba_4.18.6.bb +1 -1
similarity index 99%
rename from meta-networking/recipes-connectivity/samba/samba_4.18.6.bb
rename to meta-networking/recipes-connectivity/samba/samba_4.18.8.bb
index c40e10224..1ded9fe5e 100644
@@ -32,7 +32,7 @@ SRC_URI:append:libc-musl = " \
            file://cmocka-uintptr_t.patch \
            "
 
-SRC_URI[sha256sum] = "284c8a994ce989c87cd6808c390fcb9d00c36b21a0dc1a8a75474b67c9e715e7"
+SRC_URI[sha256sum] = "4fb87bceaeb01d832a59046c197a044b7e8e8000581548b5d577a6cda03344d1"
 
 UPSTREAM_CHECK_REGEX = "samba\-(?P<pver>4\.18(\.\d+)+).tar.gz"
 
Signature · 1 line
2.25.1
author
#1 lore raw

PATCH 2/4 samba: use external cmocka instead of bundled cmocka

Do not use bundled cmocka to get rid of bundled library libcmocka-samba4.so.

---
 .../samba/samba/cmocka-uintptr_t.patch        | 51 -------------------
 .../samba/samba_4.18.8.bb                     |  5 +-
 2 files changed, 2 insertions(+), 54 deletions(-)
 delete mode 100644 meta-networking/recipes-connectivity/samba/samba/cmocka-uintptr_t.patch
meta-networking/recipes-connectivity/samba/samba/cmocka-uintptr_t.patch deleted +0 -51
deleted file mode 100644
index e6e878433..000000000
@@ -1,51 +0,0 @@
-From 14f8ee7cd1318567b00e52217d57f0a528fd2cf7 Mon Sep 17 00:00:00 2001
-From: Changqing Li <[email protected]>
-Date: Wed, 25 Jul 2018 09:55:25 +0800
-Subject: [PATCH] samba: cmocka.h: fix musl libc conflicting types error
-
-Fix build on qemumips64(el)
-
-taken from:
-[PATCH] libldb: fix musl libc conflicting types error
-
-/third_party/cmocka/cmocka.h:126:28: error: conflicting types for 'uintptr_t'
-            typedef unsigned int uintptr_t;
-                                 ^~~~~~~~~
-use __DEFINED_uintptr_t in alltypes.h to check if uintptr already defined
-
-Upstream-Status: Pending
-
-Signed-off-by: Changqing Li <[email protected]>
-Signed-off-by: Andrea Adami <[email protected]>
----
- third_party/cmocka/cmocka.h | 7 +++----
- 1 file changed, 3 insertions(+), 4 deletions(-)
-
-diff --git a/third_party/cmocka/cmocka.h b/third_party/cmocka/cmocka.h
-index e6861c8..238201d 100644
---- a/third_party/cmocka/cmocka.h
-+++ b/third_party/cmocka/cmocka.h
-@@ -111,7 +111,7 @@ typedef uintmax_t LargestIntegralType;
-     ((LargestIntegralType)(value))
- 
- /* Smallest integral type capable of holding a pointer. */
--#if !defined(_UINTPTR_T) && !defined(_UINTPTR_T_DEFINED)
-+#if !defined(__DEFINED_uintptr_t)
- # if defined(_WIN32)
-     /* WIN32 is an ILP32 platform */
-     typedef unsigned int uintptr_t;
-@@ -135,9 +135,8 @@ typedef uintmax_t LargestIntegralType;
- #  endif /* __WORDSIZE */
- # endif /* _WIN32 */
- 
--# define _UINTPTR_T
--# define _UINTPTR_T_DEFINED
--#endif /* !defined(_UINTPTR_T) || !defined(_UINTPTR_T_DEFINED) */
-+# define __DEFINED_uintptr_t
-+#endif /* !defined(__DEFINED_uintptr_t) */
- 
- /* Perform an unsigned cast to uintptr_t. */
- #define cast_to_pointer_integral_type(value) \
--- 
-2.25.1
-
meta-networking/recipes-connectivity/samba/samba_4.18.8.bb +2 -3
index 1ded9fe5e..dc9bc1a7f 100644
@@ -29,7 +29,6 @@ SRC_URI = "${SAMBA_MIRROR}/stable/samba-${PV}.tar.gz \
 SRC_URI:append:libc-musl = " \
            file://samba-pam.patch \
            file://samba-4.3.9-remove-getpwent_r.patch \
-           file://cmocka-uintptr_t.patch \
            "
 
 SRC_URI[sha256sum] = "4fb87bceaeb01d832a59046c197a044b7e8e8000581548b5d577a6cda03344d1"
@@ -43,7 +42,7 @@ CVE_STATUS[CVE-2011-2411] = "not-applicable-platform: vulnerable only on HP NonS
 # remove default added RDEPENDS on perl
 RDEPENDS:${PN}:remove = "perl"
 
-DEPENDS += "readline virtual/libiconv zlib popt libtalloc libtdb libtevent libldb libaio libpam libtasn1 jansson libparse-yapp-perl-native gnutls"
+DEPENDS += "readline virtual/libiconv zlib popt libtalloc libtdb libtevent libldb libaio libpam libtasn1 libtasn1-native jansson libparse-yapp-perl-native gnutls cmocka"
 
 inherit features_check
 REQUIRED_DISTRO_FEATURES = "pam"
@@ -105,7 +104,7 @@ SAMBA4_MODULES="${SAMBA4_IDMAP_MODULES},${SAMBA4_PDB_MODULES},${SAMBA4_AUTH_MODU
 # .so files so there will not be a conflict.  This is not done consistantly, so be very careful
 # when adding to this list.
 #
-SAMBA4_LIBS="heimdal,cmocka,NONE"
+SAMBA4_LIBS="heimdal,NONE"
 
 EXTRA_OECONF += "--enable-fhs \
                  --with-piddir=/run \
Signature · 1 line
2.25.1
author
#2 lore raw

PATCH 3/4 libtevent: fix ptest

In reply to Yi Zhao

* use external cmocka instead of bundled cmocka
* add run-ptest script

Ptest results:

$ ./run-ptest
PASS: replace_testsuite
PASS: test_tevent_tag
PASS: test_tevent_trace
---
 ...ix-musl-libc-conflicting-types-error.patch | 45 -------------------
 .../libtevent/libtevent/run-ptest             | 17 +++++++
 .../libtevent/libtevent_0.14.1.bb             | 20 +++------
 3 files changed, 24 insertions(+), 58 deletions(-)
 delete mode 100644 meta-networking/recipes-support/libtevent/libtevent/cmocka-fix-musl-libc-conflicting-types-error.patch
 create mode 100644 meta-networking/recipes-support/libtevent/libtevent/run-ptest
meta-networking/recipes-support/libtevent/libtevent/cmocka-fix-musl-libc-conflicting-types-error.patch deleted +0 -45
deleted file mode 100644
index 5795ff3bd..000000000
@@ -1,45 +0,0 @@
-From 1d4dedab5039bb671f44566d8573ee3532ba7176 Mon Sep 17 00:00:00 2001
-From: Changqing Li <[email protected]>
-Date: Wed, 25 Jul 2018 09:55:25 +0800
-Subject: [PATCH] cmocka: fix musl libc conflicting types error
-
-/third_party/cmocka/cmocka.h:126:28: error: conflicting types for 'uintptr_t'
-            typedef unsigned int uintptr_t;
-                                 ^~~~~~~~~
-use __DEFINED_uintptr_t in alltypes.h to check if uintptr already defined
-
-Upstream-Status: Pending
-
-Signed-off-by: Changqing Li <[email protected]>
----
- third_party/cmocka/cmocka.h | 7 +++----
- 1 file changed, 3 insertions(+), 4 deletions(-)
-
-diff --git a/third_party/cmocka/cmocka.h b/third_party/cmocka/cmocka.h
-index e6861c8..238201d 100644
---- a/third_party/cmocka/cmocka.h
-+++ b/third_party/cmocka/cmocka.h
-@@ -111,7 +111,7 @@ typedef uintmax_t LargestIntegralType;
-     ((LargestIntegralType)(value))
- 
- /* Smallest integral type capable of holding a pointer. */
--#if !defined(_UINTPTR_T) && !defined(_UINTPTR_T_DEFINED)
-+#if !defined(__DEFINED_uintptr_t)
- # if defined(_WIN32)
-     /* WIN32 is an ILP32 platform */
-     typedef unsigned int uintptr_t;
-@@ -135,9 +135,8 @@ typedef uintmax_t LargestIntegralType;
- #  endif /* __WORDSIZE */
- # endif /* _WIN32 */
- 
--# define _UINTPTR_T
--# define _UINTPTR_T_DEFINED
--#endif /* !defined(_UINTPTR_T) || !defined(_UINTPTR_T_DEFINED) */
-+# define __DEFINED_uintptr_t
-+#endif /* !defined(__DEFINED_uintptr_t) */
- 
- /* Perform an unsigned cast to uintptr_t. */
- #define cast_to_pointer_integral_type(value) \
--- 
-2.25.1
-
meta-networking/recipes-support/libtevent/libtevent/run-ptest new file +17 -0
new file mode 100644
index 000000000..19f7a4a3a
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+ptestdir=$(dirname "$(readlink -f "$0")")
+cd "$ptestdir"/tests || exit
+
+tests="replace_testsuite test_tevent_tag test_tevent_trace"
+
+for f in $tests
+do
+    if test -x ./"$f"; then
+        if ./"$f" > ./"$f".out 2> ./"$f".err; then
+            echo "PASS: $f"
+        else
+            echo "FAIL: $f"
+        fi
+    fi
+done
meta-networking/recipes-support/libtevent/libtevent_0.14.1.bb +7 -13
index b34c186ca..9a2b5ede2 100644
@@ -3,7 +3,7 @@ HOMEPAGE = "https://tevent.samba.org"
 SECTION = "libs"
 LICENSE = "LGPL-3.0-or-later"
 
-DEPENDS += "libtalloc libtirpc"
+DEPENDS += "libtalloc libtirpc cmocka"
 RDEPENDS:python3-tevent = "python3"
 
 export PYTHONHASHSEED="1"
@@ -11,10 +11,9 @@ export PYTHONHASHSEED="1"
 SRC_URI = "https://samba.org/ftp/tevent/tevent-${PV}.tar.gz \
            file://0001-Add-configure-options-for-packages.patch \
            file://0002-Fix-pyext_PATTERN-for-cross-compilation.patch \
+           file://run-ptest \
           "
 
-SRC_URI:append:libc-musl = " file://cmocka-fix-musl-libc-conflicting-types-error.patch"
-
 LIC_FILES_CHKSUM = "file://tevent.h;endline=26;md5=47386b7c539bf2706b7ce52dc9341681"
 
 SRC_URI[sha256sum] = "ef85fcaa80ffd2351036ba4b347630fef2a1ac3da964a7f1820466bad03cd00d"
@@ -42,27 +41,22 @@ export WAF_NO_PREFORK="yes"
 
 EXTRA_OECONF += "--disable-rpath \
                  --disable-rpath-install \
-                 --bundled-libraries=cmocka \
+                 --bundled-libraries=NONE \
                  --builtin-libraries=replace \
                  --with-libiconv=${STAGING_DIR_HOST}${prefix}\
                  --without-gettext \
                 "
 
-do_install:append() {
-    install -Dm 0755 ${B}/bin/test_tevent_trace ${D}${bindir}/test_tevent_trace
-    install -Dm 0755 ${B}/bin/test_tevent_tag ${D}${bindir}/test_tevent_tag
-    install -Dm 0755 ${B}/bin/replace_testsuite ${D}${bindir}/replace_testsuite
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/tests
+    install -m 0755 ${B}/bin/test_tevent_* ${D}${PTEST_PATH}/tests/
+    install -m 0755 ${B}/bin/replace_testsuite ${D}${PTEST_PATH}/tests/
 }
 
 PACKAGES += "python3-tevent"
 
 RPROVIDES:${PN}-dbg += "python3-tevent-dbg"
 
-FILES:${PN} += "${libdir}/tevent/*"
-FILES:${PN}-ptest += "${bindir}/replace_testsuite \
-                      ${bindir}/test_tevent_tag \
-                      ${bindir}/test_tevent_trace \
-                      ${libdir}/libcmocka-tevent.so"
 FILES:python3-tevent = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*"
 
 INSANE_SKIP:${MLPREFIX}python3-tevent = "dev-so"
Signature · 1 line
2.25.1
author
#3 lore raw

PATCH 4/4 libldb: add ptest

In reply to Yi Zhao

* use external cmocka instead of bundled cmocka
* add run-ptest script

Ptest results:

$ ptest-runner libldb
START: ptest-runner
2023-10-12T11:49
BEGIN: /usr/lib/libldb/ptest
PASS: test_ldb_dn
PASS: test_ldb_qsort
DURATION: 0
END: /usr/lib/libldb/ptest
2023-10-12T11:49
STOP: ptest-runner
TOTAL: 1 FAIL: 0
---
 ...ix-musl-libc-conflicting-types-error.patch | 45 -------------------
 .../recipes-support/libldb/libldb/run-ptest   | 17 +++++++
 .../recipes-support/libldb/libldb_2.7.2.bb    | 14 +++---
 3 files changed, 26 insertions(+), 50 deletions(-)
 delete mode 100644 meta-networking/recipes-support/libldb/libldb/cmocka-fix-musl-libc-conflicting-types-error.patch
 create mode 100644 meta-networking/recipes-support/libldb/libldb/run-ptest
meta-networking/recipes-support/libldb/libldb/cmocka-fix-musl-libc-conflicting-types-error.patch deleted +0 -45
deleted file mode 100644
index 8e756d8d3..000000000
@@ -1,45 +0,0 @@
-From a37eb0a46669592e32ed4e004abb2698ee4f90c5 Mon Sep 17 00:00:00 2001
-From: Changqing Li <[email protected]>
-Date: Wed, 25 Jul 2018 09:55:25 +0800
-Subject: [PATCH] cmocka: fix musl libc conflicting types error
-
-/third_party/cmocka/cmocka.h:126:28: error: conflicting types for 'uintptr_t'
-            typedef unsigned int uintptr_t;
-                                 ^~~~~~~~~
-use __DEFINED_uintptr_t in alltypes.h to check if uintptr already defined
-
-Upstream-Status: Pending
-
-Signed-off-by: Changqing Li <[email protected]>
----
- third_party/cmocka/cmocka.h | 7 +++----
- 1 file changed, 3 insertions(+), 4 deletions(-)
-
-diff --git a/third_party/cmocka/cmocka.h b/third_party/cmocka/cmocka.h
-index e6861c8..238201d 100644
---- a/third_party/cmocka/cmocka.h
-+++ b/third_party/cmocka/cmocka.h
-@@ -111,7 +111,7 @@ typedef uintmax_t LargestIntegralType;
-     ((LargestIntegralType)(value))
- 
- /* Smallest integral type capable of holding a pointer. */
--#if !defined(_UINTPTR_T) && !defined(_UINTPTR_T_DEFINED)
-+#if !defined(__DEFINED_uintptr_t)
- # if defined(_WIN32)
-     /* WIN32 is an ILP32 platform */
-     typedef unsigned int uintptr_t;
-@@ -135,9 +135,8 @@ typedef uintmax_t LargestIntegralType;
- #  endif /* __WORDSIZE */
- # endif /* _WIN32 */
- 
--# define _UINTPTR_T
--# define _UINTPTR_T_DEFINED
--#endif /* !defined(_UINTPTR_T) || !defined(_UINTPTR_T_DEFINED) */
-+# define __DEFINED_uintptr_t
-+#endif /* !defined(__DEFINED_uintptr_t) */
- 
- /* Perform an unsigned cast to uintptr_t. */
- #define cast_to_pointer_integral_type(value) \
--- 
-2.25.1
-
meta-networking/recipes-support/libldb/libldb/run-ptest new file +17 -0
new file mode 100644
index 000000000..f0de0578c
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+ptestdir=$(dirname "$(readlink -f "$0")")
+cd "$ptestdir"/tests || exit
+
+tests="test_ldb_dn test_ldb_qsort"
+
+for f in $tests
+do
+    if test -x ./"$f"; then
+        if ./"$f" > ./"$f".out 2> ./"$f".err; then
+            echo "PASS: $f"
+        else
+            echo "FAIL: $f"
+        fi
+    fi
+done
meta-networking/recipes-support/libldb/libldb_2.7.2.bb +9 -5
index daf0f73b8..c4b7602bf 100644
@@ -3,7 +3,7 @@ HOMEPAGE = "https://ldb.samba.org"
 SECTION = "libs"
 LICENSE = "LGPL-3.0-or-later & LGPL-2.1-or-later & GPL-3.0-or-later"
 
-DEPENDS += "libtdb libtalloc libtevent popt"
+DEPENDS += "libtdb libtalloc libtevent popt cmocka"
 RDEPENDS:pyldb += "python3"
 
 export PYTHONHASHSEED="1"
@@ -12,10 +12,9 @@ SRC_URI = "http://samba.org/ftp/ldb/ldb-${PV}.tar.gz \
            file://0001-do-not-import-target-module-while-cross-compile.patch \
            file://0002-ldb-Add-configure-options-for-packages.patch \
            file://0003-Fix-pyext_PATTERN-for-cross-compilation.patch \
+           file://run-ptest \
           "
 
-SRC_URI:append:libc-musl = " file://cmocka-fix-musl-libc-conflicting-types-error.patch"
-
 PACKAGECONFIG ??= "\
     ${@bb.utils.filter('DISTRO_FEATURES', 'acl', d)} \
     ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'attr', '', d)} \
@@ -37,7 +36,7 @@ LIC_FILES_CHKSUM = "file://pyldb.h;endline=24;md5=dfbd238cecad76957f7f860fbe9ada
 
 SRC_URI[sha256sum] = "26ee72d647854e662d99643eb2b2d341655abf31f4990838d6650fb5cf9209c8"
 
-inherit pkgconfig waf-samba
+inherit pkgconfig waf-samba ptest
 
 S = "${WORKDIR}/ldb-${PV}"
 
@@ -47,7 +46,7 @@ export WAF_NO_PREFORK="yes"
 
 EXTRA_OECONF += "--disable-rpath \
                  --disable-rpath-install \
-                 --bundled-libraries=cmocka \
+                 --bundled-libraries=NONE \
                  --builtin-libraries=replace \
                  --with-modulesdir=${libdir}/ldb/modules \
                  --with-privatelibdir=${libdir}/ldb \
@@ -81,3 +80,8 @@ do_configure:prepend() {
     # For a clean rebuild
     rm -fr bin/
 }
+
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/tests
+    install -m 0755 ${B}/bin/test_ldb_* ${D}${PTEST_PATH}/tests/
+}
Signature · 1 line
2.25.1