[SCM] Samba Shared Repository - branch master updated

Volker Lendecke vlendec at samba.org
Fri Sep 11 16:11:01 UTC 2026


The branch, master has been updated
       via  b54246e258d lib:param: Log the right parameter in handle_kdc_supported_enctypes()
       via  a1979f9b976 tests/param: Test hex and decimal enctype bitmask parsing
       via  27c87a723ba lib:param: Fix uppercase "0X" prefix in kdc supported enctypes
       via  608afbe571a lib:param: Fix uppercase "0X" prefix in kdc default domain enctypes
      from  4d45e61a158 dbwrap: Suppress mutex error noise when built without robust mutexes

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit b54246e258dd3dbd94a112ac460318b27de1d6fd
Author: Kopylov Pavel <pkopylov at cloudlinux.com>
Date:   Wed Sep 9 10:34:03 2026 +0200

    lib:param: Log the right parameter in handle_kdc_supported_enctypes()
    
    The warning emitted for an unparsable token names "kdc default domain
    supported enctypes", the parameter handled by the neighbouring
    handle_kdc_default_domain_supported_enctypes(). An admin with a bad
    value in "kdc supported enctypes" is pointed at the wrong smb.conf
    line:
    
      handle_kdc_supported_enctypes: WARNING: Ignoring invalid value '0Xzz'
      for parameter 'kdc default domain supported enctypes'
    
    Name the parameter the handler actually parses.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=16239
    
    Signed-off-by: Kopylov Pavel <pkopylov at cloudlinux.com>
    Co-Authored-By: Claude Opus 5 (1M context) <noreply at anthropic.com>
    Reviewed-by: Jennifer Sutton <jennifersutton at catalyst.net.nz>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    Autobuild-User(master): Volker Lendecke <vl at samba.org>
    Autobuild-Date(master): Fri Sep 11 16:10:09 UTC 2026 on atb-devel-224

commit a1979f9b976a9f0f0505068ce2b4fa057eb7072c
Author: Kopylov Pavel <pkopylov at cloudlinux.com>
Date:   Wed Sep 9 10:33:08 2026 +0200

    tests/param: Test hex and decimal enctype bitmask parsing
    
    Cover both "kdc supported enctypes" and "kdc default domain supported
    enctypes" with lowercase and uppercase "0x" / "0X" prefixes. The
    uppercase spellings were rejected outright before the preceding two
    commits.
    
    The bare "0" cases exercise the token that made the old code read past
    the end of the string. They pass either way in a plain build and only
    fail under a memory checker, but keep that input covered.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=16239
    
    Signed-off-by: Kopylov Pavel <pkopylov at cloudlinux.com>
    Co-Authored-By: Claude Opus 5 (1M context) <noreply at anthropic.com>
    Reviewed-by: Jennifer Sutton <jennifersutton at catalyst.net.nz>
    Reviewed-by: Volker Lendecke <vl at samba.org>

commit 27c87a723ba3e2e9d36df8736641d3c191bf4aa2
Author: Kopylov Pavel <pkopylov at cloudlinux.com>
Date:   Wed Sep 9 10:33:01 2026 +0200

    lib:param: Fix uppercase "0X" prefix in kdc supported enctypes
    
    handle_kdc_supported_enctypes() carries the same typo the previous
    commit fixed in handle_kdc_default_domain_supported_enctypes():
    
        if (bitstr[0] == '0' &&
            (bitstr[1] == 'x' || bitstr[2] == 'X'))
    
    The second comparison indexes bitstr[2] instead of bitstr[1], with the
    same two consequences:
    
     * A value written with an uppercase prefix, e.g. "0X1C", is not
       recognised as hexadecimal. It is then parsed with base 10 using
       smb_strtoul(..., SMB_STR_FULL_STR_CONV), which fails on the "X" and
       the whole value is rejected with a warning and silently dropped.
       Lowercase "0x1c" happened to work only by accident.
    
     * For a bare "0" token, bitstr[1] is the NUL terminator, so the
       short-circuit falls through to bitstr[2], reading one byte past the
       end of the string allocated by str_list_make(). valgrind on
       "kdc supported enctypes = 0" reports:
    
         Invalid read of size 1
            at handle_kdc_supported_enctypes (loadparm.c:1931)
            by set_variable (loadparm.c:1969)
            by lpcfg_do_global_parameter (loadparm.c:2028)
          Address 0x939cd52 is 0 bytes after a block of size 98 alloc'd
            by talloc_strndup (talloc.c:2479)
            by str_list_make (util_strlist.c:101)
            by handle_kdc_supported_enctypes (loadparm.c:1899)
    
    Compare bitstr[1] against 'X' as intended. This makes uppercase hex
    values work and removes the out-of-bounds read. The value is parsed from
    admin-controlled smb.conf, so there is no remote exposure.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=16239
    RN: Fix parsing of uppercase "0X" hex values in the "kdc supported
    enctypes" smb.conf parameter.
    
    Signed-off-by: Kopylov Pavel <pkopylov at cloudlinux.com>
    Co-Authored-By: Claude Opus 5 (1M context) <noreply at anthropic.com>
    Reviewed-by: Jennifer Sutton <jennifersutton at catalyst.net.nz>
    Reviewed-by: Volker Lendecke <vl at samba.org>

