]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
mdssvc: introduce MAX_MDSCMD_SIZE
authorRalph Boehme <slow@samba.org>
Mon, 17 Jul 2023 12:51:54 +0000 (14:51 +0200)
committerRalph Boehme <slow@samba.org>
Mon, 24 Jul 2023 15:18:32 +0000 (15:18 +0000)
Allow larger value for the reassembled mdscmd's. Now that the client supports
fragementation, when processing reassambled large result sets from macOS
Spotlight server, it's possible to hit this limit in the unmarshalling
code. Let's just increase it to some larger value.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
source3/rpc_server/mdssvc/marshalling.c
source3/rpc_server/mdssvc/marshalling.h

index 5f866d7fb6ea6c4277bb2c476c3959b4e1d412ae..c9c9384bb8735fc135b21c2ba131fb823177007c 100644 (file)
@@ -667,12 +667,12 @@ static ssize_t sl_unpack_tag(const char *buf,
        tag->count = val >> 32;
        tag->length = tag->count * 8;
 
-       if (tag->size > MAX_SL_FRAGMENT_SIZE) {
+       if (tag->size > MAX_MDSCMD_SIZE) {
                DEBUG(1,("%s: size limit %zu\n", __func__, tag->size));
                return -1;
        }
 
-       if (tag->length > MAX_SL_FRAGMENT_SIZE) {
+       if (tag->length > MAX_MDSCMD_SIZE) {
                DEBUG(1,("%s: length limit %zu\n", __func__, tag->length));
                return -1;
        }
@@ -963,7 +963,7 @@ static ssize_t sl_unpack_cpx(DALLOC_CTX *query,
                        return -1;
                }
                slen = tag.size - 16 + tag.count;
-               if (slen > MAX_SL_FRAGMENT_SIZE) {
+               if (slen > MAX_MDSCMD_SIZE) {
                        return -1;
                }
 
@@ -1312,7 +1312,7 @@ bool sl_unpack(DALLOC_CTX *query, const char *buf, size_t bufsize)
        uint64_t toc_offset;
        struct sl_tag toc_tag;
 
-       if (bufsize > MAX_SL_FRAGMENT_SIZE) {
+       if (bufsize > MAX_MDSCMD_SIZE) {
                return false;
        }
 
index 2cc1b44712cb1b317e34030da6f039ca6d2f0fc6..ccc8b4422686ae172b225851a0d3c29284348b21 100644 (file)
@@ -27,6 +27,7 @@
 #include "librpc/gen_ndr/mdssvc.h"
 
 #define MAX_SL_FRAGMENT_SIZE 0xFFFFF
+#define MAX_MDSCMD_SIZE 0xFFFFFF
 
 /* Can be ored and used as flags */
 #define SL_ENC_LITTLE_ENDIAN 1