agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Use pg_parse_lsn() for LSNs in backup manifests
Date: Fri, 04 Sep 2026 14:06:35 +0000
Message-ID: <E1x2UYs-00000003ScM-2ZYz@gemulon.postgresql.org> (raw)

Use pg_parse_lsn() for LSNs in backup manifests

A user-supplied or modified backup manifest could contain an invalid WAL
range LSN that was nevertheless accepted by the manifest parser. For
example, an LSN component wider than 32 bits could be silently truncated,
and trailing characters after an otherwise valid LSN could be ignored.

This could cause pg_verifybackup, pg_combinebackup, and incremental
backup validation to check WAL availability against a different location
from the one specified in the manifest. PostgreSQL-generated manifests
should not contain such values, but tools consuming manifests should
reject invalid input rather than reinterpret it.

Fix this by using the common pg_parse_lsn() helper to parse LSNs in
backup manifests. It requires the same syntax as the pg_lsn input
function.

Author: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Reviewed-by: Yuefei Shi <shiyuefei1004@gmail.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/CAJTYsWXieRHb-ooV2XfjHAtBsS7+P5La_-o8-Cqi15CNDhh9hQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/2227afac0171550b0e213173cadcefd165434b23

Modified Files
--------------
src/bin/pg_verifybackup/t/005_bad_manifest.pl | 14 ++++++++++++++
src/common/parse_manifest.c                   | 21 +++------------------
2 files changed, 17 insertions(+), 18 deletions(-)



Message-ID: <E1x2UYs-00000003ScM-2ZYz@gemulon.postgresql.org>
Permalink:  ../E1x2UYs-00000003ScM-2ZYz@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1x2UYs-00000003ScM-2ZYz@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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: fujii@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Use pg_parse_lsn() for LSNs in backup manifests
  In-Reply-To: <E1x2UYs-00000003ScM-2ZYz@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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox