From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Avoid invalid alloc size error in shm_mq
Date: Tue, 20 Oct 2020 16:17:10 +0000
Message-ID: <E1kUuJy-0002EK-Je@gemulon.postgresql.org> (raw)
Avoid invalid alloc size error in shm_mq
In shm_mq_receive(), a huge payload could trigger an unjustified
"invalid memory alloc request size" error due to the way the buffer
size is increased.
Add error checks (documenting the upper limit) and avoid the error by
limiting the allocation size to MaxAllocSize.
Author: Markus Wanner <markus.wanner@2ndquadrant.com>
Discussion: https://www.postgresql.org/message-id/flat/3bb363e7-ac04-0ac4-9fe8-db1148755bfa%402ndquadrant.com
Branch
------
REL_10_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/f78ebbe68f48b7bb4fe8e23b5a30c32dfc452331
Modified Files
--------------
src/backend/storage/ipc/shm_mq.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: peter@eisentraut.org
Subject: Re: pgsql: Avoid invalid alloc size error in shm_mq
In-Reply-To: <E1kUuJy-0002EK-Je@gemulon.postgresql.org>
References: <E1kUuJy-0002EK-Je@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