pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Geoghegan <pg@bowt.ie>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Sanitize line pointers within contrib/amcheck.
Date: Thu, 25 Apr 2019 19:50:55 +0000
Message-ID: <E1hJkOV-00009C-BH@gemulon.postgresql.org> (raw)

Sanitize line pointers within contrib/amcheck.

Adopt a more defensive approach to accessing index tuples in
contrib/amcheck: verify that each line pointer looks sane before
accessing associated tuple using pointer arithmetic based on line
pointer's offset.  This avoids undefined behavior and assertion failures
in cases where line pointers are corrupt.

Issue spotted following a complaint about an assertion failure by
Grigory Smolkin, which involved a test harness that deliberately
corrupts indexes.

This is arguably a bugfix, but no backpatch given the lack of field
reports beyond Grigory's.

Discussion: https://postgr.es/m/CAH2-WzmkurhCqnyLHxk0VkOZqd49+ZZsp1xAJOg7j2x7dmp_XQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/a9ce839a31375a6c04189222706ae6b2abe96919

Modified Files
--------------
contrib/amcheck/verify_nbtree.c | 141 +++++++++++++++++++++++++++++++---------
1 file changed, 109 insertions(+), 32 deletions(-)



Message-ID: <E1hJkOV-00009C-BH@gemulon.postgresql.org>
Permalink:  ../E1hJkOV-00009C-BH@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1hJkOV-00009C-BH@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: pg@bowt.ie
  Subject: Re: pgsql: Sanitize line pointers within contrib/amcheck.
  In-Reply-To: <E1hJkOV-00009C-BH@gemulon.postgresql.org>
  References: <E1hJkOV-00009C-BH@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