Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1whh8M-000MuR-0P for pgsql-bugs@arkaria.postgresql.org; Thu, 09 Jul 2026 05:17:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1whh8J-00AyAh-1d for pgsql-bugs@arkaria.postgresql.org; Thu, 09 Jul 2026 05:17:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1whh8J-00AyAZ-0c for pgsql-bugs@lists.postgresql.org; Thu, 09 Jul 2026 05:17:11 +0000 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1whh8G-00000000PRd-3riD for pgsql-bugs@lists.postgresql.org; Thu, 09 Jul 2026 05:17:11 +0000 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-5aebd77cbb4so414084e87.2 for ; Wed, 08 Jul 2026 22:17:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1783574228; cv=none; d=google.com; s=arc-20260327; b=UNYJP8uvroCOTLkJBAr8S80Ad3ldYsslzA4QN/sRc64WmNrnPAjpZgIGNS+2iCMivK OBXSJoEBQa/zN7Wk04OKWS+BNP9aWwUZIqabMcbgJXIfWopgWGXaMbEKDfmTkZKshUCE oaCmOI/+vhgVTAFvFvWsZNlfYltAODp8ZqP5tQxsmtrS6gnPwGFU5n5RXMf3fcnCdrb6 yPFF5NxQ9ZIo3KI+hjSRbJ/4Q+rlxvPmyU0hH/4y5cF2EgSjxDprdl0M59KdRqiIRGpt 6zHpYMGZNck33P3haWKq95haJRojWqooi1MO0efcHVYMNgNm/D9gDDrRVz/heLSYaWGv uyvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=12dGqOFGUjvgpmovvt/Xl7f/wz535I3HRqRJS5MiW58=; fh=5IU2LIHIOw4vXrf5OwmflDSSUCKAjrEYEyOx9wCTVIw=; b=g1ZXQ9lOhiSkjyLh7EMGanvTEgdfl/MECxjy/R8IyedzH0aOjfnOoO3q6YeXPAxvZD yWdGpoxQYcDwddSKFUNGA/jOXY27d0Wlrxq9zzuv3R9PZhrvnCBOqjc+k3t/6s8W8jwE Zs61InSteJhlVDXmDlfnKlz6UdazYEAs3Owen0hHniOG6DNUMLmmgY1i6zel5mdDaebp bVD9Bv5rjh2AHU1Z8QUYveKkQWzQURPvVV+3ulnDUO+xdf8rxMVbhnxKiv1VbxtBcetU Wo9eBKhL69Eb7rOlH8IvhSqeM+sowUU1TNVhddX0z+KFqoIl06WEae79rvNL9xXir2lT wEXw==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783574228; x=1784179028; darn=lists.postgresql.org; h=content-type:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:from:to:cc:subject:date:message-id:reply-to :content-type; bh=12dGqOFGUjvgpmovvt/Xl7f/wz535I3HRqRJS5MiW58=; b=ALjZqSgOTBxg6XXunaCLj6yksv9cDxdev0zaBpW9ZuQGHhHhQYIUOkEvNDMKz7z6vY Og7NxA+dW+auPZ3HXg6cpYMO5/lgbx0pvKzyGKGsLii3W0La390aKv7EnAj/azjpn05F oUolJEDjhSxtYsqDVCP5bDOW+kZrZ00w2QLldiFH3Nlh4FaBhf1J5RaMy4yIRJONlvOI kgJCvICO9wCqJ8k8Lo566Cg0nKCeQw/bN5tGnQge9uWJn1SP3eyNzn9oBlz95GxsWOv+ JTqECmrkBGn7XPzhYnMCtQqMaqHzcnhakm77u0qb/B0eKiqSO6NkgpysYSKlwQOAiS5y BKCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783574228; x=1784179028; h=content-type:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=12dGqOFGUjvgpmovvt/Xl7f/wz535I3HRqRJS5MiW58=; b=UHfJD2eYkKJxiu4zfOIScjjo4WyPr8hbj8TGGr5jwj7h8wS7BHlxQg1hPzfxql8t4H OtKUvjVQMbu6bWfrRrmM+XTQ2hUcbVWs2dEXZ6a1Et0BgBeIfABudZgTAL+sR4dkrAdO Sip7/KW4KZIXVb3+TlRiwLgDKCXzY3pem2RelRk5LpnCGQsqh/Fbp+8WVFdRx9wOnqVx 7VGxJ73doiVfhgPvXEF+8FGB01GC+QCApO7xklyCmFWUVAjj5SM+cLZER/TcY7Jk70v2 4ZzrnA0ZEyNf5Gc5BRPGVHHLnHTGu3pS90adgCWpJrgv+pDYk+NPjJZMOsYec4MgmKT/ XtAQ== X-Forwarded-Encrypted: i=1; AHgh+RpKq8F/1oKsd+kkco6VvFl4XDEbGnM3kka+TcJwGynwY8u8XNOnPI4gBmW2cSIs9KmIvzv6PQaTsGAQ@lists.postgresql.org X-Gm-Message-State: AOJu0YzR4pE6SjRtWfnDo/brXmZbXQErnR4go5/eAUaxKQBjNbJlgCWg s+FBmwCEJLB+FcMmPtXtETBGHNk22lQ1I6ytJkJsUK2pDG0GvmipHT7r/QY4OyjB2+710RdfNVO 05LUHItjPdJRFnbEduCNzLr9tfNWT7bE= X-Gm-Gg: AfdE7clXLHN/bRg5aHXgRQVjgiNy2GjgukfU9uOEIsZX2SWQ7yZligqIgGP7AN8YVzL qaRaVOMnLG7xsqXIgpXew+8k8yW9xHuNxy2QEtr+vtpeXuvCU3aOM4uhKkyh0xbJ+t1J+BvJVlZ rc74rooJBuzV/Q2zMUTKfB+I/9o/G6iDQb4ghRKe9GEHUu1XJz2DGwAZBbOBHXSWFHA8J/CF+Pm jdlrAplz1Tuse0LAhThv14p2WCHbYhUJkVAYX48JDCTSKysHSwJOk7HZaloZNTlmYEd4EABzZDo FBA36zgid/CrI8QwQFXvNMW0cDEOyIdAOGXlfsKMSrw2kewacT/iJ6g3DaS29CRjwcJey2Ktg8H iESwIzArtF1Ng X-Received: by 2002:a05:6512:1417:b0:5ae:bd5e:95f7 with SMTP id 2adb3069b0e04-5b01141ec97mr1302226e87.4.1783574228159; Wed, 08 Jul 2026 22:17:08 -0700 (PDT) MIME-Version: 1.0 References: <19545-0f25b7e47351e8fc@postgresql.org> In-Reply-To: From: Ewan Young Date: Thu, 9 Jul 2026 13:16:54 +0800 X-Gm-Features: AUfX_mzzG6zNR4sHkWmYcqmZ8zAbOgJ7WiyuAyMp95kIswL_4GMTR4MrasJ48C8 Message-ID: Subject: Re: BUG #19545: Integer truncation of `GinTuple.keylen` causes out-of-bounds read in parallel GIN index build To: Heikki Linnakangas , Peter Eisentraut Cc: 1217816127@qq.com, pgsql-bugs@lists.postgresql.org Content-Type: multipart/mixed; boundary="0000000000004ce5f4065626bc38" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000004ce5f4065626bc38 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Heikki and Peter, On Wed, Jul 8, 2026 at 10:36=E2=80=AFPM Heikki Linnakangas wrote: > > On 08/07/2026 14:34, Ewan Young wrote: > > On Wed, Jul 8, 2026 at 3:52=E2=80=AFPM Heikki Linnakangas wrote: > >> > >> On 08/07/2026 09:27, Ewan Young wrote: > >>> Hi Yuelin, > >>> > >>> Thanks for the very precise report -- I reproduced it on master and y= our > >>> analysis is exactly right. _gin_build_tuple() builds the whole GinTup= le > >>> (palloc size, key memcpy, TID-list offset) from the int keylen, but t= he > >>> stored GinTuple.keylen is uint16, so a key wider than 65535 bytes has= its > >>> stored length truncated. On read-back GinTupleGetFirst() and > >>> _gin_parse_tuple_items() recompute the posting-list offset from the > >>> truncated value, and ginPostingListDecodeAllSegments() then walks the= key > >>> bytes, aborting (or reading past the allocation on non-assert builds) > >>> exactly as you saw. It's parallel-only because only the parallel path > >>> serializes a GinTuple. > >>> > >>> I went with your fix A -- widening keylen to uint32 (attached). It's = the > >>> minimal root-cause fix: the stored length now matches the length the = rest > >>> of the function already uses. > >> > >> Ugh, the datatypes used for keylen are all over the place. In GinTuple > >> struct it was 'uint16', in GinBuffer it's Size, and in the > >> _gin_build_tuple() function's local variable it's 'int'. Would be good > >> to make them consistent. > > > > Good point, agreed. v2 (attached) uses int for keylen everywhere: in > > GinTuple (was uint16) and in GinBuffer (was Size); the local in > > _gin_build_tuple() was already int. int matches the tuplen and nitems > > fields of GinTuple and is plenty wide (a key can't exceed the 1GB varle= na > > limit), so it seemed like the natural choice. > > When I built this with "-fsanitize=3Dalignment,undefined" flag, it > triggers a sanity check in the 'jsonb' test: > > (gdb) bt > #0 __pthread_kill_implementation (threadid=3D281473024218464, > signo=3Dsigno@entry=3D6, no_tid=3Dno_tid@entry=3D0) at ./nptl/pthread_kil= l.c:44 > #1 0x0000ffff89fa7e24 [PAC] in __pthread_kill_internal > (threadid=3D, signo=3D6) at ./nptl/pthread_kill.c:89 > #2 0x0000ffff89f56940 in __GI_raise (sig=3Dsig@entry=3D6) at > ../sysdeps/posix/raise.c:26 > #3 0x0000ffff89f41a84 [PAC] in __GI_abort () at ./stdlib/abort.c:77 > #4 0x0000ffff8a0fc600 [PAC] in __sanitizer::Abort () at > ../../../../src/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cpp= :143 > #5 0x0000ffff8a10bc94 [PAC] in __sanitizer::Die () at > ../../../../src/libsanitizer/sanitizer_common/sanitizer_termination.cpp:5= 8 > #6 0x0000ffff8a0e7da0 [PAC] in __ubsan::ScopedReport::~ScopedReport > (this=3Dthis@entry=3D0xffffd8a433d0, __in_chrg=3D) > at ../../../../src/libsanitizer/ubsan/ubsan_diag.cpp:402 > #7 0x0000ffff8a0eb10c [PAC] in handleTypeMismatchImpl (Data=3D out>, Pointer=3D187650525702668, Opts=3D...) > at ../../../../src/libsanitizer/ubsan/ubsan_handlers.cpp:137 > #8 0x0000ffff8a0ebc0c [PAC] in > __ubsan::__ubsan_handle_type_mismatch_v1_abort (Data=3D, > Pointer=3D) > at ../../../../src/libsanitizer/ubsan/ubsan_handlers.cpp:147 > #9 0x0000aaaab7d3f2e4 [PAC] in GinBufferKeyEquals > (buffer=3D0xaaaacaee4330, tup=3D0xaaaacaed29f8) at > ../src/backend/access/gin/gininsert.c:1382 > #10 0x0000aaaab7d414c0 in GinBufferCanAddKey (buffer=3D0xaaaacaee4330, > tup=3D0xaaaacaed29f8) at ../src/backend/access/gin/gininsert.c:1633 > #11 0x0000aaaab7d42500 in _gin_process_worker_data > (state=3D0xffffd8a43890, worker_sort=3D0xaaaacae16fb0, progress=3Dtrue) a= t > ../src/backend/access/gin/gininsert.c:1899 > #12 0x0000aaaab7d43618 in _gin_parallel_scan_and_build > (state=3D0xffffd8a43890, ginshared=3D0xffff8b9b83a0, > sharedsort=3D0xffff8b9b8340, heap=3D0xffff7d7012a8, > index=3D0xffff7d708768, sortmem=3D21845, progress=3Dtrue) at > ../src/backend/access/gin/gininsert.c:2085 > #13 0x0000aaaab7d42378 in _gin_leader_participate_as_worker > (buildstate=3D0xffffd8a43890, heap=3D0xffff7d7012a8, index=3D0xffff7d7087= 68) > at ../src/backend/access/gin/gininsert.c:1834 > #14 0x0000aaaab7d3d7b0 in _gin_begin_parallel > (buildstate=3D0xffffd8a43890, heap=3D0xffff7d7012a8, index=3D0xffff7d7087= 68, > isconcurrent=3Dtrue, request=3D2) > at ../src/backend/access/gin/gininsert.c:1103 > #15 0x0000aaaab7d3ae3c in ginbuild (heap=3D0xffff7d7012a8, > index=3D0xffff7d708768, indexInfo=3D0xaaaacad8f5b0) at > ../src/backend/access/gin/gininsert.c:700 > #16 0x0000aaaab807c110 in index_build (heapRelation=3D0xffff7d7012a8, > indexRelation=3D0xffff7d708768, indexInfo=3D0xaaaacad8f5b0, isreindex=3Df= alse, > parallel=3Dtrue, progress=3Dtrue) > at ../src/backend/catalog/index.c:3099 > #17 0x0000aaaab8074514 in index_concurrently_build > (heapRelationId=3D41578, indexRelationId=3D41993) at > ../src/backend/catalog/index.c:1543 > > That's this line: > > #9 0x0000aaaab7d3f2e4 [PAC] in GinBufferKeyEquals > (buffer=3D0xaaaacaee4330, tup=3D0xaaaacaed29f8) at > ../src/backend/access/gin/gininsert.c:1382 > 1382 tupkey =3D (buffer->typbyval) ? *(Datum *) tup->data : > PointerGetDatum(tup->data); > > So we have a hidden assumption that 'data' is Datum-aligned. > > > In _gin_parse_tuple_key() we do this instead: > > Datum key; > ... > if (a->typbyval) > { > memcpy(&key, a->data, a->keylen); > return key; > } > > That one doesn't require the alignment. I would be inclined to always > use memcpy() when 'typbyval=3D=3Dtrue', as above, to not be sensitive to = the > alignment. However, I think we assume that it's aligned for the > 'typbyval=3D=3Dfalse' case anyway, as we just do DatumGetPoint(a->data). Good catch, and this is really surfaced by widening keylen: on master GinTuple.data lands at offset 16, which is MAXALIGN'd, so that read is (accidentally) fine; growing the header pushed data off an 8-byte boundary and exposed the unaligned Datum load. Rather than pad data back to MAXALIGN (which grows every GinTuple), I did what you suggest here -- read the key via the existing _gin_parse_tuple_key() helper, which already copies byval keys out with memcpy() and so makes no alignment assumption. That also removes the duplicated "byval ? deref : pointer" logic, so the key is now read the same way everywhere; the byref branch is unchanged. With the _gin_parse_tuple_key() change the sanitizer is clean -- both at th= at 4-aligned offset and with Size (where data happens to be back to MAXALIGN'd), so the fix doesn't depend on the realignment. > > The straightforward fix is to add padding to make 'data' MAXALIGNed. It > makes GinTuples larger, which is bad for performance, but it's probably > fine. > > That said, I actually wonder why we need to store 'typbyval' and > 'typlen' in GinTuple at all. That information could be looked up using > 'attrnum'. Maybe 'typbyval' is good for performance in the comparison > functions, but AFAICS GinTuple->typbyval is only used to copy it into > GinBuffer in GinBufferStoreTuple(), which I think could easily afford to > look it up. I like the idea, but they're not only used to seed GinBuffer -- typbyval is also read on the sort's hot path, in _gin_parse_tuple_key() (and thus _gin_compare_tuples()), which only receives the GinTuple, not the index tupdesc. So dropping them means threading the attr metadata into the tuplesort comparator, which felt like a larger, separable cleanup than this fix. Happy to look at it as a follow-up if you think it's worthwhile, but I'd lean toward not blocking the bug fix on it. > > >>> I preferred it over an explicit ereport at > >>> UINT16_MAX, since 65535 isn't a meaningful GIN limit -- the entry-tre= e item > >>> limit is much smaller and is applied to the (compressed) tuple by > >>> GinFormTuple() -- so rejecting there would be an arbitrary cutoff. > >> > >> Hmm, we don't compress the key data though, so a tuple with a key larg= er > >> than 65535 will inevitably fail in GinFormTuple(), right? I agree it > > > > That was my first thought too, but it turns out we do compress it, just > > not in _gin_build_tuple(). GinFormTuple() builds the on-page tuple via > > index_form_tuple(), whose TOAST_INDEX_HACK path compresses a compressib= le > > key over TOAST_INDEX_TARGET (~BLCKSZ/16) inline before the GinMaxItemSi= ze > > check runs. So that check sees the *compressed* key, and a large but > > compressible key sails through. It's only the parallel path's GinTuple > > that keeps the key uncompressed, which is exactly where the uint16 > > truncation bit us. > > > > Concretely, unpatched master indexes a key far larger than GinMaxItemSi= ze > > just fine in a serial build: > > > > CREATE TABLE t (a text[]); > > INSERT INTO t SELECT ARRAY[repeat('x',100000)] FROM generate_serie= s(1,50); > > SET max_parallel_maintenance_workers =3D 0; -- force a serial bu= ild > > CREATE INDEX ON t USING gin (a); -- succeeds; key is > > 100000 bytes > > Oh, ok, I stand corrected. Let's keep that working then. Thanks -- leaving GinFormTuple() as the single size gate, then. > Size (or size_t) is the correct type for sizes of objects in memory. > > Note that the return type of VARSIZE_ANY() is already Size, so by using > int you are still doing a type truncation, and by using a signed type > you are introducing unnecessary potential for confusion. Agreed, that's clearly better. v3 (attached) uses Size for GinTuple.keylen (GinBuffer.keylen already was Size), and also for the local in _gin_build_tuple(), which was the int that truncated VARSIZE_ANY() in the first place. Thanks again for the review! > > - Heikki > --=20 Regards, Ewan Young --0000000000004ce5f4065626bc38 Content-Type: application/octet-stream; name="v3-0001-Fix-parallel-GIN-index-build-with-keys-larger-tha.patch" Content-Disposition: attachment; filename="v3-0001-Fix-parallel-GIN-index-build-with-keys-larger-tha.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_mrd1tabr0 RnJvbSAyZTJkNWM1Y2VjMmNlZmQwNGFlNjQ0ODZhODMzM2U0ZWQ0MTkxMTEyIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBFd2FuIFlvdW5nIDxrZGJhc2UuaGFja0BnbWFpbC5jb20+CkRh dGU6IFRodSwgOSBKdWwgMjAyNiAxODoxOTo1MSArMDgwMApTdWJqZWN0OiBbUEFUQ0ggdjNdIEZp eCBwYXJhbGxlbCBHSU4gaW5kZXggYnVpbGQgd2l0aCBrZXlzIGxhcmdlciB0aGFuIDY1NTM1CiBi eXRlcwoKRHVyaW5nIGEgcGFyYWxsZWwgR0lOIGJ1aWxkIGVhY2gga2V5IGlzIHNlcmlhbGl6ZWQg aW50byBhIEdpblR1cGxlLCBhCnRyYW5zaWVudCByZXByZXNlbnRhdGlvbiB1c2VkIG9ubHkgd2hp bGUgc29ydGluZy4gIF9naW5fYnVpbGRfdHVwbGUoKQpsYXlzIG91dCB0aGUgd2hvbGUgdHVwbGUg LS0gdGhlIHBhbGxvYyBzaXplLCB0aGUga2V5IG1lbWNweSwgYW5kIHRoZQpvZmZzZXQgdG8gdGhl IHBvc3RpbmcgbGlzdCAtLSBmcm9tIGEgbG9jYWwga2V5bGVuIGhvbGRpbmcgVkFSU0laRV9BTlko KQpvZiB0aGUga2V5LiAgQnV0IHRoZSBzdG9yZWQgR2luVHVwbGUua2V5bGVuIGZpZWxkIHdhcyB1 aW50MTY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