commit 608afbe571a6314adfd191e2b069ac3ff66f7c93
Author: Kopylov Pavel <pkopylov at cloudlinux.com>
Date:   Tue Sep 8 10:25:35 2026 +0200

    lib:param: Fix uppercase "0X" prefix in kdc default domain enctypes
    
    handle_kdc_default_domain_supported_enctypes() decides whether an
    enctype token is written in hexadecimal by looking for a leading
    "0x" / "0X". The test contained a typo:
    
        if (bitstr[0] == '0' &&
            (bitstr[1] == 'x' || bitstr[2] == 'X'))
    
    The second comparison indexes bitstr[2] instead of bitstr[1]. Two
    consequences follow:
    
     * A value written with an uppercase prefix, e.g. "0X1F", is not
       recognised as hexadecimal. It is then parsed with base 10 using
       smb_strtoul(..., SMB_STR_FULL_STR_CONV), which fails on the "X" and
       the whole value is rejected with a warning and silently dropped.
       Lowercase "0x1f" happened to work only by accident.
    
     * For a bare "0" token, bitstr[1] is the NUL terminator, so the
       short-circuit falls through to bitstr[2], a one-byte read past the
       end of the two-byte buffer "0\0" (out-of-bounds read).
    
    Compare bitstr[1] against 'X' as intended. This makes uppercase hex
    values work and removes the out-of-bounds read. The value is parsed from
    admin-controlled smb.conf, so there is no remote exposure.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=16239
    RN: Fix parsing of uppercase "0X" hex values in the "kdc default domain
    supported enctypes" smb.conf parameter.
    
    Signed-off-by: Kopylov Pavel <pkopylov at cloudlinux.com>
    Reviewed-by: Jennifer Sutton <jennifersutton at catalyst.net.nz>
    Reviewed-by: Volker Lendecke <vl at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 lib/param/loadparm.c        |  6 +++---
 python/samba/tests/param.py | 27 +++++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index ebf8a047af0..2d1c6e93f95 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -1859,7 +1859,7 @@ bool handle_kdc_default_domain_supported_enctypes(struct loadparm_context *lp_ct
 
 			/* See if the bit's specified in hexadecimal. */
 			if (bitstr[0] == '0' &&
-			    (bitstr[1] == 'x' || bitstr[2] == 'X'))
+			    (bitstr[1] == 'x' || bitstr[1] == 'X'))
 			{
 				base = 16;
 				bitstr += 2;
@@ -1928,7 +1928,7 @@ bool handle_kdc_supported_enctypes(struct loadparm_context *lp_ctx,
 
 			/* See if the bit's specified in hexadecimal. */
 			if (bitstr[0] == '0' &&
-			    (bitstr[1] == 'x' || bitstr[2] == 'X'))
+			    (bitstr[1] == 'x' || bitstr[1] == 'X'))
 			{
 				base = 16;
 				bitstr += 2;
@@ -1940,7 +1940,7 @@ bool handle_kdc_supported_enctypes(struct loadparm_context *lp_ctx,
 			bit = smb_strtoul(bitstr, NULL, base, &error, SMB_STR_FULL_STR_CONV);
 			if (error) {
 				DBG_ERR("WARNING: Ignoring invalid value '%s' "
-					"for parameter 'kdc default domain supported enctypes'\n",
+					"for parameter 'kdc supported enctypes'\n",
 					*enctype);
 				ok = false;
 			} else {
diff --git a/python/samba/tests/param.py b/python/samba/tests/param.py
index 7c45d91c1e6..4b8756dc0a6 100644
--- a/python/samba/tests/param.py
+++ b/python/samba/tests/param.py
@@ -105,3 +105,30 @@ class LoadParmTestCase(samba.tests.TestCaseInTempDir):
         samdb_url = samba_lp.samdb_url()
         self.assertTrue(samdb_url.startswith('tdb://'))
         self.assertTrue(samdb_url.endswith('/sam.ldb'))
+
+    def _assert_enctypes(self, name, value, expected):
+        samba_lp = param.LoadParm()
+        samba_lp.set(name, value)
+        self.assertEqual(expected, samba_lp.get(name),
+                         "'%s = %s' was not parsed as 0x%x" %
+                         (name, value, expected))
+
+    def test_kdc_supported_enctypes_hex(self):
+        """The hex prefix of an enctype bitmask is case insensitive."""
+        for value in ('0x1c', '0X1C', '0x1C', '0X1c'):
+            self._assert_enctypes('kdc supported enctypes', value, 0x1c)
+
+    def test_kdc_default_domain_supported_enctypes_hex(self):
+        """The hex prefix of an enctype bitmask is case insensitive."""
+        for value in ('0x3c', '0X3C', '0x3C', '0X3c'):
+            self._assert_enctypes('kdc default domain supported enctypes',
+                                  value, 0x3c)
+
+    def test_kdc_supported_enctypes_decimal(self):
+        for value, expected in (('28', 28), ('0', 0)):
+            self._assert_enctypes('kdc supported enctypes', value, expected)
+
+    def test_kdc_default_domain_supported_enctypes_decimal(self):
+        for value, expected in (('60', 60), ('0', 0)):
+            self._assert_enctypes('kdc default domain supported enctypes',
+                                  value, expected)


-- 
Samba Shared Repository



More information about the samba-cvs mailing list