pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Use pg_parse_lsn() to parse LSN fields in backup_label
Date: Thu, 29 Oct 2026 11:46:36 +0000
Message-ID: <E1xMOaa-00000001Fm8-3f45@gemulon.postgresql.org> (raw)

Use pg_parse_lsn() to parse LSN fields in backup_label

The START WAL LOCATION and CHECKPOINT LOCATION fields in backup_label
accepted overlong high components, which could overflow and produce a
different LSN from the one supplied.

Use pg_parse_lsn() to validate and convert these fields, requiring one
to eight hexadecimal digits per component and no trailing characters,
as for pg_lsn input.

Also detect INCREMENTAL FROM LSN without parsing its value, so that
malformed values such as "junk" do not bypass the existing check
against using an incremental backup directly as a data directory.

Author: Hayato Kuroda <kuroda.hayato@fujitsu.com>
Reviewed-by: Jan Nidzwetzki <jan@planetscale.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/OS7PR01MB18317EED85B1A72C69B226630F5672@OS7PR01MB18317.jpnprd01.prod.outlook.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/76a55702d89ba9f5d0198c2d5d3d2d62357a8880

Modified Files
--------------
src/backend/access/transam/xlogrecovery.c | 27 ++++++++++++++++++---------
src/backend/utils/adt/pg_lsn.c            |  2 --
src/include/common/pg_parse_lsn.h         |  2 ++
3 files changed, 20 insertions(+), 11 deletions(-)



Message-ID: <E1xMOaa-00000001Fm8-3f45@gemulon.postgresql.org>
Permalink:  ../E1xMOaa-00000001Fm8-3f45@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1xMOaa-00000001Fm8-3f45@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: fujii@postgresql.org
  Subject: Re: pgsql: Use pg_parse_lsn() to parse LSN fields in backup_label
  In-Reply-To: <E1xMOaa-00000001Fm8-3f45@gemulon.postgresql.org>
  References: <E1xMOaa-00000001Fm8-3f45@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