pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix use of dangling pointer in heap_delete() when logging replic
Date: Fri, 01 Feb 2019 01:38:26 +0000
Message-ID: <E1gpNmk-00028m-RC@gemulon.postgresql.org> (raw)

Fix use of dangling pointer in heap_delete() when logging replica identity

When logging the replica identity of a deleted tuple, XLOG_HEAP_DELETE
records include references of the old tuple.  Its data is stored in an
intermediate variable used to register this information for the WAL
record, but this variable gets away from the stack when the record gets
actually inserted.

Spotted by clang's AddressSanitizer.

Author: Stas Kelvish
Discussion: https://postgr.es/m/085C8825-AD86-4E93-AF80-E26CDF03D1EA@postgrespro.ru
Backpatch-through: 9.4

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/90f1ba7ecf01f063c0e113c72afcf8c1a64ca285

Modified Files
--------------
src/backend/access/heap/heapam.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)



view thread (6+ messages)  latest in thread

Message-ID: <E1gpNmk-00028m-RC@gemulon.postgresql.org>
Permalink:  ../E1gpNmk-00028m-RC@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1gpNmk-00028m-RC@gemulon.postgresql.org

 · 

reply

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: michael@paquier.xyz
  Subject: Re: pgsql: Fix use of dangling pointer in heap_delete() when logging replic
  In-Reply-To: <E1gpNmk-00028m-RC@gemulon.postgresql.org>
  References: <E1gpNmk-00028m-RC@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