From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Improve pglz_decompress's defenses against corrupt compressed da
Date: Thu, 19 Oct 2023 00:43:43 +0000
Message-ID: <E1qtH8Y-001FTN-Mp@gemulon.postgresql.org> (raw)
Improve pglz_decompress's defenses against corrupt compressed data.
When processing a match tag, check to see if the claimed "off"
is more than the distance back to the output buffer start.
If it is, then the data is corrupt, and what's more we would
fetch from outside the buffer boundaries and potentially incur
a SIGSEGV. (Although the odds of that seem relatively low, given
that "off" can't be more than 4K.)
Back-patch to v13; before that, this function wasn't really
trying to protect against bad data.
Report and fix by Flavien Guedez.
Discussion: https://postgr.es/m/01fc0593-e31e-463d-902c-dd43174acee2@oopacity.net
Branch
------
REL_14_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/2c63dc0356b3573382821bb67c869e95646b6f6d
Modified Files
--------------
src/common/pg_lzcompress.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Improve pglz_decompress's defenses against corrupt compressed da
In-Reply-To: <E1qtH8Y-001FTN-Mp@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox